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 com.liferay.portlet.wiki.model.WikiPageSoap addPage(
103         long nodeId, java.lang.String title, java.lang.String content,
104         java.lang.String summary, boolean minorEdit, java.lang.String format,
105         java.lang.String parentTitle, java.lang.String redirectTitle,
106         com.liferay.portal.service.ServiceContext serviceContext)
107         throws RemoteException {
108         try {
109             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.addPage(nodeId,
110                     title, content, summary, minorEdit, format, parentTitle,
111                     redirectTitle, serviceContext);
112 
113             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
114         }
115         catch (Exception e) {
116             _log.error(e, e);
117 
118             throw new RemoteException(e.getMessage());
119         }
120     }
121 
122     public static void addPageAttachments(long nodeId, java.lang.String title,
123         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files)
124         throws RemoteException {
125         try {
126             WikiPageServiceUtil.addPageAttachments(nodeId, title, files);
127         }
128         catch (Exception e) {
129             _log.error(e, e);
130 
131             throw new RemoteException(e.getMessage());
132         }
133     }
134 
135     public static void changeParent(long nodeId, java.lang.String title,
136         java.lang.String newParentTitle,
137         com.liferay.portal.service.ServiceContext serviceContext)
138         throws RemoteException {
139         try {
140             WikiPageServiceUtil.changeParent(nodeId, title, newParentTitle,
141                 serviceContext);
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145 
146             throw new RemoteException(e.getMessage());
147         }
148     }
149 
150     public static void deletePage(long nodeId, java.lang.String title)
151         throws RemoteException {
152         try {
153             WikiPageServiceUtil.deletePage(nodeId, title);
154         }
155         catch (Exception e) {
156             _log.error(e, e);
157 
158             throw new RemoteException(e.getMessage());
159         }
160     }
161 
162     public static void deletePageAttachment(long nodeId,
163         java.lang.String title, java.lang.String fileName)
164         throws RemoteException {
165         try {
166             WikiPageServiceUtil.deletePageAttachment(nodeId, title, fileName);
167         }
168         catch (Exception e) {
169             _log.error(e, e);
170 
171             throw new RemoteException(e.getMessage());
172         }
173     }
174 
175     public static com.liferay.portlet.wiki.model.WikiPageSoap[] getNodePages(
176         long nodeId, int max) throws RemoteException {
177         try {
178             java.util.List<com.liferay.portlet.wiki.model.WikiPage> returnValue = WikiPageServiceUtil.getNodePages(nodeId,
179                     max);
180 
181             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModels(returnValue);
182         }
183         catch (Exception e) {
184             _log.error(e, e);
185 
186             throw new RemoteException(e.getMessage());
187         }
188     }
189 
190     public static java.lang.String getNodePagesRSS(long nodeId, int max,
191         java.lang.String type, double version, java.lang.String displayStyle,
192         java.lang.String feedURL, java.lang.String entryURL)
193         throws RemoteException {
194         try {
195             java.lang.String returnValue = WikiPageServiceUtil.getNodePagesRSS(nodeId,
196                     max, type, version, displayStyle, feedURL, entryURL);
197 
198             return returnValue;
199         }
200         catch (Exception e) {
201             _log.error(e, e);
202 
203             throw new RemoteException(e.getMessage());
204         }
205     }
206 
207     public static com.liferay.portlet.wiki.model.WikiPageSoap getPage(
208         long nodeId, java.lang.String title) throws RemoteException {
209         try {
210             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.getPage(nodeId,
211                     title);
212 
213             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
214         }
215         catch (Exception e) {
216             _log.error(e, e);
217 
218             throw new RemoteException(e.getMessage());
219         }
220     }
221 
222     public static com.liferay.portlet.wiki.model.WikiPageSoap getPage(
223         long nodeId, java.lang.String title, double version)
224         throws RemoteException {
225         try {
226             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.getPage(nodeId,
227                     title, version);
228 
229             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
230         }
231         catch (Exception e) {
232             _log.error(e, e);
233 
234             throw new RemoteException(e.getMessage());
235         }
236     }
237 
238     public static java.lang.String getPagesRSS(long companyId, long nodeId,
239         java.lang.String title, int max, java.lang.String type, double version,
240         java.lang.String displayStyle, java.lang.String feedURL,
241         java.lang.String entryURL, String locale) throws RemoteException {
242         try {
243             java.lang.String returnValue = WikiPageServiceUtil.getPagesRSS(companyId,
244                     nodeId, title, max, type, version, displayStyle, feedURL,
245                     entryURL, new java.util.Locale(locale));
246 
247             return returnValue;
248         }
249         catch (Exception e) {
250             _log.error(e, e);
251 
252             throw new RemoteException(e.getMessage());
253         }
254     }
255 
256     public static void movePage(long nodeId, java.lang.String title,
257         java.lang.String newTitle,
258         com.liferay.portal.service.ServiceContext serviceContext)
259         throws RemoteException {
260         try {
261             WikiPageServiceUtil.movePage(nodeId, title, newTitle, serviceContext);
262         }
263         catch (Exception e) {
264             _log.error(e, e);
265 
266             throw new RemoteException(e.getMessage());
267         }
268     }
269 
270     public static com.liferay.portlet.wiki.model.WikiPageSoap revertPage(
271         long nodeId, java.lang.String title, double version,
272         com.liferay.portal.service.ServiceContext serviceContext)
273         throws RemoteException {
274         try {
275             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.revertPage(nodeId,
276                     title, version, serviceContext);
277 
278             return com.liferay.portlet.wiki.model.WikiPageSoap.toSoapModel(returnValue);
279         }
280         catch (Exception e) {
281             _log.error(e, e);
282 
283             throw new RemoteException(e.getMessage());
284         }
285     }
286 
287     public static void subscribePage(long nodeId, java.lang.String title)
288         throws RemoteException {
289         try {
290             WikiPageServiceUtil.subscribePage(nodeId, title);
291         }
292         catch (Exception e) {
293             _log.error(e, e);
294 
295             throw new RemoteException(e.getMessage());
296         }
297     }
298 
299     public static void unsubscribePage(long nodeId, java.lang.String title)
300         throws RemoteException {
301         try {
302             WikiPageServiceUtil.unsubscribePage(nodeId, title);
303         }
304         catch (Exception e) {
305             _log.error(e, e);
306 
307             throw new RemoteException(e.getMessage());
308         }
309     }
310 
311     public static com.liferay.portlet.wiki.model.WikiPageSoap updatePage(
312         long nodeId, java.lang.String title, double version,
313         java.lang.String content, java.lang.String summary, boolean minorEdit,
314         java.lang.String format, java.lang.String parentTitle,
315         java.lang.String redirectTitle,
316         com.liferay.portal.service.ServiceContext serviceContext)
317         throws RemoteException {
318         try {
319             com.liferay.portlet.wiki.model.WikiPage returnValue = WikiPageServiceUtil.updatePage(nodeId,
320                     title, version, content, summary, minorEdit, format,
321                     parentTitle, redirectTitle, serviceContext);
322 
323             return com.liferay.portlet.wiki.model.WikiPageSoap.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(WikiPageServiceSoap.class);
333 }