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    /**
020     * Provides a wrapper for {@link ResourceLocalService}.
021     *
022     * @author Brian Wing Shun Chan
023     * @see ResourceLocalService
024     * @generated
025     */
026    @ProviderType
027    public class ResourceLocalServiceWrapper implements ResourceLocalService,
028            ServiceWrapper<ResourceLocalService> {
029            public ResourceLocalServiceWrapper(
030                    ResourceLocalService resourceLocalService) {
031                    _resourceLocalService = resourceLocalService;
032            }
033    
034            /**
035            * Adds resources for the model, always creating a resource at the
036            * individual scope and only creating resources at the group, group
037            * template, and company scope if such resources don't already exist.
038            *
039            * <ol>
040            * <li>
041            * If the service context specifies that default group or default guest
042            * permissions are to be added, then only default permissions are added. See
043            * {@link ServiceContext#setAddGroupPermissions(
044            * boolean)} and {@link
045            * ServiceContext#setAddGuestPermissions(
046            * boolean)}.
047            * </li>
048            * <li>
049            * Else ...
050            * <ol>
051            * <li>
052            * If the service context specifies to derive default permissions, then
053            * default group and guest permissions are derived from the model and
054            * added. See {@link
055            * ServiceContext#setDeriveDefaultPermissions(
056            * boolean)}.
057            * </li>
058            * <li>
059            * Lastly group and guest permissions from the service
060            * context are applied. See {@link
061            * ServiceContext#setGroupPermissions(String[])}
062            * and {@link
063            * ServiceContext#setGuestPermissions(String[])}.
064            * </li>
065            * </ol>
066            *
067            * </li>
068            * </ol>
069            *
070            * @param auditedModel the model to associate with the resources
071            * @param serviceContext the service context to apply. Can set whether to
072            add the model's default group and guest permissions, set whether
073            to derive default group and guest permissions from the model, set
074            group permissions to apply, and set guest permissions to apply.
075            * @throws PortalException if no portal actions could be found associated
076            with the model or if a portal exception occurred
077            */
078            @Override
079            public void addModelResources(
080                    com.liferay.portal.model.AuditedModel auditedModel,
081                    com.liferay.portal.service.ServiceContext serviceContext)
082                    throws com.liferay.portal.kernel.exception.PortalException {
083                    _resourceLocalService.addModelResources(auditedModel, serviceContext);
084            }
085    
086            /**
087            * Adds resources for the model with the name and primary key, always
088            * creating a resource at the individual scope and only creating resources
089            * at the group, group template, and company scope if such resources don't
090            * already exist.
091            *
092            * @param companyId the primary key of the portal instance
093            * @param groupId the primary key of the group
094            * @param userId the primary key of the user adding the resources
095            * @param name a name for the resource, typically the model's class name
096            * @param primKey the primary key of the model instance, optionally
097            <code>0</code> if no instance exists
098            * @param groupPermissions the group permissions to be applied
099            * @param guestPermissions the guest permissions to be applied
100            * @throws PortalException if no portal actions could be found associated
101            with the model or if a portal exception occurred
102            */
103            @Override
104            public void addModelResources(long companyId, long groupId, long userId,
105                    java.lang.String name, long primKey,
106                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
107                    throws com.liferay.portal.kernel.exception.PortalException {
108                    _resourceLocalService.addModelResources(companyId, groupId, userId,
109                            name, primKey, groupPermissions, guestPermissions);
110            }
111    
112            /**
113            * Adds resources for the model with the name and primary key string, always
114            * creating a resource at the individual scope and only creating resources
115            * at the group, group template, and company scope if such resources don't
116            * already exist.
117            *
118            * @param companyId the primary key of the portal instance
119            * @param groupId the primary key of the group
120            * @param userId the primary key of the user adding the resources
121            * @param name a name for the resource, typically the model's class name
122            * @param primKey the primary key string of the model instance, optionally
123            an empty string if no instance exists
124            * @param groupPermissions the group permissions to be applied
125            * @param guestPermissions the guest permissions to be applied
126            * @throws PortalException if no portal actions could be found associated
127            with the model or if a portal exception occurred
128            */
129            @Override
130            public void addModelResources(long companyId, long groupId, long userId,
131                    java.lang.String name, java.lang.String primKey,
132                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    _resourceLocalService.addModelResources(companyId, groupId, userId,
135                            name, primKey, groupPermissions, guestPermissions);
136            }
137    
138            @Override
139            public void addModelResources(long companyId, long groupId, long userId,
140                    java.lang.String name, long primKey,
141                    com.liferay.portal.service.permission.ModelPermissions modelPermissions)
142                    throws com.liferay.portal.kernel.exception.PortalException {
143                    _resourceLocalService.addModelResources(companyId, groupId, userId,
144                            name, primKey, modelPermissions);
145            }
146    
147            @Override
148            public void addModelResources(long companyId, long groupId, long userId,
149                    java.lang.String name, java.lang.String primKey,
150                    com.liferay.portal.service.permission.ModelPermissions modelPermissions)
151                    throws com.liferay.portal.kernel.exception.PortalException {
152                    _resourceLocalService.addModelResources(companyId, groupId, userId,
153                            name, primKey, modelPermissions);
154            }
155    
156            /**
157            * Adds resources for the entity with the name. Use this method if the user
158            * is unknown or irrelevant and there is no current entity instance.
159            *
160            * @param companyId the primary key of the portal instance
161            * @param groupId the primary key of the group
162            * @param name a name for the resource, which should be a portlet ID if the
163            resource is a portlet or the resource's class name otherwise
164            * @param portletActions whether to associate portlet actions with the
165            resource
166            * @throws PortalException if no portal actions could be found associated
167            with the resource or if a portal exception occurred
168            */
169            @Override
170            public void addResources(long companyId, long groupId,
171                    java.lang.String name, boolean portletActions)
172                    throws com.liferay.portal.kernel.exception.PortalException {
173                    _resourceLocalService.addResources(companyId, groupId, name,
174                            portletActions);
175            }
176    
177            /**
178            * Adds resources for the entity with the name and primary key string,
179            * always creating a resource at the individual scope and only creating
180            * resources at the group, group template, and company scope if such
181            * resources don't already exist.
182            *
183            * @param companyId the primary key of the portal instance
184            * @param groupId the primary key of the group
185            * @param userId the primary key of the user adding the resources
186            * @param name a name for the resource, which should be a portlet ID if the
187            resource is a portlet or the resource's class name otherwise
188            * @param primKey the primary key string of the resource instance,
189            optionally an empty string if no instance exists
190            * @param portletActions whether to associate portlet actions with the
191            resource
192            * @param addGroupPermissions whether to add group permissions
193            * @param addGuestPermissions whether to add guest permissions
194            * @throws PortalException if no portal actions could be found associated
195            with the resource or if a portal exception occurred
196            */
197            @Override
198            public void addResources(long companyId, long groupId, long userId,
199                    java.lang.String name, java.lang.String primKey,
200                    boolean portletActions, boolean addGroupPermissions,
201                    boolean addGuestPermissions)
202                    throws com.liferay.portal.kernel.exception.PortalException {
203                    _resourceLocalService.addResources(companyId, groupId, userId, name,
204                            primKey, portletActions, addGroupPermissions, addGuestPermissions);
205            }
206    
207            /**
208            * Adds resources for the entity with the name and primary key, always
209            * creating a resource at the individual scope and only creating resources
210            * at the group, group template, and company scope if such resources don't
211            * already exist.
212            *
213            * @param companyId the primary key of the portal instance
214            * @param groupId the primary key of the group
215            * @param userId the primary key of the user adding the resources
216            * @param name a name for the resource, which should be a portlet ID if the
217            resource is a portlet or the resource's class name otherwise
218            * @param primKey the primary key of the resource instance, optionally
219            <code>0</code> if no instance exists
220            * @param portletActions whether to associate portlet actions with the
221            resource
222            * @param addGroupPermissions whether to add group permissions
223            * @param addGuestPermissions whether to add guest permissions
224            * @throws PortalException if no portal actions could be found associated
225            with the resource or if a portal exception occurred
226            */
227            @Override
228            public void addResources(long companyId, long groupId, long userId,
229                    java.lang.String name, long primKey, boolean portletActions,
230                    boolean addGroupPermissions, boolean addGuestPermissions)
231                    throws com.liferay.portal.kernel.exception.PortalException {
232                    _resourceLocalService.addResources(companyId, groupId, userId, name,
233                            primKey, portletActions, addGroupPermissions, addGuestPermissions);
234            }
235    
236            /**
237            * Deletes the resource associated with the model at the scope.
238            *
239            * @param auditedModel the model associated with the resource
240            * @param scope the scope of the resource. For more information see {@link
241            ResourceConstants}.
242            * @throws PortalException if a portal exception occurred
243            */
244            @Override
245            public void deleteResource(
246                    com.liferay.portal.model.AuditedModel auditedModel, int scope)
247                    throws com.liferay.portal.kernel.exception.PortalException {
248                    _resourceLocalService.deleteResource(auditedModel, scope);
249            }
250    
251            /**
252            * Deletes the resource matching the primary key at the scope.
253            *
254            * @param companyId the primary key of the portal instance
255            * @param name the resource's name, which should be a portlet ID if the
256            resource is a portlet or the resource's class name otherwise
257            * @param scope the scope of the resource. For more information see {@link
258            ResourceConstants}.
259            * @param primKey the primary key of the resource instance
260            * @throws PortalException if a portal exception occurred
261            */
262            @Override
263            public void deleteResource(long companyId, java.lang.String name,
264                    int scope, long primKey)
265                    throws com.liferay.portal.kernel.exception.PortalException {
266                    _resourceLocalService.deleteResource(companyId, name, scope, primKey);
267            }
268    
269            /**
270            * Deletes the resource matching the primary key at the scope.
271            *
272            * @param companyId the primary key of the portal instance
273            * @param name the resource's name, which should be a portlet ID if the
274            resource is a portlet or the resource's class name otherwise
275            * @param scope the scope of the resource. For more information see {@link
276            ResourceConstants}.
277            * @param primKey the primary key string of the resource instance
278            * @throws PortalException if a portal exception occurred
279            */
280            @Override
281            public void deleteResource(long companyId, java.lang.String name,
282                    int scope, java.lang.String primKey)
283                    throws com.liferay.portal.kernel.exception.PortalException {
284                    _resourceLocalService.deleteResource(companyId, name, scope, primKey);
285            }
286    
287            /**
288            * Returns the Spring bean ID for this bean.
289            *
290            * @return the Spring bean ID for this bean
291            */
292            @Override
293            public java.lang.String getBeanIdentifier() {
294                    return _resourceLocalService.getBeanIdentifier();
295            }
296    
297            /**
298            * Returns a new resource with the name and primary key at the scope.
299            *
300            * @param companyId the primary key of the portal instance
301            * @param name a name for the resource, which should be a portlet ID if the
302            resource is a portlet or the resource's class name otherwise
303            * @param scope the scope of the resource. For more information see {@link
304            ResourceConstants}.
305            * @param primKey the primary key string of the resource
306            * @return the new resource
307            */
308            @Override
309            public com.liferay.portal.model.Resource getResource(long companyId,
310                    java.lang.String name, int scope, java.lang.String primKey) {
311                    return _resourceLocalService.getResource(companyId, name, scope, primKey);
312            }
313    
314            /**
315            * Returns <code>true</code> if the roles have permission to perform the
316            * action on the resources.
317            *
318            * @param userId the primary key of the user performing the permission
319            check
320            * @param resourceId the primary key of the resource, typically the scope
321            group ID representing the scope in which the permission check is
322            being performed
323            * @param resources the resources for which permissions are to be checked
324            * @param actionId the primary key of the action to be performed on the
325            resources
326            * @param roleIds the primary keys of the roles
327            * @return <code>true</code> if the roles have permission to perform the
328            action on the resources;<code>false</code> otherwise
329            * @throws PortalException if any one of the roles with the primary keys
330            could not be found or if a resource action with the action ID
331            could not be found
332            */
333            @Override
334            public boolean hasUserPermissions(long userId, long resourceId,
335                    java.util.List<com.liferay.portal.model.Resource> resources,
336                    java.lang.String actionId, long[] roleIds)
337                    throws com.liferay.portal.kernel.exception.PortalException {
338                    return _resourceLocalService.hasUserPermissions(userId, resourceId,
339                            resources, actionId, roleIds);
340            }
341    
342            /**
343            * Sets the Spring bean ID for this bean.
344            *
345            * @param beanIdentifier the Spring bean ID for this bean
346            */
347            @Override
348            public void setBeanIdentifier(java.lang.String beanIdentifier) {
349                    _resourceLocalService.setBeanIdentifier(beanIdentifier);
350            }
351    
352            /**
353            * Updates the resources for the model, replacing their group and guest
354            * permissions with new ones from the service context.
355            *
356            * @param auditedModel the model associated with the resources
357            * @param serviceContext the service context to be applied. Can set group
358            and guest permissions.
359            * @throws PortalException if a portal exception occurred
360            */
361            @Override
362            public void updateModelResources(
363                    com.liferay.portal.model.AuditedModel auditedModel,
364                    com.liferay.portal.service.ServiceContext serviceContext)
365                    throws com.liferay.portal.kernel.exception.PortalException {
366                    _resourceLocalService.updateModelResources(auditedModel, serviceContext);
367            }
368    
369            /**
370            * Updates resources matching the group, name, and primary key string at the
371            * individual scope, setting new group and guest permissions.
372            *
373            * @param companyId the primary key of the portal instance
374            * @param groupId the primary key of the group
375            * @param name the resource's name, which should be a portlet ID if the
376            resource is a portlet or the resource's class name otherwise
377            * @param primKey the primary key string of the resource instance
378            * @param groupPermissions the group permissions to be applied
379            * @param guestPermissions the guest permissions to be applied
380            * @throws PortalException if a portal exception occurred
381            */
382            @Override
383            public void updateResources(long companyId, long groupId,
384                    java.lang.String name, java.lang.String primKey,
385                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
386                    throws com.liferay.portal.kernel.exception.PortalException {
387                    _resourceLocalService.updateResources(companyId, groupId, name,
388                            primKey, groupPermissions, guestPermissions);
389            }
390    
391            /**
392            * Updates resources matching the group, name, and primary key at the
393            * individual scope, setting new group and guest permissions.
394            *
395            * @param companyId the primary key of the portal instance
396            * @param groupId the primary key of the group
397            * @param name the resource's name, which should be a portlet ID if the
398            resource is a portlet or the resource's class name otherwise
399            * @param primKey the primary key of the resource instance
400            * @param groupPermissions the group permissions to be applied
401            * @param guestPermissions the guest permissions to be applied
402            * @throws PortalException if a portal exception occurred
403            */
404            @Override
405            public void updateResources(long companyId, long groupId,
406                    java.lang.String name, long primKey,
407                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
408                    throws com.liferay.portal.kernel.exception.PortalException {
409                    _resourceLocalService.updateResources(companyId, groupId, name,
410                            primKey, groupPermissions, guestPermissions);
411            }
412    
413            /**
414            * Updates resources matching the group, name, and primary key at the
415            * individual scope, setting new permissions.
416            *
417            * @param companyId the primary key of the portal instance
418            * @param groupId the primary key of the group
419            * @param name the resource's name, which should be a portlet ID if the
420            resource is a portlet or the resource's class name otherwise
421            * @param primKey the primary key of the resource instance
422            * @param modelPermissions the model permissions to be applied
423            * @throws PortalException if a portal exception occurred
424            */
425            @Override
426            public void updateResources(long companyId, long groupId,
427                    java.lang.String name, long primKey,
428                    com.liferay.portal.service.permission.ModelPermissions modelPermissions)
429                    throws com.liferay.portal.kernel.exception.PortalException {
430                    _resourceLocalService.updateResources(companyId, groupId, name,
431                            primKey, modelPermissions);
432            }
433    
434            /**
435            * Updates resources matching the group, name, and primary key string at the
436            * individual scope, setting new permissions.
437            *
438            * @param companyId the primary key of the portal instance
439            * @param groupId the primary key of the group
440            * @param name the resource's name, which should be a portlet ID if the
441            resource is a portlet or the resource's class name otherwise
442            * @param primKey the primary key string of the resource instance
443            * @param modelPermissions the model permissions to be applied
444            * @throws PortalException if a portal exception occurred
445            */
446            @Override
447            public void updateResources(long companyId, long groupId,
448                    java.lang.String name, java.lang.String primKey,
449                    com.liferay.portal.service.permission.ModelPermissions modelPermissions)
450                    throws com.liferay.portal.kernel.exception.PortalException {
451                    _resourceLocalService.updateResources(companyId, groupId, name,
452                            primKey, modelPermissions);
453            }
454    
455            /**
456            * Updates resources matching the name, primary key string and scope,
457            * replacing the primary key of their resource permissions with the new
458            * primary key.
459            *
460            * @param companyId the primary key of the portal instance
461            * @param name the resource's name, which should be a portlet ID if the
462            resource is a portlet or the resource's class name otherwise
463            * @param scope the scope of the resource. For more information see {@link
464            ResourceConstants}.
465            * @param primKey the primary key string of the resource instance
466            * @param newPrimKey the new primary key string of the resource
467            */
468            @Override
469            public void updateResources(long companyId, java.lang.String name,
470                    int scope, java.lang.String primKey, java.lang.String newPrimKey) {
471                    _resourceLocalService.updateResources(companyId, name, scope, primKey,
472                            newPrimKey);
473            }
474    
475            /**
476             * @deprecated As of 6.1.0, replaced by {@link #getWrappedService}
477             */
478            @Deprecated
479            public ResourceLocalService getWrappedResourceLocalService() {
480                    return _resourceLocalService;
481            }
482    
483            /**
484             * @deprecated As of 6.1.0, replaced by {@link #setWrappedService}
485             */
486            @Deprecated
487            public void setWrappedResourceLocalService(
488                    ResourceLocalService resourceLocalService) {
489                    _resourceLocalService = resourceLocalService;
490            }
491    
492            @Override
493            public ResourceLocalService getWrappedService() {
494                    return _resourceLocalService;
495            }
496    
497            @Override
498            public void setWrappedService(ResourceLocalService resourceLocalService) {
499                    _resourceLocalService = resourceLocalService;
500            }
501    
502            private ResourceLocalService _resourceLocalService;
503    }