PageRenderTime 76ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/apps/trash/trash-service/src/main/java/com/liferay/trash/service/http/TrashEntryServiceSoap.java

http://github.com/liferay/liferay-portal
Java | 409 lines | 178 code | 50 blank | 181 comment | 0 complexity | 3f8827473c47cc6b05bbcf95c75885a3 MD5 | raw file
Possible License(s): LGPL-2.0
  1. /**
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.trash.service.http;
  15. import com.liferay.portal.kernel.log.Log;
  16. import com.liferay.portal.kernel.log.LogFactoryUtil;
  17. import com.liferay.trash.service.TrashEntryServiceUtil;
  18. import java.rmi.RemoteException;
  19. /**
  20. * Provides the SOAP utility for the
  21. * <code>TrashEntryServiceUtil</code> service
  22. * utility. The static methods of this class call the same methods of the
  23. * service utility. However, the signatures are different because it is
  24. * difficult for SOAP to support certain types.
  25. *
  26. * <p>
  27. * ServiceBuilder follows certain rules in translating the methods. For example,
  28. * if the method in the service utility returns a <code>java.util.List</code>,
  29. * that is translated to an array of
  30. * <code>com.liferay.trash.model.TrashEntrySoap</code>. If the method in the
  31. * service utility returns a
  32. * <code>com.liferay.trash.model.TrashEntry</code>, that is translated to a
  33. * <code>com.liferay.trash.model.TrashEntrySoap</code>. Methods that SOAP
  34. * cannot safely wire are skipped.
  35. * </p>
  36. *
  37. * <p>
  38. * The benefits of using the SOAP utility is that it is cross platform
  39. * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
  40. * even Perl, to call the generated services. One drawback of SOAP is that it is
  41. * slow because it needs to serialize all calls into a text format (XML).
  42. * </p>
  43. *
  44. * <p>
  45. * You can see a list of services at http://localhost:8080/api/axis. Set the
  46. * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
  47. * security.
  48. * </p>
  49. *
  50. * <p>
  51. * The SOAP utility is only generated for remote services.
  52. * </p>
  53. *
  54. * @author Brian Wing Shun Chan
  55. * @see TrashEntryServiceHttp
  56. * @deprecated As of Athanasius (7.3.x), with no direct replacement
  57. * @generated
  58. */
  59. @Deprecated
  60. public class TrashEntryServiceSoap {
  61. /**
  62. * Deletes the trash entries with the matching group ID considering
  63. * permissions.
  64. *
  65. * @param groupId the primary key of the group
  66. */
  67. public static void deleteEntries(long groupId) throws RemoteException {
  68. try {
  69. TrashEntryServiceUtil.deleteEntries(groupId);
  70. }
  71. catch (Exception exception) {
  72. _log.error(exception, exception);
  73. throw new RemoteException(exception.getMessage());
  74. }
  75. }
  76. /**
  77. * Deletes the trash entries with the primary keys.
  78. *
  79. * @param entryIds the primary keys of the trash entries
  80. */
  81. public static void deleteEntries(long[] entryIds) throws RemoteException {
  82. try {
  83. TrashEntryServiceUtil.deleteEntries(entryIds);
  84. }
  85. catch (Exception exception) {
  86. _log.error(exception, exception);
  87. throw new RemoteException(exception.getMessage());
  88. }
  89. }
  90. /**
  91. * Deletes the trash entry with the primary key.
  92. *
  93. * <p>
  94. * This method throws a {@link TrashPermissionException} with type {@link
  95. * TrashPermissionException#DELETE} if the user did not have permission to
  96. * delete the trash entry.
  97. * </p>
  98. *
  99. * @param entryId the primary key of the trash entry
  100. */
  101. public static void deleteEntry(long entryId) throws RemoteException {
  102. try {
  103. TrashEntryServiceUtil.deleteEntry(entryId);
  104. }
  105. catch (Exception exception) {
  106. _log.error(exception, exception);
  107. throw new RemoteException(exception.getMessage());
  108. }
  109. }
  110. /**
  111. * Deletes the trash entry with the entity class name and class primary key.
  112. *
  113. * <p>
  114. * This method throws a {@link TrashPermissionException} with type {@link
  115. * TrashPermissionException#DELETE} if the user did not have permission to
  116. * delete the trash entry.
  117. * </p>
  118. *
  119. * @param className the class name of the entity
  120. * @param classPK the primary key of the entity
  121. */
  122. public static void deleteEntry(String className, long classPK)
  123. throws RemoteException {
  124. try {
  125. TrashEntryServiceUtil.deleteEntry(className, classPK);
  126. }
  127. catch (Exception exception) {
  128. _log.error(exception, exception);
  129. throw new RemoteException(exception.getMessage());
  130. }
  131. }
  132. /**
  133. * Returns the trash entries with the matching group ID.
  134. *
  135. * @param groupId the primary key of the group
  136. * @return the matching trash entries
  137. */
  138. public static com.liferay.trash.model.TrashEntryList getEntries(
  139. long groupId)
  140. throws RemoteException {
  141. try {
  142. com.liferay.trash.model.TrashEntryList returnValue =
  143. TrashEntryServiceUtil.getEntries(groupId);
  144. return returnValue;
  145. }
  146. catch (Exception exception) {
  147. _log.error(exception, exception);
  148. throw new RemoteException(exception.getMessage());
  149. }
  150. }
  151. /**
  152. * Returns a range of all the trash entries matching the group ID.
  153. *
  154. * @param groupId the primary key of the group
  155. * @param start the lower bound of the range of trash entries to return
  156. * @param end the upper bound of the range of trash entries to return (not
  157. inclusive)
  158. * @param orderByComparator the comparator to order the trash entries
  159. (optionally <code>null</code>)
  160. * @return the range of matching trash entries ordered by comparator
  161. <code>orderByComparator</code>
  162. */
  163. public static com.liferay.trash.model.TrashEntryList getEntries(
  164. long groupId, int start, int end,
  165. com.liferay.portal.kernel.util.OrderByComparator
  166. <com.liferay.trash.model.TrashEntry> orderByComparator)
  167. throws RemoteException {
  168. try {
  169. com.liferay.trash.model.TrashEntryList returnValue =
  170. TrashEntryServiceUtil.getEntries(
  171. groupId, start, end, orderByComparator);
  172. return returnValue;
  173. }
  174. catch (Exception exception) {
  175. _log.error(exception, exception);
  176. throw new RemoteException(exception.getMessage());
  177. }
  178. }
  179. public static com.liferay.trash.model.TrashEntrySoap[] getEntries(
  180. long groupId, String className)
  181. throws RemoteException {
  182. try {
  183. java.util.List<com.liferay.trash.model.TrashEntry> returnValue =
  184. TrashEntryServiceUtil.getEntries(groupId, className);
  185. return com.liferay.trash.model.TrashEntrySoap.toSoapModels(
  186. returnValue);
  187. }
  188. catch (Exception exception) {
  189. _log.error(exception, exception);
  190. throw new RemoteException(exception.getMessage());
  191. }
  192. }
  193. /**
  194. * Returns a range of all the trash entries matching the group ID.
  195. *
  196. * @param groupId the primary key of the group
  197. * @param className the class name of the entity
  198. * @param start the lower bound of the range of trash entries to return
  199. * @param end the upper bound of the range of trash entries to return (not
  200. inclusive)
  201. * @param orderByComparator the comparator to order the trash entries
  202. (optionally <code>null</code>)
  203. * @return the range of matching trash entries ordered by comparator
  204. <code>orderByComparator</code>
  205. */
  206. public static com.liferay.trash.model.TrashEntryList getEntries(
  207. long groupId, String className, int start, int end,
  208. com.liferay.portal.kernel.util.OrderByComparator
  209. <com.liferay.trash.model.TrashEntry> orderByComparator)
  210. throws RemoteException {
  211. try {
  212. com.liferay.trash.model.TrashEntryList returnValue =
  213. TrashEntryServiceUtil.getEntries(
  214. groupId, className, start, end, orderByComparator);
  215. return returnValue;
  216. }
  217. catch (Exception exception) {
  218. _log.error(exception, exception);
  219. throw new RemoteException(exception.getMessage());
  220. }
  221. }
  222. /**
  223. * Moves the trash entry with the entity class name and primary key,
  224. * restoring it to a new location identified by the destination container
  225. * model ID.
  226. *
  227. * <p>
  228. * This method throws a {@link TrashPermissionException} if the user did not
  229. * have the permission to perform one of the necessary operations. The
  230. * exception is created with a type specific to the operation:
  231. * </p>
  232. *
  233. * <ul>
  234. * <li>
  235. * {@link TrashPermissionException#MOVE} - if the user did not have
  236. * permission to move the trash entry to the new
  237. * destination
  238. * </li>
  239. * <li>
  240. * {@link TrashPermissionException#RESTORE} - if the user did not have
  241. * permission to restore the trash entry
  242. * </li>
  243. * </ul>
  244. *
  245. * @param className the class name of the entity
  246. * @param classPK the primary key of the entity
  247. * @param destinationContainerModelId the primary key of the new location
  248. * @param serviceContext the service context to be applied (optionally
  249. <code>null</code>)
  250. */
  251. public static void moveEntry(
  252. String className, long classPK, long destinationContainerModelId,
  253. com.liferay.portal.kernel.service.ServiceContext serviceContext)
  254. throws RemoteException {
  255. try {
  256. TrashEntryServiceUtil.moveEntry(
  257. className, classPK, destinationContainerModelId,
  258. serviceContext);
  259. }
  260. catch (Exception exception) {
  261. _log.error(exception, exception);
  262. throw new RemoteException(exception.getMessage());
  263. }
  264. }
  265. public static com.liferay.trash.model.TrashEntrySoap restoreEntry(
  266. long entryId)
  267. throws RemoteException {
  268. try {
  269. com.liferay.trash.model.TrashEntry returnValue =
  270. TrashEntryServiceUtil.restoreEntry(entryId);
  271. return com.liferay.trash.model.TrashEntrySoap.toSoapModel(
  272. returnValue);
  273. }
  274. catch (Exception exception) {
  275. _log.error(exception, exception);
  276. throw new RemoteException(exception.getMessage());
  277. }
  278. }
  279. /**
  280. * Restores the trash entry to its original location. In order to handle a
  281. * duplicate trash entry already existing at the original location, either
  282. * pass in the primary key of the existing trash entry's entity to overwrite
  283. * or pass in a new name to give to the trash entry being restored.
  284. *
  285. * <p>
  286. * This method throws a {@link TrashPermissionException} if the user did not
  287. * have the permission to perform one of the necessary operations. The
  288. * exception is created with a type specific to the operation:
  289. * </p>
  290. *
  291. * <ul>
  292. * <li>
  293. * {@link TrashPermissionException#RESTORE} - if the user did not have
  294. * permission to restore the trash entry
  295. * </li>
  296. * <li>
  297. * {@link TrashPermissionException#RESTORE_OVERWRITE} - if the user did not
  298. * have permission to delete the existing trash entry
  299. * </li>
  300. * <li>
  301. * {@link TrashPermissionException#RESTORE_RENAME} - if the user did not
  302. * have permission to rename the trash entry
  303. * </li>
  304. * </ul>
  305. *
  306. * @param entryId the primary key of the trash entry to restore
  307. * @param overrideClassPK the primary key of the entity to overwrite
  308. (optionally <code>0</code>)
  309. * @param name a new name to give to the trash entry being restored
  310. (optionally <code>null</code>)
  311. * @return the restored trash entry
  312. */
  313. public static com.liferay.trash.model.TrashEntrySoap restoreEntry(
  314. long entryId, long overrideClassPK, String name)
  315. throws RemoteException {
  316. try {
  317. com.liferay.trash.model.TrashEntry returnValue =
  318. TrashEntryServiceUtil.restoreEntry(
  319. entryId, overrideClassPK, name);
  320. return com.liferay.trash.model.TrashEntrySoap.toSoapModel(
  321. returnValue);
  322. }
  323. catch (Exception exception) {
  324. _log.error(exception, exception);
  325. throw new RemoteException(exception.getMessage());
  326. }
  327. }
  328. public static com.liferay.trash.model.TrashEntrySoap restoreEntry(
  329. String className, long classPK)
  330. throws RemoteException {
  331. try {
  332. com.liferay.trash.model.TrashEntry returnValue =
  333. TrashEntryServiceUtil.restoreEntry(className, classPK);
  334. return com.liferay.trash.model.TrashEntrySoap.toSoapModel(
  335. returnValue);
  336. }
  337. catch (Exception exception) {
  338. _log.error(exception, exception);
  339. throw new RemoteException(exception.getMessage());
  340. }
  341. }
  342. public static com.liferay.trash.model.TrashEntrySoap restoreEntry(
  343. String className, long classPK, long overrideClassPK, String name)
  344. throws RemoteException {
  345. try {
  346. com.liferay.trash.model.TrashEntry returnValue =
  347. TrashEntryServiceUtil.restoreEntry(
  348. className, classPK, overrideClassPK, name);
  349. return com.liferay.trash.model.TrashEntrySoap.toSoapModel(
  350. returnValue);
  351. }
  352. catch (Exception exception) {
  353. _log.error(exception, exception);
  354. throw new RemoteException(exception.getMessage());
  355. }
  356. }
  357. private static Log _log = LogFactoryUtil.getLog(
  358. TrashEntryServiceSoap.class);
  359. }