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