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: ParserComponent.java 7094 2007-04-26 07:40:09Z lzheng $
23: */
24: package com.bostechcorp.cbesb.common.sa.component;
25:
26: import java.util.List;
27:
28: import javax.wsdl.WSDLException;
29:
30: import com.bostechcorp.cbesb.common.i18n.Message;
31: import com.bostechcorp.cbesb.common.i18n.Messages;
32: import com.bostechcorp.cbesb.common.sa.service.EndPoint;
33: import com.bostechcorp.cbesb.common.sa.service.PropertiesKey;
34: import com.bostechcorp.cbesb.common.util.generators.wsdl.generators.AbstractWsdlGenaretor;
35: import com.bostechcorp.cbesb.common.util.generators.wsdl.generators.ParserWsdlGenerator;
36:
37: public class ParserComponent extends AbstractComponent {
38:
39: // private final String ns =
40: // "xmlns:parser='http://cbesb.bostechcorp.com/wsdl/parser/1.0'";
41:
42: public ParserComponent() {
43: super ();
44:
45: }
46:
47: public String getComponentName() {
48: return "ChainBuilderESB-SE-Parser";
49: }
50:
51: @Override
52: public void validateBase(List<String> list) {
53: super .validateBase(list);
54: for (int i = 0; i < getEndPointList().size(); i++) {
55: EndPoint endPoint = getEndPointList().get(i);
56: if (endPoint.getName() == null
57: || "".equals(endPoint.getName())) {
58: list.add(new Message(
59: Messages.FLOWEDITOR_MISSING_ENDPOINTNAME,
60: getName()).getMessage());
61: }
62: if (endPoint.getSettings().getProperty(
63: PropertiesKey.PARSER_WSDL_MESSAGEDEFINITION) == null
64: || ""
65: .equals(endPoint
66: .getSettings()
67: .getProperty(
68: PropertiesKey.PARSER_WSDL_MESSAGEDEFINITION))) {
69: list
70: .add(new Message(
71: Messages.PARSERCOMPONENT_MISSING_MESSAGEDEFINITION,
72: getName()).getMessage());
73: }
74: }
75: }
76:
77: @Override
78: protected AbstractWsdlGenaretor getWsdlGenerator(String path,
79: String saName, EndPoint ep) throws WSDLException {
80: return new ParserWsdlGenerator(path, saName, getName(), this
81: .getComponentType(), ep);
82: }
83:
84: }
|