001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.annotation.Isolation;
018    import com.liferay.portal.kernel.annotation.Propagation;
019    import com.liferay.portal.kernel.annotation.Transactional;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.exception.SystemException;
022    
023    /**
024     * The interface for the resource local service.
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * <p>
031     * 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.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ResourceLocalServiceUtil
036     * @see com.liferay.portal.service.base.ResourceLocalServiceBaseImpl
037     * @see com.liferay.portal.service.impl.ResourceLocalServiceImpl
038     * @generated
039     */
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface ResourceLocalService {
043            /**
044            * Adds the resource to the database. Also notifies the appropriate model listeners.
045            *
046            * @param resource the resource to add
047            * @return the resource that was added
048            * @throws SystemException if a system exception occurred
049            */
050            public com.liferay.portal.model.Resource addResource(
051                    com.liferay.portal.model.Resource resource)
052                    throws com.liferay.portal.kernel.exception.SystemException;
053    
054            /**
055            * Creates a new resource with the primary key. Does not add the resource to the database.
056            *
057            * @param resourceId the primary key for the new resource
058            * @return the new resource
059            */
060            public com.liferay.portal.model.Resource createResource(long resourceId);
061    
062            /**
063            * Deletes the resource with the primary key from the database. Also notifies the appropriate model listeners.
064            *
065            * @param resourceId the primary key of the resource to delete
066            * @throws PortalException if a resource with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public void deleteResource(long resourceId)
070                    throws com.liferay.portal.kernel.exception.PortalException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            /**
074            * Deletes the resource from the database. Also notifies the appropriate model listeners.
075            *
076            * @param resource the resource to delete
077            * @throws SystemException if a system exception occurred
078            */
079            public void deleteResource(com.liferay.portal.model.Resource resource)
080                    throws com.liferay.portal.kernel.exception.SystemException;
081    
082            /**
083            * Performs a dynamic query on the database and returns the matching rows.
084            *
085            * @param dynamicQuery the dynamic query to search with
086            * @return the matching rows
087            * @throws SystemException if a system exception occurred
088            */
089            @SuppressWarnings("rawtypes")
090            public java.util.List dynamicQuery(
091                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
092                    throws com.liferay.portal.kernel.exception.SystemException;
093    
094            /**
095            * Performs a dynamic query on the database and returns a range of the matching rows.
096            *
097            * <p>
098            * 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.
099            * </p>
100            *
101            * @param dynamicQuery the dynamic query to search with
102            * @param start the lower bound of the range of model instances to return
103            * @param end the upper bound of the range of model instances to return (not inclusive)
104            * @return the range of matching rows
105            * @throws SystemException if a system exception occurred
106            */
107            @SuppressWarnings("rawtypes")
108            public java.util.List dynamicQuery(
109                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
110                    int end) throws com.liferay.portal.kernel.exception.SystemException;
111    
112            /**
113            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
114            *
115            * <p>
116            * 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.
117            * </p>
118            *
119            * @param dynamicQuery the dynamic query to search with
120            * @param start the lower bound of the range of model instances to return
121            * @param end the upper bound of the range of model instances to return (not inclusive)
122            * @param orderByComparator the comparator to order the results by
123            * @return the ordered range of matching rows
124            * @throws SystemException if a system exception occurred
125            */
126            @SuppressWarnings("rawtypes")
127            public java.util.List dynamicQuery(
128                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
129                    int end,
130                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
131                    throws com.liferay.portal.kernel.exception.SystemException;
132    
133            /**
134            * Counts the number of rows that match the dynamic query.
135            *
136            * @param dynamicQuery the dynamic query to search with
137            * @return the number of rows that match the dynamic query
138            * @throws SystemException if a system exception occurred
139            */
140            public long dynamicQueryCount(
141                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
142                    throws com.liferay.portal.kernel.exception.SystemException;
143    
144            /**
145            * Gets the resource with the primary key.
146            *
147            * @param resourceId the primary key of the resource to get
148            * @return the resource
149            * @throws PortalException if a resource with the primary key could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153            public com.liferay.portal.model.Resource getResource(long resourceId)
154                    throws com.liferay.portal.kernel.exception.PortalException,
155                            com.liferay.portal.kernel.exception.SystemException;
156    
157            /**
158            * Gets a range of all the resources.
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.
162            * </p>
163            *
164            * @param start the lower bound of the range of resources to return
165            * @param end the upper bound of the range of resources to return (not inclusive)
166            * @return the range of resources
167            * @throws SystemException if a system exception occurred
168            */
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public java.util.List<com.liferay.portal.model.Resource> getResources(
171                    int start, int end)
172                    throws com.liferay.portal.kernel.exception.SystemException;
173    
174            /**
175            * Gets the number of resources.
176            *
177            * @return the number of resources
178            * @throws SystemException if a system exception occurred
179            */
180            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181            public int getResourcesCount()
182                    throws com.liferay.portal.kernel.exception.SystemException;
183    
184            /**
185            * Updates the resource in the database. Also notifies the appropriate model listeners.
186            *
187            * @param resource the resource to update
188            * @return the resource that was updated
189            * @throws SystemException if a system exception occurred
190            */
191            public com.liferay.portal.model.Resource updateResource(
192                    com.liferay.portal.model.Resource resource)
193                    throws com.liferay.portal.kernel.exception.SystemException;
194    
195            /**
196            * Updates the resource in the database. Also notifies the appropriate model listeners.
197            *
198            * @param resource the resource to update
199            * @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.
200            * @return the resource that was updated
201            * @throws SystemException if a system exception occurred
202            */
203            public com.liferay.portal.model.Resource updateResource(
204                    com.liferay.portal.model.Resource resource, boolean merge)
205                    throws com.liferay.portal.kernel.exception.SystemException;
206    
207            public void addModelResources(long companyId, long groupId, long userId,
208                    java.lang.String name, long primKey,
209                    java.lang.String[] communityPermissions,
210                    java.lang.String[] guestPermissions)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException;
213    
214            public void addModelResources(long companyId, long groupId, long userId,
215                    java.lang.String name, java.lang.String primKey,
216                    java.lang.String[] communityPermissions,
217                    java.lang.String[] guestPermissions)
218                    throws com.liferay.portal.kernel.exception.PortalException,
219                            com.liferay.portal.kernel.exception.SystemException;
220    
221            public com.liferay.portal.model.Resource addResource(long companyId,
222                    java.lang.String name, int scope, java.lang.String primKey)
223                    throws com.liferay.portal.kernel.exception.SystemException;
224    
225            public void addResources(long companyId, long groupId,
226                    java.lang.String name, boolean portletActions)
227                    throws com.liferay.portal.kernel.exception.PortalException,
228                            com.liferay.portal.kernel.exception.SystemException;
229    
230            public void addResources(long companyId, long groupId, long userId,
231                    java.lang.String name, long primKey, boolean portletActions,
232                    boolean addCommunityPermissions, boolean addGuestPermissions)
233                    throws com.liferay.portal.kernel.exception.PortalException,
234                            com.liferay.portal.kernel.exception.SystemException;
235    
236            public void addResources(long companyId, long groupId, long userId,
237                    java.lang.String name, java.lang.String primKey,
238                    boolean portletActions, boolean addCommunityPermissions,
239                    boolean addGuestPermissions)
240                    throws com.liferay.portal.kernel.exception.PortalException,
241                            com.liferay.portal.kernel.exception.SystemException;
242    
243            public void deleteResource(long companyId, java.lang.String name,
244                    int scope, long primKey)
245                    throws com.liferay.portal.kernel.exception.PortalException,
246                            com.liferay.portal.kernel.exception.SystemException;
247    
248            public void deleteResource(long companyId, java.lang.String name,
249                    int scope, java.lang.String primKey)
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException;
252    
253            public void deleteResources(java.lang.String name)
254                    throws com.liferay.portal.kernel.exception.SystemException;
255    
256            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257            public long getLatestResourceId()
258                    throws com.liferay.portal.kernel.exception.SystemException;
259    
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public com.liferay.portal.model.Resource getResource(long companyId,
262                    java.lang.String name, int scope, java.lang.String primKey)
263                    throws com.liferay.portal.kernel.exception.PortalException,
264                            com.liferay.portal.kernel.exception.SystemException;
265    
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public java.util.List<com.liferay.portal.model.Resource> getResources()
268                    throws com.liferay.portal.kernel.exception.SystemException;
269    
270            public void updateResources(long companyId, java.lang.String name,
271                    int scope, java.lang.String primKey, java.lang.String newPrimKey)
272                    throws com.liferay.portal.kernel.exception.PortalException,
273                            com.liferay.portal.kernel.exception.SystemException;
274    
275            public void updateResources(long companyId, long groupId,
276                    java.lang.String name, long primKey,
277                    java.lang.String[] communityPermissions,
278                    java.lang.String[] guestPermissions)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException;
281    
282            public void updateResources(long companyId, long groupId,
283                    java.lang.String name, java.lang.String primKey,
284                    java.lang.String[] communityPermissions,
285                    java.lang.String[] guestPermissions)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException;
288    }