06-03-2011 05:48 AM
var activeFolder = companyhome.childByNamePath("Content_Expiry");
var archivedFolder = companyhome.childByNamePath("Content_Expiry/ExpiredContent");
if(activeFolder != null)
{
var i=0;
activeChildren = activeFolder.children;
activeTotal = activeChildren.length;
for(i=0; i<activeTotal;i++)
{
child = activeChildren[i];
child.move(archivedFolder);
}
}
I have a project called Content_Expiry under Web Projects. And I'm trying to move the content to a folder called ExpiredContent in the same project. However the above JavaScript doesn't work. Am I giving the paths wrong here –> companyhome.childByNamePath("Content_Expiry");06-03-2011 06:10 PM
06-07-2011 07:42 AM
var fullcurrentpath = "/www/avm_webapps/ROOT/Folder1";
var fullarchivepath = "/www/avm_webapps/ROOT/Folder2";
var stores = avm.stores;
var currentFolder = avm.lookupNode(stores[3].id + ":" + fullcurrentpath);
var archivedFolder = avm.lookupNode(stores[3].id + ":" + fullarchivepath);
if(currentFolder != null)
{
var i=0;
activeChildren = currentFolder.children;
activeTotal = activeChildren.length;
for(i=0; i<activeTotal;i++)
{
child = activeChildren[i];
child.move(archivedFolder);
}
}
This works!
06-09-2011 10:16 AM
08-03-2011 04:32 AM
var currentFolder = avm.lookupNode("ContentExpiry–admin:/www/avm_webapps/ROOT");
var archivedFolder = avm.lookupNode("ExpiredContent–admin:/www/avm_webapps/ROOT/Folder1");
if(currentFolder != null)
{
var i=0;
activeChildren = currentFolder.children;
activeTotal = activeChildren.length;
for(i=0; i<activeTotal;i++)
{
child = activeChildren[i];
if(child != 'Folder1')
{
child.move(archivedFolder);
}
}
}
08-05-2011 11:20 AM
// …
child = activeChildren[i];
childName = child.name;
if(childName != 'Folder1')
{
child.move(archivedFolder);
}
// …
08-08-2011 12:56 AM
03-04-2012 01:27 PM
It sounds like you are moving nodes that reside in a Web Project, which means you are working with the AVM store. I don't think you can get to an AVM node using companyhome's childByNamePath function (I could be wrong).Hi Jeff,
Have you taken a look at the AVM JavaScript API and the avm.lookupNode(path) function? Here's the wiki page with the doc:
http://wiki.alfresco.com/wiki/3.4_JavaScript_API#AVM_API
Jeff
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.