<?xml version="1.0" encoding="UTF-8"?>\r
<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
- <artifactId>${rootArtifactId}</artifactId>\r
- <groupId>${groupId}</groupId>\r
- <version>${version}</version>\r
- </parent>\r
- <artifactId>${rootArtifactId}-consumer</artifactId>\r
- <packaging>bundle</packaging>\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <artifactId>${rootArtifactId}</artifactId>\r
+ <groupId>${groupId}</groupId>\r
+ <version>${version}</version>\r
+ </parent>\r
+ <artifactId>${rootArtifactId}-consumer</artifactId>\r
+ <packaging>bundle</packaging>\r
<scm>\r
<connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
<tag>HEAD</tag>\r
</scm>\r
\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.apache.felix</groupId>\r
- <artifactId>maven-bundle-plugin</artifactId>\r
- <version>${bundle.plugin.version}</version>\r
- <extensions>true</extensions>\r
- <configuration>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.apache.felix</groupId>\r
+ <artifactId>maven-bundle-plugin</artifactId>\r
+ <version>${bundle.plugin.version}</version>\r
+ <extensions>true</extensions>\r
+ <configuration>\r
<instructions>\r
<Export-Package>org.opendaylight.controller.config.yang.config.${appName}_consumer.impl</Export-Package>\r
<Import-Package>*</Import-Package>\r
</instructions>\r
- </configuration>\r
- </plugin>\r
+ </configuration>\r
+ </plugin>\r
<plugin>\r
<groupId>org.opendaylight.yangtools</groupId>\r
<artifactId>yang-maven-plugin</artifactId>\r
</dependency>\r
</dependencies>\r
</plugin>\r
- </plugins>\r
- </build>\r
+ </plugins>\r
+ </build>\r
\r
- <dependencies>\r
- <dependency>\r
- <groupId>${groupId}</groupId>\r
- <artifactId>${rootArtifactId}-model</artifactId>\r
- <version>${version}</version>\r
- </dependency>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>${groupId}</groupId>\r
+ <artifactId>${rootArtifactId}-model</artifactId>\r
+ <version>${version}</version>\r
+ </dependency>\r
<dependency>\r
<groupId>org.opendaylight.controller</groupId>\r
<artifactId>config-api</artifactId>\r
<artifactId>sal-binding-config</artifactId>\r
<version>${mdsal.version}</version>\r
</dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-binding-api</artifactId>\r
- <version>${mdsal.version}</version>\r
- </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-binding-api</artifactId>\r
+ <version>${mdsal.version}</version>\r
+ </dependency>\r
<dependency>\r
<groupId>org.opendaylight.controller</groupId>\r
<artifactId>sal-common-util</artifactId>\r
<version>${mdsal.version}</version>\r
</dependency>\r
- <dependency>\r
+ <dependency>\r
<groupId>equinoxSDK381</groupId>\r
<artifactId>org.eclipse.osgi</artifactId>\r
<version>${equinox.osgi.version}</version>\r
</dependency>\r
- </dependencies>\r
+ </dependencies>\r
</project>\r
public class ConsumerActivator {
-
+
}
<?xml version="1.0" encoding="UTF-8"?>\r
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- 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
- <artifactId>${rootArtifactId}</artifactId>\r
- <groupId>${groupId}</groupId>\r
- <version>${version}</version>\r
- </parent>\r
- <artifactId>${rootArtifactId}-generate</artifactId>\r
- <packaging>jar</packaging>\r
- <scm>\r
- <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
- <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
- <tag>HEAD</tag>\r
- </scm>\r
- <profiles>\r
- <profile>\r
- <id>generateCode</id>\r
- <activation>\r
- <property>\r
- <name>gen</name>\r
- </property>\r
- </activation>\r
- <build>\r
- <plugins>\r
- <!-- Move your template files under classes folder, so code generator can use them -->\r
- <plugin>\r
- <artifactId>maven-resources-plugin</artifactId>\r
- <version>2.6</version>\r
- <executions>\r
- <execution>\r
- <id>copy-resources</id>\r
- <phase>process-classes</phase>\r
- <goals>\r
- <goal>copy-resources</goal>\r
- </goals>\r
- <configuration>\r
- <outputDirectory>${basedir}/target/classes</outputDirectory>\r
- <resources>\r
- <resource>\r
- <directory>src/main/template</directory>\r
- <filtering>true</filtering>\r
- </resource>\r
- </resources>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin>\r
+ 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
+ <artifactId>${rootArtifactId}</artifactId>\r
+ <groupId>${groupId}</groupId>\r
+ <version>${version}</version>\r
+ </parent>\r
+ <artifactId>${rootArtifactId}-generate</artifactId>\r
+ <packaging>jar</packaging>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
+ <tag>HEAD</tag>\r
+ </scm>\r
+ <profiles>\r
+ <profile>\r
+ <id>generateCode</id>\r
+ <activation>\r
+ <property>\r
+ <name>gen</name>\r
+ </property>\r
+ </activation>\r
+ <build>\r
+ <plugins>\r
+ <!-- Move your template files under classes folder, so code generator can use them -->\r
+ <plugin>\r
+ <artifactId>maven-resources-plugin</artifactId>\r
+ <version>2.6</version>\r
+ <executions>\r
+ <execution>\r
+ <id>copy-resources</id>\r
+ <phase>process-classes</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${basedir}/target/classes</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>src/main/template</directory>\r
+ <filtering>true</filtering>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
<!-- run your code generator only once-->\r
- <plugin>\r
- <groupId>org.codehaus.mojo</groupId>\r
- <artifactId>exec-maven-plugin</artifactId>\r
- <version>1.2.1</version>\r
- <executions>\r
- <execution>\r
- <phase>process-classes</phase>\r
- <goals>\r
- <goal>java</goal>\r
- </goals>\r
- <configuration>\r
- <mainClass>${package}.generate.CodeGenerator</mainClass>\r
- <arguments>\r
- <argument>${appName}</argument>\r
- <argument>${modelFields}</argument>\r
- </arguments>\r
- </configuration>\r
- </execution>\r
- </executions>\r
- </plugin>\r
- </plugins>\r
- </build>\r
- </profile>\r
- </profiles>\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.apache.velocity</groupId>\r
- <artifactId>velocity</artifactId>\r
- <version>1.6.4</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>com.googlecode.json-simple</groupId>\r
- <artifactId>json-simple</artifactId>\r
- <version>1.1</version>\r
- </dependency>\r
- </dependencies>\r
+ <plugin>\r
+ <groupId>org.codehaus.mojo</groupId>\r
+ <artifactId>exec-maven-plugin</artifactId>\r
+ <version>1.2.1</version>\r
+ <executions>\r
+ <execution>\r
+ <phase>process-classes</phase>\r
+ <goals>\r
+ <goal>java</goal>\r
+ </goals>\r
+ <configuration>\r
+ <mainClass>${package}.generate.CodeGenerator</mainClass>\r
+ <arguments>\r
+ <argument>${appName}</argument>\r
+ <argument>${modelFields}</argument>\r
+ </arguments>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+ </profile>\r
+ </profiles>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.apache.velocity</groupId>\r
+ <artifactId>velocity</artifactId>\r
+ <version>1.6.4</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>com.googlecode.json-simple</groupId>\r
+ <artifactId>json-simple</artifactId>\r
+ <version>1.1</version>\r
+ </dependency>\r
+ </dependencies>\r
</project>\r
<body>
<div class="container">
<h2>${app} application</h2>
- <div class="actions" style="padding:15px 0px;">
- <button class="btn btn-primary" data-toggle="modal" data-target="#myModal">
+ <div class="actions" style="padding:15px 0px;">
+ <button class="btn btn-primary" data-toggle="modal" data-target="#myModal">
Add entry
</button>
</div>
<h4 class="modal-title" id="myModalLabel">Add entry</h4>
</div>
<div class="modal-body">
- <form id="addEntry" role="form">
- #foreach( $field in $fields )
- <div class="form-group">
+ <form id="addEntry" role="form">
+ #foreach( $field in $fields )
+ <div class="form-group">
<label for="${field}">${field}</label>
<input type="text" class="form-control" name="${field}" id="${field}">
</div>
- #end
+ #end
<div class="form-group">
<button type="submit" class="btn btn-primary">Save</button>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery.ajax({
- url: window.location.origin +"/restconf/operational/${app}:${app}",
- dataType: "json",
- success: function(data) {
- jQuery.each(data.${app}.entry,
- function(){
- var rowEntry = "<tr><td>" +
- this['entry-id']+"</td>"
- #foreach( $field in $fields )
- + "<td>" + this.${field} + "</td>"
- #end
-
- +"</tr>";
- console.log(rowEntry);
- jQuery(".table tbody").append(rowEntry);
- });
- },
- error : function(){ console.log("no data found");}
+ url: window.location.origin +"/restconf/operational/${app}:${app}",
+ dataType: "json",
+ success: function(data) {
+ jQuery.each(data.${app}.entry,
+ function(){
+ var rowEntry = "<tr><td>" +
+ this['entry-id']+"</td>"
+ #foreach( $field in $fields )
+ + "<td>" + this.${field} + "</td>"
+ #end
+
+ +"</tr>";
+ console.log(rowEntry);
+ jQuery(".table tbody").append(rowEntry);
+ });
+ },
+ error : function(){ console.log("no data found");}
});
});
jQuery("form").on( "submit", function( event ) {
- event.preventDefault();
- var entryId = Math.random()*100000000000000000;
- var formData = '{"input":{"entryField":['
- #foreach( $field in $fields )
- + '{"key":"${field}", "value":"'+ jQuery("input[name='${field}']").val()+ '"}'
- #if($velocityCount != $fields.size())
- +','
- #end
- #end
- +'], "entryId" : "'+entryId+'" } }';
- console.log( jQuery( this ).serialize() );
- jQuery.ajax({
- url: window.location.origin +"/restconf/operations/${app}:saveEntry",
- type: "POST",
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json'
- },
- data: formData,
- dataType: "json",
- success: function(data) {
- location.reload(true);
- },
- error : function(){ console.log("Error");}
- });
-
- });
+ event.preventDefault();
+ var entryId = Math.random()*100000000000000000;
+ var formData = '{"input":{"entryField":['
+ #foreach( $field in $fields )
+ + '{"key":"${field}", "value":"'+ jQuery("input[name='${field}']").val()+ '"}'
+ #if($velocityCount != $fields.size())
+ +','
+ #end
+ #end
+ +'], "entryId" : "'+entryId+'" } }';
+ console.log( jQuery( this ).serialize() );
+ jQuery.ajax({
+ url: window.location.origin +"/restconf/operations/${app}:saveEntry",
+ type: "POST",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ data: formData,
+ dataType: "json",
+ success: function(data) {
+ location.reload(true);
+ },
+ error : function(){ console.log("Error");}
+ });
+
+ });
</script>
</body>
prefix $app;
- import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
-
+ import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
+
organization "Netconf Central";
contact
description
"Top-level container for all application database objects.";
list entry {
- key "entry-id";
+ key "entry-id";
leaf entry-id {
type entry-id;
description "identifier of single list of entries.";
prefix task;
- import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
-
+ import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
+
organization "Netconf Central";
contact
description
"Top-level container for all application database objects.";
list entry {
- key "entry-id";
+ key "entry-id";
leaf entry-id {
type entry-id;
description "identifier of single list of entries.";
<mdsal.version>1.1-SNAPSHOT</mdsal.version>
<equinox.osgi.version>3.8.1.v20120830-144521</equinox.osgi.version>
<ietf-inet-types.version>2010.09.24.4-SNAPSHOT</ietf-inet-types.version>
- <ietf-yang-types.version>2010.09.24.4-SNAPSHOT</ietf-yang-types.version>
+ <ietf-yang-types.version>2010.09.24.4-SNAPSHOT</ietf-yang-types.version>
<spring.version>3.1.3.RELEASE</spring.version>
- <jackson.version>1.9.10</jackson.version>
+ <jackson.version>1.9.10</jackson.version>
<jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
<salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
<config.version>0.2.5-SNAPSHOT</config.version>
</plugins>
</build>
<dependencies>
- <!-- Spring 3 dependencies -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- </dependency>
+ <!-- Spring 3 dependencies -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ </dependencies>
</project>
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
- <context:component-scan base-package="org.opendaylight.controller.app.web" />
+ <context:component-scan base-package="org.opendaylight.controller.app.web" />
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/img/**" location="/img/" />
- <mvc:annotation-driven />
-
- <bean
- class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix">
- <value>/WEB-INF/pages/</value>
- </property>
- <property name="suffix">
- <value>.jsp</value>
- </property>
- </bean>
+ <mvc:annotation-driven />
+
+ <bean
+ class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+ <property name="prefix">
+ <value>/WEB-INF/pages/</value>
+ </property>
+ <property name="suffix">
+ <value>.jsp</value>
+ </property>
+ </bean>
</beans>
\ No newline at end of file
<display-name>MD-SAL Application</display-name>
<servlet>
- <servlet-name>md-sal-app</servlet-name>
- <servlet-class>
- org.springframework.web.servlet.DispatcherServlet
- </servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
+ <servlet-name>md-sal-app</servlet-name>
+ <servlet-class>
+ org.springframework.web.servlet.DispatcherServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
- <servlet-mapping>
- <servlet-name>md-sal-app</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>md-sal-app</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
-
+
</web-app>