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