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.journal.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.BooleanWrapper;
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.journal.service.JournalStructureServiceUtil;
033:
034: /**
035: * <a href="JournalStructureServiceHttp.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.journal.service.JournalStructureServiceUtil</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.journal.service.JournalStructureServiceUtil
070: * @see com.liferay.portlet.journal.service.http.JournalStructureServiceSoap
071: *
072: */
073: public class JournalStructureServiceHttp {
074: public static com.liferay.portlet.journal.model.JournalStructure addStructure(
075: HttpPrincipal httpPrincipal, java.lang.String structureId,
076: boolean autoStructureId, long plid, java.lang.String name,
077: java.lang.String description, java.lang.String xsd,
078: boolean addCommunityPermissions, boolean addGuestPermissions)
079: throws com.liferay.portal.SystemException,
080: com.liferay.portal.PortalException {
081: try {
082: Object paramObj0 = structureId;
083:
084: if (structureId == null) {
085: paramObj0 = new NullWrapper("java.lang.String");
086: }
087:
088: Object paramObj1 = new BooleanWrapper(autoStructureId);
089:
090: Object paramObj2 = new LongWrapper(plid);
091:
092: Object paramObj3 = name;
093:
094: if (name == null) {
095: paramObj3 = new NullWrapper("java.lang.String");
096: }
097:
098: Object paramObj4 = description;
099:
100: if (description == null) {
101: paramObj4 = new NullWrapper("java.lang.String");
102: }
103:
104: Object paramObj5 = xsd;
105:
106: if (xsd == null) {
107: paramObj5 = new NullWrapper("java.lang.String");
108: }
109:
110: Object paramObj6 = new BooleanWrapper(
111: addCommunityPermissions);
112:
113: Object paramObj7 = new BooleanWrapper(addGuestPermissions);
114:
115: MethodWrapper methodWrapper = new MethodWrapper(
116: JournalStructureServiceUtil.class.getName(),
117: "addStructure", new Object[] { paramObj0,
118: paramObj1, paramObj2, paramObj3, paramObj4,
119: paramObj5, paramObj6, paramObj7 });
120:
121: Object returnObj = null;
122:
123: try {
124: returnObj = TunnelUtil.invoke(httpPrincipal,
125: methodWrapper);
126: } catch (Exception e) {
127: if (e instanceof com.liferay.portal.SystemException) {
128: throw (com.liferay.portal.SystemException) e;
129: }
130:
131: if (e instanceof com.liferay.portal.PortalException) {
132: throw (com.liferay.portal.PortalException) e;
133: }
134:
135: throw new com.liferay.portal.SystemException(e);
136: }
137:
138: return (com.liferay.portlet.journal.model.JournalStructure) returnObj;
139: } catch (com.liferay.portal.SystemException se) {
140: _log.error(se, se);
141:
142: throw se;
143: }
144: }
145:
146: public static com.liferay.portlet.journal.model.JournalStructure addStructure(
147: HttpPrincipal httpPrincipal, java.lang.String structureId,
148: boolean autoStructureId, long plid, java.lang.String name,
149: java.lang.String description, java.lang.String xsd,
150: java.lang.String[] communityPermissions,
151: java.lang.String[] guestPermissions)
152: throws com.liferay.portal.SystemException,
153: com.liferay.portal.PortalException {
154: try {
155: Object paramObj0 = structureId;
156:
157: if (structureId == null) {
158: paramObj0 = new NullWrapper("java.lang.String");
159: }
160:
161: Object paramObj1 = new BooleanWrapper(autoStructureId);
162:
163: Object paramObj2 = new LongWrapper(plid);
164:
165: Object paramObj3 = name;
166:
167: if (name == null) {
168: paramObj3 = new NullWrapper("java.lang.String");
169: }
170:
171: Object paramObj4 = description;
172:
173: if (description == null) {
174: paramObj4 = new NullWrapper("java.lang.String");
175: }
176:
177: Object paramObj5 = xsd;
178:
179: if (xsd == null) {
180: paramObj5 = new NullWrapper("java.lang.String");
181: }
182:
183: Object paramObj6 = communityPermissions;
184:
185: if (communityPermissions == null) {
186: paramObj6 = new NullWrapper("[Ljava.lang.String;");
187: }
188:
189: Object paramObj7 = guestPermissions;
190:
191: if (guestPermissions == null) {
192: paramObj7 = new NullWrapper("[Ljava.lang.String;");
193: }
194:
195: MethodWrapper methodWrapper = new MethodWrapper(
196: JournalStructureServiceUtil.class.getName(),
197: "addStructure", new Object[] { paramObj0,
198: paramObj1, paramObj2, paramObj3, paramObj4,
199: paramObj5, paramObj6, paramObj7 });
200:
201: Object returnObj = null;
202:
203: try {
204: returnObj = TunnelUtil.invoke(httpPrincipal,
205: methodWrapper);
206: } catch (Exception e) {
207: if (e instanceof com.liferay.portal.SystemException) {
208: throw (com.liferay.portal.SystemException) e;
209: }
210:
211: if (e instanceof com.liferay.portal.PortalException) {
212: throw (com.liferay.portal.PortalException) e;
213: }
214:
215: throw new com.liferay.portal.SystemException(e);
216: }
217:
218: return (com.liferay.portlet.journal.model.JournalStructure) returnObj;
219: } catch (com.liferay.portal.SystemException se) {
220: _log.error(se, se);
221:
222: throw se;
223: }
224: }
225:
226: public static void deleteStructure(HttpPrincipal httpPrincipal,
227: long groupId, java.lang.String structureId)
228: throws com.liferay.portal.SystemException,
229: com.liferay.portal.PortalException {
230: try {
231: Object paramObj0 = new LongWrapper(groupId);
232:
233: Object paramObj1 = structureId;
234:
235: if (structureId == null) {
236: paramObj1 = new NullWrapper("java.lang.String");
237: }
238:
239: MethodWrapper methodWrapper = new MethodWrapper(
240: JournalStructureServiceUtil.class.getName(),
241: "deleteStructure", new Object[] { paramObj0,
242: paramObj1 });
243:
244: try {
245: TunnelUtil.invoke(httpPrincipal, methodWrapper);
246: } catch (Exception e) {
247: if (e instanceof com.liferay.portal.SystemException) {
248: throw (com.liferay.portal.SystemException) e;
249: }
250:
251: if (e instanceof com.liferay.portal.PortalException) {
252: throw (com.liferay.portal.PortalException) e;
253: }
254:
255: throw new com.liferay.portal.SystemException(e);
256: }
257: } catch (com.liferay.portal.SystemException se) {
258: _log.error(se, se);
259:
260: throw se;
261: }
262: }
263:
264: public static com.liferay.portlet.journal.model.JournalStructure getStructure(
265: HttpPrincipal httpPrincipal, long groupId,
266: java.lang.String structureId)
267: throws com.liferay.portal.SystemException,
268: com.liferay.portal.PortalException {
269: try {
270: Object paramObj0 = new LongWrapper(groupId);
271:
272: Object paramObj1 = structureId;
273:
274: if (structureId == null) {
275: paramObj1 = new NullWrapper("java.lang.String");
276: }
277:
278: MethodWrapper methodWrapper = new MethodWrapper(
279: JournalStructureServiceUtil.class.getName(),
280: "getStructure",
281: new Object[] { paramObj0, paramObj1 });
282:
283: Object returnObj = null;
284:
285: try {
286: returnObj = TunnelUtil.invoke(httpPrincipal,
287: methodWrapper);
288: } catch (Exception e) {
289: if (e instanceof com.liferay.portal.SystemException) {
290: throw (com.liferay.portal.SystemException) e;
291: }
292:
293: if (e instanceof com.liferay.portal.PortalException) {
294: throw (com.liferay.portal.PortalException) e;
295: }
296:
297: throw new com.liferay.portal.SystemException(e);
298: }
299:
300: return (com.liferay.portlet.journal.model.JournalStructure) returnObj;
301: } catch (com.liferay.portal.SystemException se) {
302: _log.error(se, se);
303:
304: throw se;
305: }
306: }
307:
308: public static com.liferay.portlet.journal.model.JournalStructure updateStructure(
309: HttpPrincipal httpPrincipal, long groupId,
310: java.lang.String structureId, java.lang.String name,
311: java.lang.String description, java.lang.String xsd)
312: throws com.liferay.portal.SystemException,
313: com.liferay.portal.PortalException {
314: try {
315: Object paramObj0 = new LongWrapper(groupId);
316:
317: Object paramObj1 = structureId;
318:
319: if (structureId == null) {
320: paramObj1 = new NullWrapper("java.lang.String");
321: }
322:
323: Object paramObj2 = name;
324:
325: if (name == null) {
326: paramObj2 = new NullWrapper("java.lang.String");
327: }
328:
329: Object paramObj3 = description;
330:
331: if (description == null) {
332: paramObj3 = new NullWrapper("java.lang.String");
333: }
334:
335: Object paramObj4 = xsd;
336:
337: if (xsd == null) {
338: paramObj4 = new NullWrapper("java.lang.String");
339: }
340:
341: MethodWrapper methodWrapper = new MethodWrapper(
342: JournalStructureServiceUtil.class.getName(),
343: "updateStructure",
344: new Object[] { paramObj0, paramObj1, paramObj2,
345: paramObj3, paramObj4 });
346:
347: Object returnObj = null;
348:
349: try {
350: returnObj = TunnelUtil.invoke(httpPrincipal,
351: methodWrapper);
352: } catch (Exception e) {
353: if (e instanceof com.liferay.portal.SystemException) {
354: throw (com.liferay.portal.SystemException) e;
355: }
356:
357: if (e instanceof com.liferay.portal.PortalException) {
358: throw (com.liferay.portal.PortalException) e;
359: }
360:
361: throw new com.liferay.portal.SystemException(e);
362: }
363:
364: return (com.liferay.portlet.journal.model.JournalStructure) returnObj;
365: } catch (com.liferay.portal.SystemException se) {
366: _log.error(se, se);
367:
368: throw se;
369: }
370: }
371:
372: private static Log _log = LogFactoryUtil
373: .getLog(JournalStructureServiceHttp.class);
374: }
|