1   /**
2    * Copyright (c) 2000-2007 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.workflow.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.workflow.service.WorkflowComponentServiceUtil;
29  
30  import java.rmi.RemoteException;
31  
32  /**
33   * <a href="WorkflowComponentServiceSoap.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be overwritten
37   * the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a SOAP utility for the <code>com.liferay.portlet.workflow.service.WorkflowComponentServiceUtil</code>
42   * service utility. The static methods of this class calls the same methods of the
43   * service utility. However, the signatures are different because it is difficult
44   * for SOAP to support certain types.
45   * </p>
46   *
47   * <p>
48   * ServiceBuilder follows certain rules in translating the methods. For example,
49   * if the method in the service utility returns a <code>java.util.List</code>, that
50   * is translated to an array of <code>com.liferay.portlet.workflow.model.WorkflowComponentSoap</code>.
51   * If the method in the service utility returns a <code>com.liferay.portlet.workflow.model.WorkflowComponent</code>,
52   * that is translated to a <code>com.liferay.portlet.workflow.model.WorkflowComponentSoap</code>.
53   * Methods that SOAP cannot safely wire are skipped.
54   * </p>
55   *
56   * <p>
57   * The benefits of using the SOAP utility is that it is cross platform compatible.
58   * SOAP allows different languages like Java, .NET, C++, PHP, and even Perl, to
59   * call the generated services. One drawback of SOAP is that it is slow because
60   * it needs to serialize all calls into a text format (XML).
61   * </p>
62   *
63   * <p>
64   * You can see a list of services at http://localhost:8080/tunnel-web/secure/axis.
65   * Set the property <code>tunnel.servlet.hosts.allowed</code> in portal.properties
66   * to configure security.
67   * </p>
68   *
69   * <p>
70   * The SOAP utility is only generated for remote services.
71   * </p>
72   *
73   * @author Brian Wing Shun Chan
74   *
75   * @see com.liferay.portlet.workflow.service.WorkflowComponentServiceUtil
76   * @see com.liferay.portlet.workflow.service.http.WorkflowComponentServiceHttp
77   * @see com.liferay.portlet.workflow.service.model.WorkflowComponentSoap
78   *
79   */
80  public class WorkflowComponentServiceSoap {
81      public static java.util.List getCurrentTasks(long instanceId, long tokenId)
82          throws RemoteException {
83          try {
84              java.util.List returnValue = WorkflowComponentServiceUtil.getCurrentTasks(instanceId,
85                      tokenId);
86  
87              return returnValue;
88          }
89          catch (Exception e) {
90              _log.error(e, e);
91              throw new RemoteException(e.getMessage());
92          }
93      }
94  
95      public static java.lang.String getCurrentTasksXml(long instanceId,
96          long tokenId) throws RemoteException {
97          try {
98              java.lang.String returnValue = WorkflowComponentServiceUtil.getCurrentTasksXml(instanceId,
99                      tokenId);
100 
101             return returnValue;
102         }
103         catch (Exception e) {
104             _log.error(e, e);
105             throw new RemoteException(e.getMessage());
106         }
107     }
108 
109     public static java.lang.String deploy(java.lang.String xml)
110         throws RemoteException {
111         try {
112             java.lang.String returnValue = WorkflowComponentServiceUtil.deploy(xml);
113 
114             return returnValue;
115         }
116         catch (Exception e) {
117             _log.error(e, e);
118             throw new RemoteException(e.getMessage());
119         }
120     }
121 
122     public static java.lang.Object getDefinition(long definitionId)
123         throws RemoteException {
124         try {
125             java.lang.Object returnValue = WorkflowComponentServiceUtil.getDefinition(definitionId);
126 
127             return returnValue;
128         }
129         catch (Exception e) {
130             _log.error(e, e);
131             throw new RemoteException(e.getMessage());
132         }
133     }
134 
135     public static java.util.List getDefinitions(long definitionId,
136         java.lang.String name, int begin, int end) throws RemoteException {
137         try {
138             java.util.List returnValue = WorkflowComponentServiceUtil.getDefinitions(definitionId,
139                     name, begin, end);
140 
141             return returnValue;
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145             throw new RemoteException(e.getMessage());
146         }
147     }
148 
149     public static java.lang.String getDefinitionsXml(long definitionId,
150         java.lang.String name, int begin, int end) throws RemoteException {
151         try {
152             java.lang.String returnValue = WorkflowComponentServiceUtil.getDefinitionsXml(definitionId,
153                     name, begin, end);
154 
155             return returnValue;
156         }
157         catch (Exception e) {
158             _log.error(e, e);
159             throw new RemoteException(e.getMessage());
160         }
161     }
162 
163     public static int getDefinitionsCount(long definitionId,
164         java.lang.String name) throws RemoteException {
165         try {
166             int returnValue = WorkflowComponentServiceUtil.getDefinitionsCount(definitionId,
167                     name);
168 
169             return returnValue;
170         }
171         catch (Exception e) {
172             _log.error(e, e);
173             throw new RemoteException(e.getMessage());
174         }
175     }
176 
177     public static java.lang.String getDefinitionsCountXml(long definitionId,
178         java.lang.String name) throws RemoteException {
179         try {
180             java.lang.String returnValue = WorkflowComponentServiceUtil.getDefinitionsCountXml(definitionId,
181                     name);
182 
183             return returnValue;
184         }
185         catch (Exception e) {
186             _log.error(e, e);
187             throw new RemoteException(e.getMessage());
188         }
189     }
190 
191     public static java.lang.String getDefinitionXml(long definitionId)
192         throws RemoteException {
193         try {
194             java.lang.String returnValue = WorkflowComponentServiceUtil.getDefinitionXml(definitionId);
195 
196             return returnValue;
197         }
198         catch (Exception e) {
199             _log.error(e, e);
200             throw new RemoteException(e.getMessage());
201         }
202     }
203 
204     public static java.util.List getInstances(long definitionId,
205         long instanceId, java.lang.String definitionName,
206         java.lang.String definitionVersion, java.lang.String startDateGT,
207         java.lang.String startDateLT, java.lang.String endDateGT,
208         java.lang.String endDateLT, boolean hideEndedTasks,
209         boolean andOperator, int begin, int end) throws RemoteException {
210         try {
211             java.util.List returnValue = WorkflowComponentServiceUtil.getInstances(definitionId,
212                     instanceId, definitionName, definitionVersion, startDateGT,
213                     startDateLT, endDateGT, endDateLT, hideEndedTasks,
214                     andOperator, begin, end);
215 
216             return returnValue;
217         }
218         catch (Exception e) {
219             _log.error(e, e);
220             throw new RemoteException(e.getMessage());
221         }
222     }
223 
224     public static int getInstancesCount(long definitionId, long instanceId,
225         java.lang.String definitionName, java.lang.String definitionVersion,
226         java.lang.String startDateGT, java.lang.String startDateLT,
227         java.lang.String endDateGT, java.lang.String endDateLT,
228         boolean hideEndedTasks, boolean andOperator) throws RemoteException {
229         try {
230             int returnValue = WorkflowComponentServiceUtil.getInstancesCount(definitionId,
231                     instanceId, definitionName, definitionVersion, startDateGT,
232                     startDateLT, endDateGT, endDateLT, hideEndedTasks,
233                     andOperator);
234 
235             return returnValue;
236         }
237         catch (Exception e) {
238             _log.error(e, e);
239             throw new RemoteException(e.getMessage());
240         }
241     }
242 
243     public static java.lang.String getInstancesCountXml(long definitionId,
244         long instanceId, java.lang.String definitionName,
245         java.lang.String definitionVersion, java.lang.String startDateGT,
246         java.lang.String startDateLT, java.lang.String endDateGT,
247         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
248         throws RemoteException {
249         try {
250             java.lang.String returnValue = WorkflowComponentServiceUtil.getInstancesCountXml(definitionId,
251                     instanceId, definitionName, definitionVersion, startDateGT,
252                     startDateLT, endDateGT, endDateLT, hideEndedTasks,
253                     andOperator);
254 
255             return returnValue;
256         }
257         catch (Exception e) {
258             _log.error(e, e);
259             throw new RemoteException(e.getMessage());
260         }
261     }
262 
263     public static java.lang.String getInstancesXml(long definitionId,
264         long instanceId, java.lang.String definitionName,
265         java.lang.String definitionVersion, java.lang.String startDateGT,
266         java.lang.String startDateLT, java.lang.String endDateGT,
267         java.lang.String endDateLT, boolean hideEndedTasks,
268         boolean andOperator, int begin, int end) throws RemoteException {
269         try {
270             java.lang.String returnValue = WorkflowComponentServiceUtil.getInstancesXml(definitionId,
271                     instanceId, definitionName, definitionVersion, startDateGT,
272                     startDateLT, endDateGT, endDateLT, hideEndedTasks,
273                     andOperator, begin, end);
274 
275             return returnValue;
276         }
277         catch (Exception e) {
278             _log.error(e, e);
279             throw new RemoteException(e.getMessage());
280         }
281     }
282 
283     public static java.util.List getTaskFormElements(long taskId)
284         throws RemoteException {
285         try {
286             java.util.List returnValue = WorkflowComponentServiceUtil.getTaskFormElements(taskId);
287 
288             return returnValue;
289         }
290         catch (Exception e) {
291             _log.error(e, e);
292             throw new RemoteException(e.getMessage());
293         }
294     }
295 
296     public static java.lang.String getTaskFormElementsXml(long taskId)
297         throws RemoteException {
298         try {
299             java.lang.String returnValue = WorkflowComponentServiceUtil.getTaskFormElementsXml(taskId);
300 
301             return returnValue;
302         }
303         catch (Exception e) {
304             _log.error(e, e);
305             throw new RemoteException(e.getMessage());
306         }
307     }
308 
309     public static java.util.List getTaskTransitions(long taskId)
310         throws RemoteException {
311         try {
312             java.util.List returnValue = WorkflowComponentServiceUtil.getTaskTransitions(taskId);
313 
314             return returnValue;
315         }
316         catch (Exception e) {
317             _log.error(e, e);
318             throw new RemoteException(e.getMessage());
319         }
320     }
321 
322     public static java.lang.String getTaskTransitionsXml(long taskId)
323         throws RemoteException {
324         try {
325             java.lang.String returnValue = WorkflowComponentServiceUtil.getTaskTransitionsXml(taskId);
326 
327             return returnValue;
328         }
329         catch (Exception e) {
330             _log.error(e, e);
331             throw new RemoteException(e.getMessage());
332         }
333     }
334 
335     public static java.util.List getUserTasks(long instanceId,
336         java.lang.String taskName, java.lang.String definitionName,
337         java.lang.String assignedTo, java.lang.String createDateGT,
338         java.lang.String createDateLT, java.lang.String startDateGT,
339         java.lang.String startDateLT, java.lang.String endDateGT,
340         java.lang.String endDateLT, boolean hideEndedTasks,
341         boolean andOperator, int begin, int end) throws RemoteException {
342         try {
343             java.util.List returnValue = WorkflowComponentServiceUtil.getUserTasks(instanceId,
344                     taskName, definitionName, assignedTo, createDateGT,
345                     createDateLT, startDateGT, startDateLT, endDateGT,
346                     endDateLT, hideEndedTasks, andOperator, begin, end);
347 
348             return returnValue;
349         }
350         catch (Exception e) {
351             _log.error(e, e);
352             throw new RemoteException(e.getMessage());
353         }
354     }
355 
356     public static int getUserTasksCount(long instanceId,
357         java.lang.String taskName, java.lang.String definitionName,
358         java.lang.String assignedTo, java.lang.String createDateGT,
359         java.lang.String createDateLT, java.lang.String startDateGT,
360         java.lang.String startDateLT, java.lang.String endDateGT,
361         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
362         throws RemoteException {
363         try {
364             int returnValue = WorkflowComponentServiceUtil.getUserTasksCount(instanceId,
365                     taskName, definitionName, assignedTo, createDateGT,
366                     createDateLT, startDateGT, startDateLT, endDateGT,
367                     endDateLT, hideEndedTasks, andOperator);
368 
369             return returnValue;
370         }
371         catch (Exception e) {
372             _log.error(e, e);
373             throw new RemoteException(e.getMessage());
374         }
375     }
376 
377     public static java.lang.String getUserTasksCountXml(long instanceId,
378         java.lang.String taskName, java.lang.String definitionName,
379         java.lang.String assignedTo, java.lang.String createDateGT,
380         java.lang.String createDateLT, java.lang.String startDateGT,
381         java.lang.String startDateLT, java.lang.String endDateGT,
382         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
383         throws RemoteException {
384         try {
385             java.lang.String returnValue = WorkflowComponentServiceUtil.getUserTasksCountXml(instanceId,
386                     taskName, definitionName, assignedTo, createDateGT,
387                     createDateLT, startDateGT, startDateLT, endDateGT,
388                     endDateLT, hideEndedTasks, andOperator);
389 
390             return returnValue;
391         }
392         catch (Exception e) {
393             _log.error(e, e);
394             throw new RemoteException(e.getMessage());
395         }
396     }
397 
398     public static java.lang.String getUserTasksXml(long instanceId,
399         java.lang.String taskName, java.lang.String definitionName,
400         java.lang.String assignedTo, java.lang.String createDateGT,
401         java.lang.String createDateLT, java.lang.String startDateGT,
402         java.lang.String startDateLT, java.lang.String endDateGT,
403         java.lang.String endDateLT, boolean hideEndedTasks,
404         boolean andOperator, int begin, int end) throws RemoteException {
405         try {
406             java.lang.String returnValue = WorkflowComponentServiceUtil.getUserTasksXml(instanceId,
407                     taskName, definitionName, assignedTo, createDateGT,
408                     createDateLT, startDateGT, startDateLT, endDateGT,
409                     endDateLT, hideEndedTasks, andOperator, begin, end);
410 
411             return returnValue;
412         }
413         catch (Exception e) {
414             _log.error(e, e);
415             throw new RemoteException(e.getMessage());
416         }
417     }
418 
419     public static void signalInstance(long instanceId)
420         throws RemoteException {
421         try {
422             WorkflowComponentServiceUtil.signalInstance(instanceId);
423         }
424         catch (Exception e) {
425             _log.error(e, e);
426             throw new RemoteException(e.getMessage());
427         }
428     }
429 
430     public static void signalToken(long instanceId, long tokenId)
431         throws RemoteException {
432         try {
433             WorkflowComponentServiceUtil.signalToken(instanceId, tokenId);
434         }
435         catch (Exception e) {
436             _log.error(e, e);
437             throw new RemoteException(e.getMessage());
438         }
439     }
440 
441     public static java.lang.String startWorkflow(long definitionId)
442         throws RemoteException {
443         try {
444             java.lang.String returnValue = WorkflowComponentServiceUtil.startWorkflow(definitionId);
445 
446             return returnValue;
447         }
448         catch (Exception e) {
449             _log.error(e, e);
450             throw new RemoteException(e.getMessage());
451         }
452     }
453 
454     private static Log _log = LogFactoryUtil.getLog(WorkflowComponentServiceSoap.class);
455 }