From b9b3b4b74e70cae099a6ccb0dd06427fdb5a2279 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 6 Nov 2018 13:39:01 -0500 Subject: Remove obsolete dgbuilder SDNC dgbuilder is no longer used - dgbuilder is now in CCSDK. Change-Id: I496e346ed3864779f36c00c354742f7d36447399 Issue-ID: SDNC-488 Signed-off-by: Timoney, Dan (dt5972) Former-commit-id: e38fe292bd511784d1c145e84a9af7d94b6f3669 --- dgbuilder/red/server.js | 1318 ----------------------------------------------- 1 file changed, 1318 deletions(-) delete mode 100644 dgbuilder/red/server.js (limited to 'dgbuilder/red/server.js') diff --git a/dgbuilder/red/server.js b/dgbuilder/red/server.js deleted file mode 100644 index 91bee453..00000000 --- a/dgbuilder/red/server.js +++ /dev/null @@ -1,1318 +0,0 @@ -/** - * 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. - **/ - -var express = require('express'); -var util = require('util'); -var multer = require('multer'); -var when = require('when'); -var exec = require('child_process').exec; - -var createUI = require("./ui"); -var redNodes = require("./nodes"); -var comms = require("./comms"); -var storage = require("./storage"); -var fs=require('fs'); -var path = require("path"); -var app = null; -var nodeApp = null; -var server = null; -var settings = null; - -var flowShareUsers = require("../flowShareUsers"); - -//console.dir(flowShareUsers); - -function createServer(_server,_settings) { - server = _server; - settings = _settings; - - comms.init(_server,_settings); - - nodeApp = express(); - app = express(); - - if (settings.httpAdminRoot !== false) { - - - if (!settings.disableEditor) { - createUI(settings,app); - } - - var slaActions = require("./sla"); - - app.get("/flows",function(req,res) { - res.json(redNodes.getFlows()); - }); - - app.get("/loadJSFiles",function(req,res) { - var appDir = path.dirname(require.main.filename); - var generatedJSDir=appDir + "/generatedJS"; - var glob = require("glob") - glob(generatedJSDir + "/**/*.js", null, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. - //console.dir(files); - var sliValuesObj =[]; - for(var i=0;files!= null && i0){ - files.sort(function(a,b){ - //console.log("file1:" + a); - //console.log("file2:" + b); - var fileStat1=fs.statSync(flowDir+ "/" + a); - var fileStat2=fs.statSync(flowDir+ "/" + b); - if(fileStat1.mtime > fileStat2.mtime){ - return 1; - }else if(fileStat1.mtime < fileStat2.mtime){ - return -1; - }else{ - return 0; - } - }); - for(var i=0;i0){ - console.log("uploaded zip file" + fileName); - //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); - } - } - var exec = require('child_process').exec; - console.log("commandToExec:" + commandToExec); - var child = exec(commandToExec ,function (error,stdout,stderr){ - if(error){ - console.log("Error occured:" + error); - var msg = "File " + fileName + " could not be processed successfully."; - if(stderr){ - console.log("stderr:" + stderr); - res.json({"sliValuesObj" : [],"message":msg}); - }else{ - res.json({"sliValuesObj" : [],"message":msg}); - } - }else{ - if(stderr){ - console.log("stderr:" + stderr); - } - if(stdout){ - console.log("stdout:" + stdout); - } - var msg = "File " + fileName + " processed successfully."; - var generatedJSDir=appDir + "/generatedJS"; - var sliValuesObj =[]; - //var glob = require("glob"); - //glob(generatedJSDir + "/**/*.js", null, function (er, files) { - /* - var sliValuesObj =[]; - for(var i=0;files!= null && i 0) { - util.log("[red] Added node types:"); - for (var i=0;i 0) { - util.log("------------------------------------------"); - if (settings.verbose) { - for (i=0;i 0) { - util.log("[red] Missing node modules:"); - var missingModules = {}; - for (i=0;i