diff options
Diffstat (limited to 'dgbuilder')
52 files changed, 422 insertions, 689 deletions
diff --git a/dgbuilder/build_pom_for_yang_compile b/dgbuilder/build_pom_for_yang_compile new file mode 100755 index 00000000..9ea090a6 --- /dev/null +++ b/dgbuilder/build_pom_for_yang_compile @@ -0,0 +1,86 @@ +echo "Version of dgbuilder pom is : $4" +echo "Building pom.xml_base for compiling yang" + +model_pom_content=$(cat <<EOF +<?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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.openecomp.sdnc.core</groupId> + <artifactId>root</artifactId> + <version>${1}</version> + </parent> + <artifactId>yangApp-model</artifactId> + <packaging>bundle</packaging> + <version>1.0.0-SNAPSHOT</version> + + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Import-Package>*</Import-Package> + </instructions> + </configuration> + </plugin> + <plugin> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-maven-plugin</artifactId> + <version>\${odl.yangtools.yang.maven.plugin.version}</version> + <dependencies> + <dependency> + <groupId>org.opendaylight.mdsal</groupId> + <artifactId>maven-sal-api-gen-plugin</artifactId> + <version>\${odl.sal.api.gen.plugin.version}</version> + <type>jar</type> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>generate-sources</goal> + </goals> + <configuration> + <yangFilesRootDir>\${yang.file.directory}</yangFilesRootDir> + <codeGenerators> + <generator> + <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass> + <outputBaseDir>\${salGeneratorPath}</outputBaseDir> + </generator> + </codeGenerators> + <inspectDependencies>true</inspectDependencies> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.opendaylight.mdsal</groupId> + <artifactId>yang-binding</artifactId> + <version>\${odl.mdsal.yang.binding.version}</version> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-common</artifactId> + <version>\${odl.yangtools.version}</version> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal.model</groupId> + <artifactId>ietf-inet-types</artifactId> + <version>\${odl.ietf-inet-types.version}</version> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal.model</groupId> + <artifactId>ietf-yang-types</artifactId> + <version>\${odl.ietf-yang-types.version}</version> + </dependency> + </dependencies> +</project> +EOF +) +echo "$model_pom_content" >tools/pom.xml_base diff --git a/dgbuilder/createReleaseDir b/dgbuilder/createReleaseDir deleted file mode 100755 index c2974cba..00000000 --- a/dgbuilder/createReleaseDir +++ /dev/null @@ -1,128 +0,0 @@ -export PATH=$PATH:. -appDir=$(pwd) -if [ "$#" != 3 -a "$#" != 4 ] -then - echo "Usage $0 releaseDir loginId emailAddress [gitLocalRepository]" - echo "Note: Specify the gitLocalRepository path if you would want to be able to import flows from your local git repository" - exit -fi -if [ ! -e "releases" ] -then - mkdir releases -fi -releaseDir="$1" -name="Release $releaseDir" -loginId="$2" -emailid="$3" -dbHost="dbhost" -dbPort="3306" -dbName="sdnctl" -dbUser="sdnctl" -dbPassword="gamma" -gitLocalRepository="$4" - -lastPort=$(find "releases/" -name "customSettings.js" |xargs grep uiPort|cut -d: -f2|sed -e s/,//|sort|tail -1) -echo $lastPort|grep uiPort >/dev/null 2>&1 -if [ "$?" == "0" ] -then -lastPort=$(find "releases/" -name "customSettings.js" |xargs grep uiPort|cut -d: -f3|sed -e s/,//|sort|tail -1) -fi -#echo $lastPort -if [ "${lastPort}" == "" ] -then - lastPort="3099" -fi -let nextPort=$(expr $lastPort+1) -#echo $nextPort -if [ ! -e "releases/$releaseDir" ] -then -mkdir releases/$releaseDir -cd releases/$releaseDir -mkdir flows -mkdir flows/shared -mkdir flows/shared/backups -mkdir html -mkdir xml -mkdir lib -mkdir lib/flows -mkdir logs -mkdir conf -mkdir codecloud -customSettingsFile="customSettings.js" -if [ ! -e "./$customSettingsFile" ] -then - echo "module.exports = {" >$customSettingsFile - echo " 'name' : '$name'," >>$customSettingsFile - echo " 'emailAddress' :'$emailid'," >>$customSettingsFile - echo " 'uiPort' :$nextPort," >>$customSettingsFile - echo " 'mqttReconnectTime': 15000," >>$customSettingsFile - echo " 'serialReconnectTime' : 15000," >>$customSettingsFile - echo " 'debugMaxLength': 1000," >>$customSettingsFile - echo " 'htmlPath': 'releases/$releaseDir/html/'," >>$customSettingsFile - echo " 'xmlPath': 'releases/$releaseDir/xml/'," >>$customSettingsFile - echo " 'flowFile' : 'releases/$releaseDir/flows/flows.json'," >>$customSettingsFile - echo " 'sharedDir': 'releases/$releaseDir/flows/shared'," >>$customSettingsFile - echo " 'userDir' : 'releases/$releaseDir'," >>$customSettingsFile - echo " 'httpAuth': {user:'$loginId',pass:'cc03e747a6afbbcbf8be7668acfebee5'}," >>$customSettingsFile - echo " 'dbHost': '$dbHost'," >>$customSettingsFile - echo " 'dbPort': '$dbPort'," >>$customSettingsFile - echo " 'dbName': '$dbName'," >>$customSettingsFile - echo " 'dbUser': '$dbUser'," >>$customSettingsFile - echo " 'dbPassword': '$dbPassword'," >>$customSettingsFile - echo " 'gitLocalRepository': '$gitLocalRepository'" >>$customSettingsFile - echo " }" >>$customSettingsFile -fi - #echo "Created custom settings file $customSettingsFile" - echo "Done ....." -else - echo "ERROR:customSettings file $customSettingsFile already exists for $releaseDir" - exit -fi -#echo "Content of custom settings file" -#echo "============================================================================" -# cat $customSettingsFile -#echo "============================================================================" -svclogicPropFile="./conf/svclogic.properties" -if [ ! -d "${appDir}/yangFiles" ] -then - mkdir -p "${appDir}/yangFiles" -fi -if [ ! -d "${appDir}/generatedJS" ] -then - mkdir -p "${appDir}/generatedJS" -fi - -if [ ! -e "./$svclogicPropFile" ] -then - echo "org.openecomp.sdnc.sli.dbtype=jdbc" >$svclogicPropFile - echo "org.openecomp.sdnc.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl" >>$svclogicPropFile - echo "org.openecomp.sdnc.sli.jdbc.database=sdnctl" >>$svclogicPropFile - echo "org.openecomp.sdnc.sli.jdbc.user=sdnctl" >>$svclogicPropFile - echo "org.openecomp.sdnc.sli.jdbc.password=gamma" >>$svclogicPropFile -fi -if [ ! -e "${appDir}/flowShareUsers.js" ] -then - echo "module.exports = {\"flowShareUsers\":" >${appDir}/flowShareUsers.js - echo " [" >>${appDir}/flowShareUsers.js - echo " ]" >>${appDir}/flowShareUsers.js - echo "}" >>${appDir}/flowShareUsers.js -fi -grep "$releaseDir" ${appDir}/flowShareUsers.js >/dev/null 2>&1 -if [ "$?" != "0" ] -then - num_of_lines=$(cat ${appDir}/flowShareUsers.js|wc -l) - if [ $num_of_lines -gt 4 ] - then - content=$(head -n -2 ${appDir}/flowShareUsers.js) - echo "${content}," > ${appDir}/flowShareUsers.js - else - content=$(head -n -2 ${appDir}/flowShareUsers.js) - echo "$content" > ${appDir}/flowShareUsers.js - fi - echo " {" >> ${appDir}/flowShareUsers.js - echo " \"name\" : \"$name\"," >> ${appDir}/flowShareUsers.js - echo " \"rootDir\" : \"$releaseDir\"" >> ${appDir}/flowShareUsers.js - echo " }" >> ${appDir}/flowShareUsers.js - echo " ]" >> ${appDir}/flowShareUsers.js - echo "}" >> ${appDir}/flowShareUsers.js -fi diff --git a/dgbuilder/nodes/dge/dgelogic/block.html b/dgbuilder/nodes/dge/dgelogic/block.html index 9dc116ee..656ad28d 100644 --- a/dgbuilder/nodes/dge/dgelogic/block.html +++ b/dgbuilder/nodes/dge/dgelogic/block.html @@ -38,7 +38,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!--<a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a>--> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/breakNode.html b/dgbuilder/nodes/dge/dgelogic/breakNode.html new file mode 100644 index 00000000..e3edef9d --- /dev/null +++ b/dgbuilder/nodes/dge/dgelogic/breakNode.html @@ -0,0 +1,161 @@ +<!-- + Copyright 2013 IBM Corp. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<script type="text/x-red" data-template-name="break"> + <div class="form-row"> + <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> + <input type="text" id="node-input-name" placeholder="Name"> + </div> + <div class="form-row"> + <label for="node-input-xml"><i class="fa fa-wrench"></i> Node XML</label> + <input type="hidden" id="node-input-xml" autofocus="autofocus"> + <div style="height: 450px;" class="node-text-editor" id="node-input-xml-editor" onkeyup="resetStatus()" ></div> + </div> + <div class="form-row"> + <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> + <input type="hidden" id="node-input-comments"> + <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> + <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> + </div> + <div class="form-tips">See the Info tab for help using this node.</div> +</script> + +<script type="text/x-red" data-help-name="break"> + <p>A break node.</p> + <p>First line of XML must contain opening tag.</p> + <p>Do not include closing tag - it will be automatically generated.</p> + +<div class="section"> +<h4><a name="Break_node"></a>Break node</h4> +<div class="section"> +<h5><a name="Description"></a>Description</h5> +<p>A <b>break</b> node works like a break in any programming language. So you can break out of a for loop.</p></div> +<div class="section"> +<h5><a name="Attributes"></a>Attributes</h5> +<p>Not applicable. The <b>break</b> node does not have attributes.</p></div> +<div class="section"> +<h5><a name="Parameters"></a>Parameters</h5> +<p>Not applicable. The <b>break</b> node does not have attributes.</p> </div> +<div class="section"> +<h5><a name="Outcomes"></a>Outcomes</h5> +<p>Not applicable. The <b>break</b> node has no outcomes.</p></div> +<div class="section"> +<h5><a name="Example"></a>Example</h5> +<div class="source"> +<pre><break> +</pre></div></div></div> + +</script> + + +<script type="text/javascript"> + RED.nodes.registerType('break',{ + color:"#fdd0a2", + category: 'DGElogic', + defaults: { + name: {value:"break"}, + xml: {value:"<break>\n"}, + comments:{value:""} + }, + inputs:1, + icon: "arrow-in.png", + label: function() { + return this.name; + }, + oneditprepare: function() { + $( "#node-input-outputs" ).spinner({ + min:1 + }); + + + var comments = $( "#node-input-comments").val(); + if(comments != null){ + comments = comments.trim(); + if(comments != ''){ + $("#node-input-btnComments").html("<span style='color:blue;'><b>View Comments</b></span>"); + } + } + + function functionDialogResize(ev,ui) { + $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px"); + }; + + $( "#dialog" ).dialog( "option", "width", 1200 ); + $( "#dialog" ).dialog( "option", "height", 750 ); + $( "#dialog" ).on("dialogresize", functionDialogResize); + $( "#dialog" ).one("dialogopen", function(ev) { + var size = $( "#dialog" ).dialog('option','sizeCache-function'); + if (size) { + functionDialogResize(null,{size:size}); + } + }); + + /* close dialog when ESC is pressed and released */ + $( "#dialog" ).keyup(function(event){ + if(event.which == 27 ) { + $("#node-dialog-cancel").click(); + } + }); + + $( "#dialog" ).one("dialogclose", function(ev,ui) { + var height = $( "#dialog" ).dialog('option','height'); + $( "#dialog" ).off("dialogresize",functionDialogResize); + }); + var that = this; + require(["orion/editor/edit"], function(edit) { + that.editor = edit({ + parent:document.getElementById('node-input-xml-editor'), + lang:"html", + contents: $("#node-input-xml").val() + }); + RED.library.create({ + url:"functions", // where to get the data from + type:"function", // the type of object the library is for + editor:that.editor, // the field name the main text body goes to + fields:['name','outputs'] + }); + $("#node-input-name").focus(); + $("#node-input-validate").click(function(){ + console.log("validate clicked."); + //console.dir(that.editor); + //console.log("getText:" + that.editor.getText()); + var val = that.editor.getText(); + validateXML(val); + }); + $("#node-input-show-sli-values").click(function(){ + console.log("SLIValues clicked."); + showValuesBox(that.editor,sliValuesObj); + }); + + }); + //for click of add comments button + $("#node-input-btnComments").click(function(e){ + showCommentsBox(); + }); + }, + oneditsave: function() { + $("#node-input-xml").val(this.editor.getText()); + var resp=validateXML(this.editor.getText()); + if(resp){ + this.status = {fill:"green",shape:"dot",text:"OK"}; + }else{ + this.status = {fill:"red",shape:"dot",text:"ERROR"}; + } + delete this.editor; + } + }); +</script> diff --git a/dgbuilder/nodes/dge/dgelogic/breakNode.js b/dgbuilder/nodes/dge/dgelogic/breakNode.js new file mode 100644 index 00000000..9b0b1b00 --- /dev/null +++ b/dgbuilder/nodes/dge/dgelogic/breakNode.js @@ -0,0 +1,31 @@ +/** + * Copyright 2013 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +module.exports = function(RED) { + "use strict"; + var util = require("util"); + var vm = require("vm"); + + function breakNode(n) { + RED.nodes.createNode(this,n); + this.name = n.name; + this.xml = n.xml; + this.topic = n.topic; + } + + RED.nodes.registerType("break",breakNode); + // RED.library.register("block"); +} diff --git a/dgbuilder/nodes/dge/dgelogic/call.html b/dgbuilder/nodes/dge/dgelogic/call.html index 02b865e0..0e49e26c 100644 --- a/dgbuilder/nodes/dge/dgelogic/call.html +++ b/dgbuilder/nodes/dge/dgelogic/call.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!--<a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a>--> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/configure.html b/dgbuilder/nodes/dge/dgelogic/configure.html index 232d22e3..a0e340e8 100644 --- a/dgbuilder/nodes/dge/dgelogic/configure.html +++ b/dgbuilder/nodes/dge/dgelogic/configure.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/delete.html b/dgbuilder/nodes/dge/dgelogic/delete.html index 0fbb0022..2b867e69 100644 --- a/dgbuilder/nodes/dge/dgelogic/delete.html +++ b/dgbuilder/nodes/dge/dgelogic/delete.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/execute.html b/dgbuilder/nodes/dge/dgelogic/execute.html index 2a5934a0..70b15e25 100644 --- a/dgbuilder/nodes/dge/dgelogic/execute.html +++ b/dgbuilder/nodes/dge/dgelogic/execute.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/exists.html b/dgbuilder/nodes/dge/dgelogic/exists.html index 0ccc43a9..fd5afc4d 100644 --- a/dgbuilder/nodes/dge/dgelogic/exists.html +++ b/dgbuilder/nodes/dge/dgelogic/exists.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/forNode.html b/dgbuilder/nodes/dge/dgelogic/forNode.html index 01a8a059..b6095a5a 100644 --- a/dgbuilder/nodes/dge/dgelogic/forNode.html +++ b/dgbuilder/nodes/dge/dgelogic/forNode.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/get-resource.html b/dgbuilder/nodes/dge/dgelogic/get-resource.html index ecd58192..247cd049 100644 --- a/dgbuilder/nodes/dge/dgelogic/get-resource.html +++ b/dgbuilder/nodes/dge/dgelogic/get-resource.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/is-available.html b/dgbuilder/nodes/dge/dgelogic/is-available.html index dc27e048..1a70f588 100644 --- a/dgbuilder/nodes/dge/dgelogic/is-available.html +++ b/dgbuilder/nodes/dge/dgelogic/is-available.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/notify.html b/dgbuilder/nodes/dge/dgelogic/notify.html index 157a133d..6423ad35 100644 --- a/dgbuilder/nodes/dge/dgelogic/notify.html +++ b/dgbuilder/nodes/dge/dgelogic/notify.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/record.html b/dgbuilder/nodes/dge/dgelogic/record.html index 310ebac0..f5360110 100644 --- a/dgbuilder/nodes/dge/dgelogic/record.html +++ b/dgbuilder/nodes/dge/dgelogic/record.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/release.html b/dgbuilder/nodes/dge/dgelogic/release.html index c68a2f72..2ea8cea9 100644 --- a/dgbuilder/nodes/dge/dgelogic/release.html +++ b/dgbuilder/nodes/dge/dgelogic/release.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/reserve.html b/dgbuilder/nodes/dge/dgelogic/reserve.html index a6a799a2..59bfb3ad 100644 --- a/dgbuilder/nodes/dge/dgelogic/reserve.html +++ b/dgbuilder/nodes/dge/dgelogic/reserve.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/save.html b/dgbuilder/nodes/dge/dgelogic/save.html index 923698ae..6e022154 100644 --- a/dgbuilder/nodes/dge/dgelogic/save.html +++ b/dgbuilder/nodes/dge/dgelogic/save.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/set.html b/dgbuilder/nodes/dge/dgelogic/set.html index b4a02f3f..bcbcae30 100644 --- a/dgbuilder/nodes/dge/dgelogic/set.html +++ b/dgbuilder/nodes/dge/dgelogic/set.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/switchNode.html b/dgbuilder/nodes/dge/dgelogic/switchNode.html index ad2077b1..57f82c97 100644 --- a/dgbuilder/nodes/dge/dgelogic/switchNode.html +++ b/dgbuilder/nodes/dge/dgelogic/switchNode.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgelogic/update.html b/dgbuilder/nodes/dge/dgelogic/update.html index e728a409..c166773c 100644 --- a/dgbuilder/nodes/dge/dgelogic/update.html +++ b/dgbuilder/nodes/dge/dgelogic/update.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgemain/GenericXML.html b/dgbuilder/nodes/dge/dgemain/GenericXML.html index 270bea63..4c9c01a6 100644 --- a/dgbuilder/nodes/dge/dgemain/GenericXML.html +++ b/dgbuilder/nodes/dge/dgemain/GenericXML.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!--<a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show SLI Values</b></a>--> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show SLI Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> @@ -116,7 +116,7 @@ validateXML(val); }); $("#node-input-show-sli-values").click(function(){ - console.log("SLIValues clicked."); + //console.log("SLIValues clicked."); showValuesBox(that.editor,sliValuesObj); }); diff --git a/dgbuilder/nodes/dge/dgemain/method.html b/dgbuilder/nodes/dge/dgemain/method.html index 52190335..134896e7 100644 --- a/dgbuilder/nodes/dge/dgemain/method.html +++ b/dgbuilder/nodes/dge/dgemain/method.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!--<a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show RPCs</b></a>--> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show RPCs</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/already-active.html b/dgbuilder/nodes/dge/dgeoutcome/already-active.html index a6c0778c..914bda10 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/already-active.html +++ b/dgbuilder/nodes/dge/dgeoutcome/already-active.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/failure.html b/dgbuilder/nodes/dge/dgeoutcome/failure.html index ed175a87..cabfab4b 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/failure.html +++ b/dgbuilder/nodes/dge/dgeoutcome/failure.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/not-found.html b/dgbuilder/nodes/dge/dgeoutcome/not-found.html index da09eafc..0b6bb8f9 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/not-found.html +++ b/dgbuilder/nodes/dge/dgeoutcome/not-found.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/other.html b/dgbuilder/nodes/dge/dgeoutcome/other.html index b346609c..7ceb2e79 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/other.html +++ b/dgbuilder/nodes/dge/dgeoutcome/other.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/outcome.html b/dgbuilder/nodes/dge/dgeoutcome/outcome.html index 33b084b6..122f7d3d 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/outcome.html +++ b/dgbuilder/nodes/dge/dgeoutcome/outcome.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html b/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html index 442b51bc..d1044208 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html +++ b/dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html b/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html index d1a27ba7..a080bbf6 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html +++ b/dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgeoutcome/success.html b/dgbuilder/nodes/dge/dgeoutcome/success.html index 3ea1266e..347d7d6a 100644 --- a/dgbuilder/nodes/dge/dgeoutcome/success.html +++ b/dgbuilder/nodes/dge/dgeoutcome/success.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgereturn/returnFailure.html b/dgbuilder/nodes/dge/dgereturn/returnFailure.html index 90adae7c..60ab2299 100644 --- a/dgbuilder/nodes/dge/dgereturn/returnFailure.html +++ b/dgbuilder/nodes/dge/dgereturn/returnFailure.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/nodes/dge/dgereturn/returnSuccess.html b/dgbuilder/nodes/dge/dgereturn/returnSuccess.html index 8de0c266..e2d50f3a 100644 --- a/dgbuilder/nodes/dge/dgereturn/returnSuccess.html +++ b/dgbuilder/nodes/dge/dgereturn/returnSuccess.html @@ -26,7 +26,7 @@ </div> <div class="form-row"> <a href="#" class="btn btn-mini" id="node-input-validate" style="margin-top: 4px;"><b>Validate XML</b></a> - <!-- <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> --> + <a href="#" class="btn btn-mini" id="node-input-show-sli-values" style="margin-top: 4px;"><b>Show Values</b></a> <input type="hidden" id="node-input-comments"> <a href="#" class="btn btn-mini" id="node-input-btnComments" style="margin-top: 4px;"><b>Add Comments</b></a> <div id="node-validate-result" class="form-tips" style="float:right;font-size:10px"></div> diff --git a/dgbuilder/pom.xml b/dgbuilder/pom.xml index 5eb8e726..6c185bbf 100644 --- a/dgbuilder/pom.xml +++ b/dgbuilder/pom.xml @@ -109,6 +109,25 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <phase>generate-sources</phase> + <configuration> + <tasks> + <exec executable="${project.basedir}/build_pom_for_yang_compile"> + <arg value="${project.parent.version}"/> + </exec> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> diff --git a/dgbuilder/public/red/main.js b/dgbuilder/public/red/main.js index 77b5cdfe..27032a26 100644 --- a/dgbuilder/public/red/main.js +++ b/dgbuilder/public/red/main.js @@ -392,8 +392,7 @@ var RED = (function() { .always(function() { }); } - - /* + /* function listYangFiles(){ yangFilesList=[]; var divStyle="<style>#list-yang-data-container a { color: #067ab4; font-size: 0.75em;} #list-yang-data-container a:hover { text-decoration: underline; padding: -15px -15px -15px 15px; } .header { height: 40px; border-bottom: 1px solid #EEE; background-color: #ffffff; height: 40px; -webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; } .footer { height: 40px; background-color: whiteSmoke; border-top: 1px solid #DDD; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 5px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }</style>"; @@ -1547,16 +1546,22 @@ Added this logic because , when the configuration item is choosen in the menu th options: [ {id:"btn-sidebar",icon:"fa fa-columns",label:"Sidebar (Ctrl+Space)",toggle:true,onselect:RED.sidebar.toggleSidebar}, null, + {id:"btn-manage-yang-modules-menu",icon:"fa fa-sign-in",label:"Manage Yang Modules",options:[ + {id:"btn-yang-upload",icon:"fa fa-clipboard",label:"Upload Yang File",onselect:RED.view.showYangUploadDialog}, + {id:"btn-available-yang-modules",icon:"fa fa-clipboard",label:"Available Yang Modules",onselect:showAvailableYangModules}, + {id:"btn-list-yang-files",icon:"fa fa-clipboard",label:"List Yang Files",onselect:listYangFiles}, + ]}, + null, {id:"btn-configure-upload",icon:"fa fa-book",label:"Configuration",toggle:false,onselect:updateConfiguration}, null, {id:"btn-manage-tabs",icon:"fa fa-info",label:"Manage Tabs",toggle:false,onselect:showSelectedTabs}, null, - {id:"btn-find-dgnumber",icon:"fa fa-info",label:"Search Text (Ctrl+[)",toggle:false,onselect:RED.view.showSearchTextDialog}, + {id:"btn-search-text",icon:"fa fa-info",label:"Search Text (Ctrl+[)",toggle:false,onselect:RED.view.showSearchTextDialog}, null, {id:"btn-find-dgnumber",icon:"fa fa-info",label:"Find Node (Ctrl+B)",toggle:false,onselect:RED.view.showDgNumberDialog}, null, - /*{id:"btn-loop-detection",icon:"fa fa-info",label:"Loop Detection",toggle:true,onselect:performLoopDetection}, - null ,*/ + {id:"btn-request-input",icon:"fa fa-info",label:"RPC Input (Ctrl+O)",toggle:false,onselect:RED.view.showRequestTemplateDialog}, + null, {id:"btn-node-status",icon:"fa fa-info",label:"Node Status",toggle:true,onselect:toggleStatus}, null, {id:"btn-node-dgnumber",icon:"fa fa-info",label:"Show Node Numbers",toggle:true,onselect:toggleDgNumberDisplay}, diff --git a/dgbuilder/public/red/ui/view.js b/dgbuilder/public/red/ui/view.js index 0109d1ed..707bde9e 100644 --- a/dgbuilder/public/red/ui/view.js +++ b/dgbuilder/public/red/ui/view.js @@ -1700,7 +1700,7 @@ RED.view = (function() { $(function() { var htmlStr= "<div id='yang-upload-div' style='width:375;height:225'>" + '<form id="uploadForm" name="uploadForm" enctype="multipart/form-data" action="/api/uploadyang" method="post" >' + - "<input id='yang-file-id' name='yangFile' type='file' accept='.yang,.zip'><p style='font-size:0.7em'><i>For Module depending on multiple yang files, zip them and upload the zip file</i</p><br><br><br><br><br><p id='yang-upload-status'></p>" + + "<input id='yang-file-id' name='yangFile' type='file' accept='.yang,.zip'><p style='font-size:0.7em'><i>For Module depending on multiple yang files, zip them and upload the zip file. The zip file name should match the exact name of the module with .zip extension</i</p><br><br><br><br><br><p id='yang-upload-status'></p>" + //'<input id="upload-yang-button-id" style="font-size:1em;font-weight:bold" type="button" value="Upload Yang" name="upload-yang-button">' + "</form></div>"; diff --git a/dgbuilder/public/util/js/dgeToXml.js b/dgbuilder/public/util/js/dgeToXml.js index 2bbb0c15..7582d275 100644 --- a/dgbuilder/public/util/js/dgeToXml.js +++ b/dgbuilder/public/util/js/dgeToXml.js @@ -522,7 +522,7 @@ function customValidation(currNodeSet){ } //console.log("parentNodeType:" + parentNodeType); - if(countChildLogicNodes >1 && parentNodeType != 'block' ){ + if(countChildLogicNodes >1 && parentNodeType != 'block' && parentNodeType != 'for' ){ if(node.dgnumber != undefined && node.dgnumber){ flowDesignErrors.push("Warning:May need a block Node after Node. <br><span style='color:red'>Node Name:</span>" + node.name + "<br><span style='color:red'>DG Number:</span>" + node.dgnumber[0] ); }else{ diff --git a/dgbuilder/red/server.js b/dgbuilder/red/server.js index 01a769e7..a5eb922d 100644 --- a/dgbuilder/red/server.js +++ b/dgbuilder/red/server.js @@ -1084,7 +1084,8 @@ function createServer(_server,_settings) { var matchedArr = fileName.match(/.zip$/); if(matchedArr != null && matchedArr.length >0){ console.log("uploaded zip file" + fileName); - commandToExec = appDir + "/tools/generate_props_from_yangs_zip.sh " + yangFileFullPath ; + //commandToExec = appDir + "/tools/generate_props_from_yangs_zip.sh " + yangFileFullPath ; + commandToExec = appDir + "/tools/generate_props_from_yang.sh " + yangFileFullPath ; }else{ commandToExec = appDir + "/tools/generate_props_from_yang.sh " + yangFileFullPath ; console.log("uploaded file" + fileName); diff --git a/dgbuilder/show_status b/dgbuilder/show_status deleted file mode 100755 index 8c7c37bd..00000000 --- a/dgbuilder/show_status +++ /dev/null @@ -1,53 +0,0 @@ -tbold=$(tput setf 3) -bold=$(tput setf 2) -bold1=$(tput setf 2) -offbold=$(tput rmso;tput sgr0) - -function pad { - #echo "1 is $1 2 is $2" - if [ "$1" == "" ] - then - $1 = ""; - fi - let count=0 - curr_len=`expr length "$1"` - let space_length=$2-$curr_len - spaces="" - while [ $count -lt $space_length ] - do - spaces="$spaces " - let count=$count+1 - done - echo "$1$spaces" -} - -function isRunning { - echo $(curl -I "$1" 2>/dev/null|head -1|tail -1|awk '{print $2}') -} -dirName=$(pwd) -options=($(ls -l $dirName/releases|grep ^d|awk '{print $NF}'|sort)) - echo "$(pad RELEASE 15)$(pad URL 30)$(pad Status 10)" - echo "$(pad '----' 15)$(pad '---' 30)$(pad '------' 10)" - for opt in "${options[@]}" - do - - releaseDir="$opt" - if [ -e "./releases/${opt}/customSettings.js" ] - then - pid=$(cat ./releases/$releaseDir/logs/process_pid 2>/dev/null) - port=$(cat ./releases/$releaseDir/customSettings.js 2>/dev/null|grep uiPort|sed -e 's/[, ]//g'|cut -d: -f2) - resp1=$(isRunning "http://localhost:$port") - if [ "$resp1" == "401" ] - then - echo "$(pad $releaseDir 15)$(pad http://localhost:$port 30)${bold}$(pad running 10)${offbold}" - else - processId=$(netstat -upltn 2>/dev/null|grep $port|awk '{print $NF}'|sed -e 's%/node-red%%g') - if [ "$processId" == "" ] - then - echo "$(pad $releaseDir 15)$(pad http://localhost:$port 30)${bold}$(pad stopped 10)${offbold}" - else - echo "$(pad $releaseDir 15)$(pad http://localhost:$port 30)${bold}$(pad running 10)${offbold}" - fi - fi - fi - done diff --git a/dgbuilder/src/assembly/assemble_zip.xml b/dgbuilder/src/assembly/assemble_zip.xml index 0fbdde84..7bf22d22 100644 --- a/dgbuilder/src/assembly/assemble_zip.xml +++ b/dgbuilder/src/assembly/assemble_zip.xml @@ -95,12 +95,7 @@ <directory>target/svclogic/lib</directory> <outputDirectory>dgbuilder/svclogic/lib</outputDirectory> <includes> - <include>sli-common*.jar</include> - <include>mysql-connector*.jar</include> - <include>antlr*.jar</include> - <include>commons-lang*.jar</include> - <include>slf4j-api*.jar</include> - <include>slf4j-simple*.jar</include> + <include>*.jar</include> </includes> </fileSet> </fileSets> diff --git a/dgbuilder/start b/dgbuilder/start deleted file mode 100755 index 4d3f9f5e..00000000 --- a/dgbuilder/start +++ /dev/null @@ -1,71 +0,0 @@ -releaseDir="$1" -if [ "$#" != "1" ] -then - echo "Usage: $0 releaseDirName" - exit -fi -echo "ReleaseDir:$releaseDir" -export PROJECT_HOME=`pwd` -tbold=$(tput setf 3) -bold=$(tput setf 2) -bold1=$(tput setf 2) -offbold=$(tput rmso;tput sgr0) - -function pad { - #echo "1 is $1 2 is $2" - if [ "$1" == "" ] - then - $1 = ""; - fi - let count=0 - curr_len=`expr length "$1"` - let space_length=$2-$curr_len - spaces="" - while [ $count -lt $space_length ] - do - spaces="$spaces " - let count=$count+1 - done - echo "$1$spaces" -} - -function isRunning { - echo $(curl -I "$1" 2>/dev/null|head -1|tail -1|awk '{print $2}') -} - -if [ -e "releases/${releaseDir}/customSettings.js" ] -then - pid=$(cat releases/$releaseDir/logs/process_pid 2>/dev/null) - port=$(cat releases/$releaseDir/customSettings.js|grep uiPort|sed -e 's/[, ]//g'|cut -d: -f2 ) - count=$(ps -p$pid 2>/dev/null|grep -v PID|wc -l) - if [ "$count" != "0" ] - then - echo "For Release \"$releaseDir\" - http://localhost:$port" - echo "********ALREADY RUNNING PID:$pid *******" - else - pid_listening_on_port=$(netstat -upltn 2>/dev/null|grep -w $port|awk '{print $NF}'|cut -d'/' -f1) - if [ "$pid_listening_on_port" != "" ] - then - if [ "$pid_listening_on_port" != "$pid" ] - then - echo "port $port is already in use by other process" - ps -p $pid_listening_on_port - else - echo "Process is already running."; - fi - exit; - fi - node red.js --settings releases/${releaseDir}/customSettings.js - process_pid="$!" - echo $process_pid >releases/$releaseDir/logs/process_pid - port=$(cat releases/${releaseDir}/customSettings.js|grep uiPort|sed -e 's/[, ]//g'|cut -d: -f2) - echo "For Release \"$releaseDir\" ${urlIp}:$port --- STARTED PID:$process_pid" - if [ "${releaseDir}" != "" ] - then - sleep 3 - ./show_status|grep -w ${releaseDir} - fi - fi -else - echo "Directory ${releaseDir} is not setup. Use the createReleaseDir.sh script to setup the directory." -fi diff --git a/dgbuilder/stop b/dgbuilder/stop deleted file mode 100755 index 9d0591a4..00000000 --- a/dgbuilder/stop +++ /dev/null @@ -1,51 +0,0 @@ -tbold=$(tput setf 3) -bold=$(tput setf 2) -bold1=$(tput setf 2) -offbold=$(tput rmso;tput sgr0) - -function pad { - #echo "1 is $1 2 is $2" - if [ "$1" == "" ] - then - $1 = ""; - fi - let count=0 - curr_len=`expr length "$1"` - let space_length=$2-$curr_len - spaces="" - while [ $count -lt $space_length ] - do - spaces="$spaces " - let count=$count+1 - done - echo "$1$spaces" -} -releaseDir="" -if [ "$#" == "1" ] -then - releaseDir="$1" -fi - -if [ -e "releases/${releaseDir}/customSettings.js" ] -then - port=$(cat releases/${releaseDir}/customSettings.js|grep uiPort|sed -e 's/[, ]//g'|cut -d: -f2) - kill $(cat releases/${releaseDir}/logs/process_pid 2>/dev/null) >/dev/null 2>&1 - if [ "$?" != "0" ] - then - #kill only if its a node-red process - processPid=$(netstat -upltn 2>/dev/null|grep -w $port|awk '{print $NF}'|sed -e 's%/node-red%%g') - kill $processPid 2>/dev/null - echo "http://localhost:$port ---- STOPPED" - ./show_status|grep -w "${releaseDir}" - else - echo "http://localhost:$port ---- STOPPED" - ./show_status|grep -w "${releaseDir}" - fi -else - if [ "$releaseDir" != "" ] - then - echo "Release Directory ${releaseDir} not setup."; - else - echo "Usage:$0 releaseDirName" - fi -fi diff --git a/dgbuilder/tools/auto_app.sh b/dgbuilder/tools/auto_app.sh deleted file mode 100755 index a3e0f2e9..00000000 --- a/dgbuilder/tools/auto_app.sh +++ /dev/null @@ -1,24 +0,0 @@ -toolsDir=$PROJECT_HOME/tools -if [ "$#" != "1" ] -then - echo "Usage: $0 appName" - exit -fi -appName="$1" -mkdir tmpws -cd tmpws -mkdir logs -mvn archetype:generate -DarchetypeGroupId=com.brocade.developer -DarchetypeArtifactId=brocade.dev.plugin.ext.archetype -DarchetypeVersion=1.2.0.100-SNAPSHOT >${toolsDir}/tmpws/logs/mvn_gen_archetype.log 2>&1 <<EOF -org.openecomp.sdnc.app -${appName} -1.0.0-SNAPSHOT -org.openecomp.sdnc.app -Y -EOF -if [ "$?" == "0" ] -then - echo "App created successfully" -else - echo "App creation failed" -fi -${toolsDir}/update_app_impl_yang.sh "${appName}" $1 diff --git a/dgbuilder/tools/generate_props_from_yang.sh b/dgbuilder/tools/generate_props_from_yang.sh index 4ce93af5..70162c6f 100755 --- a/dgbuilder/tools/generate_props_from_yang.sh +++ b/dgbuilder/tools/generate_props_from_yang.sh @@ -7,6 +7,8 @@ toolsDir=$PROJECT_HOME/tools rm -rf ${toolsDir}/tmpws mkdir ${toolsDir}/tmpws mkdir ${toolsDir}/tmpws/logs +mkdir ${toolsDir}/tmpws/jars +mkdir ${toolsDir}/tmpws/tmp if [ "$#" != "1" ] then echo "Command line:$0 $*" >${toolsDir}/tmpws/logs/err.log @@ -14,15 +16,81 @@ then exit fi -appName="yangApp" -cd ${toolsDir}/tmpws -mvn archetype:generate -DarchetypeGroupId=com.brocade.developer -DarchetypeArtifactId=brocade.dev.plugin.ext.archetype -DarchetypeVersion=1.2.0.100-SNAPSHOT >${toolsDir}/tmpws/logs/mvn_gen_archetype.log 2>&1 <<EOF -org.openecomp.sdnc.app -${appName} -1.0.0-SNAPSHOT -org.openecomp.sdnc.app -Y -EOF -${toolsDir}/update_app_impl_yang.sh "${appName}" $1 +isZipFile="N" +echo "$1" | grep "\.zip$" >/dev/null 2>&1 +if [ "$?" -eq "0" ] +then + isZipFile="Y" +fi + +if [ "$isZipFile" = "Y" ] +then + #zip file of yangs provided + zipFile=$(basename $1) + unzip -o -d $PROJECT_HOME/tools/tmpws/tmp $1 >/dev/null 2>&1 + rm $1 >/dev/null 2>&1 + cd $PROJECT_HOME/tools/tmpws/tmp + fName="${zipFile}" + extension="${fName##*.}" + moduleName="${fName%.*}" + #echo "ModuleName is :$moduleName" + rm -rf $PROJECT_HOME/yangFiles/$moduleName + mkdir $PROJECT_HOME/yangFiles/$moduleName + mv *.yang $PROJECT_HOME/yangFiles/$moduleName + cd $PROJECT_HOME/tools + yangFilesFullPath=${PROJECT_HOME}/yangFiles/$moduleName + cd ${toolsDir}/tmpws + mkdir -p yangApp/model/src/main/yang + mkdir -p yangApp/model/src/main/yang-gen-sal + cp -r ${yangFilesFullPath}/* yangApp/model/src/main/yang + cp ${toolsDir}/pom.xml_base yangApp/model/pom.xml + cd ${toolsDir}/tmpws/yangApp/model + + #Maven Compile + mvn clean install >${toolsDir}/tmpws/logs/mvn_install.log 2>${toolsDir}/tmpws/logs/err.log + yangApp_model_jar="yangApp-model-1.0.0-SNAPSHOT.jar" + + #Copy the built jar to jars directory + cp ${toolsDir}/tmpws/yangApp/model/target/${yangApp_model_jar} ${toolsDir}/tmpws/jars + . ${toolsDir}/setClasspath + + mv ${toolsDir}/output_js/${moduleName}_inputs.js ${toolsDir}/output_js/${moduleName}_inputs_prev.js >/dev/null 2>&1 + + ${toolsDir}/getRpcsClassFromYang.sh ${yangFilesFullPath}/${moduleName}.yang ${toolsDir}/tmpws/yangApp/model/target/${yangApp_model_jar} > ${toolsDir}/output_js/${moduleName}.js + + node ${toolsDir}/dot_to_json.js ${toolsDir}/output_js/${moduleName}.js $moduleName >${toolsDir}/output_js/${moduleName}_inputs.js + + cp ${toolsDir}/output_js/${moduleName}_inputs.js $PROJECT_HOME/generatedJS +else + #Single yang provided + yangFileFullPath=$1 + cd ${toolsDir}/tmpws + mkdir -p yangApp/model/src/main/yang + mkdir -p yangApp/model/src/main/yang-gen-sal + cp ${yangFileFullPath} yangApp/model/src/main/yang + cp ${toolsDir}/pom.xml_base yangApp/model/pom.xml + cd ${toolsDir}/tmpws/yangApp/model + + #Maven Compile + mvn clean install >${toolsDir}/tmpws/logs/mvn_install.log 2>${toolsDir}/tmpws/logs/err.log + yangApp_model_jar="yangApp-model-1.0.0-SNAPSHOT.jar" + + #Copy the built jar to jars directory + cp ${toolsDir}/tmpws/yangApp/model/target/${yangApp_model_jar} ${toolsDir}/tmpws/jars + . ${toolsDir}/setClasspath + + moduleName=$(cat $yangFileFullPath|egrep "module .*{"|cut -d' ' -f2|cut -d'{' -f1) + + mv ${toolsDir}/output_js/${moduleName}_inputs.js ${toolsDir}/output_js/${moduleName}_inputs_prev.js >/dev/null 2>&1 + + ${toolsDir}/getRpcsClassFromYang.sh ${yangFileFullPath} ${toolsDir}/tmpws/yangApp/model/target/${yangApp_model_jar} > ${toolsDir}/output_js/${moduleName}.js + + node ${toolsDir}/dot_to_json.js ${toolsDir}/output_js/${moduleName}.js $moduleName >${toolsDir}/output_js/${moduleName}_inputs.js + + cp ${toolsDir}/output_js/${moduleName}_inputs.js $PROJECT_HOME/generatedJS + + +fi + echo "Done..." diff --git a/dgbuilder/tools/generate_props_from_yangs.sh b/dgbuilder/tools/generate_props_from_yangs.sh deleted file mode 100755 index 8867cea3..00000000 --- a/dgbuilder/tools/generate_props_from_yangs.sh +++ /dev/null @@ -1,28 +0,0 @@ -if [ -z "$PROJECT_HOME" ] -then - export PROJECT_HOME=$(pwd)/.. -fi - -toolsDir=$PROJECT_HOME/tools -rm -rf ${toolsDir}/tmpws -mkdir ${toolsDir}/tmpws -mkdir ${toolsDir}/tmpws/logs -if [ "$#" != "2" ] -then - echo "Command line:$0 $*" >${toolsDir}/tmpws/logs/err.log - echo "Usage: $0 yangFilesdirectoryFullPath baseYangFile" >>${toolsDir}/tmpws/logs/err.log - exit -fi - -appName="yangApp" -cd ${toolsDir}/tmpws -mvn archetype:generate -DarchetypeGroupId=com.brocade.developer -DarchetypeArtifactId=brocade.dev.plugin.ext.archetype -DarchetypeVersion=1.2.0.100-SNAPSHOT >${toolsDir}/tmpws/logs/mvn_gen_archetype.log 2>&1 <<EOF -org.openecomp.sdnc.app -${appName} -1.0.0-SNAPSHOT -org.openecomp.sdnc.app -Y -EOF -${toolsDir}/update_app_impl_yangs.sh "${appName}" $1 $2 -echo "Done..." - diff --git a/dgbuilder/tools/generate_props_from_yangs_zip.sh b/dgbuilder/tools/generate_props_from_yangs_zip.sh deleted file mode 100755 index 39607110..00000000 --- a/dgbuilder/tools/generate_props_from_yangs_zip.sh +++ /dev/null @@ -1,36 +0,0 @@ -if [ "$PROJECT_HOME" == "" ] -then - export PROJECT_HOME=$(pwd)/.. -fi - -toolsDir=$PROJECT_HOME/tools -if [ "$#" != "1" ] -then - echo "Usage: $0 yangFilesZipFullPath" - exit -fi -yangFilesZipFullPath="$1" -rm -rf $PROJECT_HOME/tools/tmp -mkdir $PROJECT_HOME/tools/tmp -mv ${yangFilesZipFullPath} $PROJECT_HOME/tools/tmp -cd $PROJECT_HOME/tools/tmp -zipFile=$(basename $yangFilesZipFullPath) -unzip $PROJECT_HOME/tools/tmp/$zipFile -rm ${zipFile} -for i in $(ls *.yang) -do - fName="$i" - extension="${fName##*.}" - moduleName="${fName%.*}" - count=$(grep -w "import $moduleName" *.yang|wc -l) - if [ "$count" -eq "0" ] - then - rm -rf $PROJECT_HOME/yangFiles/$moduleName - mkdir $PROJECT_HOME/yangFiles/$moduleName - mv *.yang $PROJECT_HOME/yangFiles/$moduleName - cd $PROJECT_HOME/tools - echo ./generate_props_from_yangs.sh "$PROJECT_HOME/yangFiles/$moduleName" "$fName" - ./generate_props_from_yangs.sh "$PROJECT_HOME/yangFiles/$moduleName" "$fName" - exit - fi -done diff --git a/dgbuilder/tools/getRpcsClassFromYang.sh b/dgbuilder/tools/getRpcsClassFromYang.sh index 91d95f02..b0703152 100755 --- a/dgbuilder/tools/getRpcsClassFromYang.sh +++ b/dgbuilder/tools/getRpcsClassFromYang.sh @@ -12,12 +12,12 @@ module=$(cat $yangFile|egrep "module .*{"|awk '{print $2}'|sed -e 's/{//g') #echo " \"$module\" : [" rpcs=$(grep rpc $yangFile|grep -v leaf|sed -e 's/^\s\+rpc//g'|awk '{print $1}') #echo ${rpcs} -for i in `find ${toolsDir}/yangToolsJars -name "*.jar" -print` +for i in `find ${PROJECT_HOME}/svclogic/lib -name "*.jar" -print` do #echo $i export CLASSPATH=$CLASSPATH:$i done -export CLASSPATH=$2:$CLASSPATH:.:${toolsDir}/slf4j-api-1.7.2.jar:${toolsDir}/guava-14.0.1.jar:${toolsDir}/printYangToProp.jar +export CLASSPATH=$CLASSPATH:${toolsDir}/printYangToProp.jar:. allProps="" for rpc in $rpcs do diff --git a/dgbuilder/tools/getRpcsClassFromYangs.sh b/dgbuilder/tools/getRpcsClassFromYangs.sh deleted file mode 100755 index f3ce4c81..00000000 --- a/dgbuilder/tools/getRpcsClassFromYangs.sh +++ /dev/null @@ -1,85 +0,0 @@ -toolsDir=$PROJECT_HOME/tools -. ${toolsDir}/setClasspath -if [ "$#" != "2" ] -then - echo "Usage $0 yang_file generated_jar_file" - echo "example $0 /home/users/sdnc/src/appName/model/src/main/yang/app.yang /home/users/sdnc/src/appName/model/target/appName.model-2.0.0.jar" - exit -fi -yangFile="$1" -jarFile="$2" -module=$(cat $yangFile|egrep "module .*{"|awk '{print $2}'|sed -e 's/{//g') -#echo " \"$module\" : [" -rpcs=$(grep rpc $yangFile|grep -v leaf|sed -e 's/^\s\+rpc//g'|awk '{print $1}') -for i in `find ${toolsDir}/yangToolsJars -name "*.jar" -print` -do -#echo $i -export CLASSPATH=$CLASSPATH:$i -done -export CLASSPATH=$2:$CLASSPATH:.:${toolsDir}/slf4j-api-1.7.2.jar:${toolsDir}/guava-14.0.1.jar:${toolsDir}/printYangToProp.jar -allProps="" -for rpc in $rpcs -do -rpcVal=$(echo $rpc|sed -e "s/\b\(.\)/\u\1/g"|sed s/\-//g) -#echo $rpcVal -className=$(jar -tvf ${jarFile}|grep "org/opendaylight/yang/gen/"|grep -w "${rpcVal}Input.class"|grep -v grep|awk '{print $NF}'|sed -e 's/\//./g'|sed -e 's/.class$//g') -#echo $className -inputProps="" -if [ "$className" != "" ] -then - #java -cp $CLASSPATH PrintYangToProp $className 2>/dev/null|grep '*' |cut -d'*' -f2|sed -e "s/^[ \t]*//g"|sed -e "s/^/\t\t\"/g"|sed -e "s/$/\",/g" - inputProps=$(java -cp $CLASSPATH PrintYangToProp $className 2>${toolsDir}/tmpws/logs/err.log) -fi -className=$(jar -tvf ${jarFile}|grep "org/opendaylight/yang/gen/"|grep -w "${rpcVal}Output"|grep -v grep|awk '{print $NF}'|sed -e 's/\//./g'|sed -e 's/.class$//g') -#echo $inputProps -#echo $className -outputProps="" -if [ "$className" != "" ] -then - #java -cp $CLASSPATH PrintYangToProp $className 2>/dev/null|grep '*' |cut -d'*' -f2|sed -e "s/^[ \t]*//g"|sed -e "s/^/\t\t\"/g"|sed -e "s/$/\",/g" - outputProps=$(java -cp $CLASSPATH PrintYangToProp $className 2>${toolsDir}/tmpws/logs/err.log) -fi -if [ -z "$allProps" ] -then - allProps=$(echo ${inputProps}${outputProps}|sed -e s/,$//g) -else - allProps=$(echo ${allProps},${inputProps}${outputProps}|sed -e s/,$//g) -fi -done -#echo $allProps -#OIFS=$IFS -#IFS=',' -#arr2=$allProps -#for x in $arr2 -#do -# echo "$x" -#done -#IFS=$OIFS -#echo " ]" -echo "module.exports = {" -echo "\"moduleName\" : \"${module}\"," -echo "'${module}_VALUES' : " -echo "[ $allProps ]"|python -m json.tool -echo "," -echo "'${module}_RPCS' : [" - -cnt=0 -#numOfRpcs=${#rpcs[@]} -numOfRpcs=0; -for rpc in $rpcs -do - numOfRpcs=$((numOfRpcs+1)) -done - -for rpc in $rpcs -do - cnt=$((cnt+1)) - if [ $cnt -eq $numOfRpcs ] - then - echo " \"$rpc\"" - else - echo " \"$rpc\"," - fi -done -echo " ]" -echo "}" diff --git a/dgbuilder/tools/module-provider-impl.yang b/dgbuilder/tools/module-provider-impl.yang deleted file mode 100644 index 62059104..00000000 --- a/dgbuilder/tools/module-provider-impl.yang +++ /dev/null @@ -1,61 +0,0 @@ -module yangApp-provider-impl { - - yang-version 1; - namespace "brocade:training:yangApp:provider:impl"; - prefix "yangApp-provider-impl"; - - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } - - description - "This module contains the base YANG definitions for - yangApp-provider impl implementation."; - - revision "2014-05-23" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity yangApp-provider-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix yangAppProvider; - } - - // Augments the 'configuration' choice node under modules/module. - // We consume the three main services, RPCs, DataStore, and Notifications - augment "/config:modules/config:module/config:configuration" { - case yangApp-provider-impl { - when "/config:modules/config:module/config:type = 'yangApp-provider-impl'"; - - container rpc-registry { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-rpc-registry; - } - } - } - - container notification-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-notification-service; - } - } - } - - container data-broker { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity mdsal:binding-async-data-broker; - } - } - } - } - } -} diff --git a/dgbuilder/tools/module-provider-impl.yang.bak b/dgbuilder/tools/module-provider-impl.yang.bak deleted file mode 100644 index e69de29b..00000000 --- a/dgbuilder/tools/module-provider-impl.yang.bak +++ /dev/null diff --git a/dgbuilder/tools/update_app_impl_yang.sh b/dgbuilder/tools/update_app_impl_yang.sh deleted file mode 100755 index 9ae5610b..00000000 --- a/dgbuilder/tools/update_app_impl_yang.sh +++ /dev/null @@ -1,45 +0,0 @@ -toolsDir=$PROJECT_HOME/tools -appRootDir=$1 -yangFileFullPath=$2 -yangFile=$(basename $yangFileFullPath) - -if [ "$#" != "2" ] -then - echo "Usage: $0 appRootDir yangModuleName example:$0 bwcal bwcal" - exit -fi -cd ${toolsDir}/tmpws -#cp ${toolsDir}/module-provider-impl.yang ${toolsDir}/tmpws - -if [ ! -e "${toolsDir}/module-provider-impl.yang" ] -then - echo "${toolsDir}/module-provider-impl.yang should exist" - exit -fi - -#echo "appRootDir:$appRootDir" -#echo "yangFileFullPath:$yangFileFullPath" -#echo "yangFile:$yangFile" - -cp ${yangFileFullPath} ${appRootDir}/model/src/main/yang/${yangFile} -if [ "$?" != "0" ] -then - echo "Could not copy the yang file. Exiting ..." - exit -fi - -moduleName=$(cat $yangFileFullPath|egrep "module .*{"|cut -d' ' -f2|cut -d'{' -f1) -#echo $moduleName -sed -i.bak s/\$MODULE/$1/g ${toolsDir}/module-provider-impl.yang -cp ${toolsDir}/module-provider-impl.yang ${appRootDir}/provider/src/main/yang/${appRootDir}-provider-impl.yang -cd $appRootDir -mvn clean install >${toolsDir}/tmpws/logs/mvn_install.log 2>&1 -mkdir ${toolsDir}/tmpws/jars -cp ./model/target/${appRootDir}.model-1.0.0-SNAPSHOT.jar ${toolsDir}/tmpws/jars - -mv ${toolsDir}/output_js/${moduleName}_inputs.js ${toolsDir}/output_js/${moduleName}_inputs_prev.js >/dev/null 2>&1 - -${toolsDir}/getRpcsClassFromYang.sh ${yangFileFullPath} ${toolsDir}/tmpws/${appRootDir}/model/target/${appRootDir}.model-1.0.0-SNAPSHOT.jar > ${toolsDir}/output_js/${moduleName}.js - -node ${toolsDir}/dot_to_json.js ${toolsDir}/output_js/${moduleName}.js $moduleName >${toolsDir}/output_js/${moduleName}_inputs.js -cp ${toolsDir}/output_js/${moduleName}_inputs.js $PROJECT_HOME/generatedJS diff --git a/dgbuilder/tools/update_app_impl_yangs.sh b/dgbuilder/tools/update_app_impl_yangs.sh deleted file mode 100755 index 612f97d3..00000000 --- a/dgbuilder/tools/update_app_impl_yangs.sh +++ /dev/null @@ -1,51 +0,0 @@ -toolsDir=$PROJECT_HOME/tools -appRootDir=$1 -yangFilesDirFullPath=$2 -baseYangFile=$3 - -#echo ${appRootDir} -#echo ${yangFilesDirFullPath} -#echo ${baseYangFile} -if [ "$#" -lt "3" ] -then - echo "Usage: $0 appRootDir yangFilesDirectoryFullPath baseYangFile example:$0 asdcApi /home/brocade/sdnc/asdcApi ASDC-API.yang" - exit -fi -cd ${toolsDir}/tmpws -#cp ${toolsDir}/module-provider-impl.yang ${toolsDir}/tmpws - -if [ ! -e "${toolsDir}/module-provider-impl.yang" ] -then - echo "module-provider-impl.yang should exist in the current directory" - exit -fi - -#echo "appRootDir:$appRootDir" -#echo "yangFileFullPath:$yangFileFullPath" -#echo "yangFile:$yangFile" -cp ${yangFilesDirFullPath}/*.yang ${appRootDir}/model/src/main/yang -if [ "$?" != "0" ] -then - echo "Could not copy the yang file. Exiting ..." - exit -fi - -moduleName=$(cat ${yangFilesDirFullPath}/${baseYangFile}|egrep "module .*{"|cut -d' ' -f2|cut -d'{' -f1) -sed -i.bak s/\$MODULE/$1/g ${toolsDir}/module-provider-impl.yang -cp ${toolsDir}/module-provider-impl.yang ${appRootDir}/provider/src/main/yang/${appRootDir}-provider-impl.yang -cd $appRootDir -mvn clean install >${toolsDir}/tmpws/logs/mvn_install.log 2>&1 -if [ "$?" != "0" ] -then - echo "mvn compile failed" - exit 1 -fi -mkdir ${toolsDir}/tmpws/jars -cp ./model/target/${appRootDir}.model-1.0.0-SNAPSHOT.jar ${toolsDir}/tmpws/jars - -mv ${toolsDir}/output_js/${moduleName}.js ${toolsDir}/output_js/${moduleName}.js_prev >/dev/null 2>&1 -${toolsDir}/getRpcsClassFromYangs.sh ${yangFilesDirFullPath}/${baseYangFile} ${toolsDir}/tmpws/${appRootDir}/model/target/${appRootDir}.model-1.0.0-SNAPSHOT.jar > ${toolsDir}/output_js/${moduleName}.js - -mv ${toolsDir}/output_js/${moduleName}_inputs.js ${toolsDir}/output_js/${moduleName}_inputs_prev.js >/dev/null 2>&1 -node ${toolsDir}/dot_to_json.js ${toolsDir}/output_js/${moduleName}.js $moduleName >>${toolsDir}/output_js/${moduleName}_inputs.js -cp ${toolsDir}/output_js/${moduleName}_inputs.js $PROJECT_HOME/generatedJS |