Source Code Cross Referenced for JBossWSConsumeAction.java in  » Web-Services » soapui-1.7.5 » com » eviware » soapui » impl » wsdl » actions » iface » tools » jbossws » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » soapui 1.7.5 » com.eviware.soapui.impl.wsdl.actions.iface.tools.jbossws 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  soapUI, copyright (C) 2004-2007 eviware.com 
003:         *
004:         *  soapUI is free software; you can redistribute it and/or modify it under the 
005:         *  terms of version 2.1 of the GNU Lesser General Public License as published by 
006:         *  the Free Software Foundation.
007:         *
008:         *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
009:         *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
010:         *  See the GNU Lesser General Public License for more details at gnu.org.
011:         */
012:
013:        package com.eviware.soapui.impl.wsdl.actions.iface.tools.jbossws;
014:
015:        import java.io.File;
016:        import java.io.IOException;
017:
018:        import com.eviware.soapui.SoapUI;
019:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.AbstractToolsAction;
020:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.ArgumentBuilder;
021:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.ProcessToolRunner;
022:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.ToolHost;
023:        import com.eviware.soapui.impl.wsdl.support.HelpUrls;
024:        import com.eviware.soapui.model.iface.Interface;
025:        import com.eviware.soapui.settings.ToolsSettings;
026:        import com.eviware.soapui.support.Tools;
027:        import com.eviware.soapui.support.UISupport;
028:        import com.eviware.soapui.support.types.StringToStringMap;
029:        import com.eviware.x.form.XForm;
030:        import com.eviware.x.form.XFormDialog;
031:        import com.eviware.x.form.XFormDialogBuilder;
032:        import com.eviware.x.form.XFormFactory;
033:
034:        /**
035:         * Invokes JBossWS-specific JAX-WS WSImport
036:         * 
037:         * @author Ole.Matzura
038:         */
039:
040:        public class JBossWSConsumeAction extends
041:                AbstractToolsAction<Interface> {
042:            private static final String PACKAGE = "Package";
043:            private static final String OUTPUT = "Target Directory";
044:            private static final String SOURCE_OUTPUT = "Source Directory";
045:            private static final String WSDLLOCATION = "wsdlLocation";
046:            private static final String BINDING_FILES = "Binding files";
047:            private static final String KEEP = "Keep";
048:            private static final String CATALOG = "Catalog";
049:            private static final String STACKTRACE = "Stacktrace";
050:            public static final String SOAPUI_ACTION_ID = "JBossWSConsumeAction";
051:
052:            public JBossWSConsumeAction() {
053:                super ("JBossWS JAX-WS Artifacts",
054:                        "Generates JAX-WS artifacts using JBossWS wsconsume");
055:            }
056:
057:            protected XFormDialog buildDialog(Interface modelItem) {
058:                XFormDialogBuilder builder = XFormFactory
059:                        .createDialogBuilder("JBossWS JAX-WS Artifacts");
060:
061:                XForm mainForm = builder.createForm("Basic");
062:                addWSDLFields(mainForm, modelItem);
063:
064:                mainForm.addTextField(OUTPUT,
065:                        "target directory for generated files.",
066:                        XForm.FieldType.PROJECT_FOLDER);
067:                mainForm.addTextField(PACKAGE, "target package nam",
068:                        XForm.FieldType.JAVA_PACKAGE);
069:                mainForm.addTextField(SOURCE_OUTPUT,
070:                        "target directory for generated source files",
071:                        XForm.FieldType.PROJECT_FOLDER);
072:                mainForm.addTextField(CATALOG,
073:                        "catalog file to resolve external entity references",
074:                        XForm.FieldType.PROJECT_FILE);
075:                mainForm
076:                        .addTextField(
077:                                BINDING_FILES,
078:                                "comma-separated list of external JAX-WS or JAXB binding files",
079:                                XForm.FieldType.TEXT);
080:                mainForm
081:                        .addTextField(
082:                                WSDLLOCATION,
083:                                "@WebService.wsdlLocation and @WebServiceClient.wsdlLocation value",
084:                                XForm.FieldType.TEXT);
085:
086:                mainForm.addCheckBox(KEEP, "(keep generated files)");
087:                mainForm
088:                        .addCheckBox(STACKTRACE, "(show stacktrace for errors)");
089:
090:                buildArgsForm(builder, false, "WSImport");
091:
092:                return builder.buildDialog(buildDefaultActions(
093:                        HelpUrls.JBOSSWS_WSCONSUME_HELP_URL, modelItem),
094:                        "Specify arguments for JBossWS wsconsume",
095:                        UISupport.TOOL_ICON);
096:            }
097:
098:            protected void generate(StringToStringMap values,
099:                    ToolHost toolHost, Interface modelItem) throws Exception {
100:                String wsimportDir = SoapUI.getSettings().getString(
101:                        ToolsSettings.JBOSSWS_WSTOOLS_LOCATION, null);
102:                if (Tools.isEmpty(wsimportDir)) {
103:                    UISupport
104:                            .showErrorMessage("JBossWS wstools/wsconsume directory must be set in global preferences");
105:                    return;
106:                }
107:
108:                String wsimportExtension = UISupport.isWindows() ? ".bat"
109:                        : ".sh";
110:
111:                File wscompileFile = new File(wsimportDir + File.separatorChar
112:                        + "wsconsume" + wsimportExtension);
113:                if (!wscompileFile.exists()) {
114:                    UISupport
115:                            .showErrorMessage("Could not find wsconsume script at ["
116:                                    + wscompileFile + "]");
117:                    return;
118:                }
119:
120:                ProcessBuilder builder = new ProcessBuilder();
121:                ArgumentBuilder args = buildArgs(UISupport.isWindows(),
122:                        modelItem);
123:                builder.command(args.getArgs());
124:                builder.directory(new File(wsimportDir));
125:
126:                toolHost.run(new ProcessToolRunner(builder,
127:                        "JBossWS wsconsume", modelItem));
128:            }
129:
130:            private ArgumentBuilder buildArgs(boolean isWindows,
131:                    Interface modelItem) throws IOException {
132:                StringToStringMap values = dialog.getValues();
133:                values.put(OUTPUT, Tools.ensureDir(values.get(OUTPUT), ""));
134:                values.put(SOURCE_OUTPUT, Tools.ensureDir(values
135:                        .get(SOURCE_OUTPUT), values.get(OUTPUT)));
136:
137:                ArgumentBuilder builder = new ArgumentBuilder(values);
138:                builder.startScript("wsconsume");
139:
140:                builder.addString(OUTPUT, "-d");
141:                builder.addString(CATALOG, "-c");
142:                builder.addString(PACKAGE, "-p");
143:                builder.addString(SOURCE_OUTPUT, "-s");
144:                builder.addString(WSDLLOCATION, "-w");
145:                builder.addBoolean(KEEP, "-k");
146:                builder.addBoolean(STACKTRACE, "-t");
147:
148:                String[] bindingFiles = values.get(BINDING_FILES).split(",");
149:                for (String file : bindingFiles) {
150:                    if (file.trim().length() > 0)
151:                        builder.addArgs("-b", file.trim());
152:                }
153:
154:                addToolArgs(values, builder);
155:                builder.addArgs(getWsdlUrl(values, modelItem));
156:
157:                return builder;
158:            }
159:        }
w___w___w.__j___av__a_2_s__._c_o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.