Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
issue #30 - updating so generated readme is found and copied successf…
Browse files Browse the repository at this point in the history
…ully

Signed-off-by: Brian Fitzpatrick <bfitzpat@redhat.com>
  • Loading branch information
bfitzpat committed Feb 26, 2019
1 parent 02a3491 commit cb7d815
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ node_modules
*.vsix
wsdl2rest/target/
*.log

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to the "vscode-wsdl2rest" extension will be documented in this file.

## 0.0.4
- addressed issue https://github.com/camel-tooling/vscode-wsdl2rest/issues/30

## 0.0.3
- Initial release
- Support creation of Camel Rest DSL artifacts from local WSDL file
Expand Down
43 changes: 31 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###
# #%L
# Fuse Patch :: Distro :: Standalone
# %%
# Copyright (C) 2015 Private
# %%
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# #L%
###

# Root logger option
log4j.rootLogger=DEBUG, file, console

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.file=wsdl2rest.log
log4j.appender.file.append=true
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c] (%t) - %m%n
log4j.appender.file.threshold=DEBUG

# Direct log messages to console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%m%n
log4j.appender.console.threshold=INFO
60 changes: 60 additions & 0 deletions resources/wsdl2rest.readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Next steps for your wsdl2rest artifacts

Now that you've generated your Camel Rest DSL configuration and all the CXF classes
to wrap your SOAP-based service to make it accessible in a RESTful way, you may have
some additional steps before you can make it run.

If you generated artifacts in a Maven-based Camel or Fuse project, you may have to update
the pom file with a few additional dependencies as follows.

## Spring- and Spring Boot-based projects

```xml
<!-- wsdl2rest dependencies -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<version>1.0.0.Final-redhat-1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>${camel.version}</version>
</dependency>
```

## Blueprint-based projects

```xml
<!-- wsdl2rest dependencies -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<version>1.0.0.Final-redhat-1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-servlet</artifactId>
<version>${camel.version}</version>
</dependency>
```
6 changes: 5 additions & 1 deletion scripts/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ let filename = 'wsdl2rest-fatjar-' + wsdl2rest_version + '.jar';
let configFileName = "logging.properties";
let src = path.join('./wsdl2rest/target/', filename);
let configSrc = path.join('./wsdl2rest/config/', configFileName);
let readmeFileName = "wsdl2rest.readme.md";
let readmeSrc = path.join('./src/', readmeFileName);
let destDir = path.join('./', 'jars');
let destResourcesDir = path.join('./', 'resources');

fs.access(destDir, err => {
if (err) {
fs.mkdirSync(destDir);
}
copyFile(src, path.join(destDir, "wsdl2rest.jar"));
copyFile(configSrc, path.join(destDir, "log4j.properties"));
copyFile(configSrc, path.join(destResourcesDir, "log4j.properties"));
copyFile(readmeSrc,path. join(destResourcesDir, readmeFileName));
});

function copyFile(src, dest) {
Expand Down
6 changes: 4 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ let outputChannel: vscode.OutputChannel;
let wsdl2restProcess: child_process.ChildProcess;
let javaExecutablePath: string;
let wsdl2restExecutablePath: string;
let resourcesPath: string;
let wsdlFileUri: string;
let outputDirectory: string;
let dsl: string;
Expand All @@ -39,7 +40,7 @@ let readmePath: string;
export function activate(context: vscode.ExtensionContext) {

wsdl2restExecutablePath = context.asAbsolutePath(path.join('./', 'jars/','wsdl2rest.jar'));
readmePath = context.asAbsolutePath(path.join('./', 'src/','wsdl2rest.readme.md'));
resourcesPath = context.asAbsolutePath(path.join('./', 'resources/'));
outputChannel = vscode.window.createOutputChannel("WSDL2Rest");
context.subscriptions.push(vscode.commands.registerCommand('extension.wsdl2rest.local', () => callWsdl2RestViaUIAsync(false)));
context.subscriptions.push(vscode.commands.registerCommand('extension.wsdl2rest.url', () => callWsdl2RestViaUIAsync(true)));
Expand Down Expand Up @@ -228,7 +229,7 @@ function callWsdl2Rest(wsdl2restExecutablePath: string): Promise<boolean> {

requirements.resolveRequirements()
.then(requirements => {
let originalLog4JProps = wsdl2restExecutablePath.substring(0, wsdl2restExecutablePath.lastIndexOf(path.sep)+1) + "log4j.properties";
let originalLog4JProps = resourcesPath.substring(0, resourcesPath.lastIndexOf(path.sep)+1) + "log4j.properties";
let newLogsFolder = storagePath + path.sep + 'config';
let newLog4JProps = newLogsFolder + path.sep + 'logging.properties';
fs.copySync(path.resolve(originalLog4JProps), newLog4JProps);
Expand All @@ -238,6 +239,7 @@ function callWsdl2Rest(wsdl2restExecutablePath: string): Promise<boolean> {
utils.printDebug("Log4J Config: " + log4jConfigPath);
javaExecutablePath = path.resolve(requirements.java_home + '/bin/java');

let readmePath = resourcesPath.substring(0, resourcesPath.lastIndexOf(path.sep)+1) + 'wsdl2rest.readme.md';
fs.copySync(path.resolve(readmePath), newReadmePath);
utils.printDebug("New readme: " + newReadmePath);

Expand Down

0 comments on commit cb7d815

Please sign in to comment.