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 com.liferay.portal.kernel.exception.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 com.liferay.portal.kernel.exception.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)
066                    throws com.liferay.portal.kernel.exception.PortalException;
067    
068            public void addIndividualScopePermission(long companyId, long groupId,
069                    java.lang.String name, long primKey, long roleId,
070                    java.lang.String actionId)
071                    throws com.liferay.portal.kernel.exception.PortalException;
072    
073            public void addIndividualScopePermissions(long companyId, long groupId,
074                    java.lang.String name,
075                    com.liferay.portal.model.PermissionedModel permissionedModel,
076                    long roleId, long actionIdsLong);
077    
078            public void addIndividualScopePermissions(long companyId, long groupId,
079                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
080                    throws com.liferay.portal.kernel.exception.PortalException;
081    
082            /**
083            * Adds a resource block if necessary and associates the resource block
084            * permissions with it. The resource block will have an initial reference
085            * count of one.
086            *
087            * @param companyId the primary key of the resource block's company
088            * @param groupId the primary key of the resource block's group
089            * @param name the resource block's name
090            * @param permissionsHash the resource block's permission hash
091            * @param resourceBlockPermissionsContainer the resource block's
092            permissions container
093            * @return the new resource block
094            */
095            public com.liferay.portal.model.ResourceBlock addResourceBlock(
096                    long companyId, long groupId, java.lang.String name,
097                    java.lang.String permissionsHash,
098                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer);
099    
100            /**
101            * Adds the resource block to the database. Also notifies the appropriate model listeners.
102            *
103            * @param resourceBlock the resource block
104            * @return the resource block that was added
105            */
106            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
107            public com.liferay.portal.model.ResourceBlock addResourceBlock(
108                    com.liferay.portal.model.ResourceBlock resourceBlock);
109    
110            /**
111            * Creates a new resource block with the primary key. Does not add the resource block to the database.
112            *
113            * @param resourceBlockId the primary key for the new resource block
114            * @return the new resource block
115            */
116            public com.liferay.portal.model.ResourceBlock createResourceBlock(
117                    long resourceBlockId);
118    
119            /**
120            * @throws PortalException
121            */
122            @Override
123            public com.liferay.portal.model.PersistedModel deletePersistedModel(
124                    com.liferay.portal.model.PersistedModel persistedModel)
125                    throws com.liferay.portal.kernel.exception.PortalException;
126    
127            /**
128            * Deletes the resource block from the database. Also notifies the appropriate model listeners.
129            *
130            * @param resourceBlock the resource block
131            * @return the resource block that was removed
132            */
133            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
134            public com.liferay.portal.model.ResourceBlock deleteResourceBlock(
135                    com.liferay.portal.model.ResourceBlock resourceBlock);
136    
137            /**
138            * Deletes the resource block with the primary key from the database. Also notifies the appropriate model listeners.
139            *
140            * @param resourceBlockId the primary key of the resource block
141            * @return the resource block that was removed
142            * @throws PortalException if a resource block with the primary key could not be found
143            */
144            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
145            public com.liferay.portal.model.ResourceBlock deleteResourceBlock(
146                    long resourceBlockId)
147                    throws com.liferay.portal.kernel.exception.PortalException;
148    
149            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
150    
151            /**
152            * Performs a dynamic query on the database and returns the matching rows.
153            *
154            * @param dynamicQuery the dynamic query
155            * @return the matching rows
156            */
157            public <T> java.util.List<T> dynamicQuery(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
159    
160            /**
161            * Performs a dynamic query on the database and returns a range of the matching rows.
162            *
163            * <p>
164            * 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.
165            * </p>
166            *
167            * @param dynamicQuery the dynamic query
168            * @param start the lower bound of the range of model instances
169            * @param end the upper bound of the range of model instances (not inclusive)
170            * @return the range of matching rows
171            */
172            public <T> java.util.List<T> dynamicQuery(
173                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
174                    int end);
175    
176            /**
177            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
178            *
179            * <p>
180            * 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.
181            * </p>
182            *
183            * @param dynamicQuery the dynamic query
184            * @param start the lower bound of the range of model instances
185            * @param end the upper bound of the range of model instances (not inclusive)
186            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
187            * @return the ordered range of matching rows
188            */
189            public <T> java.util.List<T> dynamicQuery(
190                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
191                    int end,
192                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
193    
194            /**
195            * Returns the number of rows matching the dynamic query.
196            *
197            * @param dynamicQuery the dynamic query
198            * @return the number of rows matching the dynamic query
199            */
200            public long dynamicQueryCount(
201                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
202    
203            /**
204            * Returns the number of rows matching the dynamic query.
205            *
206            * @param dynamicQuery the dynamic query
207            * @param projection the projection to apply to the query
208            * @return the number of rows matching the dynamic query
209            */
210            public long dynamicQueryCount(
211                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
212                    com.liferay.portal.kernel.dao.orm.Projection projection);
213    
214            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215            public com.liferay.portal.model.ResourceBlock fetchResourceBlock(
216                    long resourceBlockId);
217    
218            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
219            public long getActionId(java.lang.String name, java.lang.String actionId)
220                    throws com.liferay.portal.kernel.exception.PortalException;
221    
222            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
223            public long getActionIds(java.lang.String name,
224                    java.util.List<java.lang.String> actionIds)
225                    throws com.liferay.portal.kernel.exception.PortalException;
226    
227            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228            public java.util.List<java.lang.String> getActionIds(
229                    java.lang.String name, long actionIdsLong);
230    
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
233    
234            /**
235            * Returns the Spring bean ID for this bean.
236            *
237            * @return the Spring bean ID for this bean
238            */
239            public java.lang.String getBeanIdentifier();
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public java.util.List<java.lang.String> getCompanyScopePermissions(
243                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
244    
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public java.util.List<java.lang.String> getGroupScopePermissions(
247                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
248    
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public com.liferay.portal.model.PermissionedModel getPermissionedModel(
251                    java.lang.String name, long primKey)
252                    throws com.liferay.portal.kernel.exception.PortalException;
253    
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public java.util.List<java.lang.String> getPermissions(
256                    com.liferay.portal.model.ResourceBlock resourceBlock, long roleId);
257    
258            @Override
259            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
260            public com.liferay.portal.model.PersistedModel getPersistedModel(
261                    java.io.Serializable primaryKeyObj)
262                    throws com.liferay.portal.kernel.exception.PortalException;
263    
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public com.liferay.portal.model.ResourceBlock getResourceBlock(
266                    java.lang.String name, long primKey)
267                    throws com.liferay.portal.kernel.exception.PortalException;
268    
269            /**
270            * Returns the resource block with the primary key.
271            *
272            * @param resourceBlockId the primary key of the resource block
273            * @return the resource block
274            * @throws PortalException if a resource block with the primary key could not be found
275            */
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portal.model.ResourceBlock getResourceBlock(
278                    long resourceBlockId)
279                    throws com.liferay.portal.kernel.exception.PortalException;
280    
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public java.util.List<java.lang.Long> getResourceBlockIds(
283                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag,
284                    java.lang.String name, java.lang.String actionId)
285                    throws com.liferay.portal.kernel.exception.PortalException;
286    
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public com.liferay.portal.security.permission.ResourceBlockIdsBag getResourceBlockIdsBag(
289                    long companyId, long groupId, java.lang.String name, long[] roleIds);
290    
291            /**
292            * Returns a range of all the resource blocks.
293            *
294            * <p>
295            * 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.
296            * </p>
297            *
298            * @param start the lower bound of the range of resource blocks
299            * @param end the upper bound of the range of resource blocks (not inclusive)
300            * @return the range of resource blocks
301            */
302            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
303            public java.util.List<com.liferay.portal.model.ResourceBlock> getResourceBlocks(
304                    int start, int end);
305    
306            /**
307            * Returns the number of resource blocks.
308            *
309            * @return the number of resource blocks
310            */
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public int getResourceBlocksCount();
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 com.liferay.portal.kernel.exception.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 com.liferay.portal.kernel.exception.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)
332                    throws com.liferay.portal.kernel.exception.PortalException;
333    
334            @com.liferay.portal.kernel.transaction.Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
335            public void releasePermissionedModelResourceBlock(
336                    com.liferay.portal.model.PermissionedModel permissionedModel);
337    
338            /**
339            * Decrements the reference count of the resource block and updates it in
340            * the database or deletes the resource block if the reference count reaches
341            * zero.
342            *
343            * @param resourceBlock the resource block
344            */
345            @com.liferay.portal.kernel.transaction.Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
346            public void releaseResourceBlock(
347                    com.liferay.portal.model.ResourceBlock resourceBlock);
348    
349            /**
350            * Decrements the reference count of the resource block and updates it in
351            * the database or deletes the resource block if the reference count reaches
352            * zero.
353            *
354            * @param resourceBlockId the primary key of the resource block
355            */
356            @com.liferay.portal.kernel.transaction.Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
357            public void releaseResourceBlock(long resourceBlockId);
358    
359            public void removeAllGroupScopePermissions(long companyId,
360                    java.lang.String name, long roleId, java.lang.String actionId)
361                    throws com.liferay.portal.kernel.exception.PortalException;
362    
363            public void removeAllGroupScopePermissions(long companyId,
364                    java.lang.String name, long roleId, long actionIdsLong);
365    
366            public void removeCompanyScopePermission(long companyId,
367                    java.lang.String name, long roleId, java.lang.String actionId)
368                    throws com.liferay.portal.kernel.exception.PortalException;
369    
370            public void removeCompanyScopePermissions(long companyId,
371                    java.lang.String name, long roleId, long actionIdsLong);
372    
373            public void removeGroupScopePermission(long companyId, long groupId,
374                    java.lang.String name, long roleId, java.lang.String actionId)
375                    throws com.liferay.portal.kernel.exception.PortalException;
376    
377            public void removeGroupScopePermissions(long companyId, long groupId,
378                    java.lang.String name, long roleId, long actionIdsLong);
379    
380            public void removeIndividualScopePermission(long companyId, long groupId,
381                    java.lang.String name,
382                    com.liferay.portal.model.PermissionedModel permissionedModel,
383                    long roleId, java.lang.String actionId)
384                    throws com.liferay.portal.kernel.exception.PortalException;
385    
386            public void removeIndividualScopePermission(long companyId, long groupId,
387                    java.lang.String name, long primKey, long roleId,
388                    java.lang.String actionId)
389                    throws com.liferay.portal.kernel.exception.PortalException;
390    
391            public void removeIndividualScopePermissions(long companyId, long groupId,
392                    java.lang.String name,
393                    com.liferay.portal.model.PermissionedModel permissionedModel,
394                    long roleId, long actionIdsLong);
395    
396            public void removeIndividualScopePermissions(long companyId, long groupId,
397                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
398                    throws com.liferay.portal.kernel.exception.PortalException;
399    
400            /**
401            * Sets the Spring bean ID for this bean.
402            *
403            * @param beanIdentifier the Spring bean ID for this bean
404            */
405            public void setBeanIdentifier(java.lang.String beanIdentifier);
406    
407            public void setCompanyScopePermissions(long companyId,
408                    java.lang.String name, long roleId,
409                    java.util.List<java.lang.String> actionIds)
410                    throws com.liferay.portal.kernel.exception.PortalException;
411    
412            public void setCompanyScopePermissions(long companyId,
413                    java.lang.String name, long roleId, long actionIdsLong);
414    
415            public void setGroupScopePermissions(long companyId, long groupId,
416                    java.lang.String name, long roleId,
417                    java.util.List<java.lang.String> actionIds)
418                    throws com.liferay.portal.kernel.exception.PortalException;
419    
420            public void setGroupScopePermissions(long companyId, long groupId,
421                    java.lang.String name, long roleId, long actionIdsLong);
422    
423            public void setIndividualScopePermissions(long companyId, long groupId,
424                    java.lang.String name,
425                    com.liferay.portal.model.PermissionedModel permissionedModel,
426                    long roleId, java.util.List<java.lang.String> actionIds)
427                    throws com.liferay.portal.kernel.exception.PortalException;
428    
429            public void setIndividualScopePermissions(long companyId, long groupId,
430                    java.lang.String name,
431                    com.liferay.portal.model.PermissionedModel permissionedModel,
432                    long roleId, long actionIdsLong);
433    
434            public void setIndividualScopePermissions(long companyId, long groupId,
435                    java.lang.String name, long primKey, long roleId,
436                    java.util.List<java.lang.String> actionIds)
437                    throws com.liferay.portal.kernel.exception.PortalException;
438    
439            public void setIndividualScopePermissions(long companyId, long groupId,
440                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
441                    throws com.liferay.portal.kernel.exception.PortalException;
442    
443            public void setIndividualScopePermissions(long companyId, long groupId,
444                    java.lang.String name, long primKey,
445                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
446                    throws com.liferay.portal.kernel.exception.PortalException;
447    
448            public void updateCompanyScopePermissions(long companyId,
449                    java.lang.String name, long roleId, long actionIdsLong, int operator);
450    
451            public void updateGroupScopePermissions(long companyId, long groupId,
452                    java.lang.String name, long roleId, long actionIdsLong, int operator);
453    
454            public void updateIndividualScopePermissions(long companyId, long groupId,
455                    java.lang.String name,
456                    com.liferay.portal.model.PermissionedModel permissionedModel,
457                    long roleId, long actionIdsLong, int operator);
458    
459            /**
460            * Updates the resource block in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
461            *
462            * @param resourceBlock the resource block
463            * @return the resource block that was updated
464            */
465            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
466            public com.liferay.portal.model.ResourceBlock updateResourceBlock(
467                    com.liferay.portal.model.ResourceBlock resourceBlock);
468    
469            @com.liferay.portal.kernel.transaction.Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
470            public com.liferay.portal.model.ResourceBlock updateResourceBlockId(
471                    long companyId, long groupId, java.lang.String name,
472                    com.liferay.portal.model.PermissionedModel permissionedModel,
473                    java.lang.String permissionsHash,
474                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer);
475    
476            public void verifyResourceBlockId(long companyId, java.lang.String name,
477                    long primKey)
478                    throws com.liferay.portal.kernel.exception.PortalException;
479    }