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.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the resource type permission local service. This utility wraps {@link com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * 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.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ResourceTypePermissionLocalService
030     * @see com.liferay.portal.service.base.ResourceTypePermissionLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl
032     * @generated
033     */
034    public class ResourceTypePermissionLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the resource type permission to the database. Also notifies the appropriate model listeners.
043            *
044            * @param resourceTypePermission the resource type permission
045            * @return the resource type permission that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.ResourceTypePermission addResourceTypePermission(
049                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addResourceTypePermission(resourceTypePermission);
052            }
053    
054            /**
055            * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database.
056            *
057            * @param resourceTypePermissionId the primary key for the new resource type permission
058            * @return the new resource type permission
059            */
060            public static com.liferay.portal.model.ResourceTypePermission createResourceTypePermission(
061                    long resourceTypePermissionId) {
062                    return getService()
063                                       .createResourceTypePermission(resourceTypePermissionId);
064            }
065    
066            /**
067            * Deletes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners.
068            *
069            * @param resourceTypePermissionId the primary key of the resource type permission
070            * @throws PortalException if a resource type permission with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public static void deleteResourceTypePermission(
074                    long resourceTypePermissionId)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    getService().deleteResourceTypePermission(resourceTypePermissionId);
078            }
079    
080            /**
081            * Deletes the resource type permission from the database. Also notifies the appropriate model listeners.
082            *
083            * @param resourceTypePermission the resource type permission
084            * @throws SystemException if a system exception occurred
085            */
086            public static void deleteResourceTypePermission(
087                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    getService().deleteResourceTypePermission(resourceTypePermission);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            public static com.liferay.portal.model.ResourceTypePermission fetchResourceTypePermission(
164                    long resourceTypePermissionId)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getService().fetchResourceTypePermission(resourceTypePermissionId);
167            }
168    
169            /**
170            * Returns the resource type permission with the primary key.
171            *
172            * @param resourceTypePermissionId the primary key of the resource type permission
173            * @return the resource type permission
174            * @throws PortalException if a resource type permission with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.ResourceTypePermission getResourceTypePermission(
178                    long resourceTypePermissionId)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getService().getResourceTypePermission(resourceTypePermissionId);
182            }
183    
184            public static com.liferay.portal.model.PersistedModel getPersistedModel(
185                    java.io.Serializable primaryKeyObj)
186                    throws com.liferay.portal.kernel.exception.PortalException,
187                            com.liferay.portal.kernel.exception.SystemException {
188                    return getService().getPersistedModel(primaryKeyObj);
189            }
190    
191            /**
192            * Returns a range of all the resource type permissions.
193            *
194            * <p>
195            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
196            * </p>
197            *
198            * @param start the lower bound of the range of resource type permissions
199            * @param end the upper bound of the range of resource type permissions (not inclusive)
200            * @return the range of resource type permissions
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getResourceTypePermissions(
204                    int start, int end)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getService().getResourceTypePermissions(start, end);
207            }
208    
209            /**
210            * Returns the number of resource type permissions.
211            *
212            * @return the number of resource type permissions
213            * @throws SystemException if a system exception occurred
214            */
215            public static int getResourceTypePermissionsCount()
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    return getService().getResourceTypePermissionsCount();
218            }
219    
220            /**
221            * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
222            *
223            * @param resourceTypePermission the resource type permission
224            * @return the resource type permission that was updated
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.ResourceTypePermission updateResourceTypePermission(
228                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getService().updateResourceTypePermission(resourceTypePermission);
231            }
232    
233            /**
234            * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param resourceTypePermission the resource type permission
237            * @param merge whether to merge the resource type permission with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
238            * @return the resource type permission that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portal.model.ResourceTypePermission updateResourceTypePermission(
242                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission,
243                    boolean merge)
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    return getService()
246                                       .updateResourceTypePermission(resourceTypePermission, merge);
247            }
248    
249            /**
250            * Returns the Spring bean ID for this bean.
251            *
252            * @return the Spring bean ID for this bean
253            */
254            public static java.lang.String getBeanIdentifier() {
255                    return getService().getBeanIdentifier();
256            }
257    
258            /**
259            * Sets the Spring bean ID for this bean.
260            *
261            * @param beanIdentifier the Spring bean ID for this bean
262            */
263            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
264                    getService().setBeanIdentifier(beanIdentifier);
265            }
266    
267            public static long getCompanyScopeActionIds(long companyId,
268                    java.lang.String name, long roleId)
269                    throws com.liferay.portal.kernel.exception.SystemException {
270                    return getService().getCompanyScopeActionIds(companyId, name, roleId);
271            }
272    
273            public static long getGroupScopeActionIds(long companyId, long groupId,
274                    java.lang.String name, long roleId)
275                    throws com.liferay.portal.kernel.exception.SystemException {
276                    return getService()
277                                       .getGroupScopeActionIds(companyId, groupId, name, roleId);
278            }
279    
280            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getGroupScopeResourceTypePermissions(
281                    long companyId, java.lang.String name, long roleId)
282                    throws com.liferay.portal.kernel.exception.SystemException {
283                    return getService()
284                                       .getGroupScopeResourceTypePermissions(companyId, name, roleId);
285            }
286    
287            public static com.liferay.portal.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
288                    long companyId, long groupId, java.lang.String name)
289                    throws com.liferay.portal.kernel.exception.SystemException {
290                    return getService()
291                                       .getResourceBlockPermissionsContainer(companyId, groupId,
292                            name);
293            }
294    
295            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getRoleResourceTypePermissions(
296                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
297                    return getService().getRoleResourceTypePermissions(roleId);
298            }
299    
300            public static boolean hasCompanyScopePermission(long companyId,
301                    java.lang.String name, long roleId, java.lang.String actionId)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException {
304                    return getService()
305                                       .hasCompanyScopePermission(companyId, name, roleId, actionId);
306            }
307    
308            public static boolean hasEitherScopePermission(long companyId,
309                    java.lang.String name, long roleId, java.lang.String actionId)
310                    throws com.liferay.portal.kernel.exception.PortalException,
311                            com.liferay.portal.kernel.exception.SystemException {
312                    return getService()
313                                       .hasEitherScopePermission(companyId, name, roleId, actionId);
314            }
315    
316            public static boolean hasGroupScopePermission(long companyId, long groupId,
317                    java.lang.String name, long roleId, java.lang.String actionId)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService()
321                                       .hasGroupScopePermission(companyId, groupId, name, roleId,
322                            actionId);
323            }
324    
325            public static void updateCompanyScopeResourceTypePermissions(
326                    long companyId, java.lang.String name, long roleId, long actionIdsLong,
327                    long operator)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    getService()
330                            .updateCompanyScopeResourceTypePermissions(companyId, name, roleId,
331                            actionIdsLong, operator);
332            }
333    
334            public static void updateGroupScopeResourceTypePermissions(long companyId,
335                    long groupId, java.lang.String name, long roleId, long actionIdsLong,
336                    long operator)
337                    throws com.liferay.portal.kernel.exception.SystemException {
338                    getService()
339                            .updateGroupScopeResourceTypePermissions(companyId, groupId, name,
340                            roleId, actionIdsLong, operator);
341            }
342    
343            public static ResourceTypePermissionLocalService getService() {
344                    if (_service == null) {
345                            _service = (ResourceTypePermissionLocalService)PortalBeanLocatorUtil.locate(ResourceTypePermissionLocalService.class.getName());
346    
347                            ReferenceRegistry.registerReference(ResourceTypePermissionLocalServiceUtil.class,
348                                    "_service");
349                            MethodCache.remove(ResourceTypePermissionLocalService.class);
350                    }
351    
352                    return _service;
353            }
354    
355            public void setService(ResourceTypePermissionLocalService service) {
356                    MethodCache.remove(ResourceTypePermissionLocalService.class);
357    
358                    _service = service;
359    
360                    ReferenceRegistry.registerReference(ResourceTypePermissionLocalServiceUtil.class,
361                            "_service");
362                    MethodCache.remove(ResourceTypePermissionLocalService.class);
363            }
364    
365            private static ResourceTypePermissionLocalService _service;
366    }