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.security.access.control.AccessControlled; 023 import com.liferay.portal.kernel.transaction.Isolation; 024 import com.liferay.portal.kernel.transaction.Propagation; 025 import com.liferay.portal.kernel.transaction.Transactional; 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 */ 056 @Transactional(noRollbackFor = { 057 com.liferay.portal.TrashPermissionException.class} 058 ) 059 public void deleteEntries(long[] entryIds) throws PortalException; 060 061 /** 062 * Deletes the trash entries with the matching group ID considering 063 * permissions. 064 * 065 * @param groupId the primary key of the group 066 */ 067 @Transactional(noRollbackFor = { 068 com.liferay.portal.TrashPermissionException.class} 069 ) 070 public void deleteEntries(long groupId) throws PortalException; 071 072 /** 073 * Deletes the trash entry with the entity class name and class primary key. 074 * 075 * <p> 076 * This method throws a {@link TrashPermissionException} with type {@link 077 * TrashPermissionException#DELETE} if the user did not have permission to 078 * delete the trash entry. 079 * </p> 080 * 081 * @param className the class name of the entity 082 * @param classPK the primary key of the entity 083 */ 084 public void deleteEntry(java.lang.String className, long classPK) 085 throws PortalException; 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 */ 098 public void deleteEntry(long entryId) throws PortalException; 099 100 /** 101 * Returns the trash entries with the matching group ID. 102 * 103 * @param groupId the primary key of the group 104 * @return the matching trash entries 105 */ 106 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 107 public com.liferay.portlet.trash.model.TrashEntryList getEntries( 108 long groupId) 109 throws com.liferay.portal.security.auth.PrincipalException; 110 111 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 112 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 113 long groupId, java.lang.String className) 114 throws com.liferay.portal.security.auth.PrincipalException; 115 116 /** 117 * Returns a range of all the trash entries matching the group ID. 118 * 119 * @param groupId the primary key of the group 120 * @param start the lower bound of the range of trash entries to return 121 * @param end the upper bound of the range of trash entries to return (not 122 inclusive) 123 * @param obc the comparator to order the trash entries (optionally 124 <code>null</code>) 125 * @return the range of matching trash entries ordered by comparator 126 <code>obc</code> 127 */ 128 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 129 public com.liferay.portlet.trash.model.TrashEntryList getEntries( 130 long groupId, int start, int end, 131 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashEntry> obc) 132 throws com.liferay.portal.security.auth.PrincipalException; 133 134 /** 135 * Returns the OSGi service identifier. 136 * 137 * @return the OSGi service identifier 138 */ 139 public java.lang.String getOSGiServiceIdentifier(); 140 141 /** 142 * Moves the trash entry with the entity class name and primary key, 143 * restoring it to a new location identified by the destination container 144 * model ID. 145 * 146 * <p> 147 * This method throws a {@link TrashPermissionException} if the user did not 148 * have the permission to perform one of the necessary operations. The 149 * exception is created with a type specific to the operation: 150 * </p> 151 * 152 * <ul> 153 * <li> 154 * {@link TrashPermissionException#MOVE} - if the user did not have 155 * permission to move the trash entry to the new 156 * destination 157 * </li> 158 * <li> 159 * {@link TrashPermissionException#RESTORE} - if the user did not have 160 * permission to restore the trash entry 161 * </li> 162 * </ul> 163 * 164 * @param className the class name of the entity 165 * @param classPK the primary key of the entity 166 * @param destinationContainerModelId the primary key of the new location 167 * @param serviceContext the service context to be applied (optionally 168 <code>null</code>) 169 */ 170 public void moveEntry(java.lang.String className, long classPK, 171 long destinationContainerModelId, 172 com.liferay.portal.service.ServiceContext serviceContext) 173 throws PortalException; 174 175 public com.liferay.portlet.trash.model.TrashEntry restoreEntry( 176 java.lang.String className, long classPK) throws PortalException; 177 178 public com.liferay.portlet.trash.model.TrashEntry restoreEntry( 179 java.lang.String className, long classPK, long overrideClassPK, 180 java.lang.String name) throws PortalException; 181 182 public com.liferay.portlet.trash.model.TrashEntry restoreEntry(long entryId) 183 throws PortalException; 184 185 /** 186 * Restores the trash entry to its original location. In order to handle a 187 * duplicate trash entry already existing at the original location, either 188 * pass in the primary key of the existing trash entry's entity to overwrite 189 * or pass in a new name to give to the trash entry being restored. 190 * 191 * <p> 192 * This method throws a {@link TrashPermissionException} if the user did not 193 * have the permission to perform one of the necessary operations. The 194 * exception is created with a type specific to the operation: 195 * </p> 196 * 197 * <ul> 198 * <li> 199 * {@link TrashPermissionException#RESTORE} - if the user did not have 200 * permission to restore the trash entry 201 * </li> 202 * <li> 203 * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not 204 * have permission to delete the existing trash entry 205 * </li> 206 * <li> 207 * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not 208 * have permission to rename the trash entry 209 * </li> 210 * </ul> 211 * 212 * @param entryId the primary key of the trash entry to restore 213 * @param overrideClassPK the primary key of the entity to overwrite 214 (optionally <code>0</code>) 215 * @param name a new name to give to the trash entry being restored 216 (optionally <code>null</code>) 217 * @return the restored trash entry 218 */ 219 public com.liferay.portlet.trash.model.TrashEntry restoreEntry( 220 long entryId, long overrideClassPK, java.lang.String name) 221 throws PortalException; 222 }