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