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.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    
044            /**
045            * Adds the resource type permission to the database. Also notifies the appropriate model listeners.
046            *
047            * @param resourceTypePermission the resource type permission
048            * @return the resource type permission that was added
049            */
050            public static com.liferay.portal.model.ResourceTypePermission addResourceTypePermission(
051                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
052                    return getService().addResourceTypePermission(resourceTypePermission);
053            }
054    
055            /**
056            * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database.
057            *
058            * @param resourceTypePermissionId the primary key for the new resource type permission
059            * @return the new resource type permission
060            */
061            public static com.liferay.portal.model.ResourceTypePermission createResourceTypePermission(
062                    long resourceTypePermissionId) {
063                    return getService()
064                                       .createResourceTypePermission(resourceTypePermissionId);
065            }
066    
067            /**
068            * @throws PortalException
069            */
070            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
071                    com.liferay.portal.model.PersistedModel persistedModel)
072                    throws com.liferay.portal.kernel.exception.PortalException {
073                    return getService().deletePersistedModel(persistedModel);
074            }
075    
076            /**
077            * Deletes the resource type permission from the database. Also notifies the appropriate model listeners.
078            *
079            * @param resourceTypePermission the resource type permission
080            * @return the resource type permission that was removed
081            */
082            public static com.liferay.portal.model.ResourceTypePermission deleteResourceTypePermission(
083                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
084                    return getService().deleteResourceTypePermission(resourceTypePermission);
085            }
086    
087            /**
088            * Deletes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners.
089            *
090            * @param resourceTypePermissionId the primary key of the resource type permission
091            * @return the resource type permission that was removed
092            * @throws PortalException if a resource type permission with the primary key could not be found
093            */
094            public static com.liferay.portal.model.ResourceTypePermission deleteResourceTypePermission(
095                    long resourceTypePermissionId)
096                    throws com.liferay.portal.kernel.exception.PortalException {
097                    return getService()
098                                       .deleteResourceTypePermission(resourceTypePermissionId);
099            }
100    
101            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
102                    return getService().dynamicQuery();
103            }
104    
105            /**
106            * Performs a dynamic query on the database and returns the matching rows.
107            *
108            * @param dynamicQuery the dynamic query
109            * @return the matching rows
110            */
111            public static <T> java.util.List<T> dynamicQuery(
112                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
113                    return getService().dynamicQuery(dynamicQuery);
114            }
115    
116            /**
117            * Performs a dynamic query on the database and returns a range of the matching rows.
118            *
119            * <p>
120            * 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.
121            * </p>
122            *
123            * @param dynamicQuery the dynamic query
124            * @param start the lower bound of the range of model instances
125            * @param end the upper bound of the range of model instances (not inclusive)
126            * @return the range of matching rows
127            */
128            public static <T> java.util.List<T> dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end) {
131                    return getService().dynamicQuery(dynamicQuery, start, end);
132            }
133    
134            /**
135            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
136            *
137            * <p>
138            * 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
145            * @return the ordered range of matching rows
146            */
147            public static <T> java.util.List<T> dynamicQuery(
148                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
149                    int end,
150                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
151                    return getService()
152                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
153            }
154    
155            /**
156            * Returns the number of rows matching the dynamic query.
157            *
158            * @param dynamicQuery the dynamic query
159            * @return the number of rows matching the dynamic query
160            */
161            public static long dynamicQueryCount(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
163                    return getService().dynamicQueryCount(dynamicQuery);
164            }
165    
166            /**
167            * Returns the number of rows matching the dynamic query.
168            *
169            * @param dynamicQuery the dynamic query
170            * @param projection the projection to apply to the query
171            * @return the number of rows matching the dynamic query
172            */
173            public static long dynamicQueryCount(
174                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
175                    com.liferay.portal.kernel.dao.orm.Projection projection) {
176                    return getService().dynamicQueryCount(dynamicQuery, projection);
177            }
178    
179            public static com.liferay.portal.model.ResourceTypePermission fetchResourceTypePermission(
180                    long resourceTypePermissionId) {
181                    return getService().fetchResourceTypePermission(resourceTypePermissionId);
182            }
183    
184            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
185                    return getService().getActionableDynamicQuery();
186            }
187    
188            public static long getCompanyScopeActionIds(long companyId,
189                    java.lang.String name, long roleId) {
190                    return getService().getCompanyScopeActionIds(companyId, name, roleId);
191            }
192    
193            public static long getGroupScopeActionIds(long companyId, long groupId,
194                    java.lang.String name, long roleId) {
195                    return getService()
196                                       .getGroupScopeActionIds(companyId, groupId, name, roleId);
197            }
198    
199            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getGroupScopeResourceTypePermissions(
200                    long companyId, java.lang.String name, long roleId) {
201                    return getService()
202                                       .getGroupScopeResourceTypePermissions(companyId, name, roleId);
203            }
204    
205            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
206                    return getService().getIndexableActionableDynamicQuery();
207            }
208    
209            /**
210            * Returns the OSGi service identifier.
211            *
212            * @return the OSGi service identifier
213            */
214            public static java.lang.String getOSGiServiceIdentifier() {
215                    return getService().getOSGiServiceIdentifier();
216            }
217    
218            public static com.liferay.portal.model.PersistedModel getPersistedModel(
219                    java.io.Serializable primaryKeyObj)
220                    throws com.liferay.portal.kernel.exception.PortalException {
221                    return getService().getPersistedModel(primaryKeyObj);
222            }
223    
224            public static com.liferay.portal.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
225                    long companyId, long groupId, java.lang.String name) {
226                    return getService()
227                                       .getResourceBlockPermissionsContainer(companyId, groupId,
228                            name);
229            }
230    
231            /**
232            * Returns the resource type permission with the primary key.
233            *
234            * @param resourceTypePermissionId the primary key of the resource type permission
235            * @return the resource type permission
236            * @throws PortalException if a resource type permission with the primary key could not be found
237            */
238            public static com.liferay.portal.model.ResourceTypePermission getResourceTypePermission(
239                    long resourceTypePermissionId)
240                    throws com.liferay.portal.kernel.exception.PortalException {
241                    return getService().getResourceTypePermission(resourceTypePermissionId);
242            }
243    
244            /**
245            * Returns a range of all the resource type permissions.
246            *
247            * <p>
248            * 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.
249            * </p>
250            *
251            * @param start the lower bound of the range of resource type permissions
252            * @param end the upper bound of the range of resource type permissions (not inclusive)
253            * @return the range of resource type permissions
254            */
255            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getResourceTypePermissions(
256                    int start, int end) {
257                    return getService().getResourceTypePermissions(start, end);
258            }
259    
260            /**
261            * Returns the number of resource type permissions.
262            *
263            * @return the number of resource type permissions
264            */
265            public static int getResourceTypePermissionsCount() {
266                    return getService().getResourceTypePermissionsCount();
267            }
268    
269            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getRoleResourceTypePermissions(
270                    long roleId) {
271                    return getService().getRoleResourceTypePermissions(roleId);
272            }
273    
274            public static boolean hasCompanyScopePermission(long companyId,
275                    java.lang.String name, long roleId, java.lang.String actionId)
276                    throws com.liferay.portal.kernel.exception.PortalException {
277                    return getService()
278                                       .hasCompanyScopePermission(companyId, name, roleId, actionId);
279            }
280    
281            public static boolean hasEitherScopePermission(long companyId,
282                    java.lang.String name, long roleId, java.lang.String actionId)
283                    throws com.liferay.portal.kernel.exception.PortalException {
284                    return getService()
285                                       .hasEitherScopePermission(companyId, name, roleId, actionId);
286            }
287    
288            public static boolean hasGroupScopePermission(long companyId, long groupId,
289                    java.lang.String name, long roleId, java.lang.String actionId)
290                    throws com.liferay.portal.kernel.exception.PortalException {
291                    return getService()
292                                       .hasGroupScopePermission(companyId, groupId, name, roleId,
293                            actionId);
294            }
295    
296            public static void updateCompanyScopeResourceTypePermissions(
297                    long companyId, java.lang.String name, long roleId, long actionIdsLong,
298                    long operator) {
299                    getService()
300                            .updateCompanyScopeResourceTypePermissions(companyId, name, roleId,
301                            actionIdsLong, operator);
302            }
303    
304            public static void updateGroupScopeResourceTypePermissions(long companyId,
305                    long groupId, java.lang.String name, long roleId, long actionIdsLong,
306                    long operator) {
307                    getService()
308                            .updateGroupScopeResourceTypePermissions(companyId, groupId, name,
309                            roleId, actionIdsLong, operator);
310            }
311    
312            /**
313            * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
314            *
315            * @param resourceTypePermission the resource type permission
316            * @return the resource type permission that was updated
317            */
318            public static com.liferay.portal.model.ResourceTypePermission updateResourceTypePermission(
319                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
320                    return getService().updateResourceTypePermission(resourceTypePermission);
321            }
322    
323            public static ResourceTypePermissionLocalService getService() {
324                    if (_service == null) {
325                            _service = (ResourceTypePermissionLocalService)PortalBeanLocatorUtil.locate(ResourceTypePermissionLocalService.class.getName());
326    
327                            ReferenceRegistry.registerReference(ResourceTypePermissionLocalServiceUtil.class,
328                                    "_service");
329                    }
330    
331                    return _service;
332            }
333    
334            private static ResourceTypePermissionLocalService _service;
335    }