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            /**
231            * Returns the Spring bean ID for this bean.
232            *
233            * @return the Spring bean ID for this bean
234            */
235            public java.lang.String getBeanIdentifier();
236    
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public java.util.List<java.lang.String> getCompanyScopePermissions(
239                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public java.util.List<java.lang.String> getGroupScopePermissions(
243                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
244    
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public com.liferay.portal.model.PermissionedModel getPermissionedModel(
247                    java.lang.String name, long primKey) throws PortalException;
248    
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public java.util.List<java.lang.String> getPermissions(
251                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
252    
253            @Override
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public com.liferay.portal.model.PersistedModel getPersistedModel(
256                    java.io.Serializable primaryKeyObj) throws PortalException;
257    
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public com.liferay.portal.model.ResourceBlock getResourceBlock(
260                    java.lang.String name, long primKey) throws PortalException;
261    
262            /**
263            * Returns the resource block with the primary key.
264            *
265            * @param resourceBlockId the primary key of the resource block
266            * @return the resource block
267            * @throws PortalException if a resource block with the primary key could not be found
268            */
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public com.liferay.portal.model.ResourceBlock getResourceBlock(
271                    long resourceBlockId) throws PortalException;
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public java.util.List<java.lang.Long> getResourceBlockIds(
275                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag,
276                    java.lang.String name, java.lang.String actionId)
277                    throws PortalException;
278    
279            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280            public com.liferay.portal.security.permission.ResourceBlockIdsBag getResourceBlockIdsBag(
281                    long companyId, long groupId, java.lang.String name, long[] roleIds);
282    
283            /**
284            * Returns a range of all the resource blocks.
285            *
286            * <p>
287            * 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.
288            * </p>
289            *
290            * @param start the lower bound of the range of resource blocks
291            * @param end the upper bound of the range of resource blocks (not inclusive)
292            * @return the range of resource blocks
293            */
294            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
295            public java.util.List<com.liferay.portal.model.ResourceBlock> getResourceBlocks(
296                    int start, int end);
297    
298            /**
299            * Returns the number of resource blocks.
300            *
301            * @return the number of resource blocks
302            */
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public int getResourceBlocksCount();
305    
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public boolean hasPermission(java.lang.String name,
308                    com.liferay.portal.model.PermissionedModel permissionedModel,
309                    java.lang.String actionId,
310                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag)
311                    throws PortalException;
312    
313            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314            public boolean hasPermission(java.lang.String name, long primKey,
315                    java.lang.String actionId,
316                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag)
317                    throws PortalException;
318    
319            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
320            public boolean isSupported(java.lang.String name);
321    
322            public void releasePermissionedModelResourceBlock(java.lang.String name,
323                    long primKey) throws PortalException;
324    
325            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
326            public void releasePermissionedModelResourceBlock(
327                    com.liferay.portal.model.PermissionedModel permissionedModel);
328    
329            /**
330            * Decrements the reference count of the resource block and updates it in
331            * the database or deletes the resource block if the reference count reaches
332            * zero.
333            *
334            * @param resourceBlock the resource block
335            */
336            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
337            public void releaseResourceBlock(
338                    com.liferay.portal.model.ResourceBlock resourceBlock);
339    
340            /**
341            * Decrements the reference count of the resource block and updates it in
342            * the database or deletes the resource block if the reference count reaches
343            * zero.
344            *
345            * @param resourceBlockId the primary key of the resource block
346            */
347            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
348            public void releaseResourceBlock(long resourceBlockId);
349    
350            public void removeAllGroupScopePermissions(long companyId,
351                    java.lang.String name, long roleId, java.lang.String actionId)
352                    throws PortalException;
353    
354            public void removeAllGroupScopePermissions(long companyId,
355                    java.lang.String name, long roleId, long actionIdsLong);
356    
357            public void removeCompanyScopePermission(long companyId,
358                    java.lang.String name, long roleId, java.lang.String actionId)
359                    throws PortalException;
360    
361            public void removeCompanyScopePermissions(long companyId,
362                    java.lang.String name, long roleId, long actionIdsLong);
363    
364            public void removeGroupScopePermission(long companyId, long groupId,
365                    java.lang.String name, long roleId, java.lang.String actionId)
366                    throws PortalException;
367    
368            public void removeGroupScopePermissions(long companyId, long groupId,
369                    java.lang.String name, long roleId, long actionIdsLong);
370    
371            public void removeIndividualScopePermission(long companyId, long groupId,
372                    java.lang.String name,
373                    com.liferay.portal.model.PermissionedModel permissionedModel,
374                    long roleId, java.lang.String actionId) throws PortalException;
375    
376            public void removeIndividualScopePermission(long companyId, long groupId,
377                    java.lang.String name, long primKey, long roleId,
378                    java.lang.String actionId) throws PortalException;
379    
380            public void removeIndividualScopePermissions(long companyId, long groupId,
381                    java.lang.String name,
382                    com.liferay.portal.model.PermissionedModel permissionedModel,
383                    long roleId, long actionIdsLong);
384    
385            public void removeIndividualScopePermissions(long companyId, long groupId,
386                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
387                    throws PortalException;
388    
389            /**
390            * Sets the Spring bean ID for this bean.
391            *
392            * @param beanIdentifier the Spring bean ID for this bean
393            */
394            public void setBeanIdentifier(java.lang.String beanIdentifier);
395    
396            public void setCompanyScopePermissions(long companyId,
397                    java.lang.String name, long roleId,
398                    java.util.List<java.lang.String> actionIds) throws PortalException;
399    
400            public void setCompanyScopePermissions(long companyId,
401                    java.lang.String name, long roleId, long actionIdsLong);
402    
403            public void setGroupScopePermissions(long companyId, long groupId,
404                    java.lang.String name, long roleId,
405                    java.util.List<java.lang.String> actionIds) throws PortalException;
406    
407            public void setGroupScopePermissions(long companyId, long groupId,
408                    java.lang.String name, long roleId, long actionIdsLong);
409    
410            public void setIndividualScopePermissions(long companyId, long groupId,
411                    java.lang.String name,
412                    com.liferay.portal.model.PermissionedModel permissionedModel,
413                    long roleId, java.util.List<java.lang.String> actionIds)
414                    throws PortalException;
415    
416            public void setIndividualScopePermissions(long companyId, long groupId,
417                    java.lang.String name,
418                    com.liferay.portal.model.PermissionedModel permissionedModel,
419                    long roleId, long actionIdsLong);
420    
421            public void setIndividualScopePermissions(long companyId, long groupId,
422                    java.lang.String name, long primKey, long roleId,
423                    java.util.List<java.lang.String> actionIds) throws PortalException;
424    
425            public void setIndividualScopePermissions(long companyId, long groupId,
426                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
427                    throws PortalException;
428    
429            public void setIndividualScopePermissions(long companyId, long groupId,
430                    java.lang.String name, long primKey,
431                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
432                    throws PortalException;
433    
434            public void updateCompanyScopePermissions(long companyId,
435                    java.lang.String name, long roleId, long actionIdsLong, int operator);
436    
437            public void updateGroupScopePermissions(long companyId, long groupId,
438                    java.lang.String name, long roleId, long actionIdsLong, int operator);
439    
440            public void updateIndividualScopePermissions(long companyId, long groupId,
441                    java.lang.String name,
442                    com.liferay.portal.model.PermissionedModel permissionedModel,
443                    long roleId, long actionIdsLong, int operator);
444    
445            /**
446            * Updates the resource block in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
447            *
448            * @param resourceBlock the resource block
449            * @return the resource block that was updated
450            */
451            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
452            public com.liferay.portal.model.ResourceBlock updateResourceBlock(
453                    com.liferay.portal.model.ResourceBlock resourceBlock);
454    
455            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
456            public com.liferay.portal.model.ResourceBlock updateResourceBlockId(
457                    long companyId, long groupId, java.lang.String name,
458                    com.liferay.portal.model.PermissionedModel permissionedModel,
459                    java.lang.String permissionsHash,
460                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer);
461    
462            public void verifyResourceBlockId(long companyId, java.lang.String name,
463                    long primKey) throws PortalException;
464    }