<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">\r
<modelVersion>4.0.0</modelVersion>\r
\r
- <groupId>org.opendaylight.phoenix</groupId>\r
- <artifactId>phoenix-app-flow-archetype</artifactId>\r
+ <groupId>org.opendaylight.toolkit</groupId>\r
+ <artifactId>toolkit-app-flow-archetype</artifactId>\r
<version>1.0-SNAPSHOT</version>\r
<packaging>maven-archetype</packaging>\r
\r
- <name>phoenix-app-flow-archetype</name>\r
+ <name>toolkit-app-flow-archetype</name>\r
\r
<build>\r
<extensions>\r
</includes>
</fileSet>
</fileSets>
+ <requiredProperties>
+ <requiredProperty key="REST-Resource-Name"/>
+ </requiredProperties>
</archetype-descriptor>
<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">\r
<modelVersion>4.0.0</modelVersion>\r
<parent>\r
- <groupId>org.opendaylight.phoenix</groupId>\r
+ <groupId>org.opendaylight.toolkit</groupId>\r
<artifactId>common</artifactId>\r
<version>0.0.1-SNAPSHOT</version>\r
<relativePath>../common</relativePath>\r
<extensions>true</extensions>\r
<configuration>\r
<instructions>\r
- <Import-Package>org.opendaylight.phoenix.web,\r
+ <Import-Package>org.opendaylight.toolkit.web,\r
org.opendaylight.controller.sal.authorization,\r
org.opendaylight.controller.sal.core,\r
org.opendaylight.controller.sal.utils,\r
</build>\r
<dependencies>\r
<dependency>\r
- <groupId>org.opendaylight.phoenix</groupId>\r
+ <groupId>org.opendaylight.toolkit</groupId>\r
<artifactId>web</artifactId>\r
</dependency>\r
<dependency>\r
#set( $symbol_escape = '\' )
package ${package}.northbound;
+import org.codehaus.enunciate.jaxrs.StatusCodes;
+import org.codehaus.enunciate.jaxrs.TypeHint;
+import org.opendaylight.controller.sal.utils.ServiceHelper;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
+
+import org.codehaus.enunciate.jaxrs.ResponseCode;
+import org.opendaylight.controller.northbound.commons.RestMessages;
+import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
+import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
+import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
+import org.opendaylight.controller.sal.authorization.Privilege;
+import org.opendaylight.controller.sal.utils.Status;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.codehaus.enunciate.jaxrs.TypeHint;
/**
* Northbound REST API
* Example:
*
* Request URL:
- * http://localhost:8080/${artifactId}/northbound/api
+ * http://localhost:8080/app/northbound/${artifactId}/${REST-Resource-Name}
*
* Response body in XML:
* <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
* Sample Northbound API
* </pre>
*/
- @Path("/api")
+ @Path("/${REST-Resource-Name}")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(String.class)
import org.opendaylight.controller.sal.authorization.UserLevel;
import org.opendaylight.controller.sal.utils.ServiceHelper;
-import org.opendaylight.phoenix.web.IDaylightWeb;
+import org.opendaylight.toolkit.web.IDaylightWeb;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
</servlet-mapping>
<listener>
- <listener-class>org.opendaylight.phoenix.web.ControllerUISessionManager</listener-class>
+ <listener-class>org.opendaylight.toolkit.web.ControllerUISessionManager</listener-class>
</listener>
<!-- <session-config> // needs further testing
version=0.1-SNAPSHOT
groupId=archetype.it
artifactId=basic
+REST-Resource-Name=simple-data
public Map<UUID, SimpleData> readData();
public Status updateData(UUID uuid, SimpleData data);
public Status deleteData(UUID uuid);
-}
\ No newline at end of file
+}
], function(Backbone, _, SimpleModel) {
var SimpleCollection = Backbone.Collection.extend({
model : SimpleModel,
- url : '/${artifactId}/northbound/simple'
+ url : '/${artifactId}/northbound/${artifactId}'
});
return SimpleCollection;
});
initialize : function() {
},
setUrlRoot: function() {
- this.urlRoot = '/${artifactId}/northbound/simple';
+ this.urlRoot = '/${artifactId}/northbound/${artifactId}';
}
});
return SimpleModel;
initialize: function() {
var self = this;
this.collection = new SimpleCollection();
- this.collection.url = '/${artifactId}/northbound/simple';
+ this.collection.url = '/${artifactId}/northbound/${artifactId}';
this.collection.fetch({
success : function(call, response) {
self.render();
foo : $('#simpleFooInput').val(),
bar : $('#simpleBarInput').val()
});
- simpleModel.urlRoot = '/${artifactId}/northbound/simple';
+ simpleModel.urlRoot = '/${artifactId}/northbound/${artifactId}';
simpleModel.save(null, {
dataType: 'text',
success: function(model, response) {