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.tags.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.LongWrapper;
026: import com.liferay.portal.kernel.util.MethodWrapper;
027: import com.liferay.portal.kernel.util.NullWrapper;
028: import com.liferay.portal.security.auth.HttpPrincipal;
029: import com.liferay.portal.service.http.TunnelUtil;
030:
031: import com.liferay.portlet.tags.service.TagsPropertyServiceUtil;
032:
033: /**
034: * <a href="TagsPropertyServiceHttp.java.html"><b><i>View Source</i></b></a>
035: *
036: * <p>
037: * ServiceBuilder generated this class. Modifications in this class will be
038: * overwritten the next time is generated.
039: * </p>
040: *
041: * <p>
042: * This class provides a HTTP utility for the
043: * <code>com.liferay.portlet.tags.service.TagsPropertyServiceUtil</code> service
044: * utility. The static methods of this class calls the same methods of the
045: * service utility. However, the signatures are different because it requires an
046: * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
047: * parameter.
048: * </p>
049: *
050: * <p>
051: * The benefits of using the HTTP utility is that it is fast and allows for
052: * tunneling without the cost of serializing to text. The drawback is that it
053: * only works with Java.
054: * </p>
055: *
056: * <p>
057: * Set the property <code>tunnel.servlet.hosts.allowed</code> in
058: * portal.properties to configure security.
059: * </p>
060: *
061: * <p>
062: * The HTTP utility is only generated for remote services.
063: * </p>
064: *
065: * @author Brian Wing Shun Chan
066: *
067: * @see com.liferay.portal.security.auth.HttpPrincipal
068: * @see com.liferay.portlet.tags.service.TagsPropertyServiceUtil
069: * @see com.liferay.portlet.tags.service.http.TagsPropertyServiceSoap
070: *
071: */
072: public class TagsPropertyServiceHttp {
073: public static com.liferay.portlet.tags.model.TagsProperty addProperty(
074: HttpPrincipal httpPrincipal, long entryId,
075: java.lang.String key, java.lang.String value)
076: throws com.liferay.portal.SystemException,
077: com.liferay.portal.PortalException {
078: try {
079: Object paramObj0 = new LongWrapper(entryId);
080:
081: Object paramObj1 = key;
082:
083: if (key == null) {
084: paramObj1 = new NullWrapper("java.lang.String");
085: }
086:
087: Object paramObj2 = value;
088:
089: if (value == null) {
090: paramObj2 = new NullWrapper("java.lang.String");
091: }
092:
093: MethodWrapper methodWrapper = new MethodWrapper(
094: TagsPropertyServiceUtil.class.getName(),
095: "addProperty", new Object[] { paramObj0, paramObj1,
096: paramObj2 });
097:
098: Object returnObj = null;
099:
100: try {
101: returnObj = TunnelUtil.invoke(httpPrincipal,
102: methodWrapper);
103: } catch (Exception e) {
104: if (e instanceof com.liferay.portal.SystemException) {
105: throw (com.liferay.portal.SystemException) e;
106: }
107:
108: if (e instanceof com.liferay.portal.PortalException) {
109: throw (com.liferay.portal.PortalException) e;
110: }
111:
112: throw new com.liferay.portal.SystemException(e);
113: }
114:
115: return (com.liferay.portlet.tags.model.TagsProperty) returnObj;
116: } catch (com.liferay.portal.SystemException se) {
117: _log.error(se, se);
118:
119: throw se;
120: }
121: }
122:
123: public static com.liferay.portlet.tags.model.TagsProperty addProperty(
124: HttpPrincipal httpPrincipal, java.lang.String entryName,
125: java.lang.String key, java.lang.String value)
126: throws com.liferay.portal.SystemException,
127: com.liferay.portal.PortalException {
128: try {
129: Object paramObj0 = entryName;
130:
131: if (entryName == null) {
132: paramObj0 = new NullWrapper("java.lang.String");
133: }
134:
135: Object paramObj1 = key;
136:
137: if (key == null) {
138: paramObj1 = new NullWrapper("java.lang.String");
139: }
140:
141: Object paramObj2 = value;
142:
143: if (value == null) {
144: paramObj2 = new NullWrapper("java.lang.String");
145: }
146:
147: MethodWrapper methodWrapper = new MethodWrapper(
148: TagsPropertyServiceUtil.class.getName(),
149: "addProperty", new Object[] { paramObj0, paramObj1,
150: paramObj2 });
151:
152: Object returnObj = null;
153:
154: try {
155: returnObj = TunnelUtil.invoke(httpPrincipal,
156: methodWrapper);
157: } catch (Exception e) {
158: if (e instanceof com.liferay.portal.SystemException) {
159: throw (com.liferay.portal.SystemException) e;
160: }
161:
162: if (e instanceof com.liferay.portal.PortalException) {
163: throw (com.liferay.portal.PortalException) e;
164: }
165:
166: throw new com.liferay.portal.SystemException(e);
167: }
168:
169: return (com.liferay.portlet.tags.model.TagsProperty) returnObj;
170: } catch (com.liferay.portal.SystemException se) {
171: _log.error(se, se);
172:
173: throw se;
174: }
175: }
176:
177: public static void deleteProperty(HttpPrincipal httpPrincipal,
178: long propertyId) throws com.liferay.portal.SystemException,
179: com.liferay.portal.PortalException {
180: try {
181: Object paramObj0 = new LongWrapper(propertyId);
182:
183: MethodWrapper methodWrapper = new MethodWrapper(
184: TagsPropertyServiceUtil.class.getName(),
185: "deleteProperty", new Object[] { paramObj0 });
186:
187: try {
188: TunnelUtil.invoke(httpPrincipal, methodWrapper);
189: } catch (Exception e) {
190: if (e instanceof com.liferay.portal.SystemException) {
191: throw (com.liferay.portal.SystemException) e;
192: }
193:
194: if (e instanceof com.liferay.portal.PortalException) {
195: throw (com.liferay.portal.PortalException) e;
196: }
197:
198: throw new com.liferay.portal.SystemException(e);
199: }
200: } catch (com.liferay.portal.SystemException se) {
201: _log.error(se, se);
202:
203: throw se;
204: }
205: }
206:
207: public static java.util.List getProperties(
208: HttpPrincipal httpPrincipal, long entryId)
209: throws com.liferay.portal.SystemException {
210: try {
211: Object paramObj0 = new LongWrapper(entryId);
212:
213: MethodWrapper methodWrapper = new MethodWrapper(
214: TagsPropertyServiceUtil.class.getName(),
215: "getProperties", new Object[] { paramObj0 });
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: throw new com.liferay.portal.SystemException(e);
228: }
229:
230: return (java.util.List) returnObj;
231: } catch (com.liferay.portal.SystemException se) {
232: _log.error(se, se);
233:
234: throw se;
235: }
236: }
237:
238: public static java.util.List getPropertyValues(
239: HttpPrincipal httpPrincipal, long companyId,
240: java.lang.String key)
241: throws com.liferay.portal.SystemException {
242: try {
243: Object paramObj0 = new LongWrapper(companyId);
244:
245: Object paramObj1 = key;
246:
247: if (key == null) {
248: paramObj1 = new NullWrapper("java.lang.String");
249: }
250:
251: MethodWrapper methodWrapper = new MethodWrapper(
252: TagsPropertyServiceUtil.class.getName(),
253: "getPropertyValues", new Object[] { paramObj0,
254: paramObj1 });
255:
256: Object returnObj = null;
257:
258: try {
259: returnObj = TunnelUtil.invoke(httpPrincipal,
260: methodWrapper);
261: } catch (Exception e) {
262: if (e instanceof com.liferay.portal.SystemException) {
263: throw (com.liferay.portal.SystemException) e;
264: }
265:
266: throw new com.liferay.portal.SystemException(e);
267: }
268:
269: return (java.util.List) returnObj;
270: } catch (com.liferay.portal.SystemException se) {
271: _log.error(se, se);
272:
273: throw se;
274: }
275: }
276:
277: public static com.liferay.portlet.tags.model.TagsProperty updateProperty(
278: HttpPrincipal httpPrincipal, long propertyId,
279: java.lang.String key, java.lang.String value)
280: throws com.liferay.portal.SystemException,
281: com.liferay.portal.PortalException {
282: try {
283: Object paramObj0 = new LongWrapper(propertyId);
284:
285: Object paramObj1 = key;
286:
287: if (key == null) {
288: paramObj1 = new NullWrapper("java.lang.String");
289: }
290:
291: Object paramObj2 = value;
292:
293: if (value == null) {
294: paramObj2 = new NullWrapper("java.lang.String");
295: }
296:
297: MethodWrapper methodWrapper = new MethodWrapper(
298: TagsPropertyServiceUtil.class.getName(),
299: "updateProperty", new Object[] { paramObj0,
300: paramObj1, paramObj2 });
301:
302: Object returnObj = null;
303:
304: try {
305: returnObj = TunnelUtil.invoke(httpPrincipal,
306: methodWrapper);
307: } catch (Exception e) {
308: if (e instanceof com.liferay.portal.SystemException) {
309: throw (com.liferay.portal.SystemException) e;
310: }
311:
312: if (e instanceof com.liferay.portal.PortalException) {
313: throw (com.liferay.portal.PortalException) e;
314: }
315:
316: throw new com.liferay.portal.SystemException(e);
317: }
318:
319: return (com.liferay.portlet.tags.model.TagsProperty) returnObj;
320: } catch (com.liferay.portal.SystemException se) {
321: _log.error(se, se);
322:
323: throw se;
324: }
325: }
326:
327: private static Log _log = LogFactoryUtil
328: .getLog(TagsPropertyServiceHttp.class);
329: }
|