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