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.portlet.documentlibrary.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.documentlibrary.service.DLTrashServiceUtil;
023    
024    import java.rmi.RemoteException;
025    
026    /**
027     * Provides the SOAP utility for the
028     * {@link DLTrashServiceUtil} 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     * The benefits of using the SOAP utility is that it is cross platform
035     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
036     * even Perl, to call the generated services. One drawback of SOAP is that it is
037     * slow because it needs to serialize all calls into a text format (XML).
038     * </p>
039     *
040     * <p>
041     * You can see a list of services at http://localhost:8080/api/axis. Set the
042     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
043     * security.
044     * </p>
045     *
046     * <p>
047     * The SOAP utility is only generated for remote services.
048     * </p>
049     *
050     * @author Brian Wing Shun Chan
051     * @see DLTrashServiceHttp
052     * @see DLTrashServiceUtil
053     * @generated
054     */
055    @ProviderType
056    public class DLTrashServiceSoap {
057            /**
058            * Moves the file entry from a trashed folder to the new folder.
059            *
060            * @param fileEntryId the primary key of the file entry
061            * @param newFolderId the primary key of the new folder
062            * @param serviceContext the service context to be applied
063            * @return the file entry
064            */
065            public static com.liferay.portal.kernel.repository.model.FileEntrySoap moveFileEntryFromTrash(
066                    long fileEntryId, long newFolderId,
067                    com.liferay.portal.service.ServiceContext serviceContext)
068                    throws RemoteException {
069                    try {
070                            com.liferay.portal.kernel.repository.model.FileEntry returnValue = DLTrashServiceUtil.moveFileEntryFromTrash(fileEntryId,
071                                            newFolderId, serviceContext);
072    
073                            return com.liferay.portal.kernel.repository.model.FileEntrySoap.toSoapModel(returnValue);
074                    }
075                    catch (Exception e) {
076                            _log.error(e, e);
077    
078                            throw new RemoteException(e.getMessage());
079                    }
080            }
081    
082            /**
083            * Moves the file entry with the primary key to the trash portlet.
084            *
085            * @param fileEntryId the primary key of the file entry
086            * @return the file entry
087            */
088            public static com.liferay.portal.kernel.repository.model.FileEntrySoap moveFileEntryToTrash(
089                    long fileEntryId) throws RemoteException {
090                    try {
091                            com.liferay.portal.kernel.repository.model.FileEntry returnValue = DLTrashServiceUtil.moveFileEntryToTrash(fileEntryId);
092    
093                            return com.liferay.portal.kernel.repository.model.FileEntrySoap.toSoapModel(returnValue);
094                    }
095                    catch (Exception e) {
096                            _log.error(e, e);
097    
098                            throw new RemoteException(e.getMessage());
099                    }
100            }
101    
102            /**
103            * Moves the folder with the primary key from the trash portlet to the new
104            * parent folder with the primary key.
105            *
106            * @param folderId the primary key of the folder
107            * @param parentFolderId the primary key of the new parent folder
108            * @param serviceContext the service context to be applied
109            * @return the file entry
110            */
111            public static com.liferay.portal.kernel.repository.model.FolderSoap moveFolderFromTrash(
112                    long folderId, long parentFolderId,
113                    com.liferay.portal.service.ServiceContext serviceContext)
114                    throws RemoteException {
115                    try {
116                            com.liferay.portal.kernel.repository.model.Folder returnValue = DLTrashServiceUtil.moveFolderFromTrash(folderId,
117                                            parentFolderId, serviceContext);
118    
119                            return com.liferay.portal.kernel.repository.model.FolderSoap.toSoapModel(returnValue);
120                    }
121                    catch (Exception e) {
122                            _log.error(e, e);
123    
124                            throw new RemoteException(e.getMessage());
125                    }
126            }
127    
128            /**
129            * Moves the folder with the primary key to the trash portlet.
130            *
131            * @param folderId the primary key of the folder
132            * @return the file entry
133            */
134            public static com.liferay.portal.kernel.repository.model.FolderSoap moveFolderToTrash(
135                    long folderId) throws RemoteException {
136                    try {
137                            com.liferay.portal.kernel.repository.model.Folder returnValue = DLTrashServiceUtil.moveFolderToTrash(folderId);
138    
139                            return com.liferay.portal.kernel.repository.model.FolderSoap.toSoapModel(returnValue);
140                    }
141                    catch (Exception e) {
142                            _log.error(e, e);
143    
144                            throw new RemoteException(e.getMessage());
145                    }
146            }
147    
148            /**
149            * Restores the file entry with the primary key from the trash portlet.
150            *
151            * @param fileEntryId the primary key of the file entry
152            */
153            public static void restoreFileEntryFromTrash(long fileEntryId)
154                    throws RemoteException {
155                    try {
156                            DLTrashServiceUtil.restoreFileEntryFromTrash(fileEntryId);
157                    }
158                    catch (Exception e) {
159                            _log.error(e, e);
160    
161                            throw new RemoteException(e.getMessage());
162                    }
163            }
164    
165            /**
166            * Restores the file shortcut with the primary key from the trash portlet.
167            *
168            * @param fileShortcutId the primary key of the file shortcut
169            */
170            public static void restoreFileShortcutFromTrash(long fileShortcutId)
171                    throws RemoteException {
172                    try {
173                            DLTrashServiceUtil.restoreFileShortcutFromTrash(fileShortcutId);
174                    }
175                    catch (Exception e) {
176                            _log.error(e, e);
177    
178                            throw new RemoteException(e.getMessage());
179                    }
180            }
181    
182            /**
183            * Restores the folder with the primary key from the trash portlet.
184            *
185            * @param folderId the primary key of the folder
186            */
187            public static void restoreFolderFromTrash(long folderId)
188                    throws RemoteException {
189                    try {
190                            DLTrashServiceUtil.restoreFolderFromTrash(folderId);
191                    }
192                    catch (Exception e) {
193                            _log.error(e, e);
194    
195                            throw new RemoteException(e.getMessage());
196                    }
197            }
198    
199            private static Log _log = LogFactoryUtil.getLog(DLTrashServiceSoap.class);
200    }