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            /**
189            * Returns the Spring bean ID for this bean.
190            *
191            * @return the Spring bean ID for this bean
192            */
193            public static java.lang.String getBeanIdentifier() {
194                    return getService().getBeanIdentifier();
195            }
196    
197            public static long getCompanyScopeActionIds(long companyId,
198                    java.lang.String name, long roleId) {
199                    return getService().getCompanyScopeActionIds(companyId, name, roleId);
200            }
201    
202            public static long getGroupScopeActionIds(long companyId, long groupId,
203                    java.lang.String name, long roleId) {
204                    return getService()
205                                       .getGroupScopeActionIds(companyId, groupId, name, roleId);
206            }
207    
208            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getGroupScopeResourceTypePermissions(
209                    long companyId, java.lang.String name, long roleId) {
210                    return getService()
211                                       .getGroupScopeResourceTypePermissions(companyId, name, roleId);
212            }
213    
214            public static com.liferay.portal.model.PersistedModel getPersistedModel(
215                    java.io.Serializable primaryKeyObj)
216                    throws com.liferay.portal.kernel.exception.PortalException {
217                    return getService().getPersistedModel(primaryKeyObj);
218            }
219    
220            public static com.liferay.portal.model.ResourceBlockPermissionsContainer getResourceBlockPermissionsContainer(
221                    long companyId, long groupId, java.lang.String name) {
222                    return getService()
223                                       .getResourceBlockPermissionsContainer(companyId, groupId,
224                            name);
225            }
226    
227            /**
228            * Returns the resource type permission with the primary key.
229            *
230            * @param resourceTypePermissionId the primary key of the resource type permission
231            * @return the resource type permission
232            * @throws PortalException if a resource type permission with the primary key could not be found
233            */
234            public static com.liferay.portal.model.ResourceTypePermission getResourceTypePermission(
235                    long resourceTypePermissionId)
236                    throws com.liferay.portal.kernel.exception.PortalException {
237                    return getService().getResourceTypePermission(resourceTypePermissionId);
238            }
239    
240            /**
241            * Returns a range of all the resource type permissions.
242            *
243            * <p>
244            * 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.
245            * </p>
246            *
247            * @param start the lower bound of the range of resource type permissions
248            * @param end the upper bound of the range of resource type permissions (not inclusive)
249            * @return the range of resource type permissions
250            */
251            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getResourceTypePermissions(
252                    int start, int end) {
253                    return getService().getResourceTypePermissions(start, end);
254            }
255    
256            /**
257            * Returns the number of resource type permissions.
258            *
259            * @return the number of resource type permissions
260            */
261            public static int getResourceTypePermissionsCount() {
262                    return getService().getResourceTypePermissionsCount();
263            }
264    
265            public static java.util.List<com.liferay.portal.model.ResourceTypePermission> getRoleResourceTypePermissions(
266                    long roleId) {
267                    return getService().getRoleResourceTypePermissions(roleId);
268            }
269    
270            public static boolean hasCompanyScopePermission(long companyId,
271                    java.lang.String name, long roleId, java.lang.String actionId)
272                    throws com.liferay.portal.kernel.exception.PortalException {
273                    return getService()
274                                       .hasCompanyScopePermission(companyId, name, roleId, actionId);
275            }
276    
277            public static boolean hasEitherScopePermission(long companyId,
278                    java.lang.String name, long roleId, java.lang.String actionId)
279                    throws com.liferay.portal.kernel.exception.PortalException {
280                    return getService()
281                                       .hasEitherScopePermission(companyId, name, roleId, actionId);
282            }
283    
284            public static boolean hasGroupScopePermission(long companyId, long groupId,
285                    java.lang.String name, long roleId, java.lang.String actionId)
286                    throws com.liferay.portal.kernel.exception.PortalException {
287                    return getService()
288                                       .hasGroupScopePermission(companyId, groupId, name, roleId,
289                            actionId);
290            }
291    
292            /**
293            * Sets the Spring bean ID for this bean.
294            *
295            * @param beanIdentifier the Spring bean ID for this bean
296            */
297            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
298                    getService().setBeanIdentifier(beanIdentifier);
299            }
300    
301            public static void updateCompanyScopeResourceTypePermissions(
302                    long companyId, java.lang.String name, long roleId, long actionIdsLong,
303                    long operator) {
304                    getService()
305                            .updateCompanyScopeResourceTypePermissions(companyId, name, roleId,
306                            actionIdsLong, operator);
307            }
308    
309            public static void updateGroupScopeResourceTypePermissions(long companyId,
310                    long groupId, java.lang.String name, long roleId, long actionIdsLong,
311                    long operator) {
312                    getService()
313                            .updateGroupScopeResourceTypePermissions(companyId, groupId, name,
314                            roleId, actionIdsLong, operator);
315            }
316    
317            /**
318            * Updates the resource type permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
319            *
320            * @param resourceTypePermission the resource type permission
321            * @return the resource type permission that was updated
322            */
323            public static com.liferay.portal.model.ResourceTypePermission updateResourceTypePermission(
324                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
325                    return getService().updateResourceTypePermission(resourceTypePermission);
326            }
327    
328            public static ResourceTypePermissionLocalService getService() {
329                    if (_service == null) {
330                            _service = (ResourceTypePermissionLocalService)PortalBeanLocatorUtil.locate(ResourceTypePermissionLocalService.class.getName());
331    
332                            ReferenceRegistry.registerReference(ResourceTypePermissionLocalServiceUtil.class,
333                                    "_service");
334                    }
335    
336                    return _service;
337            }
338    
339            /**
340             * @deprecated As of 6.2.0
341             */
342            @Deprecated
343            public void setService(ResourceTypePermissionLocalService service) {
344            }
345    
346            private static ResourceTypePermissionLocalService _service;
347    }