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