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.portlet.trash.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    import com.liferay.portal.service.BaseLocalService;
026    import com.liferay.portal.service.PersistedModelLocalService;
027    
028    /**
029     * Provides the local service interface for TrashEntry. Methods of this
030     * service will not have security checks based on the propagated JAAS
031     * credentials because this service can only be accessed from within the same
032     * VM.
033     *
034     * @author Brian Wing Shun Chan
035     * @see TrashEntryLocalServiceUtil
036     * @see com.liferay.portlet.trash.service.base.TrashEntryLocalServiceBaseImpl
037     * @see com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl
038     * @generated
039     */
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface TrashEntryLocalService extends BaseLocalService,
044            PersistedModelLocalService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link TrashEntryLocalServiceUtil} to access the trash entry local service. Add custom service methods to {@link com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050    
051            /**
052            * Adds the trash entry to the database. Also notifies the appropriate model listeners.
053            *
054            * @param trashEntry the trash entry
055            * @return the trash entry that was added
056            */
057            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
058            public com.liferay.portlet.trash.model.TrashEntry addTrashEntry(
059                    com.liferay.portlet.trash.model.TrashEntry trashEntry);
060    
061            /**
062            * Moves an entry to trash.
063            *
064            * @param userId the primary key of the user removing the entity
065            * @param groupId the primary key of the entry's group
066            * @param className the class name of the entity
067            * @param classPK the primary key of the entity
068            * @param classUuid the UUID of the entity's class
069            * @param referrerClassName the referrer class name used to add a deletion
070            {@link SystemEvent}
071            * @param status the status of the entity prior to being moved to trash
072            * @param statusOVPs the primary keys and statuses of any of the entry's
073            versions (e.g., {@link
074            com.liferay.portlet.documentlibrary.model.DLFileVersion})
075            * @param typeSettingsProperties the type settings properties
076            * @return the trashEntry
077            */
078            public com.liferay.portlet.trash.model.TrashEntry addTrashEntry(
079                    long userId, long groupId, java.lang.String className, long classPK,
080                    java.lang.String classUuid, java.lang.String referrerClassName,
081                    int status,
082                    java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.Long, java.lang.Integer>> statusOVPs,
083                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties)
084                    throws PortalException;
085    
086            public void checkEntries() throws PortalException;
087    
088            /**
089            * Creates a new trash entry with the primary key. Does not add the trash entry to the database.
090            *
091            * @param entryId the primary key for the new trash entry
092            * @return the new trash entry
093            */
094            public com.liferay.portlet.trash.model.TrashEntry createTrashEntry(
095                    long entryId);
096    
097            public void deleteEntries(long groupId);
098    
099            /**
100            * Deletes the trash entry with the entity class name and primary key.
101            *
102            * @param className the class name of entity
103            * @param classPK the primary key of the entry
104            * @return the trash entry with the entity class name and primary key
105            */
106            public com.liferay.portlet.trash.model.TrashEntry deleteEntry(
107                    java.lang.String className, long classPK);
108    
109            /**
110            * Deletes the trash entry with the primary key.
111            *
112            * @param entryId the primary key of the trash entry
113            * @return the trash entry with the primary key
114            */
115            public com.liferay.portlet.trash.model.TrashEntry deleteEntry(long entryId);
116    
117            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
118            public com.liferay.portlet.trash.model.TrashEntry deleteEntry(
119                    com.liferay.portlet.trash.model.TrashEntry trashEntry);
120    
121            /**
122            * @throws PortalException
123            */
124            @Override
125            public com.liferay.portal.model.PersistedModel deletePersistedModel(
126                    com.liferay.portal.model.PersistedModel persistedModel)
127                    throws PortalException;
128    
129            /**
130            * Deletes the trash entry with the primary key from the database. Also notifies the appropriate model listeners.
131            *
132            * @param entryId the primary key of the trash entry
133            * @return the trash entry that was removed
134            * @throws PortalException if a trash entry with the primary key could not be found
135            */
136            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
137            public com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry(
138                    long entryId) throws PortalException;
139    
140            /**
141            * Deletes the trash entry from the database. Also notifies the appropriate model listeners.
142            *
143            * @param trashEntry the trash entry
144            * @return the trash entry that was removed
145            */
146            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
147            public com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry(
148                    com.liferay.portlet.trash.model.TrashEntry trashEntry);
149    
150            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
151    
152            /**
153            * Performs a dynamic query on the database and returns the matching rows.
154            *
155            * @param dynamicQuery the dynamic query
156            * @return the matching rows
157            */
158            public <T> java.util.List<T> dynamicQuery(
159                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
160    
161            /**
162            * Performs a dynamic query on the database and returns a range of the matching rows.
163            *
164            * <p>
165            * 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.portlet.trash.model.impl.TrashEntryModelImpl}. 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.
166            * </p>
167            *
168            * @param dynamicQuery the dynamic query
169            * @param start the lower bound of the range of model instances
170            * @param end the upper bound of the range of model instances (not inclusive)
171            * @return the range of matching rows
172            */
173            public <T> java.util.List<T> dynamicQuery(
174                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
175                    int end);
176    
177            /**
178            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
179            *
180            * <p>
181            * 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.portlet.trash.model.impl.TrashEntryModelImpl}. 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.
182            * </p>
183            *
184            * @param dynamicQuery the dynamic query
185            * @param start the lower bound of the range of model instances
186            * @param end the upper bound of the range of model instances (not inclusive)
187            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
188            * @return the ordered range of matching rows
189            */
190            public <T> java.util.List<T> dynamicQuery(
191                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
192                    int end,
193                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
194    
195            /**
196            * Returns the number of rows matching the dynamic query.
197            *
198            * @param dynamicQuery the dynamic query
199            * @return the number of rows matching the dynamic query
200            */
201            public long dynamicQueryCount(
202                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
203    
204            /**
205            * Returns the number of rows matching the dynamic query.
206            *
207            * @param dynamicQuery the dynamic query
208            * @param projection the projection to apply to the query
209            * @return the number of rows matching the dynamic query
210            */
211            public long dynamicQueryCount(
212                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
213                    com.liferay.portal.kernel.dao.orm.Projection projection);
214    
215            /**
216            * Returns the trash entry with the entity class name and primary key.
217            *
218            * @param className the class name of the entity
219            * @param classPK the primary key of the entity
220            * @return the trash entry with the entity class name and primary key
221            */
222            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
223            public com.liferay.portlet.trash.model.TrashEntry fetchEntry(
224                    java.lang.String className, long classPK);
225    
226            /**
227            * Returns the trash entry with the primary key.
228            *
229            * @param entryId the primary key of the entry
230            * @return the trash entry with the primary key
231            */
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public com.liferay.portlet.trash.model.TrashEntry fetchEntry(long entryId);
234    
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public com.liferay.portlet.trash.model.TrashEntry fetchTrashEntry(
237                    long entryId);
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
241    
242            /**
243            * Returns the trash entries with the matching group ID.
244            *
245            * @param groupId the primary key of the group
246            * @return the trash entries with the group ID
247            */
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries(
250                    long groupId);
251    
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries(
254                    long groupId, java.lang.String className);
255    
256            /**
257            * Returns a range of all the trash entries matching the group ID.
258            *
259            * @param groupId the primary key of the group
260            * @param start the lower bound of the range of trash entries to return
261            * @param end the upper bound of the range of trash entries to return (not
262            inclusive)
263            * @return the range of matching trash entries
264            */
265            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266            public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries(
267                    long groupId, int start, int end);
268    
269            /**
270            * Returns a range of all the trash entries matching the group ID.
271            *
272            * @param groupId the primary key of the group
273            * @param start the lower bound of the range of trash entries to return
274            * @param end the upper bound of the range of trash entries to return (not
275            inclusive)
276            * @param obc the comparator to order the trash entries (optionally
277            <code>null</code>)
278            * @return the range of matching trash entries ordered by comparator
279            <code>obc</code>
280            */
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries(
283                    long groupId, int start, int end,
284                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashEntry> obc);
285    
286            /**
287            * Returns the number of trash entries with the group ID.
288            *
289            * @param groupId the primary key of the group
290            * @return the number of matching trash entries
291            */
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public int getEntriesCount(long groupId);
294    
295            /**
296            * Returns the entry with the entity class name and primary key.
297            *
298            * @param className the class name of the entity
299            * @param classPK the primary key of the entity
300            * @return the trash entry with the entity class name and primary key
301            */
302            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
303            public com.liferay.portlet.trash.model.TrashEntry getEntry(
304                    java.lang.String className, long classPK) throws PortalException;
305    
306            /**
307            * Returns the trash entry with the primary key.
308            *
309            * @param entryId the primary key of the trash entry
310            * @return the trash entry with the primary key
311            */
312            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
313            public com.liferay.portlet.trash.model.TrashEntry getEntry(long entryId)
314                    throws PortalException;
315    
316            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
317            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
318    
319            /**
320            * Returns the OSGi service identifier.
321            *
322            * @return the OSGi service identifier
323            */
324            public java.lang.String getOSGiServiceIdentifier();
325    
326            @Override
327            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
328            public com.liferay.portal.model.PersistedModel getPersistedModel(
329                    java.io.Serializable primaryKeyObj) throws PortalException;
330    
331            /**
332            * Returns a range of all the trash entries.
333            *
334            * <p>
335            * 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.portlet.trash.model.impl.TrashEntryModelImpl}. 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.
336            * </p>
337            *
338            * @param start the lower bound of the range of trash entries
339            * @param end the upper bound of the range of trash entries (not inclusive)
340            * @return the range of trash entries
341            */
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getTrashEntries(
344                    int start, int end);
345    
346            /**
347            * Returns the number of trash entries.
348            *
349            * @return the number of trash entries
350            */
351            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
352            public int getTrashEntriesCount();
353    
354            /**
355            * Returns the trash entry with the primary key.
356            *
357            * @param entryId the primary key of the trash entry
358            * @return the trash entry
359            * @throws PortalException if a trash entry with the primary key could not be found
360            */
361            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
362            public com.liferay.portlet.trash.model.TrashEntry getTrashEntry(
363                    long entryId) throws PortalException;
364    
365            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366            public com.liferay.portal.kernel.search.Hits search(long companyId,
367                    long groupId, long userId, java.lang.String keywords, int start,
368                    int end, com.liferay.portal.kernel.search.Sort sort);
369    
370            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
371            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portlet.trash.model.TrashEntry> searchTrashEntries(
372                    long companyId, long groupId, long userId, java.lang.String keywords,
373                    int start, int end, com.liferay.portal.kernel.search.Sort sort);
374    
375            /**
376            * Updates the trash entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
377            *
378            * @param trashEntry the trash entry
379            * @return the trash entry that was updated
380            */
381            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
382            public com.liferay.portlet.trash.model.TrashEntry updateTrashEntry(
383                    com.liferay.portlet.trash.model.TrashEntry trashEntry);
384    }