-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
4,460 additions
and
4,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/** | ||
* Created by tkecskes on 8/6/2014. | ||
*/ | ||
var requirejs = require("requirejs"); | ||
requirejs.config({ | ||
nodeRequire: require, | ||
baseUrl: __dirname + "/..", | ||
paths: { | ||
"storage": "common/storage", | ||
"core": "common/core", | ||
"util": "common/util", | ||
"coreclient": "common/core/users" | ||
} | ||
}); | ||
requirejs(['core/core','storage/serveruserstorage','coreclient/serialization', 'fs'], | ||
function(Core,Storage,Serialization,FS){ | ||
var mongoip = process.argv[2] || null, | ||
mongoport = process.argv[3] || null, | ||
mongodb = process.argv[4] || null, | ||
projectname = process.argv[5] || null, | ||
branchname = process.argv[6] || null, | ||
projectfilepath = process.argv[7] || null, | ||
storage = null, | ||
project = null; | ||
|
||
|
||
|
||
var finish = function(){ | ||
if(project){ | ||
project.closeProject(); | ||
} | ||
if(storage){ | ||
storage.closeDatabase(); | ||
} | ||
}; | ||
|
||
if (mongoip && mongoport && mongodb && projectname && projectfilepath){ | ||
|
||
var jProject = {}; | ||
|
||
storage = new Storage({'host':mongoip, 'port':mongoport, 'database':mongodb}); | ||
storage.openDatabase(function(err){ | ||
if(!err){ | ||
storage.openProject(projectname,function(err,p){ | ||
if(!err){ | ||
project = p; | ||
var core = new Core(project,{corerel:2}); | ||
project.getBranchHash(branchname,"#hack",function(err,commitHash){ | ||
if(!err){ | ||
project.loadObject(commitHash,function(err,commit){ | ||
if(!err && commit){ | ||
core.loadRoot(commit.root,function(err,root){ | ||
if(!err && root){ | ||
Serialization.export(core,root,function(err,jProject){ | ||
if(!err){ | ||
FS.writeFileSync(projectfilepath,JSON.stringify(jProject,undefined,2),'utf-8'); | ||
console.log("export finished successfully"); | ||
finish(); | ||
} else { | ||
console.log("export failed:",err); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("unable to load root"); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log('cannot get latest commit'); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("unable to find master branch"); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log('unable to reach project object - check your parameters and your database'); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("unable to open database - check your parameters and your connection to your database server"); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("proper usage: node export_project.js <ip of your database server> <port of your database server> <name of your database> <name of the project> <name of the branch> <file to create>"); | ||
finish(); | ||
} | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* Created by tkecskes on 8/6/2014. | ||
*/ | ||
var requirejs = require("requirejs"); | ||
requirejs.config({ | ||
nodeRequire: require, | ||
baseUrl: __dirname + '/../', | ||
paths: { | ||
"storage": "common/storage", | ||
"core": "common/core", | ||
"util": "common/util", | ||
"coreclient": "common/core/users" | ||
} | ||
}); | ||
requirejs(['core/core','storage/serveruserstorage','coreclient/serialization', 'fs'], | ||
function(Core,Storage,Serialization,FS){ | ||
'use strict'; | ||
var mongoip = process.argv[2] || null, | ||
mongoport = process.argv[3] || null, | ||
mongodb = process.argv[4] || null, | ||
projectname = process.argv[5] || null, | ||
projectfilepath = process.argv[6] || null, | ||
storage = null, | ||
project = null; | ||
|
||
|
||
|
||
var finish = function(){ | ||
if(project){ | ||
project.closeProject(); | ||
} | ||
if(storage){ | ||
storage.closeDatabase(); | ||
} | ||
}; | ||
|
||
if (mongoip && mongoport && mongodb && projectname && projectfilepath){ | ||
|
||
var jProject = JSON.parse(FS.readFileSync(projectfilepath,'utf-8')); | ||
|
||
storage = new Storage({'host':mongoip, 'port':mongoport, 'database':mongodb}); | ||
storage.openDatabase(function(err){ | ||
if(!err){ | ||
storage.openProject(projectname,function(err,p){ | ||
if(!err){ | ||
project = p; | ||
var core = new Core(project,{corerel:2}); | ||
var root = core.createNode({parent:null,base:null}); | ||
Serialization.import(core,root,jProject,function(err){ | ||
if(err){ | ||
console.log("some error happened during import:",err); | ||
} else { | ||
core.persist(root,function(err){}); | ||
var rhash = core.getHash(root); | ||
var chash = project.makeCommit([],rhash,"project imported by \'create_project_from_file\'",function(err){}); | ||
project.getBranchHash("master","#hack",function(err,oldhash){ | ||
if(!err){ | ||
project.setBranchHash("master",oldhash,chash,function(err){ | ||
if(!err){ | ||
console.log("the file have been imported to master branch"); | ||
finish(); | ||
} else { | ||
console.log("problem setting the branch..."); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("problem getting the branch set..."); | ||
finish(); | ||
} | ||
}); | ||
} | ||
}); | ||
} else { | ||
console.log('unable to reach project object - check your parameters and your database'); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("unable to open database - check your parameters and your connection to your database server"); | ||
finish(); | ||
} | ||
}); | ||
} else { | ||
console.log("proper usage: node import_project.js <ip of your database server> <port of your database server> <name of your database> <name of the project> <file to import>"); | ||
finish(); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
/** | ||
* Created by tamas on 8/13/14. | ||
*/ | ||
var requirejs = require("requirejs"); | ||
requirejs.config({ | ||
nodeRequire: require, | ||
baseUrl: __dirname + '/../', | ||
paths: { | ||
"storage": "common/storage", | ||
"core": "common/core", | ||
"util": "common/util", | ||
"coreclient": "common/core/users" | ||
} | ||
}); | ||
requirejs(['core/core','storage/serveruserstorage','storage/clientstorage','fs'], | ||
function(Core,Storage,ConnectedStorage,FS){ | ||
'use strict'; | ||
var configFile; | ||
try{ | ||
configFile = FS.readFileSync(process.argv[2],'utf8'); | ||
configFile = JSON.parse(configFile); | ||
} catch (e) { | ||
throw e; | ||
} | ||
var storage = null, | ||
project = null, | ||
core = null; | ||
|
||
|
||
|
||
var finish = function(){ | ||
if(project){ | ||
project.closeProject(); | ||
} | ||
if(storage){ | ||
storage.closeDatabase(); | ||
} | ||
}, | ||
checkDFS = function(root,callback){ | ||
var index = 0, | ||
children, | ||
error = null, | ||
checkNextChild = function(){ | ||
if(index>=children.length){ | ||
return callback(error); | ||
} | ||
checkDFS(children[index],function(err){ | ||
error = error || err; | ||
index++; | ||
checkNextChild(); | ||
}); | ||
}; | ||
|
||
checkNode(root); | ||
core.loadChildren(root,function(err,c){ | ||
if(err){ | ||
return callback(err); | ||
} | ||
children = c; | ||
if(children.length === 0){ | ||
return callback(null); | ||
} | ||
checkNextChild(); | ||
}); | ||
}, | ||
checkBFS = function(root,callback){ | ||
var needed, | ||
error = null, | ||
i, | ||
checkChild = function(child){ | ||
checkBFS(child,function(err){ | ||
error = error || err; | ||
if(--needed === 0){ | ||
callback(error); | ||
} | ||
}); | ||
}; | ||
|
||
checkNode(root); | ||
core.loadChildren(root,function(err,children){ | ||
if(err){ | ||
return callback(err); | ||
} | ||
needed = children.length; | ||
if(needed === 0){ | ||
return callback(error); | ||
} | ||
for(i=0;i<children.length;i++){ | ||
checkChild(children[i]); | ||
} | ||
}); | ||
}, | ||
checkPath = function(root,path,callback){ | ||
core.loadByPath(root,path,function(err,node){ | ||
if(err || !node){ | ||
console.log('unable to load node',err); | ||
return callback(err); | ||
} | ||
checkNode(node); | ||
callback(null); | ||
}); | ||
}, | ||
checkNode = function(node){ | ||
console.log(core.getPath(node),core.getGuid(node)); | ||
}; | ||
|
||
if(configFile.serverip && configFile.serverport ){ | ||
storage = new ConnectedStorage({type:'node',host:configFile.serverip,port:configFile.serverport,log:console}); | ||
} else if(configFile.mongoip && configFile.mongoport && configFile.mongodb) { | ||
storage = new Storage({'host':configFile.mongoip, 'port':configFile.mongoport, 'database':configFile.mongodb}); | ||
} | ||
|
||
|
||
if (storage){ | ||
storage.openDatabase(function(err){ | ||
if(err){ | ||
console.log('unable to open database',err); | ||
return finish(); | ||
} | ||
storage.openProject(configFile.projectname,function(err,p){ | ||
if(err || !p){ | ||
console.log('cannot open project',err); | ||
return finish(); | ||
} | ||
project = p; | ||
core = new Core(project); | ||
project.getBranchNames(function(err,names){ | ||
if(err){ | ||
console.log('cannot get branch info'); | ||
return finish(); | ||
} | ||
|
||
if(!names[configFile.branch]){ | ||
console.log('unknown branch'); | ||
return finish(); | ||
} | ||
|
||
project.loadObject(names[configFile.branch],function(err,commit){ | ||
if(err || !commit){ | ||
console.log('unable to load commit',err); | ||
return finish(); | ||
} | ||
|
||
core.loadRoot(commit.root,function(err,root){ | ||
if(err || !root){ | ||
console.log('cannot load root object',err); | ||
return finish(); | ||
} | ||
switch (configFile.testtype){ | ||
case "DFS": | ||
checkDFS(root,function(err) { | ||
console.log('DFS checking finished', err); | ||
return finish(); | ||
}); | ||
break; | ||
case "BFS": | ||
checkBFS(root,function(err){ | ||
console.log("BFS cheking finished",err); | ||
return finish(); | ||
}); | ||
break; | ||
case "path": | ||
checkPath(root,configFile.path,function(err){ | ||
console.log("Path checking finished",err); | ||
return finish(); | ||
}); | ||
break; | ||
default: | ||
console.log('wrong test type'); | ||
return finish(); | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
}); | ||
} else { | ||
console.log("proper usage: node project_tester.js <path of test configuration file>"); | ||
finish(); | ||
} | ||
|
||
}); |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
src/client/isis-ui-components/docs/styles/ui_components_demo.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
section { | ||
min-height: 80px; } |
3 changes: 3 additions & 0 deletions
3
src/client/isis-ui-components/docs/styles/ui_components_demo.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
section { | ||
min-height: 80px; | ||
} |
Oops, something went wrong.