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