1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.wiki.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  
28  import com.liferay.portlet.wiki.service.WikiPageServiceUtil;
29  
30  import java.rmi.RemoteException;
31  
32  /**
33   * <a href="WikiPageServiceSoap.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a SOAP utility for the
42   * <code>com.liferay.portlet.wiki.service.WikiPageServiceUtil</code> service
43   * utility. The static methods of this class calls the same methods of the
44   * service utility. However, the signatures are different because it is
45   * difficult for SOAP to support certain types.
46   * </p>
47   *
48   * <p>
49   * ServiceBuilder follows certain rules in translating the methods. For example,
50   * if the method in the service utility returns a <code>java.util.List</code>,
51   * that is translated to an array of
52   * <code>com.liferay.portlet.wiki.model.WikiPageSoap</code>. If the method in the
53   * service utility returns a <code>com.liferay.portlet.wiki.model.WikiPage</code>,
54   * that is translated to a <code>com.liferay.portlet.wiki.model.WikiPageSoap</code>.
55   * Methods that SOAP cannot safely wire are skipped.
56   * </p>
57   *
58   * <p>
59   * The benefits of using the SOAP utility is that it is cross platform
60   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
61   * even Perl, to call the generated services. One drawback of SOAP is that it is
62   * slow because it needs to serialize all calls into a text format (XML).
63   * </p>
64   *
65   * <p>
66   * You can see a list of services at
67   * http://localhost:8080/tunnel-web/secure/axis. Set the property
68   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
69   * security.
70   * </p>
71   *
72   * <p>
73   * The SOAP utility is only generated for remote services.
74   * </p>
75   *
76   * @author Brian Wing Shun Chan
77   *
78   * @see com.liferay.portlet.wiki.model.WikiPageSoap
79   * @see com.liferay.portlet.wiki.service.WikiPageServiceUtil
80   * @see com.liferay.portlet.wiki.service.http.WikiPageServiceHttp
81   *
82   */
83  public class WikiPageServiceSoap {
84      public static com.liferay.portlet.wiki.model.WikiPageSoap addPage(
85          long nodeId, java.lang.String title, java.lang.String content,
86          java.lang.String summary, boolean minorEdit,
87          com.liferay.portal.service.ServiceContext serviceContext)
88          throws RemoteException {
89          try {
90              com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.addPage(nodeId,
91                      title, content, summary, minorEdit, serviceContext);
92  
93              return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
94          }
95          catch (Exception e) {
96              _log.error(e, e);
97  
98              throw new RemoteException(e.getMessage());
99          }
100     }
101 
102     public static void addPageAttachments(long nodeId, java.lang.String title,
103         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files)
104         throws RemoteException {
105         try {
106             WikiPageServiceUtil.addPageAttachments(nodeId, title, files);
107         }
108         catch (Exception e) {
109             _log.error(e, e);
110 
111             throw new RemoteException(e.getMessage());
112         }
113     }
114 
115     public static void changeParent(long nodeId, java.lang.String title,
116         java.lang.String newParentTitle,
117         com.liferay.portal.service.ServiceContext serviceContext)
118         throws RemoteException {
119         try {
120             WikiPageServiceUtil.changeParent(nodeId, title, newParentTitle,
121                 serviceContext);
122         }
123         catch (Exception e) {
124             _log.error(e, e);
125 
126             throw new RemoteException(e.getMessage());
127         }
128     }
129 
130     public static void deletePage(long nodeId, java.lang.String title)
131         throws RemoteException {
132         try {
133             WikiPageServiceUtil.deletePage(nodeId, title);
134         }
135         catch (Exception e) {
136             _log.error(e, e);
137 
138             throw new RemoteException(e.getMessage());
139         }
140     }
141 
142     public static void deletePageAttachment(long nodeId,
143         java.lang.String title, java.lang.String fileName)
144         throws RemoteException {
145         try {
146             WikiPageServiceUtil.deletePageAttachment(nodeId, title, fileName);
147         }
148         catch (Exception e) {
149             _log.error(e, e);
150 
151             throw new RemoteException(e.getMessage());
152         }
153     }
154 
155     public static com.liferay.portlet.wiki.model.WikiPageSoap[] getNodePages(
156         long nodeId, int max) throws RemoteException {
157         try {
158             java.util.List<com.liferay.portlet.wiki.model.WikiPage> returnValue = WikiPageServiceUtil.getNodePages(nodeId,
159                     max);
160 
161             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModels(returnValue);
162         }
163         catch (Exception e) {
164             _log.error(e, e);
165 
166             throw new RemoteException(e.getMessage());
167         }
168     }
169 
170     public static java.lang.String getNodePagesRSS(long nodeId, int max,
171         java.lang.String type, double version, java.lang.String displayStyle,
172         java.lang.String feedURL, java.lang.String entryURL)
173         throws RemoteException {
174         try {
175             java.lang.String returnValue = WikiPageServiceUtil.getNodePagesRSS(nodeId,
176                     max, type, version, displayStyle, feedURL, entryURL);
177 
178             return returnValue;
179         }
180         catch (Exception e) {
181             _log.error(e, e);
182 
183             throw new RemoteException(e.getMessage());
184         }
185     }
186 
187     public static com.liferay.portlet.wiki.model.WikiPageSoap getPage(
188         long nodeId, java.lang.String title) throws RemoteException {
189         try {
190             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.getPage(nodeId,
191                     title);
192 
193             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
194         }
195         catch (Exception e) {
196             _log.error(e, e);
197 
198             throw new RemoteException(e.getMessage());
199         }
200     }
201 
202     public static com.liferay.portlet.wiki.model.WikiPageSoap getPage(
203         long nodeId, java.lang.String title, double version)
204         throws RemoteException {
205         try {
206             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.getPage(nodeId,
207                     title, version);
208 
209             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
210         }
211         catch (Exception e) {
212             _log.error(e, e);
213 
214             throw new RemoteException(e.getMessage());
215         }
216     }
217 
218     public static java.lang.String getPagesRSS(long companyId, long nodeId,
219         java.lang.String title, int max, java.lang.String type, double version,
220         java.lang.String displayStyle, java.lang.String feedURL,
221         java.lang.String entryURL, String locale) throws RemoteException {
222         try {
223             java.lang.String returnValue = WikiPageServiceUtil.getPagesRSS(companyId,
224                     nodeId, title, max, type, version, displayStyle, feedURL,
225                     entryURL, new java.util.Locale(locale));
226 
227             return returnValue;
228         }
229         catch (Exception e) {
230             _log.error(e, e);
231 
232             throw new RemoteException(e.getMessage());
233         }
234     }
235 
236     public static void movePage(long nodeId, java.lang.String title,
237         java.lang.String newTitle,
238         com.liferay.portal.service.ServiceContext serviceContext)
239         throws RemoteException {
240         try {
241             WikiPageServiceUtil.movePage(nodeId, title, newTitle, serviceContext);
242         }
243         catch (Exception e) {
244             _log.error(e, e);
245 
246             throw new RemoteException(e.getMessage());
247         }
248     }
249 
250     public static com.liferay.portlet.wiki.model.WikiPageSoap revertPage(
251         long nodeId, java.lang.String title, double version,
252         com.liferay.portal.service.ServiceContext serviceContext)
253         throws RemoteException {
254         try {
255             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.revertPage(nodeId,
256                     title, version, serviceContext);
257 
258             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
259         }
260         catch (Exception e) {
261             _log.error(e, e);
262 
263             throw new RemoteException(e.getMessage());
264         }
265     }
266 
267     public static void subscribePage(long nodeId, java.lang.String title)
268         throws RemoteException {
269         try {
270             WikiPageServiceUtil.subscribePage(nodeId, title);
271         }
272         catch (Exception e) {
273             _log.error(e, e);
274 
275             throw new RemoteException(e.getMessage());
276         }
277     }
278 
279     public static void unsubscribePage(long nodeId, java.lang.String title)
280         throws RemoteException {
281         try {
282             WikiPageServiceUtil.unsubscribePage(nodeId, title);
283         }
284         catch (Exception e) {
285             _log.error(e, e);
286 
287             throw new RemoteException(e.getMessage());
288         }
289     }
290 
291     public static com.liferay.portlet.wiki.model.WikiPageSoap updatePage(
292         long nodeId, java.lang.String title, double version,
293         java.lang.String content, java.lang.String summary, boolean minorEdit,
294         java.lang.String format, java.lang.String parentTitle,
295         java.lang.String redirectTitle,
296         com.liferay.portal.service.ServiceContext serviceContext)
297         throws RemoteException {
298         try {
299             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.updatePage(nodeId,
300                     title, version, content, summary, minorEdit, format,
301                     parentTitle, redirectTitle, serviceContext);
302 
303             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
304         }
305         catch (Exception e) {
306             _log.error(e, e);
307 
308             throw new RemoteException(e.getMessage());
309         }
310     }
311 
312     private static Log _log = LogFactoryUtil.getLog(WikiPageServiceSoap.class);
313 }