001    /**
002     * Copyright (c) 2000-present 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.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for ResourceTypePermission. This utility wraps
024     * {@link com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see ResourceTypePermissionLocalService
032     * @see com.liferay.portal.service.base.ResourceTypePermissionLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ResourceTypePermissionLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceTypePermissionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static boolean hasCompanyScopePermission(long companyId,
044                    java.lang.String name, long roleId, java.lang.String actionId)
045                    throws com.liferay.portal.kernel.exception.PortalException {
046                    return getService()
047                                       .hasCompanyScopePermission(companyId, name, roleId, actionId);
048            }
049    
050            public static boolean hasEitherScopePermission(long companyId,
051                    java.lang.String name, long roleId, java.lang.String actionId)
052                    throws com.liferay.portal.kernel.exception.PortalException {
053                    return getService()
054                                       .hasEitherScopePermission(companyId, name, roleId, actionId);
055            }
056    
057            public static boolean hasGroupScopePermission(long companyId, long groupId,
058                    java.lang.String name, long roleId, java.lang.String actionId)
059                    throws com.liferay.portal.kernel.exception.PortalException {
060                    return getService()
061                                       .hasGroupScopePermission(companyId, groupId, name, roleId,
062                            actionId);
063            }
064    
065            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
066                    return getService().getActionableDynamicQuery();
067            }
068    
069            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
070                    return getService().dynamicQuery();
071            }
072    
073            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
074                    return getService().getIndexableActionableDynamicQuery();
075            }
076    
077            /**
078            * @throws PortalException
079            */
080            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
081                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
082                    throws com.liferay.portal.kernel.exception.PortalException {
083                    return getService().deletePersistedModel(persistedModel);
084            }
085    
086            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
087                    java.io.Serializable primaryKeyObj)
088                    throws com.liferay.portal.kernel.exception.PortalException {
089                    return getService().getPersistedModel(primaryKeyObj);
090            }
091    
092            public static com.liferay.portal.kernel.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
093                    long companyId, long groupId, java.lang.String name) {
094                    return getService()
095                                       .getResourceBlockPermissionsContainer(companyId, groupId,
096                            name);
097            }
098    
099            /**
100            * Adds the resource type permission to the database. Also notifies the appropriate model listeners.
101            *
102            * @param resourceTypePermission the resource type permission
103            * @return the resource type permission that was added
104            */
105            public static com.liferay.portal.kernel.model.ResourceTypePermission addResourceTypePermission(
106                    com.liferay.portal.kernel.model.ResourceTypePermission resourceTypePermission) {
107                    return getService().addResourceTypePermission(resourceTypePermission);
108            }
109    
110            /**
111            * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database.
112            *
113            * @param resourceTypePermissionId the primary key for the new resource type permission
114            * @return the new resource type permission
115            */
116            public static com.liferay.portal.kernel.model.ResourceTypePermission createResourceTypePermission(
117                    long resourceTypePermissionId) {
118                    return getService()
119                                       .createResourceTypePermission(resourceTypePermissionId);
120            }
121    
122            /**
123            * Deletes the resource type permission from the database. Also notifies the appropriate model listeners.
124            *
125            * @param resourceTypePermission the resource type permission
126            * @return the resource type permission that was removed
127            */
128            public static com.liferay.portal.kernel.model.ResourceTypePermission deleteResourceTypePermission(
129                    com.liferay.portal.kernel.model.ResourceTypePermission resourceTypePermission) {
130                    return getService().deleteResourceTypePermission(resourceTypePermission);
131            }
132    
133            /**
134            * Deletes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners.
135            *
136            * @param resourceTypePermissionId the primary key of the resource type permission
137            * @return the resource type permission that was removed
138            * @throws PortalException if a resource type permission with the primary key could not be found
139            */
140            public static com.liferay.portal.kernel.model.ResourceTypePermission deleteResourceTypePermission(
141                    long resourceTypePermissionId)
142                    throws com.liferay.portal.kernel.exception.PortalException {
143                    return getService()
144                                       .deleteResourceTypePermission(resourceTypePermissionId);
145            }
146    
147            public static com.liferay.portal.kernel.model.ResourceTypePermission fetchResourceTypePermission(
148                    long resourceTypePermissionId) {
149                    return getService().fetchResourceTypePermission(resourceTypePermissionId);
150            }
151    
152            /**
153            * Returns the resource type permission with the primary key.
154            *
155            * @param resourceTypePermissionId the primary key of the resource type permission
156            * @return the resource type permission
157            * @throws PortalException if a resource type permission with the primary key could not be found
158            */
159            public static com.liferay.portal.kernel.model.ResourceTypePermission getResourceTypePermission(
160                    long resourceTypePermissionId)
161                    throws com.liferay.portal.kernel.exception.PortalException {
162                    return getService().getResourceTypePermission(resourceTypePermissionId);
163            }
164    
165            /**
166            * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
167            *
168            * @param resourceTypePermission the resource type permission
169            * @return the resource type permission that was updated
170            */
171            public static com.liferay.portal.kernel.model.ResourceTypePermission updateResourceTypePermission(
172                    com.liferay.portal.kernel.model.ResourceTypePermission resourceTypePermission) {
173                    return getService().updateResourceTypePermission(resourceTypePermission);
174            }
175    
176            /**
177            * Returns the number of resource type permissions.
178            *
179            * @return the number of resource type permissions
180            */
181            public static int getResourceTypePermissionsCount() {
182                    return getService().getResourceTypePermissionsCount();
183            }
184    
185            /**
186            * Returns the OSGi service identifier.
187            *
188            * @return the OSGi service identifier
189            */
190            public static java.lang.String getOSGiServiceIdentifier() {
191                    return getService().getOSGiServiceIdentifier();
192            }
193    
194            /**
195            * Performs a dynamic query on the database and returns the matching rows.
196            *
197            * @param dynamicQuery the dynamic query
198            * @return the matching rows
199            */
200            public static <T> java.util.List<T> dynamicQuery(
201                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
202                    return getService().dynamicQuery(dynamicQuery);
203            }
204    
205            /**
206            * Performs a dynamic query on the database and returns a range of the matching rows.
207            *
208            * <p>
209            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
210            * </p>
211            *
212            * @param dynamicQuery the dynamic query
213            * @param start the lower bound of the range of model instances
214            * @param end the upper bound of the range of model instances (not inclusive)
215            * @return the range of matching rows
216            */
217            public static <T> java.util.List<T> dynamicQuery(
218                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
219                    int end) {
220                    return getService().dynamicQuery(dynamicQuery, start, end);
221            }
222    
223            /**
224            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
225            *
226            * <p>
227            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
228            * </p>
229            *
230            * @param dynamicQuery the dynamic query
231            * @param start the lower bound of the range of model instances
232            * @param end the upper bound of the range of model instances (not inclusive)
233            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
234            * @return the ordered range of matching rows
235            */
236            public static <T> java.util.List<T> dynamicQuery(
237                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
238                    int end,
239                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
240                    return getService()
241                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
242            }
243    
244            public static java.util.List<com.liferay.portal.kernel.model.ResourceTypePermission> getGroupScopeResourceTypePermissions(
245                    long companyId, java.lang.String name, long roleId) {
246                    return getService()
247                                       .getGroupScopeResourceTypePermissions(companyId, name, roleId);
248            }
249    
250            /**
251            * Returns a range of all the resource type permissions.
252            *
253            * <p>
254            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
255            * </p>
256            *
257            * @param start the lower bound of the range of resource type permissions
258            * @param end the upper bound of the range of resource type permissions (not inclusive)
259            * @return the range of resource type permissions
260            */
261            public static java.util.List<com.liferay.portal.kernel.model.ResourceTypePermission> getResourceTypePermissions(
262                    int start, int end) {
263                    return getService().getResourceTypePermissions(start, end);
264            }
265    
266            public static java.util.List<com.liferay.portal.kernel.model.ResourceTypePermission> getRoleResourceTypePermissions(
267                    long roleId) {
268                    return getService().getRoleResourceTypePermissions(roleId);
269            }
270    
271            /**
272            * Returns the number of rows matching the dynamic query.
273            *
274            * @param dynamicQuery the dynamic query
275            * @return the number of rows matching the dynamic query
276            */
277            public static long dynamicQueryCount(
278                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
279                    return getService().dynamicQueryCount(dynamicQuery);
280            }
281    
282            /**
283            * Returns the number of rows matching the dynamic query.
284            *
285            * @param dynamicQuery the dynamic query
286            * @param projection the projection to apply to the query
287            * @return the number of rows matching the dynamic query
288            */
289            public static long dynamicQueryCount(
290                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
291                    com.liferay.portal.kernel.dao.orm.Projection projection) {
292                    return getService().dynamicQueryCount(dynamicQuery, projection);
293            }
294    
295            public static long getCompanyScopeActionIds(long companyId,
296                    java.lang.String name, long roleId) {
297                    return getService().getCompanyScopeActionIds(companyId, name, roleId);
298            }
299    
300            public static long getGroupScopeActionIds(long companyId, long groupId,
301                    java.lang.String name, long roleId) {
302                    return getService()
303                                       .getGroupScopeActionIds(companyId, groupId, name, roleId);
304            }
305    
306            public static void updateCompanyScopeResourceTypePermissions(
307                    long companyId, java.lang.String name, long roleId, long actionIdsLong,
308                    long operator) {
309                    getService()
310                            .updateCompanyScopeResourceTypePermissions(companyId, name, roleId,
311                            actionIdsLong, operator);
312            }
313    
314            public static void updateGroupScopeResourceTypePermissions(long companyId,
315                    long groupId, java.lang.String name, long roleId, long actionIdsLong,
316                    long operator) {
317                    getService()
318                            .updateGroupScopeResourceTypePermissions(companyId, groupId, name,
319                            roleId, actionIdsLong, operator);
320            }
321    
322            public static ResourceTypePermissionLocalService getService() {
323                    if (_service == null) {
324                            _service = (ResourceTypePermissionLocalService)PortalBeanLocatorUtil.locate(ResourceTypePermissionLocalService.class.getName());
325    
326                            ReferenceRegistry.registerReference(ResourceTypePermissionLocalServiceUtil.class,
327                                    "_service");
328                    }
329    
330                    return _service;
331            }
332    
333            private static ResourceTypePermissionLocalService _service;
334    }