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    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    
026    /**
027     * Provides the local service interface for ResourceBlock. Methods of this
028     * service will not have security checks based on the propagated JAAS
029     * credentials because this service can only be accessed from within the same
030     * VM.
031     *
032     * @author Brian Wing Shun Chan
033     * @see ResourceBlockLocalServiceUtil
034     * @see com.liferay.portal.service.base.ResourceBlockLocalServiceBaseImpl
035     * @see com.liferay.portal.service.impl.ResourceBlockLocalServiceImpl
036     * @generated
037     */
038    @ProviderType
039    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
040            PortalException.class, SystemException.class})
041    public interface ResourceBlockLocalService extends BaseLocalService,
042            PermissionedModelLocalService {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify or reference this interface directly. Always use {@link ResourceBlockLocalServiceUtil} to access the resource block local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceBlockLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
047             */
048            public void addCompanyScopePermission(long companyId,
049                    java.lang.String name, long roleId, java.lang.String actionId)
050                    throws PortalException;
051    
052            public void addCompanyScopePermissions(long companyId,
053                    java.lang.String name, long roleId, long actionIdsLong);
054    
055            public void addGroupScopePermission(long companyId, long groupId,
056                    java.lang.String name, long roleId, java.lang.String actionId)
057                    throws PortalException;
058    
059            public void addGroupScopePermissions(long companyId, long groupId,
060                    java.lang.String name, long roleId, long actionIdsLong);
061    
062            public void addIndividualScopePermission(long companyId, long groupId,
063                    java.lang.String name,
064                    com.liferay.portal.model.PermissionedModel permissionedModel,
065                    long roleId, java.lang.String actionId) throws PortalException;
066    
067            public void addIndividualScopePermission(long companyId, long groupId,
068                    java.lang.String name, long primKey, long roleId,
069                    java.lang.String actionId) throws PortalException;
070    
071            public void addIndividualScopePermissions(long companyId, long groupId,
072                    java.lang.String name,
073                    com.liferay.portal.model.PermissionedModel permissionedModel,
074                    long roleId, long actionIdsLong);
075    
076            public void addIndividualScopePermissions(long companyId, long groupId,
077                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
078                    throws PortalException;
079    
080            /**
081            * Adds a resource block if necessary and associates the resource block
082            * permissions with it. The resource block will have an initial reference
083            * count of one.
084            *
085            * @param companyId the primary key of the resource block's company
086            * @param groupId the primary key of the resource block's group
087            * @param name the resource block's name
088            * @param permissionsHash the resource block's permission hash
089            * @param resourceBlockPermissionsContainer the resource block's
090            permissions container
091            * @return the new resource block
092            */
093            public com.liferay.portal.model.ResourceBlock addResourceBlock(
094                    long companyId, long groupId, java.lang.String name,
095                    java.lang.String permissionsHash,
096                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer);
097    
098            /**
099            * Adds the resource block to the database. Also notifies the appropriate model listeners.
100            *
101            * @param resourceBlock the resource block
102            * @return the resource block that was added
103            */
104            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
105            public com.liferay.portal.model.ResourceBlock addResourceBlock(
106                    com.liferay.portal.model.ResourceBlock resourceBlock);
107    
108            /**
109            * Creates a new resource block with the primary key. Does not add the resource block to the database.
110            *
111            * @param resourceBlockId the primary key for the new resource block
112            * @return the new resource block
113            */
114            public com.liferay.portal.model.ResourceBlock createResourceBlock(
115                    long resourceBlockId);
116    
117            /**
118            * @throws PortalException
119            */
120            @Override
121            public com.liferay.portal.model.PersistedModel deletePersistedModel(
122                    com.liferay.portal.model.PersistedModel persistedModel)
123                    throws PortalException;
124    
125            /**
126            * Deletes the resource block from the database. Also notifies the appropriate model listeners.
127            *
128            * @param resourceBlock the resource block
129            * @return the resource block that was removed
130            */
131            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
132            public com.liferay.portal.model.ResourceBlock deleteResourceBlock(
133                    com.liferay.portal.model.ResourceBlock resourceBlock);
134    
135            /**
136            * Deletes the resource block with the primary key from the database. Also notifies the appropriate model listeners.
137            *
138            * @param resourceBlockId the primary key of the resource block
139            * @return the resource block that was removed
140            * @throws PortalException if a resource block with the primary key could not be found
141            */
142            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
143            public com.liferay.portal.model.ResourceBlock deleteResourceBlock(
144                    long resourceBlockId) throws PortalException;
145    
146            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
147    
148            /**
149            * Performs a dynamic query on the database and returns the matching rows.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the matching rows
153            */
154            public <T> java.util.List<T> dynamicQuery(
155                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
156    
157            /**
158            * Performs a dynamic query on the database and returns a range of the matching rows.
159            *
160            * <p>
161            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
162            * </p>
163            *
164            * @param dynamicQuery the dynamic query
165            * @param start the lower bound of the range of model instances
166            * @param end the upper bound of the range of model instances (not inclusive)
167            * @return the range of matching rows
168            */
169            public <T> java.util.List<T> dynamicQuery(
170                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
171                    int end);
172    
173            /**
174            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
175            *
176            * <p>
177            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
178            * </p>
179            *
180            * @param dynamicQuery the dynamic query
181            * @param start the lower bound of the range of model instances
182            * @param end the upper bound of the range of model instances (not inclusive)
183            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
184            * @return the ordered range of matching rows
185            */
186            public <T> java.util.List<T> dynamicQuery(
187                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
188                    int end,
189                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
190    
191            /**
192            * Returns the number of rows matching the dynamic query.
193            *
194            * @param dynamicQuery the dynamic query
195            * @return the number of rows matching the dynamic query
196            */
197            public long dynamicQueryCount(
198                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
199    
200            /**
201            * Returns the number of rows matching the dynamic query.
202            *
203            * @param dynamicQuery the dynamic query
204            * @param projection the projection to apply to the query
205            * @return the number of rows matching the dynamic query
206            */
207            public long dynamicQueryCount(
208                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
209                    com.liferay.portal.kernel.dao.orm.Projection projection);
210    
211            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
212            public com.liferay.portal.model.ResourceBlock fetchResourceBlock(
213                    long resourceBlockId);
214    
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public long getActionId(java.lang.String name, java.lang.String actionId)
217                    throws PortalException;
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public long getActionIds(java.lang.String name,
221                    java.util.List<java.lang.String> actionIds) throws PortalException;
222    
223            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224            public java.util.List<java.lang.String> getActionIds(
225                    java.lang.String name, long actionIdsLong);
226    
227            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
229    
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public java.util.List<java.lang.String> getCompanyScopePermissions(
232                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
233    
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public java.util.List<java.lang.String> getGroupScopePermissions(
236                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
237    
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
240    
241            /**
242            * Returns the OSGi service identifier.
243            *
244            * @return the OSGi service identifier
245            */
246            public java.lang.String getOSGiServiceIdentifier();
247    
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public com.liferay.portal.model.PermissionedModel getPermissionedModel(
250                    java.lang.String name, long primKey) throws PortalException;
251    
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public java.util.List<java.lang.String> getPermissions(
254                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
255    
256            @Override
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public com.liferay.portal.model.PersistedModel getPersistedModel(
259                    java.io.Serializable primaryKeyObj) throws PortalException;
260    
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public com.liferay.portal.model.ResourceBlock getResourceBlock(
263                    java.lang.String name, long primKey) throws PortalException;
264    
265            /**
266            * Returns the resource block with the primary key.
267            *
268            * @param resourceBlockId the primary key of the resource block
269            * @return the resource block
270            * @throws PortalException if a resource block with the primary key could not be found
271            */
272            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
273            public com.liferay.portal.model.ResourceBlock getResourceBlock(
274                    long resourceBlockId) throws PortalException;
275    
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public java.util.List<java.lang.Long> getResourceBlockIds(
278                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag,
279                    java.lang.String name, java.lang.String actionId)
280                    throws PortalException;
281    
282            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283            public com.liferay.portal.security.permission.ResourceBlockIdsBag getResourceBlockIdsBag(
284                    long companyId, long groupId, java.lang.String name, long[] roleIds);
285    
286            /**
287            * Returns a range of all the resource blocks.
288            *
289            * <p>
290            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
291            * </p>
292            *
293            * @param start the lower bound of the range of resource blocks
294            * @param end the upper bound of the range of resource blocks (not inclusive)
295            * @return the range of resource blocks
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public java.util.List<com.liferay.portal.model.ResourceBlock> getResourceBlocks(
299                    int start, int end);
300    
301            /**
302            * Returns the number of resource blocks.
303            *
304            * @return the number of resource blocks
305            */
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public int getResourceBlocksCount();
308    
309            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310            public java.util.List<com.liferay.portal.model.Role> getRoles(
311                    java.lang.String name, long primKey, java.lang.String actionId)
312                    throws PortalException;
313    
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public boolean hasPermission(java.lang.String name,
316                    com.liferay.portal.model.PermissionedModel permissionedModel,
317                    java.lang.String actionId,
318                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag)
319                    throws PortalException;
320    
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public boolean hasPermission(java.lang.String name, long primKey,
323                    java.lang.String actionId,
324                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag)
325                    throws PortalException;
326    
327            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
328            public boolean isSupported(java.lang.String name);
329    
330            public void releasePermissionedModelResourceBlock(java.lang.String name,
331                    long primKey) throws PortalException;
332    
333            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
334            public void releasePermissionedModelResourceBlock(
335                    com.liferay.portal.model.PermissionedModel permissionedModel);
336    
337            /**
338            * Decrements the reference count of the resource block and updates it in
339            * the database or deletes the resource block if the reference count reaches
340            * zero.
341            *
342            * @param resourceBlock the resource block
343            */
344            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
345            public void releaseResourceBlock(
346                    com.liferay.portal.model.ResourceBlock resourceBlock);
347    
348            /**
349            * Decrements the reference count of the resource block and updates it in
350            * the database or deletes the resource block if the reference count reaches
351            * zero.
352            *
353            * @param resourceBlockId the primary key of the resource block
354            */
355            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
356            public void releaseResourceBlock(long resourceBlockId);
357    
358            public void removeAllGroupScopePermissions(long companyId,
359                    java.lang.String name, long roleId, java.lang.String actionId)
360                    throws PortalException;
361    
362            public void removeAllGroupScopePermissions(long companyId,
363                    java.lang.String name, long roleId, long actionIdsLong);
364    
365            public void removeCompanyScopePermission(long companyId,
366                    java.lang.String name, long roleId, java.lang.String actionId)
367                    throws PortalException;
368    
369            public void removeCompanyScopePermissions(long companyId,
370                    java.lang.String name, long roleId, long actionIdsLong);
371    
372            public void removeGroupScopePermission(long companyId, long groupId,
373                    java.lang.String name, long roleId, java.lang.String actionId)
374                    throws PortalException;
375    
376            public void removeGroupScopePermissions(long companyId, long groupId,
377                    java.lang.String name, long roleId, long actionIdsLong);
378    
379            public void removeIndividualScopePermission(long companyId, long groupId,
380                    java.lang.String name,
381                    com.liferay.portal.model.PermissionedModel permissionedModel,
382                    long roleId, java.lang.String actionId) throws PortalException;
383    
384            public void removeIndividualScopePermission(long companyId, long groupId,
385                    java.lang.String name, long primKey, long roleId,
386                    java.lang.String actionId) throws PortalException;
387    
388            public void removeIndividualScopePermissions(long companyId, long groupId,
389                    java.lang.String name,
390                    com.liferay.portal.model.PermissionedModel permissionedModel,
391                    long roleId, long actionIdsLong);
392    
393            public void removeIndividualScopePermissions(long companyId, long groupId,
394                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
395                    throws PortalException;
396    
397            public void setCompanyScopePermissions(long companyId,
398                    java.lang.String name, long roleId,
399                    java.util.List<java.lang.String> actionIds) throws PortalException;
400    
401            public void setCompanyScopePermissions(long companyId,
402                    java.lang.String name, long roleId, long actionIdsLong);
403    
404            public void setGroupScopePermissions(long companyId, long groupId,
405                    java.lang.String name, long roleId,
406                    java.util.List<java.lang.String> actionIds) throws PortalException;
407    
408            public void setGroupScopePermissions(long companyId, long groupId,
409                    java.lang.String name, long roleId, long actionIdsLong);
410    
411            public void setIndividualScopePermissions(long companyId, long groupId,
412                    java.lang.String name,
413                    com.liferay.portal.model.PermissionedModel permissionedModel,
414                    long roleId, java.util.List<java.lang.String> actionIds)
415                    throws PortalException;
416    
417            public void setIndividualScopePermissions(long companyId, long groupId,
418                    java.lang.String name,
419                    com.liferay.portal.model.PermissionedModel permissionedModel,
420                    long roleId, long actionIdsLong);
421    
422            public void setIndividualScopePermissions(long companyId, long groupId,
423                    java.lang.String name, long primKey, long roleId,
424                    java.util.List<java.lang.String> actionIds) throws PortalException;
425    
426            public void setIndividualScopePermissions(long companyId, long groupId,
427                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
428                    throws PortalException;
429    
430            public void setIndividualScopePermissions(long companyId, long groupId,
431                    java.lang.String name, long primKey,
432                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
433                    throws PortalException;
434    
435            public void updateCompanyScopePermissions(long companyId,
436                    java.lang.String name, long roleId, long actionIdsLong, int operator);
437    
438            public void updateGroupScopePermissions(long companyId, long groupId,
439                    java.lang.String name, long roleId, long actionIdsLong, int operator);
440    
441            public void updateIndividualScopePermissions(long companyId, long groupId,
442                    java.lang.String name,
443                    com.liferay.portal.model.PermissionedModel permissionedModel,
444                    long roleId, long actionIdsLong, int operator);
445    
446            /**
447            * Updates the resource block in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
448            *
449            * @param resourceBlock the resource block
450            * @return the resource block that was updated
451            */
452            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
453            public com.liferay.portal.model.ResourceBlock updateResourceBlock(
454                    com.liferay.portal.model.ResourceBlock resourceBlock);
455    
456            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
457            public com.liferay.portal.model.ResourceBlock updateResourceBlockId(
458                    long companyId, long groupId, java.lang.String name,
459                    com.liferay.portal.model.PermissionedModel permissionedModel,
460                    java.lang.String permissionsHash,
461                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer);
462    
463            public void verifyResourceBlockId(long companyId, java.lang.String name,
464                    long primKey) throws PortalException;
465    }