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