01: package com.opensymphony.workflow.designer;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: /**
07: * @author acapitani
08: */
09: public class DesignerService {
10: protected String verb;
11: protected String address;
12: protected String workspace;
13: protected Map workflows = new HashMap();
14:
15: private static final int MAX_WORKFLOWS = 30;
16:
17: public DesignerService() {
18: verb = System.getProperty("com.opensymphony.workflow.jws.verb");
19: if ("new".equals(verb)) {
20: address = System
21: .getProperty("com.opensymphony.workflow.jws.service");
22: workspace = System
23: .getProperty("com.opensymphony.workflow.jws.workspace");
24: if (address == null) {
25: // not a valid web service name!
26: verb = null;
27: }
28: } else if ("modify".equals(verb)) {
29: address = System
30: .getProperty("com.opensymphony.workflow.jws.service");
31: workspace = System
32: .getProperty("com.opensymphony.workflow.jws.workspace");
33: if (address != null) {
34: for (int i = 1; i <= MAX_WORKFLOWS; i++) {
35: String sId = System
36: .getProperty("com.opensymphony.workflow.jws.id_"
37: + i);
38: if ((sId == null) || (sId.length() == 0))
39: break;
40: String sName = System
41: .getProperty("com.opensymphony.workflow.jws.name_"
42: + i);
43: if (sName == null)
44: break;
45: workflows.put(sId, sName);
46: }
47: } else {
48: // not a valid web service
49: verb = null;
50: }
51: }
52: }
53:
54: public String getVerb() {
55: return verb;
56: }
57:
58: public String getRemoteAddress() {
59: return address;
60: }
61:
62: public String getWorkspaceName() {
63: return workspace;
64: }
65:
66: public Map getWorkflows() {
67: return workflows;
68: }
69:
70: }
|