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.trash.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.service.ServiceWrapper; 020 021 /** 022 * Provides a wrapper for {@link TrashEntryService}. 023 * 024 * @author Brian Wing Shun Chan 025 * @see TrashEntryService 026 * @generated 027 */ 028 @ProviderType 029 public class TrashEntryServiceWrapper implements TrashEntryService, 030 ServiceWrapper<TrashEntryService> { 031 public TrashEntryServiceWrapper(TrashEntryService trashEntryService) { 032 _trashEntryService = trashEntryService; 033 } 034 035 @Override 036 public com.liferay.trash.kernel.model.TrashEntry restoreEntry( 037 java.lang.String className, long classPK) 038 throws com.liferay.portal.kernel.exception.PortalException { 039 return _trashEntryService.restoreEntry(className, classPK); 040 } 041 042 @Override 043 public com.liferay.trash.kernel.model.TrashEntry restoreEntry( 044 java.lang.String className, long classPK, long overrideClassPK, 045 java.lang.String name) 046 throws com.liferay.portal.kernel.exception.PortalException { 047 return _trashEntryService.restoreEntry(className, classPK, 048 overrideClassPK, name); 049 } 050 051 @Override 052 public com.liferay.trash.kernel.model.TrashEntry restoreEntry(long entryId) 053 throws com.liferay.portal.kernel.exception.PortalException { 054 return _trashEntryService.restoreEntry(entryId); 055 } 056 057 /** 058 * Restores the trash entry to its original location. In order to handle a 059 * duplicate trash entry already existing at the original location, either 060 * pass in the primary key of the existing trash entry's entity to overwrite 061 * or pass in a new name to give to the trash entry being restored. 062 * 063 * <p> 064 * This method throws a {@link TrashPermissionException} if the user did not 065 * have the permission to perform one of the necessary operations. The 066 * exception is created with a type specific to the operation: 067 * </p> 068 * 069 * <ul> 070 * <li> 071 * {@link TrashPermissionException#RESTORE} - if the user did not have 072 * permission to restore the trash entry 073 * </li> 074 * <li> 075 * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not 076 * have permission to delete the existing trash entry 077 * </li> 078 * <li> 079 * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not 080 * have permission to rename the trash entry 081 * </li> 082 * </ul> 083 * 084 * @param entryId the primary key of the trash entry to restore 085 * @param overrideClassPK the primary key of the entity to overwrite 086 (optionally <code>0</code>) 087 * @param name a new name to give to the trash entry being restored 088 (optionally <code>null</code>) 089 * @return the restored trash entry 090 */ 091 @Override 092 public com.liferay.trash.kernel.model.TrashEntry restoreEntry( 093 long entryId, long overrideClassPK, java.lang.String name) 094 throws com.liferay.portal.kernel.exception.PortalException { 095 return _trashEntryService.restoreEntry(entryId, overrideClassPK, name); 096 } 097 098 /** 099 * Returns the trash entries with the matching group ID. 100 * 101 * @param groupId the primary key of the group 102 * @return the matching trash entries 103 */ 104 @Override 105 public com.liferay.trash.kernel.model.TrashEntryList getEntries( 106 long groupId) 107 throws com.liferay.portal.kernel.security.auth.PrincipalException { 108 return _trashEntryService.getEntries(groupId); 109 } 110 111 /** 112 * Returns a range of all the trash entries matching the group ID. 113 * 114 * @param groupId the primary key of the group 115 * @param start the lower bound of the range of trash entries to return 116 * @param end the upper bound of the range of trash entries to return (not 117 inclusive) 118 * @param obc the comparator to order the trash entries (optionally 119 <code>null</code>) 120 * @return the range of matching trash entries ordered by comparator 121 <code>obc</code> 122 */ 123 @Override 124 public com.liferay.trash.kernel.model.TrashEntryList getEntries( 125 long groupId, int start, int end, 126 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.trash.kernel.model.TrashEntry> obc) 127 throws com.liferay.portal.kernel.security.auth.PrincipalException { 128 return _trashEntryService.getEntries(groupId, start, end, obc); 129 } 130 131 /** 132 * Returns the OSGi service identifier. 133 * 134 * @return the OSGi service identifier 135 */ 136 @Override 137 public java.lang.String getOSGiServiceIdentifier() { 138 return _trashEntryService.getOSGiServiceIdentifier(); 139 } 140 141 @Override 142 public java.util.List<com.liferay.trash.kernel.model.TrashEntry> getEntries( 143 long groupId, java.lang.String className) 144 throws com.liferay.portal.kernel.security.auth.PrincipalException { 145 return _trashEntryService.getEntries(groupId, className); 146 } 147 148 /** 149 * Deletes the trash entries with the matching group ID considering 150 * permissions. 151 * 152 * @param groupId the primary key of the group 153 */ 154 @Override 155 public void deleteEntries(long groupId) 156 throws com.liferay.portal.kernel.exception.PortalException { 157 _trashEntryService.deleteEntries(groupId); 158 } 159 160 /** 161 * Deletes the trash entries with the primary keys. 162 * 163 * @param entryIds the primary keys of the trash entries 164 */ 165 @Override 166 public void deleteEntries(long[] entryIds) 167 throws com.liferay.portal.kernel.exception.PortalException { 168 _trashEntryService.deleteEntries(entryIds); 169 } 170 171 /** 172 * Deletes the trash entry with the entity class name and class primary key. 173 * 174 * <p> 175 * This method throws a {@link TrashPermissionException} with type {@link 176 * TrashPermissionException#DELETE} if the user did not have permission to 177 * delete the trash entry. 178 * </p> 179 * 180 * @param className the class name of the entity 181 * @param classPK the primary key of the entity 182 */ 183 @Override 184 public void deleteEntry(java.lang.String className, long classPK) 185 throws com.liferay.portal.kernel.exception.PortalException { 186 _trashEntryService.deleteEntry(className, classPK); 187 } 188 189 /** 190 * Deletes the trash entry with the primary key. 191 * 192 * <p> 193 * This method throws a {@link TrashPermissionException} with type {@link 194 * TrashPermissionException#DELETE} if the user did not have permission to 195 * delete the trash entry. 196 * </p> 197 * 198 * @param entryId the primary key of the trash entry 199 */ 200 @Override 201 public void deleteEntry(long entryId) 202 throws com.liferay.portal.kernel.exception.PortalException { 203 _trashEntryService.deleteEntry(entryId); 204 } 205 206 /** 207 * Moves the trash entry with the entity class name and primary key, 208 * restoring it to a new location identified by the destination container 209 * model ID. 210 * 211 * <p> 212 * This method throws a {@link TrashPermissionException} if the user did not 213 * have the permission to perform one of the necessary operations. The 214 * exception is created with a type specific to the operation: 215 * </p> 216 * 217 * <ul> 218 * <li> 219 * {@link TrashPermissionException#MOVE} - if the user did not have 220 * permission to move the trash entry to the new 221 * destination 222 * </li> 223 * <li> 224 * {@link TrashPermissionException#RESTORE} - if the user did not have 225 * permission to restore the trash entry 226 * </li> 227 * </ul> 228 * 229 * @param className the class name of the entity 230 * @param classPK the primary key of the entity 231 * @param destinationContainerModelId the primary key of the new location 232 * @param serviceContext the service context to be applied (optionally 233 <code>null</code>) 234 */ 235 @Override 236 public void moveEntry(java.lang.String className, long classPK, 237 long destinationContainerModelId, 238 com.liferay.portal.kernel.service.ServiceContext serviceContext) 239 throws com.liferay.portal.kernel.exception.PortalException { 240 _trashEntryService.moveEntry(className, classPK, 241 destinationContainerModelId, serviceContext); 242 } 243 244 @Override 245 public TrashEntryService getWrappedService() { 246 return _trashEntryService; 247 } 248 249 @Override 250 public void setWrappedService(TrashEntryService trashEntryService) { 251 _trashEntryService = trashEntryService; 252 } 253 254 private TrashEntryService _trashEntryService; 255 }