Added pdf export support, export servlet support, renamed frontends
without s and made vasc config object.
This commit is contained in:
parent
efcbdbd519
commit
b3923bd2fb
160 changed files with 5001 additions and 2552 deletions
17
vasc-frontend/vasc-frontend-cxf/.project
Normal file
17
vasc-frontend/vasc-frontend-cxf/.project
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vasc-frontend-cxf</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
17
vasc-frontend/vasc-frontend-cxf/pom.xml
Normal file
17
vasc-frontend/vasc-frontend-cxf/pom.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<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>
|
||||
<artifactId>vasc-frontend</artifactId>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-frontend-cxf</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>vasc-frontend-cxf</name>
|
||||
<description>vasc-frontend-cxf</description>
|
||||
<modules>
|
||||
<module>vasc-frontend-cxf-client</module>
|
||||
<module>vasc-frontend-cxf-server</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vasc-frontend-cxf-client</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<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>
|
||||
<artifactId>vasc-frontend-cxf</artifactId>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-frontend-cxf-client</artifactId>
|
||||
<name>vasc-frontend-cxf-client</name>
|
||||
<description>vasc-frontend-cxf-client</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.jws</groupId>
|
||||
<artifactId>jsr181-api</artifactId>
|
||||
<version>1.0-MR1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package net.forwardfire.vasc.frontend.cxf.client;
|
||||
|
||||
import javax.jws.WebService;
|
||||
|
||||
|
||||
@WebService
|
||||
public interface VascEntryService {
|
||||
|
||||
public String testHi(String response);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vasc-frontend-cxf-server</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<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>
|
||||
<artifactId>vasc-frontend-cxf</artifactId>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-frontend-cxf-server</artifactId>
|
||||
<name>vasc-frontend-cxf-server</name>
|
||||
<description>vasc-frontend-cxf-server</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-frontend-cxf-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
<version>2.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-databinding-jaxb</artifactId>
|
||||
<version>2.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
<version>2.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>2.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package net.forwardfire.vasc.frontend.cxf.server;
|
||||
|
||||
import net.forwardfire.vasc.frontend.cxf.client.VascEntryService;
|
||||
|
||||
public class VascEntryServiceImpl implements VascEntryService {
|
||||
|
||||
public String testHi(String response) {
|
||||
return "HOHO: "+response+" HAAHA..";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.frontend.cxf.server.web;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import net.forwardfire.vasc.core.VascControllerProvider;
|
||||
import net.forwardfire.vasc.frontend.cxf.server.VascEntryServiceImpl;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
||||
import org.apache.cxf.Bus;
|
||||
import org.apache.cxf.BusFactory;
|
||||
import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
|
||||
|
||||
/**
|
||||
* VascCXFServlet exports the entries via webservices
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 May 12, 2012
|
||||
*/
|
||||
public class VascCXFServlet extends CXFNonSpringServlet {
|
||||
|
||||
private Logger logger = Logger.getLogger(VascCXFServlet.class.getName());
|
||||
private static final long serialVersionUID = 8125039180724973858L;
|
||||
private VascControllerProvider vascControllerProvider = null;
|
||||
private boolean exportTree = false;
|
||||
|
||||
/**
|
||||
* @see org.apache.cxf.transport.servlet.CXFNonSpringServlet#init(javax.servlet.ServletConfig)
|
||||
*/
|
||||
@Override
|
||||
public void init(ServletConfig sc) throws ServletException {
|
||||
|
||||
String className = getInitParameter("vascControllerProvider");
|
||||
if (className==null) {
|
||||
throw new ServletException("Can't start with null vascControllerProvider init parameter.");
|
||||
}
|
||||
String exportTreeStr = getInitParameter("exportTree");
|
||||
if (exportTreeStr!=null && "true".equalsIgnoreCase(exportTreeStr)) {
|
||||
exportTree = true;
|
||||
}
|
||||
try {
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
if (cl == null) {
|
||||
cl = className.getClass().getClassLoader();
|
||||
}
|
||||
Class<?> clazz = cl.loadClass(className);
|
||||
vascControllerProvider = (VascControllerProvider)clazz.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new ServletException("Could not create VascControllerProvider: "+e.getMessage(),e);
|
||||
}
|
||||
super.init(sc); // runs loadBus
|
||||
logger.info("CXF Servlet started. (exportTree: "+exportTree+")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadBus(ServletConfig servletConfig) {
|
||||
super.loadBus(servletConfig);
|
||||
Bus bus = getBus();
|
||||
BusFactory.setDefaultBus(bus);
|
||||
|
||||
|
||||
Endpoint.publish("/foobar", new VascEntryServiceImpl());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue