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.http; 016 017 import com.liferay.portal.kernel.log.Log; 018 import com.liferay.portal.kernel.log.LogFactoryUtil; 019 020 import com.liferay.portlet.trash.service.TrashEntryServiceUtil; 021 022 import java.rmi.RemoteException; 023 024 /** 025 * Provides the SOAP utility for the 026 * {@link com.liferay.portlet.trash.service.TrashEntryServiceUtil} service utility. The 027 * static methods of this class calls the same methods of the service utility. 028 * However, the signatures are different because it is difficult for SOAP to 029 * support certain types. 030 * 031 * <p> 032 * ServiceBuilder follows certain rules in translating the methods. For example, 033 * if the method in the service utility returns a {@link java.util.List}, that 034 * is translated to an array of {@link com.liferay.portlet.trash.model.TrashEntrySoap}. 035 * If the method in the service utility returns a 036 * {@link com.liferay.portlet.trash.model.TrashEntry}, that is translated to a 037 * {@link com.liferay.portlet.trash.model.TrashEntrySoap}. Methods that SOAP cannot 038 * safely wire are skipped. 039 * </p> 040 * 041 * <p> 042 * The benefits of using the SOAP utility is that it is cross platform 043 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and 044 * even Perl, to call the generated services. One drawback of SOAP is that it is 045 * slow because it needs to serialize all calls into a text format (XML). 046 * </p> 047 * 048 * <p> 049 * You can see a list of services at http://localhost:8080/api/axis. Set the 050 * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 051 * security. 052 * </p> 053 * 054 * <p> 055 * The SOAP utility is only generated for remote services. 056 * </p> 057 * 058 * @author Brian Wing Shun Chan 059 * @see TrashEntryServiceHttp 060 * @see com.liferay.portlet.trash.model.TrashEntrySoap 061 * @see com.liferay.portlet.trash.service.TrashEntryServiceUtil 062 * @generated 063 */ 064 public class TrashEntryServiceSoap { 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 * @throws SystemException if a system exception occurred 072 */ 073 public static void deleteEntries(long groupId) throws RemoteException { 074 try { 075 TrashEntryServiceUtil.deleteEntries(groupId); 076 } 077 catch (Exception e) { 078 _log.error(e, e); 079 080 throw new RemoteException(e.getMessage()); 081 } 082 } 083 084 /** 085 * Deletes the trash entries with the primary keys. 086 * 087 * @param entryIds the primary keys of the trash entries 088 * @throws PortalException if a trash entry with the primary key could not 089 be found or if the user did not have permission to delete any one 090 of the trash entries 091 * @throws SystemException if a system exception occurred 092 */ 093 public static void deleteEntries(long[] entryIds) throws RemoteException { 094 try { 095 TrashEntryServiceUtil.deleteEntries(entryIds); 096 } 097 catch (Exception e) { 098 _log.error(e, e); 099 100 throw new RemoteException(e.getMessage()); 101 } 102 } 103 104 /** 105 * Deletes the trash entry with the primary key. 106 * 107 * <p> 108 * This method throws a {@link TrashPermissionException} with type {@link 109 * TrashPermissionException#DELETE} if the user did not have permission to 110 * delete the trash entry. 111 * </p> 112 * 113 * @param entryId the primary key of the trash entry 114 * @throws PortalException if a trash entry with the primary key could not 115 be found or if the user did not have permission to delete the 116 trash entry 117 * @throws SystemException if a system exception occurred 118 */ 119 public static void deleteEntry(long entryId) throws RemoteException { 120 try { 121 TrashEntryServiceUtil.deleteEntry(entryId); 122 } 123 catch (Exception e) { 124 _log.error(e, e); 125 126 throw new RemoteException(e.getMessage()); 127 } 128 } 129 130 /** 131 * Deletes the trash entry with the entity class name and class primary key. 132 * 133 * <p> 134 * This method throws a {@link TrashPermissionException} with type {@link 135 * TrashPermissionException#DELETE} if the user did not have permission to 136 * delete the trash entry. 137 * </p> 138 * 139 * @param className the class name of the entity 140 * @param classPK the primary key of the entity 141 * @throws PortalException if a trash entry with the entity class name and 142 primary key could not be found or if the user did not have 143 permission to delete the entry 144 * @throws SystemException if a system exception occurred 145 */ 146 public static void deleteEntry(java.lang.String className, long classPK) 147 throws RemoteException { 148 try { 149 TrashEntryServiceUtil.deleteEntry(className, classPK); 150 } 151 catch (Exception e) { 152 _log.error(e, e); 153 154 throw new RemoteException(e.getMessage()); 155 } 156 } 157 158 /** 159 * Returns the trash entries with the matching group ID. 160 * 161 * @param groupId the primary key of the group 162 * @return the matching trash entries 163 * @throws PrincipalException if a principal exception occurred 164 * @throws SystemException if a system exception occurred 165 */ 166 public static com.liferay.portlet.trash.model.TrashEntryList getEntries( 167 long groupId) throws RemoteException { 168 try { 169 com.liferay.portlet.trash.model.TrashEntryList returnValue = TrashEntryServiceUtil.getEntries(groupId); 170 171 return returnValue; 172 } 173 catch (Exception e) { 174 _log.error(e, e); 175 176 throw new RemoteException(e.getMessage()); 177 } 178 } 179 180 /** 181 * Returns a range of all the trash entries matching the group ID. 182 * 183 * @param groupId the primary key of the group 184 * @param start the lower bound of the range of trash entries to return 185 * @param end the upper bound of the range of trash entries to return (not 186 inclusive) 187 * @param obc the comparator to order the trash entries (optionally 188 <code>null</code>) 189 * @return the range of matching trash entries ordered by comparator 190 <code>obc</code> 191 * @throws PrincipalException if a system exception occurred 192 * @throws SystemException if a system exception occurred 193 */ 194 public static com.liferay.portlet.trash.model.TrashEntryList getEntries( 195 long groupId, int start, int end, 196 com.liferay.portal.kernel.util.OrderByComparator obc) 197 throws RemoteException { 198 try { 199 com.liferay.portlet.trash.model.TrashEntryList returnValue = TrashEntryServiceUtil.getEntries(groupId, 200 start, end, obc); 201 202 return returnValue; 203 } 204 catch (Exception e) { 205 _log.error(e, e); 206 207 throw new RemoteException(e.getMessage()); 208 } 209 } 210 211 /** 212 * Moves the trash entry with the entity class name and primary key, 213 * restoring it to a new location identified by the destination container 214 * model ID. 215 * 216 * <p> 217 * This method throws a {@link TrashPermissionException} if the user did not 218 * have the permission to perform one of the necessary operations. The 219 * exception is created with a type specific to the operation: 220 * </p> 221 * 222 * <ul> 223 * <li> 224 * {@link TrashPermissionException#MOVE} - if the user did not have 225 * permission to move the trash entry to the new 226 * destination 227 * </li> 228 * <li> 229 * {@link TrashPermissionException#RESTORE} - if the user did not have 230 * permission to restore the trash entry 231 * </li> 232 * </ul> 233 * 234 * @param className the class name of the entity 235 * @param classPK the primary key of the entity 236 * @param destinationContainerModelId the primary key of the new location 237 * @param serviceContext the service context to be applied (optionally 238 <code>null</code>) 239 * @throws PortalException if a matching trash entry could not be found, if 240 the user did not have permission to move the trash entry to the 241 new location, if the user did not have permission to restore the 242 trash entry, if a duplicate trash entry exists at the new 243 location, or if a portal exception occurred 244 * @throws SystemException if a system exception occurred 245 */ 246 public static void moveEntry(java.lang.String className, long classPK, 247 long destinationContainerModelId, 248 com.liferay.portal.service.ServiceContext serviceContext) 249 throws RemoteException { 250 try { 251 TrashEntryServiceUtil.moveEntry(className, classPK, 252 destinationContainerModelId, serviceContext); 253 } 254 catch (Exception e) { 255 _log.error(e, e); 256 257 throw new RemoteException(e.getMessage()); 258 } 259 } 260 261 public static com.liferay.portlet.trash.model.TrashEntrySoap restoreEntry( 262 long entryId) throws RemoteException { 263 try { 264 com.liferay.portlet.trash.model.TrashEntry returnValue = TrashEntryServiceUtil.restoreEntry(entryId); 265 266 return com.liferay.portlet.trash.model.TrashEntrySoap.toSoapModel(returnValue); 267 } 268 catch (Exception e) { 269 _log.error(e, e); 270 271 throw new RemoteException(e.getMessage()); 272 } 273 } 274 275 /** 276 * Restores the trash entry to its original location. In order to handle a 277 * duplicate trash entry already existing at the original location, either 278 * pass in the primary key of the existing trash entry's entity to overwrite 279 * or pass in a new name to give to the trash entry being restored. 280 * 281 * <p> 282 * This method throws a {@link TrashPermissionException} if the user did not 283 * have the permission to perform one of the necessary operations. The 284 * exception is created with a type specific to the operation: 285 * </p> 286 * 287 * <ul> 288 * <li> 289 * {@link TrashPermissionException#RESTORE} - if the user did not have 290 * permission to restore the trash entry 291 * </li> 292 * <li> 293 * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not 294 * have permission to delete the existing trash entry 295 * </li> 296 * <li> 297 * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not 298 * have permission to rename the trash entry 299 * </li> 300 * </ul> 301 * 302 * @param entryId the primary key of the trash entry to restore 303 * @param overrideClassPK the primary key of the entity to overwrite 304 (optionally <code>0</code>) 305 * @param name a new name to give to the trash entry being restored 306 (optionally <code>null</code>) 307 * @return the restored trash entry 308 * @throws PortalException if a matching trash entry could not be found, if 309 the user did not have permission to overwrite an existing trash 310 entry, to rename the trash entry being restored, or to restore 311 the trash entry in general 312 * @throws SystemException if a system exception occurred 313 */ 314 public static com.liferay.portlet.trash.model.TrashEntrySoap restoreEntry( 315 long entryId, long overrideClassPK, java.lang.String name) 316 throws RemoteException { 317 try { 318 com.liferay.portlet.trash.model.TrashEntry returnValue = TrashEntryServiceUtil.restoreEntry(entryId, 319 overrideClassPK, name); 320 321 return com.liferay.portlet.trash.model.TrashEntrySoap.toSoapModel(returnValue); 322 } 323 catch (Exception e) { 324 _log.error(e, e); 325 326 throw new RemoteException(e.getMessage()); 327 } 328 } 329 330 private static Log _log = LogFactoryUtil.getLog(TrashEntryServiceSoap.class); 331 }