Source Code Cross Referenced for NewWSDLWizard.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » ui » componentflow » componentFlowEditor » diagram » wizards » httpExtra » 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 » ESB » cbesb 1.2 » com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.httpExtra 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * 
003:         */package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.httpExtra;
004:
005:        import java.io.File;
006:        import java.io.IOException;
007:        import java.net.URL;
008:        import java.util.ArrayList;
009:        import java.util.List;
010:
011:        import javax.wsdl.WSDLException;
012:
013:        import org.apache.xmlbeans.XmlException;
014:        import org.eclipse.core.resources.IResource;
015:        import org.eclipse.jface.wizard.Wizard;
016:
017:        import com.bostechcorp.cbesb.common.util.project.ProjectUtil;
018:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.httpExtra.io.CustomWSDLReader;
019:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.httpExtra.io.CustomWSDLWriter;
020:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.httpExtra.io.WSDLFileGenerator;
021:        import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.wizards.httpExtra.models.SchematicWSDLmodel;
022:
023:        /**
024:         * @author LPS
025:         *
026:         */
027:        public class NewWSDLWizard extends Wizard {
028:
029:            private SchematicWSDLmodel model = new SchematicWSDLmodel();
030:            private String suNAme = "";
031:            private String pathToProject = "";
032:            final public static String fileName = ".customWsdl";
033:            private List<String> freshImports = new ArrayList<String>();
034:            //pages
035:            private SchemaImportPage schemaImportPage;
036:            private WSEditorPage wsEditorPage;
037:            private String hostAddress;
038:
039:            /**
040:             * @param suNAme
041:             * @param pathToProject
042:             * @throws IOException 
043:             * @throws XmlException 
044:             */
045:            public NewWSDLWizard(String suNAme, String pathToProject,
046:                    String host) throws IOException, XmlException {
047:                super ();
048:                this .suNAme = suNAme;
049:                this .pathToProject = pathToProject;
050:                this .hostAddress = host;
051:
052:                loadModelFile(suNAme, pathToProject);
053:            }
054:
055:            private void loadModelFile(String suNAme2, String pathToProject2)
056:                    throws IOException, XmlException {
057:                //check if dir exist
058:                String dirName = pathToProject2 + File.separator + "src"
059:                        + File.separator + "wsdl" + File.separator + suNAme2;
060:                File dir = new File(dirName);
061:                File file = new File(dirName + File.separator + fileName);
062:                if (dir.exists() || dir.mkdirs())
063:                    ; //make dir path
064:                if (file.createNewFile()) {
065:                    //if file does not exist, create it
066:                    CustomWSDLWriter writer = new CustomWSDLWriter(file
067:                            .getAbsolutePath());
068:                    writer.writeModel(model);
069:                } else {
070:                    //load file
071:                    CustomWSDLReader reader = new CustomWSDLReader(file
072:                            .getAbsolutePath());
073:                    model = reader.readModel();
074:                }
075:            }
076:
077:            /* (non-Javadoc)
078:             * @see org.eclipse.jface.wizard.Wizard#performFinish()
079:             */
080:            @Override
081:            public boolean performFinish() {
082:                CustomWSDLWriter writer = new CustomWSDLWriter(
083:                        pathToConfigFile());
084:                try {
085:                    //write the model down
086:                    getModel().setWsName(getEditorPage().getText().getText());
087:                    writer.writeModel(getModel());
088:                    //generate the wsdl
089:                    WSDLFileGenerator wdlGenerator = new WSDLFileGenerator(
090:                            new File(pathToConfigFile()).getParent(), suNAme,
091:                            new URL(hostAddress), model);
092:                    wdlGenerator.buildDefinition();
093:                    wdlGenerator.writeToFile();
094:                    ProjectUtil.getCurProject().refreshLocal(
095:                            IResource.DEPTH_INFINITE, null);
096:
097:                } catch (IOException e) {
098:                    e.printStackTrace();
099:                    return false;
100:                } catch (XmlException e) {
101:                    e.printStackTrace();
102:                } catch (WSDLException e) {
103:                    e.printStackTrace();
104:                } catch (Exception e) {
105:                    e.printStackTrace();
106:                }
107:                return true;
108:            }
109:
110:            @Override
111:            public void addPages() {
112:                schemaImportPage = new SchemaImportPage("import");
113:                addPage(schemaImportPage);
114:                wsEditorPage = new WSEditorPage("editor");
115:                addPage(wsEditorPage);
116:                super .addPages();
117:            }
118:
119:            @Override
120:            public boolean performCancel() {
121:                //deleting imported files;
122:                for (String fname : freshImports) {
123:                    if (!new File(pathToConfigFile().replace(fileName, fname))
124:                            .delete()) {
125:                        System.out.println("File "
126:                                + pathToConfigFile().replace(fileName, fname)
127:                                + "Was not deleted.");
128:                    }
129:                }
130:                return super .performCancel();
131:            }
132:
133:            private String pathToConfigFile() {
134:                String file = "";
135:                if (pathToProject.endsWith(File.separator))
136:                    file += pathToProject + "src" + File.separator + "wsdl"
137:                            + File.separator + suNAme + File.separator
138:                            + fileName;
139:                else
140:                    file += pathToProject + File.separator + "src"
141:                            + File.separator + "wsdl" + File.separator + suNAme
142:                            + File.separator + fileName;
143:                return file;
144:            }
145:
146:            /**
147:             * @return the model
148:             */
149:            public SchematicWSDLmodel getModel() {
150:                return model;
151:            }
152:
153:            /**
154:             * @param model the model to set
155:             */
156:            public void setModel(SchematicWSDLmodel model) {
157:                this .model = model;
158:            }
159:
160:            /**
161:             * @return the pathToProject
162:             */
163:            public String getPathToProject() {
164:                return pathToProject;
165:            }
166:
167:            /**
168:             * @param pathToProject the pathToProject to set
169:             */
170:            public void setPathToProject(String pathToProject) {
171:                this .pathToProject = pathToProject;
172:            }
173:
174:            /**
175:             * @return the suNAme
176:             */
177:            public String getSuNAme() {
178:                return suNAme;
179:            }
180:
181:            /**
182:             * @param suNAme the suNAme to set
183:             */
184:            public void setSuNAme(String suNAme) {
185:                this .suNAme = suNAme;
186:            }
187:
188:            /**
189:             * @return the schemaImportPage
190:             */
191:            public SchemaImportPage getImportPage() {
192:                return schemaImportPage;
193:            }
194:
195:            /**
196:             * @return the wsEditorPage
197:             */
198:            public WSEditorPage getEditorPage() {
199:                return wsEditorPage;
200:            }
201:
202:            /**
203:             * @return the freshImports
204:             */
205:            public List<String> getFreshImports() {
206:                return freshImports;
207:            }
208:
209:            /**
210:             * @return the hostAddress
211:             */
212:            public String getHostAddress() {
213:                return hostAddress;
214:            }
215:
216:            /**
217:             * @param hostAddress the hostAddress to set
218:             */
219:            public void setHostAddress(String hostAddress) {
220:                this.hostAddress = hostAddress;
221:            }
222:
223:        }
w___w_w__.__j__a_v_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.