001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the trash entry remote service. This utility wraps {@link com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
022     *
023     * <p>
024     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see TrashEntryService
029     * @see com.liferay.portlet.trash.service.base.TrashEntryServiceBaseImpl
030     * @see com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl
031     * @generated
032     */
033    public class TrashEntryServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.trash.service.impl.TrashEntryServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Returns the Spring bean ID for this bean.
042            *
043            * @return the Spring bean ID for this bean
044            */
045            public static java.lang.String getBeanIdentifier() {
046                    return getService().getBeanIdentifier();
047            }
048    
049            /**
050            * Sets the Spring bean ID for this bean.
051            *
052            * @param beanIdentifier the Spring bean ID for this bean
053            */
054            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
055                    getService().setBeanIdentifier(beanIdentifier);
056            }
057    
058            /**
059            * Deletes the trash entries with the matching group ID considering
060            * permissions.
061            *
062            * @param groupId the primary key of the group
063            * @throws PortalException if a portal exception occurred
064            * @throws SystemException if a system exception occurred
065            */
066            public static void deleteEntries(long groupId)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    getService().deleteEntries(groupId);
070            }
071    
072            /**
073            * Deletes the trash entries with the primary keys.
074            *
075            * @param entryIds the primary keys of the trash entries
076            * @throws PortalException if a trash entry with the primary key could not
077            be found or if the user did not have permission to delete any one
078            of the trash entries
079            * @throws SystemException if a system exception occurred
080            */
081            public static void deleteEntries(long[] entryIds)
082                    throws com.liferay.portal.kernel.exception.PortalException,
083                            com.liferay.portal.kernel.exception.SystemException {
084                    getService().deleteEntries(entryIds);
085            }
086    
087            /**
088            * Deletes the trash entry with the primary key.
089            *
090            * <p>
091            * This method throws a {@link TrashPermissionException} with type {@link
092            * TrashPermissionException#DELETE} if the user did not have permission to
093            * delete the trash entry.
094            * </p>
095            *
096            * @param entryId the primary key of the trash entry
097            * @throws PortalException if a trash entry with the primary key could not
098            be found or if the user did not have permission to delete the
099            trash entry
100            * @throws SystemException if a system exception occurred
101            */
102            public static void deleteEntry(long entryId)
103                    throws com.liferay.portal.kernel.exception.PortalException,
104                            com.liferay.portal.kernel.exception.SystemException {
105                    getService().deleteEntry(entryId);
106            }
107    
108            /**
109            * Deletes the trash entry with the entity class name and class primary key.
110            *
111            * <p>
112            * This method throws a {@link TrashPermissionException} with type {@link
113            * TrashPermissionException#DELETE} if the user did not have permission to
114            * delete the trash entry.
115            * </p>
116            *
117            * @param className the class name of the entity
118            * @param classPK the primary key of the entity
119            * @throws PortalException if a trash entry with the entity class name and
120            primary key could not be found or if the user did not have
121            permission to delete the entry
122            * @throws SystemException if a system exception occurred
123            */
124            public static void deleteEntry(java.lang.String className, long classPK)
125                    throws com.liferay.portal.kernel.exception.PortalException,
126                            com.liferay.portal.kernel.exception.SystemException {
127                    getService().deleteEntry(className, classPK);
128            }
129    
130            /**
131            * Returns the trash entries with the matching group ID.
132            *
133            * @param groupId the primary key of the group
134            * @return the matching trash entries
135            * @throws PrincipalException if a principal exception occurred
136            * @throws SystemException if a system exception occurred
137            */
138            public static com.liferay.portlet.trash.model.TrashEntryList getEntries(
139                    long groupId)
140                    throws com.liferay.portal.kernel.exception.SystemException,
141                            com.liferay.portal.security.auth.PrincipalException {
142                    return getService().getEntries(groupId);
143            }
144    
145            /**
146            * Returns a range of all the trash entries matching the group ID.
147            *
148            * @param groupId the primary key of the group
149            * @param start the lower bound of the range of trash entries to return
150            * @param end the upper bound of the range of trash entries to return (not
151            inclusive)
152            * @param obc the comparator to order the trash entries (optionally
153            <code>null</code>)
154            * @return the range of matching trash entries ordered by comparator
155            <code>obc</code>
156            * @throws PrincipalException if a system exception occurred
157            * @throws SystemException if a system exception occurred
158            */
159            public static com.liferay.portlet.trash.model.TrashEntryList getEntries(
160                    long groupId, int start, int end,
161                    com.liferay.portal.kernel.util.OrderByComparator obc)
162                    throws com.liferay.portal.kernel.exception.SystemException,
163                            com.liferay.portal.security.auth.PrincipalException {
164                    return getService().getEntries(groupId, start, end, obc);
165            }
166    
167            /**
168            * Moves the trash entry with the entity class name and primary key,
169            * restoring it to a new location identified by the destination container
170            * model ID.
171            *
172            * <p>
173            * This method throws a {@link TrashPermissionException} if the user did not
174            * have the permission to perform one of the necessary operations. The
175            * exception is created with a type specific to the operation:
176            * </p>
177            *
178            * <ul>
179            * <li>
180            * {@link TrashPermissionException#MOVE} - if the user did not have
181            * permission to move the trash entry to the new
182            * destination
183            * </li>
184            * <li>
185            * {@link TrashPermissionException#RESTORE} - if the user did not have
186            * permission to restore the trash entry
187            * </li>
188            * </ul>
189            *
190            * @param className the class name of the entity
191            * @param classPK the primary key of the entity
192            * @param destinationContainerModelId the primary key of the new location
193            * @param serviceContext the service context to be applied (optionally
194            <code>null</code>)
195            * @throws PortalException if a matching trash entry could not be found, if
196            the user did not have permission to move the trash entry to the
197            new location, if the user did not have permission to restore the
198            trash entry, if a duplicate trash entry exists at the new
199            location, or if a portal exception occurred
200            * @throws SystemException if a system exception occurred
201            */
202            public static void moveEntry(java.lang.String className, long classPK,
203                    long destinationContainerModelId,
204                    com.liferay.portal.service.ServiceContext serviceContext)
205                    throws com.liferay.portal.kernel.exception.PortalException,
206                            com.liferay.portal.kernel.exception.SystemException {
207                    getService()
208                            .moveEntry(className, classPK, destinationContainerModelId,
209                            serviceContext);
210            }
211    
212            public static com.liferay.portlet.trash.model.TrashEntry restoreEntry(
213                    long entryId)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    return getService().restoreEntry(entryId);
217            }
218    
219            /**
220            * Restores the trash entry to its original location. In order to handle a
221            * duplicate trash entry already existing at the original location, either
222            * pass in the primary key of the existing trash entry's entity to overwrite
223            * or pass in a new name to give to the trash entry being restored.
224            *
225            * <p>
226            * This method throws a {@link TrashPermissionException} if the user did not
227            * have the permission to perform one of the necessary operations. The
228            * exception is created with a type specific to the operation:
229            * </p>
230            *
231            * <ul>
232            * <li>
233            * {@link TrashPermissionException#RESTORE} - if the user did not have
234            * permission to restore the trash entry
235            * </li>
236            * <li>
237            * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not
238            * have permission to delete the existing trash entry
239            * </li>
240            * <li>
241            * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not
242            * have permission to rename the trash entry
243            * </li>
244            * </ul>
245            *
246            * @param entryId the primary key of the trash entry to restore
247            * @param overrideClassPK the primary key of the entity to overwrite
248            (optionally <code>0</code>)
249            * @param name a new name to give to the trash entry being restored
250            (optionally <code>null</code>)
251            * @return the restored trash entry
252            * @throws PortalException if a matching trash entry could not be found, if
253            the user did not have permission to overwrite an existing trash
254            entry, to rename the trash entry being restored, or to restore
255            the trash entry in general
256            * @throws SystemException if a system exception occurred
257            */
258            public static com.liferay.portlet.trash.model.TrashEntry restoreEntry(
259                    long entryId, long overrideClassPK, java.lang.String name)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException {
262                    return getService().restoreEntry(entryId, overrideClassPK, name);
263            }
264    
265            public static TrashEntryService getService() {
266                    if (_service == null) {
267                            _service = (TrashEntryService)PortalBeanLocatorUtil.locate(TrashEntryService.class.getName());
268    
269                            ReferenceRegistry.registerReference(TrashEntryServiceUtil.class,
270                                    "_service");
271                    }
272    
273                    return _service;
274            }
275    
276            /**
277             * @deprecated As of 6.2.0
278             */
279            public void setService(TrashEntryService service) {
280            }
281    
282            private static TrashEntryService _service;
283    }