Committed by
Gerrit Code Review
Initial CORD subscriber web-gui demo.
Change-Id: I4b6ac320f11aad52ef058570c906f56e8c515ebd
Showing
3 changed files
with
132 additions
and
0 deletions
apps/demo/cord-gui/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!-- | ||
| 3 | + ~ Copyright 2014 Open Networking Laboratory | ||
| 4 | + ~ | ||
| 5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | + ~ you may not use this file except in compliance with the License. | ||
| 7 | + ~ You may obtain a copy of the License at | ||
| 8 | + ~ | ||
| 9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | + ~ | ||
| 11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | + ~ See the License for the specific language governing permissions and | ||
| 15 | + ~ limitations under the License. | ||
| 16 | + --> | ||
| 17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
| 20 | + <modelVersion>4.0.0</modelVersion> | ||
| 21 | + | ||
| 22 | + <parent> | ||
| 23 | + <groupId>org.onosproject</groupId> | ||
| 24 | + <artifactId>onos-base</artifactId> | ||
| 25 | + <version>1</version> | ||
| 26 | + <relativePath>../../../tools/build/pom.xml</relativePath> | ||
| 27 | + </parent> | ||
| 28 | + | ||
| 29 | + <artifactId>cord-gui</artifactId> | ||
| 30 | + <version>1.2.0-SNAPSHOT</version> | ||
| 31 | + <packaging>war</packaging> | ||
| 32 | + | ||
| 33 | + <description>Demo CORD Subscriber Web GUI</description> | ||
| 34 | + | ||
| 35 | + <properties> | ||
| 36 | + <web.context>/cord</web.context> | ||
| 37 | + </properties> | ||
| 38 | + | ||
| 39 | + <dependencies> | ||
| 40 | + <dependency> | ||
| 41 | + <groupId>javax.servlet</groupId> | ||
| 42 | + <artifactId>servlet-api</artifactId> | ||
| 43 | + <version>2.5</version> | ||
| 44 | + </dependency> | ||
| 45 | + | ||
| 46 | + <dependency> | ||
| 47 | + <groupId>com.sun.jersey</groupId> | ||
| 48 | + <artifactId>jersey-servlet</artifactId> | ||
| 49 | + <version>1.19</version> | ||
| 50 | + </dependency> | ||
| 51 | + </dependencies> | ||
| 52 | + | ||
| 53 | +</project> |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | + | ||
| 17 | +package org.onosproject.cord.gui; | ||
| 18 | + | ||
| 19 | +import javax.ws.rs.GET; | ||
| 20 | +import javax.ws.rs.Path; | ||
| 21 | +import javax.ws.rs.core.Response; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * Web resource to use as the GUI back-end and as a proxy to XOS REST API. | ||
| 25 | + */ | ||
| 26 | +@Path("") | ||
| 27 | +public class CordWebResource { | ||
| 28 | + | ||
| 29 | + @GET | ||
| 30 | + @Path("hello") | ||
| 31 | + public Response hello() { | ||
| 32 | + return Response.ok("Hello World").build(); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | +} |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!-- | ||
| 3 | + ~ Copyright 2014 Open Networking Laboratory | ||
| 4 | + ~ | ||
| 5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 6 | + ~ you may not use this file except in compliance with the License. | ||
| 7 | + ~ You may obtain a copy of the License at | ||
| 8 | + ~ | ||
| 9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | + ~ | ||
| 11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
| 12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| 13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 14 | + ~ See the License for the specific language governing permissions and | ||
| 15 | + ~ limitations under the License. | ||
| 16 | + --> | ||
| 17 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" | ||
| 18 | + xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
| 19 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | ||
| 20 | + id="ONOS" version="2.5"> | ||
| 21 | + <display-name>CORD Subscriber Web GUI</display-name> | ||
| 22 | + | ||
| 23 | + <servlet> | ||
| 24 | + <servlet-name>JAX-RS Service</servlet-name> | ||
| 25 | + <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | ||
| 26 | + <init-param> | ||
| 27 | + <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> | ||
| 28 | + <param-value>com.sun.jersey.api.core.ClassNamesResourceConfig</param-value> | ||
| 29 | + </init-param> | ||
| 30 | + <init-param> | ||
| 31 | + <param-name>com.sun.jersey.config.property.classnames</param-name> | ||
| 32 | + <param-value> | ||
| 33 | + org.onosproject.cord.gui.CordWebResource | ||
| 34 | + </param-value> | ||
| 35 | + </init-param> | ||
| 36 | + <load-on-startup>1</load-on-startup> | ||
| 37 | + </servlet> | ||
| 38 | + | ||
| 39 | + <servlet-mapping> | ||
| 40 | + <servlet-name>JAX-RS Service</servlet-name> | ||
| 41 | + <url-pattern>/*</url-pattern> | ||
| 42 | + </servlet-mapping> | ||
| 43 | + | ||
| 44 | +</web-app> |
-
Please register or login to post a comment