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