01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id:$
23: *
24: */
25: package com.bostechcorp.cbesb.common.util.generators;
26:
27: import java.util.Properties;
28: import org.jdom.Element;
29: import org.jdom.Namespace;
30:
31: /**
32: * @author LPS
33: *
34: */
35: public class SequencerComponentDOMWsdlXMLGenerator extends
36: AbstractComponentDOMWsdlXMLGenerator {
37:
38: /**
39: * @param s
40: */
41: protected final String ROLE = "role";
42: protected final String PROVIDER = "provider";
43: protected final String DefaultMEP = "defaultMep";
44: protected final String IN_OUT = "in-out";
45: protected Element config;
46:
47: public SequencerComponentDOMWsdlXMLGenerator(String s) {
48: super (s);
49:
50: }
51:
52: /* (non-Javadoc)
53: * @see com.bostechcorp.cbesb.common.sa.service.AbstractComponentDOMWsdlXMLGenerator#getFileOut()
54: */
55: @Override
56: protected String getFileOut() {
57: if (filePath.endsWith("/")) {
58: return filePath + fileName;
59: } else {
60: return filePath + "/" + fileName;
61: }
62: }
63:
64: /* (non-Javadoc)
65: * @see com.bostechcorp.cbesb.common.sa.service.AbstractComponentDOMWsdlXMLGenerator#setDefinitionNamespace(java.util.HashMap)
66: */
67: /*
68: public void setDefinitionNamespace(String namespace,
69: String tnsPrefix,
70: String prefix)
71: {
72: rootElement.setNamespace(Namespace.getNamespace(namespace));
73: rootElement.addNamespaceDeclaration(Namespace.getNamespace(definitions_Tns_NS, tnsPrefix));
74: rootElement.addNamespaceDeclaration(Namespace.getNamespace(definitions_Sequencer_NS, prefix));
75: }
76: */
77:
78: @Override
79: public void setComponentProperty(Properties properties,
80: String role, String componentType, String endPointName,
81: String saName, String componentName) {
82: fileName = componentType + "provider" + ".wsdl";
83: config = jdomFactory.element("config");
84: config.setNamespace(Namespace.getNamespace("sequencer",
85: "sequencer"));
86: config.setAttribute(jdomFactory.attribute(ROLE, PROVIDER));
87: config.setAttribute(jdomFactory.attribute(DefaultMEP, IN_OUT));
88: config.setAttribute(jdomFactory.attribute("serviceList",
89: "ServiceList.xml"));
90: // setting the operation in PortType
91: setOperation(saName + "_" + componentName, true);
92: //
93: // setTagAttributes(config,componentType+"."+PropertiesKey.ROLE_PROVIDER,componentProperties);
94: portElement.addContent(config);
95:
96: }
97:
98: }
|