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            /**
239            * Returns the OSGi service identifier.
240            *
241            * @return the OSGi service identifier
242            */
243            public java.lang.String getOSGiServiceIdentifier();
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 java.util.List<com.liferay.portal.model.Role> getRoles(
308                    java.lang.String name, long primKey, java.lang.String actionId)
309                    throws PortalException;
310    
311            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312            public boolean hasPermission(java.lang.String name,
313                    com.liferay.portal.model.PermissionedModel permissionedModel,
314                    java.lang.String actionId,
315                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag)
316                    throws PortalException;
317    
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public boolean hasPermission(java.lang.String name, long primKey,
320                    java.lang.String actionId,
321                    com.liferay.portal.security.permission.ResourceBlockIdsBag resourceBlockIdsBag)
322                    throws PortalException;
323    
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public boolean isSupported(java.lang.String name);
326    
327            public void releasePermissionedModelResourceBlock(java.lang.String name,
328                    long primKey) throws PortalException;
329    
330            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
331            public void releasePermissionedModelResourceBlock(
332                    com.liferay.portal.model.PermissionedModel permissionedModel);
333    
334            /**
335            * Decrements the reference count of the resource block and updates it in
336            * the database or deletes the resource block if the reference count reaches
337            * zero.
338            *
339            * @param resourceBlock the resource block
340            */
341            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
342            public void releaseResourceBlock(
343                    com.liferay.portal.model.ResourceBlock resourceBlock);
344    
345            /**
346            * Decrements the reference count of the resource block and updates it in
347            * the database or deletes the resource block if the reference count reaches
348            * zero.
349            *
350            * @param resourceBlockId the primary key of the resource block
351            */
352            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
353            public void releaseResourceBlock(long resourceBlockId);
354    
355            public void removeAllGroupScopePermissions(long companyId,
356                    java.lang.String name, long roleId, java.lang.String actionId)
357                    throws PortalException;
358    
359            public void removeAllGroupScopePermissions(long companyId,
360                    java.lang.String name, long roleId, long actionIdsLong);
361    
362            public void removeCompanyScopePermission(long companyId,
363                    java.lang.String name, long roleId, java.lang.String actionId)
364                    throws PortalException;
365    
366            public void removeCompanyScopePermissions(long companyId,
367                    java.lang.String name, long roleId, long actionIdsLong);
368    
369            public void removeGroupScopePermission(long companyId, long groupId,
370                    java.lang.String name, long roleId, java.lang.String actionId)
371                    throws PortalException;
372    
373            public void removeGroupScopePermissions(long companyId, long groupId,
374                    java.lang.String name, long roleId, long actionIdsLong);
375    
376            public void removeIndividualScopePermission(long companyId, long groupId,
377                    java.lang.String name,
378                    com.liferay.portal.model.PermissionedModel permissionedModel,
379                    long roleId, java.lang.String actionId) throws PortalException;
380    
381            public void removeIndividualScopePermission(long companyId, long groupId,
382                    java.lang.String name, long primKey, long roleId,
383                    java.lang.String actionId) throws PortalException;
384    
385            public void removeIndividualScopePermissions(long companyId, long groupId,
386                    java.lang.String name,
387                    com.liferay.portal.model.PermissionedModel permissionedModel,
388                    long roleId, long actionIdsLong);
389    
390            public void removeIndividualScopePermissions(long companyId, long groupId,
391                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
392                    throws PortalException;
393    
394            public void setCompanyScopePermissions(long companyId,
395                    java.lang.String name, long roleId,
396                    java.util.List<java.lang.String> actionIds) throws PortalException;
397    
398            public void setCompanyScopePermissions(long companyId,
399                    java.lang.String name, long roleId, long actionIdsLong);
400    
401            public void setGroupScopePermissions(long companyId, long groupId,
402                    java.lang.String name, long roleId,
403                    java.util.List<java.lang.String> actionIds) throws PortalException;
404    
405            public void setGroupScopePermissions(long companyId, long groupId,
406                    java.lang.String name, long roleId, long actionIdsLong);
407    
408            public void setIndividualScopePermissions(long companyId, long groupId,
409                    java.lang.String name,
410                    com.liferay.portal.model.PermissionedModel permissionedModel,
411                    long roleId, java.util.List<java.lang.String> actionIds)
412                    throws PortalException;
413    
414            public void setIndividualScopePermissions(long companyId, long groupId,
415                    java.lang.String name,
416                    com.liferay.portal.model.PermissionedModel permissionedModel,
417                    long roleId, long actionIdsLong);
418    
419            public void setIndividualScopePermissions(long companyId, long groupId,
420                    java.lang.String name, long primKey, long roleId,
421                    java.util.List<java.lang.String> actionIds) throws PortalException;
422    
423            public void setIndividualScopePermissions(long companyId, long groupId,
424                    java.lang.String name, long primKey, long roleId, long actionIdsLong)
425                    throws PortalException;
426    
427            public void setIndividualScopePermissions(long companyId, long groupId,
428                    java.lang.String name, long primKey,
429                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
430                    throws PortalException;
431    
432            public void updateCompanyScopePermissions(long companyId,
433                    java.lang.String name, long roleId, long actionIdsLong, int operator);
434    
435            public void updateGroupScopePermissions(long companyId, long groupId,
436                    java.lang.String name, long roleId, long actionIdsLong, int operator);
437    
438            public void updateIndividualScopePermissions(long companyId, long groupId,
439                    java.lang.String name,
440                    com.liferay.portal.model.PermissionedModel permissionedModel,
441                    long roleId, long actionIdsLong, int operator);
442    
443            /**
444            * Updates the resource block in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
445            *
446            * @param resourceBlock the resource block
447            * @return the resource block that was updated
448            */
449            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
450            public com.liferay.portal.model.ResourceBlock updateResourceBlock(
451                    com.liferay.portal.model.ResourceBlock resourceBlock);
452    
453            @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
454            public com.liferay.portal.model.ResourceBlock updateResourceBlockId(
455                    long companyId, long groupId, java.lang.String name,
456                    com.liferay.portal.model.PermissionedModel permissionedModel,
457                    java.lang.String permissionsHash,
458                    com.liferay.portal.model.ResourceBlockPermissionsContainer resourceBlockPermissionsContainer);
459    
460            public void verifyResourceBlockId(long companyId, java.lang.String name,
461                    long primKey) throws PortalException;
462    }