Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUSETOOLS-2564 - WSDL 2 Camel Rest DSL Wizard #1138

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
6ef2349
Initial stab at wrapping wsdl2rest code
bfitzpat Oct 4, 2017
d9d95c7
Initial Wizard contribution
bfitzpat Oct 9, 2017
04418a4
Next round of updates.
bfitzpat Oct 11, 2017
fdcb728
Can successfully run the wsdl2rest code from the wizard and tests now
bfitzpat Oct 18, 2017
0d4aaf6
Added ability to provide more detail via the wizard page
bfitzpat Oct 24, 2017
a6148b6
A few more updates
bfitzpat Oct 31, 2017
2e5788c
Refactoring one-page into two-page wizard with validation
bfitzpat Dec 7, 2017
60e5d1f
Cleanup and externalization of strings
bfitzpat Dec 8, 2017
ba40549
Correcting i10n issues
bfitzpat Dec 8, 2017
29ea262
Updates to make Eclipse paths work with java.io paths and utility
bfitzpat Dec 8, 2017
b785ad0
Adding auto-config of paths based on project selection
bfitzpat Dec 8, 2017
68689a8
Code cleanup and documentation pass.
bfitzpat Dec 8, 2017
88c9082
Adjustments based on suggestions from @apupier
bfitzpat Dec 11, 2017
dc74996
Pulling in the wsdl2rest code from maven instead of duplicating code
bfitzpat Dec 11, 2017
9423721
More cleanup of names and versions
bfitzpat Dec 12, 2017
8cca03c
Beginning of support for reading service address from wsdl
bfitzpat Dec 12, 2017
1745642
Added code to grab the target address URL from the selected WSDL
bfitzpat Dec 13, 2017
d8a7c21
Adding wizard icon (using camel project one for now)
bfitzpat Dec 14, 2017
b8c79a4
Implementing suggestions from Aurelien
bfitzpat Mar 13, 2018
0eae78e
Initial stab at wrapping wsdl2rest code
bfitzpat Oct 4, 2017
9c9862c
Initial Wizard contribution
bfitzpat Oct 9, 2017
7b3f7f6
Next round of updates.
bfitzpat Oct 11, 2017
cf53e1f
Can successfully run the wsdl2rest code from the wizard and tests now
bfitzpat Oct 18, 2017
1bb0f5f
Added ability to provide more detail via the wizard page
bfitzpat Oct 24, 2017
8c3f049
A few more updates
bfitzpat Oct 31, 2017
3c762b4
Refactoring one-page into two-page wizard with validation
bfitzpat Dec 7, 2017
4e8035f
Cleanup and externalization of strings
bfitzpat Dec 8, 2017
6c8a3b6
Correcting i10n issues
bfitzpat Dec 8, 2017
46cd6bd
Updates to make Eclipse paths work with java.io paths and utility
bfitzpat Dec 8, 2017
3cd39eb
Adding auto-config of paths based on project selection
bfitzpat Dec 8, 2017
cda9e97
Code cleanup and documentation pass.
bfitzpat Dec 8, 2017
b358051
Adjustments based on suggestions from @apupier
bfitzpat Dec 11, 2017
d898359
Pulling in the wsdl2rest code from maven instead of duplicating code
bfitzpat Dec 11, 2017
3f9a5f8
More cleanup of names and versions
bfitzpat Dec 12, 2017
eb58730
Beginning of support for reading service address from wsdl
bfitzpat Dec 12, 2017
ce887da
Added code to grab the target address URL from the selected WSDL
bfitzpat Dec 13, 2017
bd371da
Adding wizard icon (using camel project one for now)
bfitzpat Dec 14, 2017
4e0e0d0
Implementing suggestions from Aurelien
bfitzpat Mar 13, 2018
c171469
Merge branch 'FUSETOOLS-2564' of https://github.com/bfitzpat/fuseide …
bfitzpat Mar 22, 2018
50e8cc6
Updates for latest wsdl2rest changes upstream
bfitzpat Mar 23, 2018
617c740
Adds required Rest library to dependencies and refreshes project
bfitzpat Mar 23, 2018
a42e7c9
Updates to readme, new externalized string, and copyright dates
bfitzpat Mar 23, 2018
abb29df
Creates the java path for source if it doesn't exist
bfitzpat Apr 5, 2018
3e67df9
Updates for blueprint support and absolute paths
bfitzpat Apr 10, 2018
cb5ac64
Addition of gitignore
bfitzpat Apr 10, 2018
b0eaa3d
Merge remote-tracking branch 'refs/remotes/jbosstools/master' into FU…
bfitzpat Apr 10, 2018
7bb3578
Addressing first wave of feedback from Aurelien
bfitzpat Apr 10, 2018
9c30dc4
FUSETOOLS-2564 - adding integration test and adding a couple of fixes
bfitzpat Apr 16, 2018
4be9f79
FUSETOOLS-2564 - updating wsdl2rest version and dealing with ripples
bfitzpat Apr 17, 2018
06d5a14
Merge branch 'master' of https://github.com/jbosstools/jbosstools-fus…
bfitzpat Apr 18, 2018
94d1b39
FUSETOOLS-2564 - update versions and remove sysouts
bfitzpat Apr 18, 2018
410a00a
FUSETOOLS-2564 - Integration test must suffixed by IT
apupier Apr 19, 2018
9040f25
FUSETOOLS-2564 - fix name of Maven module
apupier Apr 19, 2018
fe77aaa
FUSETOOLS-2564 - fix integration wsdl 2 rest test plugin build and
apupier Apr 19, 2018
3dda50f
FUSETOOLS-2564 - add all promoted staging repo
apupier Apr 19, 2018
0d19756
FUSETOOLS-2564 - fixing errant variable that wasn't used
bfitzpat Apr 19, 2018
a4ed3a6
FUSETOOLS-2564 - code cleaning during investigation
apupier Apr 19, 2018
c4ebc7e
FUSETOOLS-2564 - export the commonsvalidator package used in wsdl ui
apupier Apr 19, 2018
1f8b9c6
FUSETOOLS-2564 - remove unused import
apupier Apr 19, 2018
002b7a3
FUSETOOLS-2564 - fix class not found exception when clicking finish
apupier Apr 19, 2018
cf4fcc0
FUSETOOLS-2564 - Remove unused properties from pom.xml
apupier Apr 20, 2018
a0ba97d
FUSETOOLS-2564 - remove wrongly committed .project
apupier Apr 20, 2018
c4771cf
FUSETOOLS-2564 - Fix when updating the destination project
apupier Apr 20, 2018
88287b6
FUSETOOLS-2564 - Improve reporting of error
apupier Apr 20, 2018
d4ebbdd
FUSETOOLS-2564 - remove empty src folder
apupier Apr 20, 2018
ac0d714
FUSETOOLS-2564 - remove no more embedded in this plugin the
apupier Apr 20, 2018
a04050c
FUSETOOLS-2564 - use @SuppressWarning(unchecked) for EMF Databinding
apupier Apr 20, 2018
8a6f177
Merge branch 'master' of https://github.com/jbosstools/jbosstools-fus…
bfitzpat Apr 20, 2018
f831a6d
FUSETOOLS-2564 - suggested updates
bfitzpat Apr 20, 2018
f2d6313
FUSETOOLS-2564 - excluding wsdl2rest plug-in wrapper from src
bfitzpat Apr 20, 2018
09312e1
FUSETOOLS-2564 - fixing sonar issues
bfitzpat Apr 20, 2018
7f982eb
FUSETOOLS-2564 - use FileDialog to allow selection of wsdl through whole
apupier Apr 23, 2018
bd1c0e5
FUSETOOLS-2564 - avoid specific method for testing
apupier Apr 23, 2018
fdb14a6
FUSETOOLS-2564 - modify name of wsdl 2 rest wizard
apupier Apr 23, 2018
d96fe0d
FUSETOOLS-2564 - remove no more used code relative to Java wsdl class
apupier Apr 23, 2018
10486e5
FUSETOOLS-2564 - avoid vertical space on Text control
apupier Apr 23, 2018
6fc6c3f
FUSETOOLS-2564 - fixing path validation and creating camel path
bfitzpat Apr 23, 2018
22e32b4
FUSETOOLS-2564 - fixing camel path problem and refactoring test
bfitzpat Apr 24, 2018
5fdc183
FUSETOOLS-2564 - a few improvements and new tests
bfitzpat Apr 26, 2018
82bcf72
Merge branch 'master' of https://github.com/jbosstools/jbosstools-fus…
bfitzpat Apr 26, 2018
b1f7ea3
FUSETOOLS-2950 - better warnings for users when possibly overwriting
bfitzpat Apr 27, 2018
d7caeff
FUSETOOLS-2564 - fixed FuseProject
bfitzpat Apr 30, 2018
857dd2c
Merge branch 'master' of https://github.com/jbosstools/jbosstools-fus…
bfitzpat Apr 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 Red Hat, Inc.
* Copyright (c) 2018 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
Expand Down Expand Up @@ -73,19 +73,75 @@ public class FuseProject extends ExternalResource {
+ " </dependencies>\n"
+ "</project>";

private static final String DUMMY_BLUEPRINT_POM_CONTENT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<project xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
+ " <modelVersion>4.0.0</modelVersion>\n"
+ " <groupId>com.mycompany</groupId>\n"
+ " <artifactId>testproject.blueprint</artifactId>\n"
+ " <version>1.0.0-SNAPSHOT</version>\n"
+ " <packaging>bundle</packaging>\n"
+ " <name>Some Dummy Blueprint Project</name>\n"
+ " <properties>\n"
+ " <camel.version>%s</camel.version>\n"
+ " </properties>\n"
+ " <build>\n"
+ " <defaultGoal>install</defaultGoal>\n"
+ " <plugins>\n"
+ " <plugin>\n"
+ " <artifactId>maven-compiler-plugin</artifactId>\n"
+ " <version>3.5.1</version>\n"
+ " <configuration>\n"
+ " <source>1.7</source>\n"
+ " <target>1.7</target>\n"
+ " </configuration>\n"
+ " </plugin>\n"
+ " <plugin>\n"
+ " <artifactId>maven-resources-plugin</artifactId>\n"
+ " <version>2.6</version>\n"
+ " <configuration>\n"
+ " <encoding>UTF-8</encoding>\n"
+ " </configuration>\n"
+ " </plugin>\n"
+ " </plugins>\n"
+ " </build>\n"
+ " <dependencies>\n"
+ " <dependency>\n"
+ " <groupId>org.apache.camel</groupId>\n"
+ " <artifactId>camel-core</artifactId>\n"
+ " <version>${camel.version}</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>org.apache.camel</groupId>\n"
+ " <artifactId>camel-blueprint</artifactId>\n"
+ " <version>${camel.version}</version>\n"
+ " </dependency>\n"
+ " </dependencies>\n"
+ "</project>";

private IProject project = null;
private String projectName;
private String camelVersion;
private boolean isBlueprint = false;

public FuseProject(String projectName) {
this(projectName, CamelCatalogUtils.getLatestCamelVersion());
}

public FuseProject(String projectName, boolean isBlueprint) {
this(projectName, CamelCatalogUtils.getLatestCamelVersion(), isBlueprint);
}

public FuseProject(String projectName, String camelVersion) {
this.projectName = projectName;
this.camelVersion = camelVersion;
}

public FuseProject(String projectName, String camelVersion, boolean isBlueprint) {
this(projectName, camelVersion);
this.isBlueprint = isBlueprint;
}

@Override
public void before() throws Throwable {
super.before();
Expand All @@ -99,7 +155,11 @@ public void before() throws Throwable {
}
// Create a fake pom.xml
IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME);
pom.create(new ByteArrayInputStream(String.format(DUMMY_POM_CONTENT, this.camelVersion).getBytes(StandardCharsets.UTF_8)), true, new NullProgressMonitor());
String pomContent = DUMMY_POM_CONTENT;
if (isBlueprint) {
pomContent = DUMMY_BLUEPRINT_POM_CONTENT;
}
pom.create(new ByteArrayInputStream(String.format(pomContent, this.camelVersion).getBytes(StandardCharsets.UTF_8)), true, new NullProgressMonitor());
IFolder srcFolder = project.getFolder("src");
srcFolder.create(IResource.FORCE, true, new NullProgressMonitor());
IFolder srcMainFolder = srcFolder.getFolder("main");
Expand Down Expand Up @@ -132,6 +192,11 @@ public CamelFile createEmptyCamelFile(IFile file) throws CoreException, IOExcept
return createFileFromTemplate(file, "/empty-CamelFile.xml");
}

