001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.wiki.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025: import com.liferay.portal.kernel.util.DoubleWrapper;
026: import com.liferay.portal.kernel.util.LongWrapper;
027: import com.liferay.portal.kernel.util.MethodWrapper;
028: import com.liferay.portal.kernel.util.NullWrapper;
029: import com.liferay.portal.security.auth.HttpPrincipal;
030: import com.liferay.portal.service.http.TunnelUtil;
031:
032: import com.liferay.portlet.wiki.service.WikiPageServiceUtil;
033:
034: /**
035: * <a href="WikiPageServiceHttp.java.html"><b><i>View Source</i></b></a>
036: *
037: * <p>
038: * ServiceBuilder generated this class. Modifications in this class will be
039: * overwritten the next time is generated.
040: * </p>
041: *
042: * <p>
043: * This class provides a HTTP utility for the
044: * <code>com.liferay.portlet.wiki.service.WikiPageServiceUtil</code> service
045: * utility. The static methods of this class calls the same methods of the
046: * service utility. However, the signatures are different because it requires an
047: * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
048: * parameter.
049: * </p>
050: *
051: * <p>
052: * The benefits of using the HTTP utility is that it is fast and allows for
053: * tunneling without the cost of serializing to text. The drawback is that it
054: * only works with Java.
055: * </p>
056: *
057: * <p>
058: * Set the property <code>tunnel.servlet.hosts.allowed</code> in
059: * portal.properties to configure security.
060: * </p>
061: *
062: * <p>
063: * The HTTP utility is only generated for remote services.
064: * </p>
065: *
066: * @author Brian Wing Shun Chan
067: *
068: * @see com.liferay.portal.security.auth.HttpPrincipal
069: * @see com.liferay.portlet.wiki.service.WikiPageServiceUtil
070: * @see com.liferay.portlet.wiki.service.http.WikiPageServiceSoap
071: *
072: */
073: public class WikiPageServiceHttp {
074: public static com.liferay.portlet.wiki.model.WikiPage addPage(
075: HttpPrincipal httpPrincipal, long nodeId,
076: java.lang.String title)
077: throws com.liferay.portal.SystemException,
078: com.liferay.portal.PortalException {
079: try {
080: Object paramObj0 = new LongWrapper(nodeId);
081:
082: Object paramObj1 = title;
083:
084: if (title == null) {
085: paramObj1 = new NullWrapper("java.lang.String");
086: }
087:
088: MethodWrapper methodWrapper = new MethodWrapper(
089: WikiPageServiceUtil.class.getName(), "addPage",
090: new Object[] { paramObj0, paramObj1 });
091:
092: Object returnObj = null;
093:
094: try {
095: returnObj = TunnelUtil.invoke(httpPrincipal,
096: methodWrapper);
097: } catch (Exception e) {
098: if (e instanceof com.liferay.portal.SystemException) {
099: throw (com.liferay.portal.SystemException) e;
100: }
101:
102: if (e instanceof com.liferay.portal.PortalException) {
103: throw (com.liferay.portal.PortalException) e;
104: }
105:
106: throw new com.liferay.portal.SystemException(e);
107: }
108:
109: return (com.liferay.portlet.wiki.model.WikiPage) returnObj;
110: } catch (com.liferay.portal.SystemException se) {
111: _log.error(se, se);
112:
113: throw se;
114: }
115: }
116:
117: public static void deletePage(HttpPrincipal httpPrincipal,
118: long nodeId, java.lang.String title)
119: throws com.liferay.portal.SystemException,
120: com.liferay.portal.PortalException {
121: try {
122: Object paramObj0 = new LongWrapper(nodeId);
123:
124: Object paramObj1 = title;
125:
126: if (title == null) {
127: paramObj1 = new NullWrapper("java.lang.String");
128: }
129:
130: MethodWrapper methodWrapper = new MethodWrapper(
131: WikiPageServiceUtil.class.getName(), "deletePage",
132: new Object[] { paramObj0, paramObj1 });
133:
134: try {
135: TunnelUtil.invoke(httpPrincipal, methodWrapper);
136: } catch (Exception e) {
137: if (e instanceof com.liferay.portal.SystemException) {
138: throw (com.liferay.portal.SystemException) e;
139: }
140:
141: if (e instanceof com.liferay.portal.PortalException) {
142: throw (com.liferay.portal.PortalException) e;
143: }
144:
145: throw new com.liferay.portal.SystemException(e);
146: }
147: } catch (com.liferay.portal.SystemException se) {
148: _log.error(se, se);
149:
150: throw se;
151: }
152: }
153:
154: public static com.liferay.portlet.wiki.model.WikiPage getPage(
155: HttpPrincipal httpPrincipal, long nodeId,
156: java.lang.String title)
157: throws com.liferay.portal.SystemException,
158: com.liferay.portal.PortalException {
159: try {
160: Object paramObj0 = new LongWrapper(nodeId);
161:
162: Object paramObj1 = title;
163:
164: if (title == null) {
165: paramObj1 = new NullWrapper("java.lang.String");
166: }
167:
168: MethodWrapper methodWrapper = new MethodWrapper(
169: WikiPageServiceUtil.class.getName(), "getPage",
170: new Object[] { paramObj0, paramObj1 });
171:
172: Object returnObj = null;
173:
174: try {
175: returnObj = TunnelUtil.invoke(httpPrincipal,
176: methodWrapper);
177: } catch (Exception e) {
178: if (e instanceof com.liferay.portal.SystemException) {
179: throw (com.liferay.portal.SystemException) e;
180: }
181:
182: if (e instanceof com.liferay.portal.PortalException) {
183: throw (com.liferay.portal.PortalException) e;
184: }
185:
186: throw new com.liferay.portal.SystemException(e);
187: }
188:
189: return (com.liferay.portlet.wiki.model.WikiPage) returnObj;
190: } catch (com.liferay.portal.SystemException se) {
191: _log.error(se, se);
192:
193: throw se;
194: }
195: }
196:
197: public static com.liferay.portlet.wiki.model.WikiPage getPage(
198: HttpPrincipal httpPrincipal, long nodeId,
199: java.lang.String title, double version)
200: throws com.liferay.portal.SystemException,
201: com.liferay.portal.PortalException {
202: try {
203: Object paramObj0 = new LongWrapper(nodeId);
204:
205: Object paramObj1 = title;
206:
207: if (title == null) {
208: paramObj1 = new NullWrapper("java.lang.String");
209: }
210:
211: Object paramObj2 = new DoubleWrapper(version);
212:
213: MethodWrapper methodWrapper = new MethodWrapper(
214: WikiPageServiceUtil.class.getName(), "getPage",
215: new Object[] { paramObj0, paramObj1, paramObj2 });
216:
217: Object returnObj = null;
218:
219: try {
220: returnObj = TunnelUtil.invoke(httpPrincipal,
221: methodWrapper);
222: } catch (Exception e) {
223: if (e instanceof com.liferay.portal.SystemException) {
224: throw (com.liferay.portal.SystemException) e;
225: }
226:
227: if (e instanceof com.liferay.portal.PortalException) {
228: throw (com.liferay.portal.PortalException) e;
229: }
230:
231: throw new com.liferay.portal.SystemException(e);
232: }
233:
234: return (com.liferay.portlet.wiki.model.WikiPage) returnObj;
235: } catch (com.liferay.portal.SystemException se) {
236: _log.error(se, se);
237:
238: throw se;
239: }
240: }
241:
242: public static com.liferay.portlet.wiki.model.WikiPage revertPage(
243: HttpPrincipal httpPrincipal, long nodeId,
244: java.lang.String title, double version)
245: throws com.liferay.portal.SystemException,
246: com.liferay.portal.PortalException {
247: try {
248: Object paramObj0 = new LongWrapper(nodeId);
249:
250: Object paramObj1 = title;
251:
252: if (title == null) {
253: paramObj1 = new NullWrapper("java.lang.String");
254: }
255:
256: Object paramObj2 = new DoubleWrapper(version);
257:
258: MethodWrapper methodWrapper = new MethodWrapper(
259: WikiPageServiceUtil.class.getName(), "revertPage",
260: new Object[] { paramObj0, paramObj1, paramObj2 });
261:
262: Object returnObj = null;
263:
264: try {
265: returnObj = TunnelUtil.invoke(httpPrincipal,
266: methodWrapper);
267: } catch (Exception e) {
268: if (e instanceof com.liferay.portal.SystemException) {
269: throw (com.liferay.portal.SystemException) e;
270: }
271:
272: if (e instanceof com.liferay.portal.PortalException) {
273: throw (com.liferay.portal.PortalException) e;
274: }
275:
276: throw new com.liferay.portal.SystemException(e);
277: }
278:
279: return (com.liferay.portlet.wiki.model.WikiPage) returnObj;
280: } catch (com.liferay.portal.SystemException se) {
281: _log.error(se, se);
282:
283: throw se;
284: }
285: }
286:
287: public static com.liferay.portlet.wiki.model.WikiPage updatePage(
288: HttpPrincipal httpPrincipal, long nodeId,
289: java.lang.String title, java.lang.String content,
290: java.lang.String format, java.lang.String[] tagsEntries)
291: throws com.liferay.portal.SystemException,
292: com.liferay.portal.PortalException {
293: try {
294: Object paramObj0 = new LongWrapper(nodeId);
295:
296: Object paramObj1 = title;
297:
298: if (title == null) {
299: paramObj1 = new NullWrapper("java.lang.String");
300: }
301:
302: Object paramObj2 = content;
303:
304: if (content == null) {
305: paramObj2 = new NullWrapper("java.lang.String");
306: }
307:
308: Object paramObj3 = format;
309:
310: if (format == null) {
311: paramObj3 = new NullWrapper("java.lang.String");
312: }
313:
314: Object paramObj4 = tagsEntries;
315:
316: if (tagsEntries == null) {
317: paramObj4 = new NullWrapper("[Ljava.lang.String;");
318: }
319:
320: MethodWrapper methodWrapper = new MethodWrapper(
321: WikiPageServiceUtil.class.getName(), "updatePage",
322: new Object[] { paramObj0, paramObj1, paramObj2,
323: paramObj3, paramObj4 });
324:
325: Object returnObj = null;
326:
327: try {
328: returnObj = TunnelUtil.invoke(httpPrincipal,
329: methodWrapper);
330: } catch (Exception e) {
331: if (e instanceof com.liferay.portal.SystemException) {
332: throw (com.liferay.portal.SystemException) e;
333: }
334:
335: if (e instanceof com.liferay.portal.PortalException) {
336: throw (com.liferay.portal.PortalException) e;
337: }
338:
339: throw new com.liferay.portal.SystemException(e);
340: }
341:
342: return (com.liferay.portlet.wiki.model.WikiPage) returnObj;
343: } catch (com.liferay.portal.SystemException se) {
344: _log.error(se, se);
345:
346: throw se;
347: }
348: }
349:
350: private static Log _log = LogFactoryUtil
351: .getLog(WikiPageServiceHttp.class);
352: }
|