Here is my code, use javascript.
var findSourFol = orient.getGraph().command("gremlin","g.V.has('name','" +
folderSo +"')");
var dfCopy = getAndCopyChild(findSourFol);
//apply the fac function
var findCoFolder = orient.getGraph().command("gremlin","g.V.has('name','" +
folderTo +"')");
if(findCoFolder === null)
{
var findCoFolder = orient.getGraph().addVertex("class:Folder");
//create the FFFF Folder
findCoFolder.setProperty('name',folderTo);
}
orient.getGraph().addEdge(null,dfCopy,findCoFolder,"isSubfolderOf");//connect
all those copy to the FFFF
/////////////////////
/////////////////////
function getAndCopyChild(folderFr)
{
var folderDe = orient.getGraph().addVertex("class:Folder");
//create the new copy Folder
folderDe.setProperty('name',folderFr.getProperty("name"));
/*
var dpSour = [];
var iterator1 = orient.getGraph().command("gremlin","g.V.has('name','"
+ folderFr.getProperty("name") +
"').out('hasPoint')");
for(y=0; y<iterator1.length; y++){
dpSour.push(iterator1[y]);
}
for(var i=0; i<dpSour.length; i++)
//create and copy those dataPoint and addEdge to them
{
var dpArr = [];
dpArr.push(orient.getGraph().addVertex("class:DataPoint"));
//dpArr[i].setProperty("name",dpSour[i].getProperty("name"));
dpArr[i].setProperty("xid",i);
orient.getGraph().addEdge(null,folderDe,dpArr[i],"hasPoint");
}
*/
var folSour = [];
//find the SubFolder
var iterator2 =[];
iterator2.push( orient.getGraph().command("gremlin","g.V.has('name','" +
folderFr.getProperty("name") +"').in('isSubfolderOf')"));
for(var z=0; z<=iterator2.length; z++){
folSour.push(iterator2[z]);
}
if(folSour === null)
{return ;}
else
for(var j=0; j<folSour.length; j++)
//create copy addedge
{
getAndCopyChild(folSour[j]);
//factorial
orient.getGraph().addEdge(null,folSour[j],folderDe,"isSubfolderOf");//addedge
isSubfolderOf
}
return folderDe;
}
Best Regards,
Devin Lee
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.