public CamelFile createEmptyBlueprintCamelFile() throws CoreException, IOException {
IFile file = project.getFile("blueprint.xml");
return createFileFromTemplate(file, "/empty-BlueprintCamelFile.xml");
}

public CamelFile createEmptyBlueprintCamelFile(IFile file) throws CoreException, IOException {
return createFileFromTemplate(file, "/empty-BlueprintCamelFile.xml");
}
Expand Down
Expand Up @@ -4,9 +4,9 @@
label="%featureName"
version="11.0.0.qualifier"
provider-name="%providerName"
plugin="org.fusesource.ide.tooling"
license-feature="org.jboss.tools.foundation.license.feature"
license-feature-version="0.0.0"
plugin="org.fusesource.ide.tooling">
license-feature-version="0.0.0">

<description url="http://tools.jboss.org/features/apachecamel.html">
%description
Expand All @@ -19,10 +19,9 @@
<license url="%licenseURL">
%license
</license>

<requires>
<import feature="org.fusesource.ide.core.feature" version="10.0.0" match="greaterOrEqual"/>

<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.resources" version="3.9.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
Expand Down Expand Up @@ -143,4 +142,18 @@
version="0.0.0"
unpack="false"/>

<plugin
id="org.fusesource.ide.wsdl2rest"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="org.fusesource.ide.wsdl2rest.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
11 changes: 11 additions & 0 deletions editor/plugins/org.fusesource.ide.wsdl2rest.ui/.classpath
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions editor/plugins/org.fusesource.ide.wsdl2rest.ui/.gitignore
@@ -0,0 +1 @@
lib/
34 changes: 34 additions & 0 deletions editor/plugins/org.fusesource.ide.wsdl2rest.ui/.project
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.fusesource.ide.wsdl2rest.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,33 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Fuse wsdl2rest UI Plugin
Bundle-SymbolicName: org.fusesource.ide.wsdl2rest.ui;singleton:=true
Bundle-Version: 11.0.0.qualifier
Bundle-Activator: org.fusesource.ide.wsdl2rest.ui.internal.Wsdl2RestUIActivator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.ui.workbench,
org.eclipse.m2e.maven.runtime,
org.eclipse.ui.ide,
org.eclipse.core.databinding,
org.jboss.tools.foundation.core,
org.jboss.tools.foundation.ui,
org.fusesource.ide.foundation.core;visibility:=reexport,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to always avoid to "reexport", if another plugin needs the dependencies, it should declare the dependencies in its MANIFEST too

