Ravi Nori has uploaded a new change for review. Change subject: ovirt-reports: Dashboard results an error, when reports is not deployed ......................................................................
ovirt-reports: Dashboard results an error, when reports is not deployed Reports tab shows error page when accessed after a server restart before the reports web app has been deployed A new Status servlet has been added to Reports app which is used by the webadmin to check the status of the report webapp before showing the reports web app in reports tab Change-Id: I13d0345962226d383f1d795174b6a98089f35e7b Bug-Url: https://bugzilla.redhat.com/1037667 Signed-off-by: Ravi Nori <[email protected]> --- A reports/jars/ReportsStatus/pom.xml A reports/jars/ReportsStatus/src/main/java/org/ovirt/status/StatusServlet.java M reports/jars/pom.xml M server-customizations/WEB-INF/web.xml 4 files changed, 119 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/80/22280/1 diff --git a/reports/jars/ReportsStatus/pom.xml b/reports/jars/ReportsStatus/pom.xml new file mode 100644 index 0000000..88237bd --- /dev/null +++ b/reports/jars/ReportsStatus/pom.xml @@ -0,0 +1,80 @@ +<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>ovirt_engine_reports</groupId> + <artifactId>jars</artifactId> + <version>3.3.0</version> + </parent> + + <groupId>ovirt_engine_reports</groupId> + <artifactId>ReportStatus</artifactId> + <packaging>jar</packaging> + <version>3.3.0</version> + <name>Report Status Servlet</name> + <description>Report Status Servlet</description> + + <properties> + <javax.servlet.api.version>2.3</javax.servlet.api.version> + </properties> + + <dependencies> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>${javax.servlet.api.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.6</source> + <target>1.6</target> + <includes> + <include>**/*.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <repositories> + <repository> + <id>central</id> + <name>maven repo1</name> + <layout>default</layout> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>maven.search.repo</id> + <name>maven search repo</name> + <layout>default</layout> + <url>http://mvnsearch.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>central</id> + <name>Maven Plugin Repository</name> + <url>http://repo1.maven.org/maven2</url> + <layout>default</layout> + <snapshots> + <enabled>false</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + </releases> + </pluginRepository> + </pluginRepositories> + +</project> diff --git a/reports/jars/ReportsStatus/src/main/java/org/ovirt/status/StatusServlet.java b/reports/jars/ReportsStatus/src/main/java/org/ovirt/status/StatusServlet.java new file mode 100644 index 0000000..4629a5c --- /dev/null +++ b/reports/jars/ReportsStatus/src/main/java/org/ovirt/status/StatusServlet.java @@ -0,0 +1,27 @@ +package org.ovirt.status; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + +public class StatusServlet extends HttpServlet { + + private static final String message = "Reports Webapp Deployed"; + + public void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException { + response.setHeader("Access-Control-Allow-Origin","*"); + // Set response content type + response.setContentType("text/html"); + + // Actual logic goes here. + PrintWriter out = response.getWriter(); + out.println(message); + } + +} + diff --git a/reports/jars/pom.xml b/reports/jars/pom.xml index dfbdec4..f945f55 100644 --- a/reports/jars/pom.xml +++ b/reports/jars/pom.xml @@ -18,6 +18,7 @@ <module>EngineAuthentication</module> <module>ReportsPieChartTheme</module> <module>ReportsLineBarChartTheme</module> + <module>ReportsStatus</module> <module>WebadminLineBarChartTheme</module> <module>CustomOvirtReportsQueryManipulator</module> </modules> diff --git a/server-customizations/WEB-INF/web.xml b/server-customizations/WEB-INF/web.xml index 66dbeca..317f0cc 100644 --- a/server-customizations/WEB-INF/web.xml +++ b/server-customizations/WEB-INF/web.xml @@ -340,6 +340,17 @@ <url-pattern>/xmla</url-pattern> </servlet-mapping> + <!-- Status Servlet --> + <servlet> + <servlet-name>StatusServlet</servlet-name> + <servlet-class>org.ovirt.status.StatusServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>StatusServlet</servlet-name> + <url-pattern>/Status</url-pattern> + </servlet-mapping> + <!-- for drillthrough --> <servlet> -- To view, visit http://gerrit.ovirt.org/22280 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13d0345962226d383f1d795174b6a98089f35e7b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Ravi Nori <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
