001: /*
002: * Copyright (c) 2002-2003 by OpenSymphony
003: * All rights reserved.
004: */
005: /*
006: * Created by IntelliJ IDEA.
007: * User: plightbo
008: * Date: May 22, 2002
009: * Time: 2:02:10 PM
010: */
011: package com.opensymphony.workflow.soap;
012:
013: import com.opensymphony.module.propertyset.PropertySet;
014:
015: import com.opensymphony.workflow.*;
016: import com.opensymphony.workflow.config.Configuration;
017: import com.opensymphony.workflow.loader.WorkflowDescriptor;
018: import com.opensymphony.workflow.ofbiz.OfbizWorkflow;
019: import com.opensymphony.workflow.query.WorkflowExpressionQuery;
020: import com.opensymphony.workflow.query.WorkflowQuery;
021:
022: import electric.util.Context;
023:
024: import java.util.List;
025: import java.util.Map;
026:
027: import javax.servlet.http.HttpServletRequest;
028:
029: /**
030: * DOCUMENT ME!
031: */
032: public class OfbizSOAPWorkflow implements Workflow {
033: //~ Methods ////////////////////////////////////////////////////////////////
034:
035: public int[] getAvailableActions(long id) {
036: return new OfbizWorkflow(getRemoteUser())
037: .getAvailableActions(id);
038: }
039:
040: public int[] getAvailableActions(long id, Map inputs) {
041: return new OfbizWorkflow(getRemoteUser()).getAvailableActions(
042: id, inputs);
043: }
044:
045: public void setConfiguration(Configuration configuration) {
046: new OfbizWorkflow(getRemoteUser())
047: .setConfiguration(configuration);
048: }
049:
050: public List getCurrentSteps(long id) {
051: return new OfbizWorkflow(getRemoteUser()).getCurrentSteps(id);
052: }
053:
054: public int getEntryState(long id) {
055: return new OfbizWorkflow(getRemoteUser()).getEntryState(id);
056: }
057:
058: public List getHistorySteps(long id) {
059: return new OfbizWorkflow(getRemoteUser()).getHistorySteps(id);
060: }
061:
062: public PropertySet getPropertySet(long id) {
063: return new OfbizWorkflow(getRemoteUser()).getPropertySet(id);
064: }
065:
066: public List getSecurityPermissions(long id) {
067: return new OfbizWorkflow(getRemoteUser())
068: .getSecurityPermissions(id, null);
069: }
070:
071: public List getSecurityPermissions(long id, Map inputs) {
072: return new OfbizWorkflow(getRemoteUser())
073: .getSecurityPermissions(id, inputs);
074: }
075:
076: public WorkflowDescriptor getWorkflowDescriptor(String workflowName) {
077: return new OfbizWorkflow(getRemoteUser())
078: .getWorkflowDescriptor(workflowName);
079: }
080:
081: public String getWorkflowName(long id) {
082: return new OfbizWorkflow(getRemoteUser()).getWorkflowName(id);
083: }
084:
085: public String[] getWorkflowNames() {
086: return new OfbizWorkflow(getRemoteUser()).getWorkflowNames();
087: }
088:
089: public boolean canInitialize(String workflowName, int initialState) {
090: return new OfbizWorkflow(getRemoteUser()).canInitialize(
091: workflowName, initialState);
092: }
093:
094: public boolean canInitialize(String workflowName,
095: int initialAction, Map inputs) {
096: return new OfbizWorkflow(getRemoteUser()).canInitialize(
097: workflowName, initialAction, inputs);
098: }
099:
100: public boolean canModifyEntryState(long id, int newState) {
101: return new OfbizWorkflow(getRemoteUser()).canModifyEntryState(
102: id, newState);
103: }
104:
105: public void changeEntryState(long id, int newState)
106: throws WorkflowException {
107: new OfbizWorkflow(getRemoteUser()).changeEntryState(id,
108: newState);
109: }
110:
111: public void doAction(long id, int actionId, Map inputs)
112: throws WorkflowException, StoreException {
113: new OfbizWorkflow(getRemoteUser()).doAction(id, actionId,
114: inputs);
115: }
116:
117: public void executeTriggerFunction(long id, int triggerId)
118: throws WorkflowException {
119: new OfbizWorkflow(getRemoteUser()).executeTriggerFunction(id,
120: triggerId);
121: }
122:
123: public long initialize(String workflowName, int initialState,
124: Map inputs) throws WorkflowException {
125: return new OfbizWorkflow(getRemoteUser()).initialize(
126: workflowName, initialState, inputs);
127: }
128:
129: public List query(WorkflowQuery query) throws StoreException,
130: FactoryException {
131: return new OfbizWorkflow(getRemoteUser()).query(query);
132: }
133:
134: public List query(WorkflowExpressionQuery query)
135: throws WorkflowException {
136: return new OfbizWorkflow(getRemoteUser()).query(query);
137: }
138:
139: public boolean removeWorkflowDescriptor(String workflowName)
140: throws FactoryException {
141: return new OfbizWorkflow(getRemoteUser())
142: .removeWorkflowDescriptor(workflowName);
143: }
144:
145: public boolean saveWorkflowDescriptor(String workflowName,
146: WorkflowDescriptor descriptor, boolean replace)
147: throws FactoryException {
148: return new OfbizWorkflow(getRemoteUser())
149: .saveWorkflowDescriptor(workflowName, descriptor,
150: replace);
151: }
152:
153: protected String getRemoteUser() {
154: HttpServletRequest request = (HttpServletRequest) Context
155: .thread().getProperty("httpRequest");
156:
157: return request.getRemoteUser();
158: }
159: }
|