Added cubby-holes for new projects.
diff --git a/web/api/pom.xml b/web/api/pom.xml
new file mode 100644
index 0000000..ffb5354
--- /dev/null
+++ b/web/api/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-web</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-rest</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>ONOS REST API</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-core</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>17.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <properties>
+ <web.context>/onos/v1</web.context>
+ </properties>
+
+</project>
diff --git a/web/api/src/main/java/org/onlab/onos/rest/GreetResource.java b/web/api/src/main/java/org/onlab/onos/rest/GreetResource.java
new file mode 100644
index 0000000..a379c62
--- /dev/null
+++ b/web/api/src/main/java/org/onlab/onos/rest/GreetResource.java
@@ -0,0 +1,31 @@
+package org.onlab.onos.rest;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.onlab.onos.net.GreetService;
+import org.onlab.rest.BaseResource;
+
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+/**
+ * Simple example on how to write a testable JAX-RS resource.
+ */
+@Path("greet")
+public class GreetResource extends BaseResource {
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response yo(@QueryParam("name") @DefaultValue("dude") String name) {
+ ObjectMapper mapper = new ObjectMapper();
+ ObjectNode root = mapper.createObjectNode();
+ root.put("greeting", get(GreetService.class).yo(name));
+ return Response.ok(root.toString()).build();
+ }
+
+}
diff --git a/web/api/src/main/javadoc/org/onlab/onos/rest/package.html b/web/api/src/main/javadoc/org/onlab/onos/rest/package.html
new file mode 100644
index 0000000..81c00df
--- /dev/null
+++ b/web/api/src/main/javadoc/org/onlab/onos/rest/package.html
@@ -0,0 +1,3 @@
+<body>
+Set of resources implementing the ONOS REST API.
+</body>
\ No newline at end of file
diff --git a/web/api/src/main/webapp/WEB-INF/web.xml b/web/api/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..0b07003
--- /dev/null
+++ b/web/api/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="ONOS" version="2.5">
+ <display-name>ONOS REST API v1.0</display-name>
+
+ <servlet>
+ <servlet-name>JAX-RS Service</servlet-name>
+ <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+ <param-name>com.sun.jersey.config.property.packages</param-name>
+ <param-value>org.onlab.onos.rest</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JAX-RS Service</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
diff --git a/web/api/src/test/java/org/onlab/onos/rest/GreetResourceTest.java b/web/api/src/test/java/org/onlab/onos/rest/GreetResourceTest.java
new file mode 100644
index 0000000..19b566c
--- /dev/null
+++ b/web/api/src/test/java/org/onlab/onos/rest/GreetResourceTest.java
@@ -0,0 +1,38 @@
+package org.onlab.onos.rest;
+
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.test.framework.JerseyTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.onlab.onos.net.GreetService;
+import org.onlab.onos.net.impl.GreetManager;
+import org.onlab.osgi.ServiceDirectory;
+import org.onlab.osgi.TestServiceDirectory;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Simple example on how to write a JAX-RS unit test using Jersey test framework.
+ * A base class should/will be created to provide further assistance for testing.
+ */
+public class GreetResourceTest extends JerseyTest {
+
+ public GreetResourceTest() {
+ super("org.onlab.onos.rest");
+ }
+
+ @BeforeClass
+ public static void classSetUp() {
+ ServiceDirectory testDirectory =
+ new TestServiceDirectory().add(GreetService.class, new GreetManager());
+ GreetResource.setServiceDirectory(testDirectory);
+ }
+
+ @Test
+ public void basics() {
+ WebResource rs = resource();
+ String response = rs.path("greet").get(String.class);
+ assertTrue("incorrect response", response.contains("Whazup "));
+ }
+
+}
diff --git a/web/gui/pom.xml b/web/gui/pom.xml
new file mode 100644
index 0000000..084f9bb
--- /dev/null
+++ b/web/gui/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-web</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-gui</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>ONOS Web GUI</description>
+
+ <properties>
+ <web.context>/onos/ui</web.context>
+ </properties>
+
+</project>
diff --git a/web/gui/src/main/java/org/onlab/onos/gui/GreetResource.java b/web/gui/src/main/java/org/onlab/onos/gui/GreetResource.java
new file mode 100644
index 0000000..7e1e7d4
--- /dev/null
+++ b/web/gui/src/main/java/org/onlab/onos/gui/GreetResource.java
@@ -0,0 +1,23 @@
+package org.onlab.onos.gui;
+
+import org.onlab.onos.net.GreetService;
+import org.onlab.rest.BaseResource;
+
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+/**
+ * Simple example of a GUI JAX-RS resource.
+ */
+@Path("greet")
+public class GreetResource extends BaseResource {
+
+ @GET
+ public Response yo(@QueryParam("name") @DefaultValue("dude") String name) {
+ return Response.ok(get(GreetService.class).yo(name)).build();
+ }
+
+}
diff --git a/web/gui/src/main/javadoc/org/onlab/onos/gui/package.html b/web/gui/src/main/javadoc/org/onlab/onos/gui/package.html
new file mode 100644
index 0000000..40769bf
--- /dev/null
+++ b/web/gui/src/main/javadoc/org/onlab/onos/gui/package.html
@@ -0,0 +1,3 @@
+<body>
+Set of resources providing data for the ONOS GUI.
+</body>
\ No newline at end of file
diff --git a/web/gui/src/main/webapp/WEB-INF/web.xml b/web/gui/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..d958283
--- /dev/null
+++ b/web/gui/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="ONOS" version="2.5">
+ <display-name>ONOS GUI</display-name>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <servlet>
+ <servlet-name>JAX-RS Service</servlet-name>
+ <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+ <param-name>com.sun.jersey.config.property.packages</param-name>
+ <param-value>org.onlab.onos.gui</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JAX-RS Service</servlet-name>
+ <url-pattern>/rs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
diff --git a/web/gui/src/main/webapp/index.html b/web/gui/src/main/webapp/index.html
new file mode 100644
index 0000000..f959f93
--- /dev/null
+++ b/web/gui/src/main/webapp/index.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>ONOS GUI</title>
+</head>
+<body>
+ <h1>ONOS GUI</h1>
+ Sort of...
+</body>
+</html>
\ No newline at end of file
diff --git a/web/pom.xml b/web/pom.xml
new file mode 100644
index 0000000..33dac46
--- /dev/null
+++ b/web/pom.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-web</artifactId>
+ <packaging>pom</packaging>
+
+ <description>ONOS web root project</description>
+
+ <modules>
+ <module>gui</module>
+ <module>api</module>
+ </modules>
+
+ <properties>
+ <web.context>default</web.context>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-utils-osgi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onlab.onos</groupId>
+ <artifactId>onos-utils-rest</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-servlet</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <version>1.18.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-grizzly2</artifactId>
+ <version>1.18.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <_wab>src/main/webapp/</_wab>
+ <Bundle-SymbolicName>
+ ${project.groupId}.${project.artifactId}
+ </Bundle-SymbolicName>
+ <Import-Package>
+ org.osgi.framework,
+ javax.ws.rs,javax.ws.rs.core,
+ com.sun.jersey.api.core,
+ com.sun.jersey.spi.container.servlet,
+ com.sun.jersey.server.impl.container.servlet,
+ com.fasterxml.jackson.databind,
+ com.fasterxml.jackson.databind.node,
+ org.onlab.osgi.*,
+ org.onlab.rest.*,
+ org.onlab.onos.net.*
+ </Import-Package>
+ <Web-ContextPath>${web.context}</Web-ContextPath>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>