Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #522 from kylinsoong/master
TEIID-3521: Use Swagger UI add a api-doc for VDB Rest Service
- Loading branch information
Showing
19 changed files
with
777 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
build/kits/jboss-as7/modules/com/fasterxml/jackson/dataformat/xml/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="com.fasterxml.jackson.dataformat.xml"> | ||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
<resources> | ||
<resource-root path="jackson-dataformat-xml-${version.com.fasterxml.jackson.swagger}.jar" /> | ||
<resource-root path="jackson-module-jaxb-annotations-${version.com.fasterxml.jackson.swagger}.jar" /> | ||
</resources> | ||
|
||
<dependencies> | ||
<module name="com.fasterxml.jackson" /> | ||
<module name="org.codehaus.woodstox" /> | ||
</dependencies> | ||
</module> |
13 changes: 13 additions & 0 deletions
13
build/kits/jboss-as7/modules/com/fasterxml/jackson/dataformat/yaml/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="com.fasterxml.jackson.dataformat.yaml"> | ||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
<resources> | ||
<resource-root path="jackson-dataformat-yaml-${version.com.fasterxml.jackson.swagger}.jar" /> | ||
</resources> | ||
|
||
<dependencies> | ||
<module name="org.yaml.snakeyaml" /> | ||
</dependencies> | ||
</module> |
14 changes: 14 additions & 0 deletions
14
build/kits/jboss-as7/modules/com/fasterxml/jackson/datatype/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="com.fasterxml.jackson.datatype"> | ||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
<resources> | ||
<resource-root path="jackson-datatype-joda-${version.com.fasterxml.jackson.swagger}.jar" /> | ||
</resources> | ||
|
||
<dependencies> | ||
<module name="org.joda.time" /> | ||
</dependencies> | ||
|
||
</module> |
10 changes: 10 additions & 0 deletions
10
build/kits/jboss-as7/modules/com/fasterxml/jackson/jaxrs/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="com.fasterxml.jackson.jaxrs"> | ||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
<resources> | ||
<resource-root path="jackson-jaxrs-json-provider-${version.com.fasterxml.jackson.swagger}.jar" /> | ||
<resource-root path="jackson-jaxrs-base-${version.com.fasterxml.jackson.swagger}.jar" /> | ||
</resources> | ||
</module> |
10 changes: 10 additions & 0 deletions
10
build/kits/jboss-as7/modules/com/google/code/findbugs/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="com.google.code.findbugs"> | ||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
<resources> | ||
<resource-root path="annotations-${version.com.google.code.findbugs}.jar" /> | ||
</resources> | ||
|
||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="io.swagger"> | ||
|
||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
|
||
<resources> | ||
<resource-root path="swagger-annotations-${version.swagger-jaxrs}.jar" /> | ||
<resource-root path="swagger-core-${version.swagger-jaxrs}.jar" /> | ||
<resource-root path="swagger-jaxrs-${version.swagger-jaxrs}.jar" /> | ||
<resource-root path="swagger-models-${version.swagger-jaxrs}.jar" /> | ||
</resources> | ||
|
||
<dependencies> | ||
<module name="com.fasterxml.jackson" /> | ||
<module name="com.fasterxml.jackson.dataformat.yaml" /> | ||
<module name="com.fasterxml.jackson.dataformat.xml" /> | ||
<module name="com.fasterxml.jackson.datatype" /> | ||
<module name="com.fasterxml.jackson.jaxrs" /> | ||
<module name="com.google.guava" /> | ||
<module name="org.apache.commons.lang" slot="3.3.2"/> | ||
<module name="org.reflections" /> | ||
<module name="org.slf4j"/> | ||
<module name="javax.ws.rs.api"/> | ||
<module name="javax.servlet.api"/> | ||
<module name="javax.xml.bind.api"/> | ||
</dependencies> | ||
|
||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
build/kits/jboss-as7/modules/org/reflections/main/module.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.0" name="org.reflections"> | ||
<properties> | ||
<property name="jboss.api" value="private"/> | ||
</properties> | ||
<resources> | ||
<resource-root path="reflections-${version.org.reflections}.jar" /> | ||
</resources> | ||
|
||
<dependencies> | ||
<module name="org.javassist" /> | ||
<module name="com.google.guava" /> | ||
<module name="com.google.code.findbugs" /> | ||
</dependencies> | ||
|
||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
jboss-integration/src/main/java/org/teiid/jboss/rest/ApiOriginFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* See the COPYRIGHT.txt file distributed with this work for information | ||
* regarding copyright ownership. Some portions may be licensed | ||
* to Red Hat, Inc. under one or more contributor license agreements. | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301 USA. | ||
*/ | ||
package org.teiid.jboss.rest; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.servlet.Filter; | ||
import javax.servlet.FilterChain; | ||
import javax.servlet.FilterConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class ApiOriginFilter implements Filter { | ||
|
||
@Override | ||
public void init(FilterConfig filterConfig) throws ServletException { | ||
} | ||
|
||
@Override | ||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { | ||
|
||
HttpServletResponse localHttpServletResponse = (HttpServletResponse)response; | ||
localHttpServletResponse.addHeader("Access-Control-Allow-Origin", "*"); | ||
localHttpServletResponse.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); | ||
localHttpServletResponse.addHeader("Access-Control-Allow-Headers", "Origin, X-Atmosphere-tracking-id, X-Atmosphere-Framework, X-Cache-Date, Content-Type, X-Atmosphere-Transport, *"); | ||
chain.doFilter(request, response); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
jboss-integration/src/main/java/org/teiid/jboss/rest/BootstrapServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* See the COPYRIGHT.txt file distributed with this work for information | ||
* regarding copyright ownership. Some portions may be licensed | ||
* to Red Hat, Inc. under one or more contributor license agreements. | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301 USA. | ||
*/ | ||
package org.teiid.jboss.rest; | ||
|
||
import io.swagger.jaxrs.config.BeanConfig; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.servlet.ServletConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class BootstrapServlet extends HttpServlet { | ||
|
||
private static final long serialVersionUID = 5704762873796188429L; | ||
|
||
@Override | ||
public void init(ServletConfig config) throws ServletException { | ||
super.init(config); | ||
|
||
BeanConfig beanConfig = new BeanConfig(); | ||
init(beanConfig); | ||
} | ||
|
||
protected void init(BeanConfig beanConfig) { | ||
} | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws ServletException, IOException { | ||
doPost(req, resp); | ||
} | ||
|
||
@Override | ||
protected void doPost(HttpServletRequest req, HttpServletResponse resp)throws ServletException, IOException { | ||
String str1 = req.getContextPath(); | ||
String str2 = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + str1 + "/"; | ||
String str3 = str1 + "/api.html"; | ||
String str4 = "swagger.json"; | ||
String str5 = "/url=" + str2 + str4; | ||
String str6 = str3 + "?" + str5; | ||
resp.sendRedirect(str6); | ||
} | ||
|
||
} |
Oops, something went wrong.