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