org.eclipse.core.databinding.observable,
org.eclipse.jface.databinding,
org.eclipse.core.databinding.property,
org.eclipse.core.databinding.beans,
org.eclipse.core.filesystem,
org.apache.commons.httpclient,
org.fusesource.ide.camel.model.service.core,
org.fusesource.ide.camel.editor,
org.eclipse.m2e.core,
org.fusesource.ide.wsdl2rest
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package:
org.fusesource.ide.wsdl2rest.ui.internal,
org.fusesource.ide.wsdl2rest.ui.wizard,
org.fusesource.ide.wsdl2rest.ui.wizard.pages
@@ -0,0 +1,4 @@
source.. = src/
bin.includes = META-INF/,\
.,\
plugin.xml
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions name = "HelloService"
targetNamespace = "http://www.examples.com/wsdl/HelloService.wsdl"
xmlns = "http://schemas.xmlsoap.org/wsdl/"
xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns = "http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd = "http://www.w3.org/2001/XMLSchema">

<message name = "SayHelloRequest">
<part name = "firstName" type = "xsd:string"/>
</message>

<message name = "SayHelloResponse">
<part name = "greeting" type = "xsd:string"/>
</message>

<portType name = "Hello_PortType">
<operation name = "sayHello">
<input message = "tns:SayHelloRequest"/>
<output message = "tns:SayHelloResponse"/>
</operation>
</portType>

