001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the resource local service. This utility wraps {@link com.liferay.portal.service.impl.ResourceLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
022     *
023     * <p>
024     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see ResourceLocalService
029     * @see com.liferay.portal.service.base.ResourceLocalServiceBaseImpl
030     * @see com.liferay.portal.service.impl.ResourceLocalServiceImpl
031     * @generated
032     */
033    public class ResourceLocalServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Returns the Spring bean ID for this bean.
042            *
043            * @return the Spring bean ID for this bean
044            */
045            public static java.lang.String getBeanIdentifier() {
046                    return getService().getBeanIdentifier();
047            }
048    
049            /**
050            * Sets the Spring bean ID for this bean.
051            *
052            * @param beanIdentifier the Spring bean ID for this bean
053            */
054            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
055                    getService().setBeanIdentifier(beanIdentifier);
056            }
057    
058            public static void addModelResources(
059                    com.liferay.portal.model.AuditedModel auditedModel,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    getService().addModelResources(auditedModel, serviceContext);
064            }
065    
066            public static void addModelResources(long companyId, long groupId,
067                    long userId, java.lang.String name, long primKey,
068                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    getService()
072                            .addModelResources(companyId, groupId, userId, name, primKey,
073                            groupPermissions, guestPermissions);
074            }
075    
076            public static void addModelResources(long companyId, long groupId,
077                    long userId, java.lang.String name, java.lang.String primKey,
078                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException {
081                    getService()
082                            .addModelResources(companyId, groupId, userId, name, primKey,
083                            groupPermissions, guestPermissions);
084            }
085    
086            public static void addResources(long companyId, long groupId, long userId,
087                    java.lang.String name, long primKey, boolean portletActions,
088                    boolean addGroupPermissions, boolean addGuestPermissions)
089                    throws com.liferay.portal.kernel.exception.PortalException,
090                            com.liferay.portal.kernel.exception.SystemException {
091                    getService()
092                            .addResources(companyId, groupId, userId, name, primKey,
093                            portletActions, addGroupPermissions, addGuestPermissions);
094            }
095    
096            public static void addResources(long companyId, long groupId, long userId,
097                    java.lang.String name, java.lang.String primKey,
098                    boolean portletActions, boolean addGroupPermissions,
099                    boolean addGuestPermissions)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    getService()
103                            .addResources(companyId, groupId, userId, name, primKey,
104                            portletActions, addGroupPermissions, addGuestPermissions);
105            }
106    
107            public static void addResources(long companyId, long groupId,
108                    java.lang.String name, boolean portletActions)
109                    throws com.liferay.portal.kernel.exception.PortalException,
110                            com.liferay.portal.kernel.exception.SystemException {
111                    getService().addResources(companyId, groupId, name, portletActions);
112            }
113    
114            public static void deleteResource(
115                    com.liferay.portal.model.AuditedModel auditedModel, int scope)
116                    throws com.liferay.portal.kernel.exception.PortalException,
117                            com.liferay.portal.kernel.exception.SystemException {
118                    getService().deleteResource(auditedModel, scope);
119            }
120    
121            public static void deleteResource(long companyId, java.lang.String name,
122                    int scope, long primKey)
123                    throws com.liferay.portal.kernel.exception.PortalException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    getService().deleteResource(companyId, name, scope, primKey);
126            }
127    
128            public static void deleteResource(long companyId, java.lang.String name,
129                    int scope, java.lang.String primKey)
130                    throws com.liferay.portal.kernel.exception.PortalException,
131                            com.liferay.portal.kernel.exception.SystemException {
132                    getService().deleteResource(companyId, name, scope, primKey);
133            }
134    
135            public static com.liferay.portal.model.Resource getResource(
136                    long companyId, java.lang.String name, int scope,
137                    java.lang.String primKey) {
138                    return getService().getResource(companyId, name, scope, primKey);
139            }
140    
141            public static boolean hasUserPermissions(long userId, long resourceId,
142                    java.util.List<com.liferay.portal.model.Resource> resources,
143                    java.lang.String actionId, long[] roleIds)
144                    throws com.liferay.portal.kernel.exception.PortalException,
145                            com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .hasUserPermissions(userId, resourceId, resources, actionId,
148                            roleIds);
149            }
150    
151            public static void updateModelResources(
152                    com.liferay.portal.model.AuditedModel auditedModel,
153                    com.liferay.portal.service.ServiceContext serviceContext)
154                    throws com.liferay.portal.kernel.exception.PortalException,
155                            com.liferay.portal.kernel.exception.SystemException {
156                    getService().updateModelResources(auditedModel, serviceContext);
157            }
158    
159            public static void updateResources(long companyId, long groupId,
160                    java.lang.String name, long primKey,
161                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
162                    throws com.liferay.portal.kernel.exception.PortalException,
163                            com.liferay.portal.kernel.exception.SystemException {
164                    getService()
165                            .updateResources(companyId, groupId, name, primKey,
166                            groupPermissions, guestPermissions);
167            }
168    
169            public static void updateResources(long companyId, long groupId,
170                    java.lang.String name, java.lang.String primKey,
171                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    getService()
175                            .updateResources(companyId, groupId, name, primKey,
176                            groupPermissions, guestPermissions);
177            }
178    
179            public static void updateResources(long companyId, java.lang.String name,
180                    int scope, java.lang.String primKey, java.lang.String newPrimKey)
181                    throws com.liferay.portal.kernel.exception.SystemException {
182                    getService().updateResources(companyId, name, scope, primKey, newPrimKey);
183            }
184    
185            public static ResourceLocalService getService() {
186                    if (_service == null) {
187                            _service = (ResourceLocalService)PortalBeanLocatorUtil.locate(ResourceLocalService.class.getName());
188    
189                            ReferenceRegistry.registerReference(ResourceLocalServiceUtil.class,
190                                    "_service");
191                    }
192    
193                    return _service;
194            }
195    
196            /**
197             * @deprecated
198             */
199            public void setService(ResourceLocalService service) {
200            }
201    
202            private static ResourceLocalService _service;
203    }