01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19: package org.netbeans.modules.jdbcwizard.builder.wsdl;
20:
21: import java.io.File;
22:
23: import org.netbeans.modules.jdbcwizard.builder.dbmodel.DBTable;
24: import org.netbeans.modules.jdbcwizard.builder.dbmodel.DBConnectionDefinition;
25:
26: public class GenerateWSDL {
27: private String mSrcDirectoryLocation;
28: private String mBuildDirectoryLocation;
29: private String mWSDLFileName;
30: private DBTable mTable;
31: private String mDBType;
32: private String mJNDIName;
33: private DBConnectionDefinition dbinfo;
34:
35: public GenerateWSDL() {
36: }
37:
38: public String getSrcDirectoryLocation() {
39: return this .mSrcDirectoryLocation;
40: }
41:
42: public void setSrcDirectoryLocation(
43: final String srcDirectoryLocation) {
44: this .mSrcDirectoryLocation = srcDirectoryLocation;
45: }
46:
47: public String getBuildDirectoryLocation() {
48: return this .mBuildDirectoryLocation;
49: }
50:
51: public void setBuildDirectoryLocation(
52: final String buildDirectoryLocation) {
53: this .mBuildDirectoryLocation = buildDirectoryLocation;
54: }
55:
56: public String getWSDLFileName() {
57: return this .mWSDLFileName;
58: }
59:
60: public void setWSDLFileName(final String wsdlFileName) {
61: this .mWSDLFileName = wsdlFileName;
62: }
63:
64: public void setDBTable(final DBTable table) {
65: this .mTable = table;
66: }
67:
68: public void setDBType(final String dbtype) {
69: this .mDBType = dbtype;
70: }
71:
72: public void setSchemaName(final String schemaName) {
73: }
74:
75: public void setJNDIName(final String jndiName) {
76: this .mJNDIName = jndiName;
77: }
78:
79: public void setDBInfo(DBConnectionDefinition dbinfo) {
80: this .dbinfo = dbinfo;
81: }
82:
83: public void execute() {
84: final File srcDir = new File(this .mSrcDirectoryLocation);
85: if (!srcDir.exists()) {
86: throw new IllegalArgumentException("Directory "
87: + this .mSrcDirectoryLocation + " does not exist.");
88: }
89: final String srcDirPath = srcDir.getAbsolutePath();
90: final WSDLGenerator wsdlgen = new WSDLGenerator(this.mTable,
91: this.mWSDLFileName, srcDirPath, this.mDBType,
92: this.mJNDIName);
93: wsdlgen.setTopEleName();
94: wsdlgen.setXSDName();
95: wsdlgen.setDBInfo(this.dbinfo);
96: wsdlgen.generateWSDL();
97: }
98: }
|