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