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.portlet.workflow.service.WorkflowComponentServiceUtil;
26  
27  /**
28   * <a href="WorkflowComponentServiceJSON.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be overwritten
32   * the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class provides a JSON utility for the <code>com.liferay.portlet.workflow.service.WorkflowComponentServiceUtil</code>
37   * service utility. The static methods of this class calls the same methods of the
38   * service utility. However, the signatures are different because it is difficult
39   * for JSON to support certain types.
40   * </p>
41   *
42   * <p>
43   * ServiceBuilder follows certain rules in translating the methods. For example,
44   * if the method in the service utility returns a <code>java.util.List</code>, that
45   * is translated to a <code>org.json.JSONArray</code>. If the method in the service
46   * utility returns a <code>com.liferay.portlet.workflow.model.WorkflowComponent</code>,
47   * that is translated to a <code>org.json.JSONObject</code>. Methods that JSON cannot
48   * safely use are skipped. The logic for the translation is encapsulated in <code>com.liferay.portlet.workflow.service.http.WorkflowComponentJSONSerializer</code>.
49   * </p>
50   *
51   * <p>
52   * This allows you to call the the backend services directly from JavaScript. See
53   * <code>portal-web/docroot/html/portlet/tags_admin/unpacked.js</code> for a reference
54   * of how that portlet uses the generated JavaScript in <code>portal-web/docroot/html/js/service.js</code>
55   * to call the backend services directly from JavaScript.
56   * </p>
57   *
58   * <p>
59   * The JSON utility is only generated for remote services.
60   * </p>
61   *
62   * @author Brian Wing Shun Chan
63   *
64   * @see com.liferay.portlet.workflow.service.WorkflowComponentServiceUtil
65   * @see com.liferay.portlet.workflow.service.http.WorkflowComponentJSONSerializer
66   *
67   */
68  public class WorkflowComponentServiceJSON {
69      public static java.util.List getCurrentTasks(long instanceId, long tokenId)
70          throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
71              java.rmi.RemoteException {
72          java.util.List returnValue = WorkflowComponentServiceUtil.getCurrentTasks(instanceId,
73                  tokenId);
74  
75          return returnValue;
76      }
77  
78      public static java.lang.String getCurrentTasksXml(long instanceId,
79          long tokenId)
80          throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
81              java.rmi.RemoteException {
82          java.lang.String returnValue = WorkflowComponentServiceUtil.getCurrentTasksXml(instanceId,
83                  tokenId);
84  
85          return returnValue;
86      }
87  
88      public static java.lang.String deploy(java.lang.String xml)
89          throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
90              java.rmi.RemoteException {
91          java.lang.String returnValue = WorkflowComponentServiceUtil.deploy(xml);
92  
93          return returnValue;
94      }
95  
96      public static java.lang.Object getDefinition(long definitionId)
97          throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
98              java.rmi.RemoteException {
99          java.lang.Object returnValue = WorkflowComponentServiceUtil.getDefinition(definitionId);
100 
101         return returnValue;
102     }
103 
104     public static java.util.List getDefinitions(long definitionId,
105         java.lang.String name, int begin, int end)
106         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
107             java.rmi.RemoteException {
108         java.util.List returnValue = WorkflowComponentServiceUtil.getDefinitions(definitionId,
109                 name, begin, end);
110 
111         return returnValue;
112     }
113 
114     public static java.lang.String getDefinitionsXml(long definitionId,
115         java.lang.String name, int begin, int end)
116         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
117             java.rmi.RemoteException {
118         java.lang.String returnValue = WorkflowComponentServiceUtil.getDefinitionsXml(definitionId,
119                 name, begin, end);
120 
121         return returnValue;
122     }
123 
124     public static int getDefinitionsCount(long definitionId,
125         java.lang.String name)
126         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
127             java.rmi.RemoteException {
128         int returnValue = WorkflowComponentServiceUtil.getDefinitionsCount(definitionId,
129                 name);
130 
131         return returnValue;
132     }
133 
134     public static java.lang.String getDefinitionsCountXml(long definitionId,
135         java.lang.String name)
136         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
137             java.rmi.RemoteException {
138         java.lang.String returnValue = WorkflowComponentServiceUtil.getDefinitionsCountXml(definitionId,
139                 name);
140 
141         return returnValue;
142     }
143 
144     public static java.lang.String getDefinitionXml(long definitionId)
145         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
146             java.rmi.RemoteException {
147         java.lang.String returnValue = WorkflowComponentServiceUtil.getDefinitionXml(definitionId);
148 
149         return returnValue;
150     }
151 
152     public static java.util.List getInstances(long definitionId,
153         long instanceId, java.lang.String definitionName,
154         java.lang.String definitionVersion, java.lang.String startDateGT,
155         java.lang.String startDateLT, java.lang.String endDateGT,
156         java.lang.String endDateLT, boolean hideEndedTasks,
157         boolean andOperator, int begin, int end)
158         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
159             java.rmi.RemoteException {
160         java.util.List returnValue = WorkflowComponentServiceUtil.getInstances(definitionId,
161                 instanceId, definitionName, definitionVersion, startDateGT,
162                 startDateLT, endDateGT, endDateLT, hideEndedTasks, andOperator,
163                 begin, end);
164 
165         return returnValue;
166     }
167 
168     public static int getInstancesCount(long definitionId, long instanceId,
169         java.lang.String definitionName, java.lang.String definitionVersion,
170         java.lang.String startDateGT, java.lang.String startDateLT,
171         java.lang.String endDateGT, java.lang.String endDateLT,
172         boolean hideEndedTasks, boolean andOperator)
173         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
174             java.rmi.RemoteException {
175         int returnValue = WorkflowComponentServiceUtil.getInstancesCount(definitionId,
176                 instanceId, definitionName, definitionVersion, startDateGT,
177                 startDateLT, endDateGT, endDateLT, hideEndedTasks, andOperator);
178 
179         return returnValue;
180     }
181 
182     public static java.lang.String getInstancesCountXml(long definitionId,
183         long instanceId, java.lang.String definitionName,
184         java.lang.String definitionVersion, java.lang.String startDateGT,
185         java.lang.String startDateLT, java.lang.String endDateGT,
186         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
187         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
188             java.rmi.RemoteException {
189         java.lang.String returnValue = WorkflowComponentServiceUtil.getInstancesCountXml(definitionId,
190                 instanceId, definitionName, definitionVersion, startDateGT,
191                 startDateLT, endDateGT, endDateLT, hideEndedTasks, andOperator);
192 
193         return returnValue;
194     }
195 
196     public static java.lang.String getInstancesXml(long definitionId,
197         long instanceId, java.lang.String definitionName,
198         java.lang.String definitionVersion, java.lang.String startDateGT,
199         java.lang.String startDateLT, java.lang.String endDateGT,
200         java.lang.String endDateLT, boolean hideEndedTasks,
201         boolean andOperator, int begin, int end)
202         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
203             java.rmi.RemoteException {
204         java.lang.String returnValue = WorkflowComponentServiceUtil.getInstancesXml(definitionId,
205                 instanceId, definitionName, definitionVersion, startDateGT,
206                 startDateLT, endDateGT, endDateLT, hideEndedTasks, andOperator,
207                 begin, end);
208 
209         return returnValue;
210     }
211 
212     public static java.util.List getTaskFormElements(long taskId)
213         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
214             java.rmi.RemoteException {
215         java.util.List returnValue = WorkflowComponentServiceUtil.getTaskFormElements(taskId);
216 
217         return returnValue;
218     }
219 
220     public static java.lang.String getTaskFormElementsXml(long taskId)
221         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
222             java.rmi.RemoteException {
223         java.lang.String returnValue = WorkflowComponentServiceUtil.getTaskFormElementsXml(taskId);
224 
225         return returnValue;
226     }
227 
228     public static java.util.List getTaskTransitions(long taskId)
229         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
230             java.rmi.RemoteException {
231         java.util.List returnValue = WorkflowComponentServiceUtil.getTaskTransitions(taskId);
232 
233         return returnValue;
234     }
235 
236     public static java.lang.String getTaskTransitionsXml(long taskId)
237         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
238             java.rmi.RemoteException {
239         java.lang.String returnValue = WorkflowComponentServiceUtil.getTaskTransitionsXml(taskId);
240 
241         return returnValue;
242     }
243 
244     public static java.util.List getUserTasks(long instanceId,
245         java.lang.String taskName, java.lang.String definitionName,
246         java.lang.String assignedTo, java.lang.String createDateGT,
247         java.lang.String createDateLT, java.lang.String startDateGT,
248         java.lang.String startDateLT, java.lang.String endDateGT,
249         java.lang.String endDateLT, boolean hideEndedTasks,
250         boolean andOperator, int begin, int end)
251         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
252             java.rmi.RemoteException {
253         java.util.List returnValue = WorkflowComponentServiceUtil.getUserTasks(instanceId,
254                 taskName, definitionName, assignedTo, createDateGT,
255                 createDateLT, startDateGT, startDateLT, endDateGT, endDateLT,
256                 hideEndedTasks, andOperator, begin, end);
257 
258         return returnValue;
259     }
260 
261     public static int getUserTasksCount(long instanceId,
262         java.lang.String taskName, java.lang.String definitionName,
263         java.lang.String assignedTo, java.lang.String createDateGT,
264         java.lang.String createDateLT, java.lang.String startDateGT,
265         java.lang.String startDateLT, java.lang.String endDateGT,
266         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
267         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
268             java.rmi.RemoteException {
269         int returnValue = WorkflowComponentServiceUtil.getUserTasksCount(instanceId,
270                 taskName, definitionName, assignedTo, createDateGT,
271                 createDateLT, startDateGT, startDateLT, endDateGT, endDateLT,
272                 hideEndedTasks, andOperator);
273 
274         return returnValue;
275     }
276 
277     public static java.lang.String getUserTasksCountXml(long instanceId,
278         java.lang.String taskName, java.lang.String definitionName,
279         java.lang.String assignedTo, java.lang.String createDateGT,
280         java.lang.String createDateLT, java.lang.String startDateGT,
281         java.lang.String startDateLT, java.lang.String endDateGT,
282         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
283         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
284             java.rmi.RemoteException {
285         java.lang.String returnValue = WorkflowComponentServiceUtil.getUserTasksCountXml(instanceId,
286                 taskName, definitionName, assignedTo, createDateGT,
287                 createDateLT, startDateGT, startDateLT, endDateGT, endDateLT,
288                 hideEndedTasks, andOperator);
289 
290         return returnValue;
291     }
292 
293     public static java.lang.String getUserTasksXml(long instanceId,
294         java.lang.String taskName, java.lang.String definitionName,
295         java.lang.String assignedTo, java.lang.String createDateGT,
296         java.lang.String createDateLT, java.lang.String startDateGT,
297         java.lang.String startDateLT, java.lang.String endDateGT,
298         java.lang.String endDateLT, boolean hideEndedTasks,
299         boolean andOperator, int begin, int end)
300         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
301             java.rmi.RemoteException {
302         java.lang.String returnValue = WorkflowComponentServiceUtil.getUserTasksXml(instanceId,
303                 taskName, definitionName, assignedTo, createDateGT,
304                 createDateLT, startDateGT, startDateLT, endDateGT, endDateLT,
305                 hideEndedTasks, andOperator, begin, end);
306 
307         return returnValue;
308     }
309 
310     public static void signalInstance(long instanceId)
311         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
312             java.rmi.RemoteException {
313         WorkflowComponentServiceUtil.signalInstance(instanceId);
314     }
315 
316     public static void signalToken(long instanceId, long tokenId)
317         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
318             java.rmi.RemoteException {
319         WorkflowComponentServiceUtil.signalToken(instanceId, tokenId);
320     }
321 
322     public static java.lang.String startWorkflow(long definitionId)
323         throws com.liferay.portal.kernel.jbi.WorkflowComponentException, 
324             java.rmi.RemoteException {
325         java.lang.String returnValue = WorkflowComponentServiceUtil.startWorkflow(definitionId);
326 
327         return returnValue;
328     }
329 }