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