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: TransformerComponent.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.TransformerWsdlGenerator;
36:
37: public class TransformerComponent extends AbstractComponent {
38: // private final String
39: // ns="xmlns:transformer='http://cbesb.bostechcorp.com/wsdl/transformer/1.0'";
40:
41: public TransformerComponent() {
42: super ();
43: }
44:
45: public String getComponentName() {
46: return "ChainBuilderESB-SE-Transformer";
47: }
48:
49: @Override
50: public void validateBase(List<String> list) {
51: super .validateBase(list);
52: for (int i = 0; i < getEndPointList().size(); i++) {
53: EndPoint endPoint = getEndPointList().get(i);
54: if (endPoint.getName() == null
55: || "".equals(endPoint.getName())) {
56: list.add(new Message(
57: Messages.FLOWEDITOR_MISSING_ENDPOINTNAME,
58: getName()).getMessage());
59: }
60: if (endPoint.getSettings().getProperty(
61: PropertiesKey.TRANSFORMER_WSDL_TRNFILE) == null
62: || "".equals(endPoint.getSettings().getProperty(
63: PropertiesKey.TRANSFORMER_WSDL_TRNFILE))) {
64: list.add(new Message(
65: Messages.TRANSFORMERCOMPONENT_MISSING_TRNFILE,
66: getName()).getMessage());
67: }
68: }
69: }
70:
71: @Override
72: protected AbstractWsdlGenaretor getWsdlGenerator(String path,
73: String saName, EndPoint ep) throws WSDLException {
74: return new TransformerWsdlGenerator(path, saName, getName(),
75: this.getComponentType(), ep);
76: }
77:
78: }
|