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