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.kernel.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.kernel.model.AuditedModel auditedModel,
079                    com.liferay.portal.kernel.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.kernel.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.kernel.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.kernel.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.kernel.model.Resource getResource(
295                    long companyId, java.lang.String name, int scope,
296                    java.lang.String primKey) {
297                    return _resourceLocalService.getResource(companyId, name, scope, primKey);
298            }
299    
300            /**
301            * Returns <code>true</code> if the roles have permission to perform the
302            * action on the resources.
303            *
304            * @param userId the primary key of the user performing the permission
305            check
306            * @param resourceId the primary key of the resource, typically the scope
307            group ID representing the scope in which the permission check is
308            being performed
309            * @param resources the resources for which permissions are to be checked
310            * @param actionId the primary key of the action to be performed on the
311            resources
312            * @param roleIds the primary keys of the roles
313            * @return <code>true</code> if the roles have permission to perform the
314            action on the resources;<code>false</code> otherwise
315            */
316            @Override
317            public boolean hasUserPermissions(long userId, long resourceId,
318                    java.util.List<com.liferay.portal.kernel.model.Resource> resources,
319                    java.lang.String actionId, long[] roleIds)
320                    throws com.liferay.portal.kernel.exception.PortalException {
321                    return _resourceLocalService.hasUserPermissions(userId, resourceId,
322                            resources, actionId, roleIds);
323            }
324    
325            /**
326            * Updates the resources for the model, replacing their group and guest
327            * permissions with new ones from the service context.
328            *
329            * @param auditedModel the model associated with the resources
330            * @param serviceContext the service context to be applied. Can set group
331            and guest permissions.
332            */
333            @Override
334            public void updateModelResources(
335                    com.liferay.portal.kernel.model.AuditedModel auditedModel,
336                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
337                    throws com.liferay.portal.kernel.exception.PortalException {
338                    _resourceLocalService.updateModelResources(auditedModel, serviceContext);
339            }
340    
341            /**
342            * Updates resources matching the group, name, and primary key string at the
343            * individual scope, setting new group and guest permissions.
344            *
345            * @param companyId the primary key of the portal instance
346            * @param groupId the primary key of the group
347            * @param name the resource's name, which should be a portlet ID if the
348            resource is a portlet or the resource's class name otherwise
349            * @param primKey the primary key string of the resource instance
350            * @param groupPermissions the group permissions to be applied
351            * @param guestPermissions the guest permissions to be applied
352            */
353            @Override
354            public void updateResources(long companyId, long groupId,
355                    java.lang.String name, java.lang.String primKey,
356                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
357                    throws com.liferay.portal.kernel.exception.PortalException {
358                    _resourceLocalService.updateResources(companyId, groupId, name,
359                            primKey, groupPermissions, guestPermissions);
360            }
361    
362            /**
363            * Updates resources matching the group, name, and primary key at the
364            * individual scope, setting new group and guest permissions.
365            *
366            * @param companyId the primary key of the portal instance
367            * @param groupId the primary key of the group
368            * @param name the resource's name, which should be a portlet ID if the
369            resource is a portlet or the resource's class name otherwise
370            * @param primKey the primary key of the resource instance
371            * @param groupPermissions the group permissions to be applied
372            * @param guestPermissions the guest permissions to be applied
373            */
374            @Override
375            public void updateResources(long companyId, long groupId,
376                    java.lang.String name, long primKey,
377                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
378                    throws com.liferay.portal.kernel.exception.PortalException {
379                    _resourceLocalService.updateResources(companyId, groupId, name,
380                            primKey, groupPermissions, guestPermissions);
381            }
382    
383            /**
384            * Updates resources matching the group, name, and primary key string at the
385            * individual scope, setting new permissions.
386            *
387            * @param companyId the primary key of the portal instance
388            * @param groupId the primary key of the group
389            * @param name the resource's name, which should be a portlet ID if the
390            resource is a portlet or the resource's class name otherwise
391            * @param primKey the primary key string of the resource instance
392            * @param modelPermissions the model permissions to be applied
393            */
394            @Override
395            public void updateResources(long companyId, long groupId,
396                    java.lang.String name, java.lang.String primKey,
397                    com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions)
398                    throws com.liferay.portal.kernel.exception.PortalException {
399                    _resourceLocalService.updateResources(companyId, groupId, name,
400                            primKey, modelPermissions);
401            }
402    
403            /**
404            * Updates resources matching the group, name, and primary key at the
405            * individual scope, setting new permissions.
406            *
407            * @param companyId the primary key of the portal instance
408            * @param groupId the primary key of the group
409            * @param name the resource's name, which should be a portlet ID if the
410            resource is a portlet or the resource's class name otherwise
411            * @param primKey the primary key of the resource instance
412            * @param modelPermissions the model permissions to be applied
413            */
414            @Override
415            public void updateResources(long companyId, long groupId,
416                    java.lang.String name, long primKey,
417                    com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions)
418                    throws com.liferay.portal.kernel.exception.PortalException {
419                    _resourceLocalService.updateResources(companyId, groupId, name,
420                            primKey, modelPermissions);
421            }
422    
423            /**
424            * Updates resources matching the name, primary key string and scope,
425            * replacing the primary key of their resource permissions with the new
426            * primary key.
427            *
428            * @param companyId the primary key of the portal instance
429            * @param name the resource's name, which should be a portlet ID if the
430            resource is a portlet or the resource's class name otherwise
431            * @param scope the scope of the resource. For more information see {@link
432            ResourceConstants}.
433            * @param primKey the primary key string of the resource instance
434            * @param newPrimKey the new primary key string of the resource
435            */
436            @Override
437            public void updateResources(long companyId, java.lang.String name,
438                    int scope, java.lang.String primKey, java.lang.String newPrimKey) {
439                    _resourceLocalService.updateResources(companyId, name, scope, primKey,
440                            newPrimKey);
441            }
442    
443            @Override
444            public ResourceLocalService getWrappedService() {
445                    return _resourceLocalService;
446            }
447    
448            @Override
449            public void setWrappedService(ResourceLocalService resourceLocalService) {
450                    _resourceLocalService = resourceLocalService;
451            }
452    
453            private ResourceLocalService _resourceLocalService;
454    }