You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sirona.apache.org by ol...@apache.org on 2014/08/06 14:22:30 UTC
svn commit: r1616188 - in /incubator/sirona/trunk/server/reporting: ./
reporting-api/ reporting-ui/ reporting-webapp/
reporting-webapp/src/main/java/org/apache/sirona/reporting/web/
reporting-webapp/src/main/webapp/WEB-INF/
Author: olamy
Date: Wed Aug 6 12:22:30 2014
New Revision: 1616188
URL: http://svn.apache.org/r1616188
Log:
start introducing jaxrs dependency
Modified:
incubator/sirona/trunk/server/reporting/pom.xml
incubator/sirona/trunk/server/reporting/reporting-api/pom.xml
incubator/sirona/trunk/server/reporting/reporting-ui/pom.xml
incubator/sirona/trunk/server/reporting/reporting-webapp/pom.xml
incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/SironaController.java
incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/webapp/WEB-INF/web.xml
Modified: incubator/sirona/trunk/server/reporting/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/pom.xml?rev=1616188&r1=1616187&r2=1616188&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/pom.xml (original)
+++ incubator/sirona/trunk/server/reporting/pom.xml Wed Aug 6 12:22:30 2014
@@ -28,6 +28,12 @@
<name>Apache Sirona Incubator :: Reporting</name>
<packaging>pom</packaging>
+ <properties>
+ <tomcatRunPort>8080</tomcatRunPort>
+ <tomcatRunPath>/sirona</tomcatRunPath>
+ <sirona.properties.path>${basedir}/src/test/sirona.properties</sirona.properties.path>
+ </properties>
+
<modules>
<module>reporting-api</module>
<module>reporting-ui</module>
@@ -43,8 +49,13 @@
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.1.1</version>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>3.0.1</version>
</dependency>
</dependencies>
</dependencyManagement>
Modified: incubator/sirona/trunk/server/reporting/reporting-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-api/pom.xml?rev=1616188&r1=1616187&r2=1616188&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-api/pom.xml (original)
+++ incubator/sirona/trunk/server/reporting/reporting-api/pom.xml Wed Aug 6 12:22:30 2014
@@ -35,7 +35,7 @@
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
+ <artifactId>javax.ws.rs-api</artifactId>
</dependency>
</dependencies>
Modified: incubator/sirona/trunk/server/reporting/reporting-ui/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-ui/pom.xml?rev=1616188&r1=1616187&r2=1616188&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-ui/pom.xml (original)
+++ incubator/sirona/trunk/server/reporting/reporting-ui/pom.xml Wed Aug 6 12:22:30 2014
@@ -26,7 +26,19 @@
<artifactId>sirona-reporting-ui</artifactId>
<name>Apache Sirona Incubator :: Server :: Reporting :: Ui</name>
- <packaging>jar</packaging>
+ <packaging>war</packaging>
+
+ <properties>
+ <sirona.reporting.ui.tomcat.skip>false</sirona.reporting.ui.tomcat.skip>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.sirona</groupId>
+ <artifactId>sirona-core</artifactId>
+ <scope>provided</scope> <!-- using to put it in the container to get JDBC monitoring and deploy the webapp -->
+ </dependency>
+ </dependencies>
<build>
<pluginManagement>
@@ -40,6 +52,27 @@
</plugin>
</plugins>
</pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <configuration>
+ <port>${tomcatRunPort}</port>
+ <path>${tomcatRunPath}</path>
+ <skip>${sirona.reporting.ui.tomcat.skip}</skip>
+ <systemProperties>
+ <org.apache.sirona.configuration.sirona.properties>${sirona.properties.path}</org.apache.sirona.configuration.sirona.properties>
+ </systemProperties>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.sirona</groupId>
+ <artifactId>sirona-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
</build>
</project>
Modified: incubator/sirona/trunk/server/reporting/reporting-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-webapp/pom.xml?rev=1616188&r1=1616187&r2=1616188&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-webapp/pom.xml (original)
+++ incubator/sirona/trunk/server/reporting/reporting-webapp/pom.xml Wed Aug 6 12:22:30 2014
@@ -29,10 +29,8 @@
<packaging>war</packaging>
<properties>
- <tomcatRunPort>8080</tomcatRunPort>
- <tomcatRunPath>/sirona</tomcatRunPath>
<sirona.reporting.tomcat.skip>false</sirona.reporting.tomcat.skip>
- <sirona.properties.path>${basedir}/src/test/sirona.properties</sirona.properties.path>
+ <jacksonVersion>2.4.1</jacksonVersion>
</properties>
<dependencies>
@@ -42,11 +40,6 @@
</dependency>
<dependency>
<groupId>org.apache.sirona</groupId>
- <artifactId>sirona-core</artifactId>
- <scope>provided</scope> <!-- using to put it in the container to get JDBC monitoring and deploy the webapp -->
- </dependency>
- <dependency>
- <groupId>org.apache.sirona</groupId>
<artifactId>sirona-reporting-api</artifactId>
</dependency>
<dependency>
@@ -71,7 +64,25 @@
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>4.0.6.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>${jacksonVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-xml-provider</artifactId>
+ <version>${jacksonVersion}</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -137,13 +148,6 @@
<org.apache.sirona.configuration.sirona.properties>${sirona.properties.path}</org.apache.sirona.configuration.sirona.properties>
</systemProperties>
</configuration>
- <dependencies>
- <dependency>
- <groupId>org.apache.sirona</groupId>
- <artifactId>sirona-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Modified: incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/SironaController.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/SironaController.java?rev=1616188&r1=1616187&r2=1616188&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/SironaController.java (original)
+++ incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/java/org/apache/sirona/reporting/web/SironaController.java Wed Aug 6 12:22:30 2014
@@ -16,6 +16,7 @@
*/
package org.apache.sirona.reporting.web;
+import org.apache.cxf.transport.servlet.CXFServlet;
import org.apache.sirona.configuration.ioc.IoCs;
import org.apache.sirona.reporting.web.handler.FilteringEndpoints;
import org.apache.sirona.reporting.web.handler.HomeEndpoint;
@@ -58,6 +59,7 @@ public class SironaController implements
private String mapping = null;
private ClassLoader classloader;
private Invoker defaultInvoker;
+ private CXFServlet cxfServlet;
@Override
public void init(final FilterConfig config) throws ServletException {
@@ -67,6 +69,7 @@ public class SironaController implements
initMapping(config.getInitParameter("monitoring-mapping"));
Templates.init(config.getServletContext().getContextPath(), mapping);
initHandlers();
+
}
private void initHandlers() {
@@ -114,12 +117,16 @@ public class SironaController implements
return;
}
+
final HttpServletRequest httpRequest = HttpServletRequest.class.cast(request);
final HttpServletResponse httpResponse = HttpServletResponse.class.cast(response);
final String baseUri = httpRequest.getContextPath() + mapping;
request.setAttribute("baseUri", baseUri);
+
+
+
final String requestURI = httpRequest.getRequestURI();
final String path = buildMatchablePath(httpRequest, baseUri, requestURI, true);
final String pathWithoutParams = buildMatchablePath(httpRequest, baseUri, requestURI, false);
Modified: incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/webapp/WEB-INF/web.xml?rev=1616188&r1=1616187&r2=1616188&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/sirona/trunk/server/reporting/reporting-webapp/src/main/webapp/WEB-INF/web.xml Wed Aug 6 12:22:30 2014
@@ -25,10 +25,21 @@
<param-value>org.apache.sirona.reporting.web.plugin</param-value>
</context-param>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ classpath*:META-INF/spring-context.xml, /WEB-INF/applicationContext.xml
+ </param-value>
+ </context-param>
+
<listener>
<listener-class>org.apache.sirona.web.discovery.GaugeDiscoveryListener</listener-class>
</listener>
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
<filter>
<filter-name>Monitoring</filter-name>
<filter-class>org.apache.sirona.reporting.web.SironaController</filter-class>
@@ -39,4 +50,15 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <servlet>
+ <servlet-name>CXFServlet</servlet-name>
+ <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CXFServlet</servlet-name>
+ <url-pattern>/restServices/*</url-pattern>
+ </servlet-mapping>
+
</web-app>