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 public void deleteEntries(long groupId) 074 throws com.liferay.portal.kernel.exception.PortalException, 075 com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Deletes the trash entries with the primary keys. 079 * 080 * @param entryIds the primary keys of the trash entries 081 * @throws PortalException if a trash entry with the primary key could not 082 be found or if the user did not have permission to delete any one 083 of the trash entries 084 * @throws SystemException if a system exception occurred 085 */ 086 public void deleteEntries(long[] entryIds) 087 throws com.liferay.portal.kernel.exception.PortalException, 088 com.liferay.portal.kernel.exception.SystemException; 089 090 /** 091 * Deletes the trash entry with the primary key. 092 * 093 * <p> 094 * This method throws a {@link TrashPermissionException} with type {@link 095 * TrashPermissionException#DELETE} if the user did not have permission to 096 * delete the trash entry. 097 * </p> 098 * 099 * @param entryId the primary key of the trash entry 100 * @throws PortalException if a trash entry with the primary key could not 101 be found or if the user did not have permission to delete the 102 trash entry 103 * @throws SystemException if a system exception occurred 104 */ 105 public void deleteEntry(long entryId) 106 throws com.liferay.portal.kernel.exception.PortalException, 107 com.liferay.portal.kernel.exception.SystemException; 108 109 /** 110 * Deletes the trash entry with the entity class name and class primary key. 111 * 112 * <p> 113 * This method throws a {@link TrashPermissionException} with type {@link 114 * TrashPermissionException#DELETE} if the user did not have permission to 115 * delete the trash entry. 116 * </p> 117 * 118 * @param className the class name of the entity 119 * @param classPK the primary key of the entity 120 * @throws PortalException if a trash entry with the entity class name and 121 primary key could not be found or if the user did not have 122 permission to delete the entry 123 * @throws SystemException if a system exception occurred 124 */ 125 public void deleteEntry(java.lang.String className, long classPK) 126 throws com.liferay.portal.kernel.exception.PortalException, 127 com.liferay.portal.kernel.exception.SystemException; 128 129 /** 130 * Returns the trash entries with the matching group ID. 131 * 132 * @param groupId the primary key of the group 133 * @return the matching trash entries 134 * @throws PrincipalException if a principal exception occurred 135 * @throws SystemException if a system exception occurred 136 */ 137 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 138 public 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 143 /** 144 * Returns a range of all the trash entries matching the group ID. 145 * 146 * @param groupId the primary key of the group 147 * @param start the lower bound of the range of trash entries to return 148 * @param end the upper bound of the range of trash entries to return (not 149 inclusive) 150 * @param obc the comparator to order the trash entries (optionally 151 <code>null</code>) 152 * @return the range of matching trash entries ordered by comparator 153 <code>obc</code> 154 * @throws PrincipalException if a system exception occurred 155 * @throws SystemException if a system exception occurred 156 */ 157 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 158 public com.liferay.portlet.trash.model.TrashEntryList getEntries( 159 long groupId, int start, int end, 160 com.liferay.portal.kernel.util.OrderByComparator obc) 161 throws com.liferay.portal.kernel.exception.SystemException, 162 com.liferay.portal.security.auth.PrincipalException; 163 164 /** 165 * Moves the trash entry with the entity class name and primary key, 166 * restoring it to a new location identified by the destination container 167 * model ID. 168 * 169 * <p> 170 * This method throws a {@link TrashPermissionException} if the user did not 171 * have the permission to perform one of the necessary operations. The 172 * exception is created with a type specific to the operation: 173 * </p> 174 * 175 * <ul> 176 * <li> 177 * {@link TrashPermissionException#MOVE} - if the user did not have 178 * permission to move the trash entry to the new 179 * destination 180 * </li> 181 * <li> 182 * {@link TrashPermissionException#RESTORE} - if the user did not have 183 * permission to restore the trash entry 184 * </li> 185 * </ul> 186 * 187 * @param className the class name of the entity 188 * @param classPK the primary key of the entity 189 * @param destinationContainerModelId the primary key of the new location 190 * @param serviceContext the service context to be applied (optionally 191 <code>null</code>) 192 * @throws PortalException if a matching trash entry could not be found, if 193 the user did not have permission to move the trash entry to the 194 new location, if the user did not have permission to restore the 195 trash entry, if a duplicate trash entry exists at the new 196 location, or if a portal exception occurred 197 * @throws SystemException if a system exception occurred 198 */ 199 public void moveEntry(java.lang.String className, long classPK, 200 long destinationContainerModelId, 201 com.liferay.portal.service.ServiceContext serviceContext) 202 throws com.liferay.portal.kernel.exception.PortalException, 203 com.liferay.portal.kernel.exception.SystemException; 204 205 public com.liferay.portlet.trash.model.TrashEntry restoreEntry(long entryId) 206 throws com.liferay.portal.kernel.exception.PortalException, 207 com.liferay.portal.kernel.exception.SystemException; 208 209 /** 210 * Restores the trash entry to its original location. In order to handle a 211 * duplicate trash entry already existing at the original location, either 212 * pass in the primary key of the existing trash entry's entity to overwrite 213 * or pass in a new name to give to the trash entry being restored. 214 * 215 * <p> 216 * This method throws a {@link TrashPermissionException} if the user did not 217 * have the permission to perform one of the necessary operations. The 218 * exception is created with a type specific to the operation: 219 * </p> 220 * 221 * <ul> 222 * <li> 223 * {@link TrashPermissionException#RESTORE} - if the user did not have 224 * permission to restore the trash entry 225 * </li> 226 * <li> 227 * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not 228 * have permission to delete the existing trash entry 229 * </li> 230 * <li> 231 * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not 232 * have permission to rename the trash entry 233 * </li> 234 * </ul> 235 * 236 * @param entryId the primary key of the trash entry to restore 237 * @param overrideClassPK the primary key of the entity to overwrite 238 (optionally <code>0</code>) 239 * @param name a new name to give to the trash entry being restored 240 (optionally <code>null</code>) 241 * @return the restored trash entry 242 * @throws PortalException if a matching trash entry could not be found, if 243 the user did not have permission to overwrite an existing trash 244 entry, to rename the trash entry being restored, or to restore 245 the trash entry in general 246 * @throws SystemException if a system exception occurred 247 */ 248 public com.liferay.portlet.trash.model.TrashEntry restoreEntry( 249 long entryId, long overrideClassPK, java.lang.String name) 250 throws com.liferay.portal.kernel.exception.PortalException, 251 com.liferay.portal.kernel.exception.SystemException; 252 }