1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.workflow;
16  
17  import com.liferay.portal.kernel.util.OrderByComparator;
18  
19  import java.io.InputStream;
20  
21  import java.util.List;
22  
23  /**
24   * <a href="WorkflowDefinitionManagerUtil.java.html"><b><i>View Source</i></b>
25   * </a>
26   *
27   * @author Micha Kiener
28   * @author Shuyang Zhou
29   * @author Brian Wing Shun Chan
30   */
31  public class WorkflowDefinitionManagerUtil {
32  
33      public static WorkflowDefinition deployWorkflowDefinition(
34              long companyId, long userId, String name, InputStream inputStream)
35          throws WorkflowException {
36  
37          return _workflowDefinitionManager.deployWorkflowDefinition(
38              companyId, userId, name, inputStream);
39      }
40  
41      public static WorkflowDefinition getWorkflowDefinition(
42              long companyId, String name, int version)
43          throws WorkflowException {
44  
45          return _workflowDefinitionManager.getWorkflowDefinition(
46              companyId, name, version);
47      }
48  
49      public static int getWorkflowDefinitionCount(long companyId)
50          throws WorkflowException {
51  
52          return _workflowDefinitionManager.getWorkflowDefinitionCount(companyId);
53      }
54  
55      public static int getWorkflowDefinitionCount(long companyId, String name)
56          throws WorkflowException {
57  
58          return _workflowDefinitionManager.getWorkflowDefinitionCount(
59              companyId, name);
60      }
61  
62      public static WorkflowDefinitionManager getWorkflowDefinitionManager() {
63          return _workflowDefinitionManager;
64      }
65  
66      public static List<WorkflowDefinition> getWorkflowDefinitions(
67              long companyId, int start, int end,
68              OrderByComparator orderByComparator)
69          throws WorkflowException {
70  
71          return _workflowDefinitionManager.getWorkflowDefinitions(
72              companyId, start, end, orderByComparator);
73      }
74  
75      public static List<WorkflowDefinition> getWorkflowDefinitions(
76              long companyId, String name, int start, int end,
77              OrderByComparator orderByComparator)
78          throws WorkflowException {
79  
80          return _workflowDefinitionManager.getWorkflowDefinitions(
81              companyId, name, start, end, orderByComparator);
82      }
83  
84      public static void undeployWorkflowDefinition(
85              long companyId, long userId, String name, int version)
86          throws WorkflowException {
87  
88          _workflowDefinitionManager.undeployWorkflowDefinition(
89              companyId, userId, name, version);
90      }
91  
92      public void setWorkflowDefinitionManager(
93          WorkflowDefinitionManager workflowDefinitionManager) {
94  
95          _workflowDefinitionManager = workflowDefinitionManager;
96      }
97  
98      private static WorkflowDefinitionManager _workflowDefinitionManager;
99  
100 }