001    /**
002     * Copyright (c) 2000-2011 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 com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the resource local service.
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see ResourceLocalServiceUtil
032     * @see com.liferay.portal.service.base.ResourceLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ResourceLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface ResourceLocalService extends PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * Never modify or reference this interface directly. Always use {@link ResourceLocalServiceUtil} to access the resource local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
043             */
044    
045            /**
046            * Adds the resource to the database. Also notifies the appropriate model listeners.
047            *
048            * @param resource the resource
049            * @return the resource that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Resource addResource(
053                    com.liferay.portal.model.Resource resource)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new resource with the primary key. Does not add the resource to the database.
058            *
059            * @param resourceId the primary key for the new resource
060            * @return the new resource
061            */
062            public com.liferay.portal.model.Resource createResource(long resourceId);
063    
064            /**
065            * Deletes the resource with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param resourceId the primary key of the resource
068            * @throws PortalException if a resource with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public void deleteResource(long resourceId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Deletes the resource from the database. Also notifies the appropriate model listeners.
077            *
078            * @param resource the resource
079            * @throws SystemException if a system exception occurred
080            */
081            public void deleteResource(com.liferay.portal.model.Resource resource)
082                    throws com.liferay.portal.kernel.exception.SystemException;
083    
084            /**
085            * Performs a dynamic query on the database and returns the matching rows.
086            *
087            * @param dynamicQuery the dynamic query
088            * @return the matching rows
089            * @throws SystemException if a system exception occurred
090            */
091            @SuppressWarnings("rawtypes")
092            public java.util.List dynamicQuery(
093                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
094                    throws com.liferay.portal.kernel.exception.SystemException;
095    
096            /**
097            * Performs a dynamic query on the database and returns a range of the matching rows.
098            *
099            * <p>
100            * 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.
101            * </p>
102            *
103            * @param dynamicQuery the dynamic query
104            * @param start the lower bound of the range of model instances
105            * @param end the upper bound of the range of model instances (not inclusive)
106            * @return the range of matching rows
107            * @throws SystemException if a system exception occurred
108            */
109            @SuppressWarnings("rawtypes")
110            public java.util.List dynamicQuery(
111                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
112                    int end) throws com.liferay.portal.kernel.exception.SystemException;
113    
114            /**
115            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
116            *
117            * <p>
118            * 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.
119            * </p>
120            *
121            * @param dynamicQuery the dynamic query
122            * @param start the lower bound of the range of model instances
123            * @param end the upper bound of the range of model instances (not inclusive)
124            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
125            * @return the ordered range of matching rows
126            * @throws SystemException if a system exception occurred
127            */
128            @SuppressWarnings("rawtypes")
129            public java.util.List dynamicQuery(
130                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
131                    int end,
132                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
133                    throws com.liferay.portal.kernel.exception.SystemException;
134    
135            /**
136            * Returns the number of rows that match the dynamic query.
137            *
138            * @param dynamicQuery the dynamic query
139            * @return the number of rows that match the dynamic query
140            * @throws SystemException if a system exception occurred
141            */
142            public long dynamicQueryCount(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
144                    throws com.liferay.portal.kernel.exception.SystemException;
145    
146            /**
147            * Returns the resource with the primary key.
148            *
149            * @param resourceId the primary key of the resource
150            * @return the resource
151            * @throws PortalException if a resource with the primary key could not be found
152            * @throws SystemException if a system exception occurred
153            */
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public com.liferay.portal.model.Resource getResource(long resourceId)
156                    throws com.liferay.portal.kernel.exception.PortalException,
157                            com.liferay.portal.kernel.exception.SystemException;
158    
159            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160            public com.liferay.portal.model.PersistedModel getPersistedModel(
161                    java.io.Serializable primaryKeyObj)
162                    throws com.liferay.portal.kernel.exception.PortalException,
163                            com.liferay.portal.kernel.exception.SystemException;
164    
165            /**
166            * Returns a range of all the resources.
167            *
168            * <p>
169            * 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.
170            * </p>
171            *
172            * @param start the lower bound of the range of resources
173            * @param end the upper bound of the range of resources (not inclusive)
174            * @return the range of resources
175            * @throws SystemException if a system exception occurred
176            */
177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178            public java.util.List<com.liferay.portal.model.Resource> getResources(
179                    int start, int end)
180                    throws com.liferay.portal.kernel.exception.SystemException;
181    
182            /**
183            * Returns the number of resources.
184            *
185            * @return the number of resources
186            * @throws SystemException if a system exception occurred
187            */
188            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189            public int getResourcesCount()
190                    throws com.liferay.portal.kernel.exception.SystemException;
191    
192            /**
193            * Updates the resource in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
194            *
195            * @param resource the resource
196            * @return the resource that was updated
197            * @throws SystemException if a system exception occurred
198            */
199            public com.liferay.portal.model.Resource updateResource(
200                    com.liferay.portal.model.Resource resource)
201                    throws com.liferay.portal.kernel.exception.SystemException;
202    
203            /**
204            * Updates the resource in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
205            *
206            * @param resource the resource
207            * @param merge whether to merge the resource with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
208            * @return the resource that was updated
209            * @throws SystemException if a system exception occurred
210            */
211            public com.liferay.portal.model.Resource updateResource(
212                    com.liferay.portal.model.Resource resource, boolean merge)
213                    throws com.liferay.portal.kernel.exception.SystemException;
214    
215            /**
216            * Returns the Spring bean ID for this bean.
217            *
218            * @return the Spring bean ID for this bean
219            */
220            public java.lang.String getBeanIdentifier();
221    
222            /**
223            * Sets the Spring bean ID for this bean.
224            *
225            * @param beanIdentifier the Spring bean ID for this bean
226            */
227            public void setBeanIdentifier(java.lang.String beanIdentifier);
228    
229            public void addModelResources(
230                    com.liferay.portal.model.AuditedModel auditedModel,
231                    com.liferay.portal.service.ServiceContext serviceContext)
232                    throws com.liferay.portal.kernel.exception.PortalException,
233                            com.liferay.portal.kernel.exception.SystemException;
234    
235            public void addModelResources(long companyId, long groupId, long userId,
236                    java.lang.String name, long primKey,
237                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
238                    throws com.liferay.portal.kernel.exception.PortalException,
239                            com.liferay.portal.kernel.exception.SystemException;
240    
241            public void addModelResources(long companyId, long groupId, long userId,
242                    java.lang.String name, java.lang.String primKey,
243                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
244                    throws com.liferay.portal.kernel.exception.PortalException,
245                            com.liferay.portal.kernel.exception.SystemException;
246    
247            public com.liferay.portal.model.Resource addResource(long companyId,
248                    java.lang.String name, int scope, java.lang.String primKey)
249                    throws com.liferay.portal.kernel.exception.SystemException;
250    
251            public void addResources(long companyId, long groupId, long userId,
252                    java.lang.String name, long primKey, boolean portletActions,
253                    boolean addGroupPermissions, boolean addGuestPermissions)
254                    throws com.liferay.portal.kernel.exception.PortalException,
255                            com.liferay.portal.kernel.exception.SystemException;
256    
257            public void addResources(long companyId, long groupId, long userId,
258                    java.lang.String name, java.lang.String primKey,
259                    boolean portletActions, boolean addGroupPermissions,
260                    boolean addGuestPermissions)
261                    throws com.liferay.portal.kernel.exception.PortalException,
262                            com.liferay.portal.kernel.exception.SystemException;
263    
264            public void addResources(long companyId, long groupId,
265                    java.lang.String name, boolean portletActions)
266                    throws com.liferay.portal.kernel.exception.PortalException,
267                            com.liferay.portal.kernel.exception.SystemException;
268    
269            public void deleteResource(
270                    com.liferay.portal.model.AuditedModel auditedModel, int scope)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException;
273    
274            public void deleteResource(long companyId, java.lang.String name,
275                    int scope, long primKey)
276                    throws com.liferay.portal.kernel.exception.PortalException,
277                            com.liferay.portal.kernel.exception.SystemException;
278    
279            public void deleteResource(long companyId, java.lang.String name,
280                    int scope, java.lang.String primKey)
281                    throws com.liferay.portal.kernel.exception.PortalException,
282                            com.liferay.portal.kernel.exception.SystemException;
283    
284            public void deleteResources(java.lang.String name)
285                    throws com.liferay.portal.kernel.exception.SystemException;
286    
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public com.liferay.portal.model.Resource fetchResource(long companyId,
289                    java.lang.String name, int scope, java.lang.String primKey)
290                    throws com.liferay.portal.kernel.exception.SystemException;
291    
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public long getLatestResourceId()
294                    throws com.liferay.portal.kernel.exception.SystemException;
295    
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public com.liferay.portal.model.Resource getResource(long companyId,
298                    java.lang.String name, int scope, java.lang.String primKey)
299                    throws com.liferay.portal.kernel.exception.PortalException,
300                            com.liferay.portal.kernel.exception.SystemException;
301    
302            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
303            public java.util.List<com.liferay.portal.model.Resource> getResources()
304                    throws com.liferay.portal.kernel.exception.SystemException;
305    
306            public void updateModelResources(
307                    com.liferay.portal.model.AuditedModel auditedModel,
308                    com.liferay.portal.service.ServiceContext serviceContext)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException;
311    
312            public void updateResources(long companyId, long groupId,
313                    java.lang.String name, long primKey,
314                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
315                    throws com.liferay.portal.kernel.exception.PortalException,
316                            com.liferay.portal.kernel.exception.SystemException;
317    
318            public void updateResources(long companyId, long groupId,
319                    java.lang.String name, java.lang.String primKey,
320                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
321                    throws com.liferay.portal.kernel.exception.PortalException,
322                            com.liferay.portal.kernel.exception.SystemException;
323    
324            public void updateResources(long companyId, java.lang.String name,
325                    int scope, java.lang.String primKey, java.lang.String newPrimKey)
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException;
328    }