<binding name = "Hello_Binding" type = "tns:Hello_PortType">
<soap:binding style = "document"
transport = "http://schemas.xmlsoap.org/soap/http"/>
<operation name = "sayHello">
<soap:operation soapAction = "sayHello"/>
<input>
<soap:body
encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
namespace = "urn:examples:helloservice"
use = "encoded"/>
</input>

<output>
<soap:body
encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
namespace = "urn:examples:helloservice"
use = "encoded"/>
</output>
</operation>
</binding>

<service name = "Hello_Service">
<documentation>WSDL File for HelloService</documentation>
<port binding = "tns:Hello_Binding" name = "Hello_Port">
<soap:address
location = "http://www.examples.com/SayHello/" />
</port>
</service>
</definitions>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions editor/plugins/org.fusesource.ide.wsdl2rest.ui/plugin.xml
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.newWizards">
<wizard
category="org.fusesource.ide.newwizards"
class="org.fusesource.ide.wsdl2rest.ui.wizard.Wsdl2RestWizard"
icon="icons/camel_project_16x16.png"
hasPages="true"
id="org.fusesource.ide.wsdl2rest.wizard"
name="Camel Rest DSL from WSDL">
</wizard>
</extension>

</plugin>
15 changes: 15 additions & 0 deletions editor/plugins/org.fusesource.ide.wsdl2rest.ui/pom.xml
@@ -0,0 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.fusesource.ide.editor</groupId>
<artifactId>plugins</artifactId>
<version>11.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>org.fusesource.ide.wsdl2rest.ui</artifactId>
<packaging>eclipse-plugin</packaging>
<name>Red Hat Fuse Tooling :: Camel Editor :: Plugins :: Wsdl2Rest UI</name>

</project>
16 changes: 16 additions & 0 deletions editor/plugins/org.fusesource.ide.wsdl2rest.ui/readme.md
@@ -0,0 +1,16 @@
# Wsdl2Rest Wizard Code
This plug-in provides a wizard wrapper for the Wsdl2Rest code found here: [https://github.com/jboss-fuse/wsdl2rest](https://github.com/jboss-fuse/wsdl2rest)

## Running the wizard
In the project you will find an "example" directory that includes several files - a couple of classes and a wsdl file.

1. Create a new Fuse Integration project. Leave it as a Blank project (Spring or Blueprint DSL).
2. Create a new src/main/resources/wsdl directory.
3. Copy the HelloService.wsdl file into the src/main/resources/wsdl directory.
4. Select the project, click New->Other, and select the Red Hat Fuse->Camel Rest DSL from WSDL.
5. On the "Select Incoming WSDL and Project for Generated Output" page, click the "..." button beside the WSDL File field and select HelloService.wsdl.
6. Click Next.
8. Click Finish. The Camel file and associated Java classes will be generated and the project will refresh.

Once the wizard finishes, you should see a new Camel Context file in the appropriate src/main/resources directory, as well as the generated code, which will appear in the /src/main/java folder.