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