08-22-2012 12:16 PM
function main()
{
var rootSpaceName = companyhome.childByNamePath("mainFolder");
var childList = rootSpaceName.children;
var count = childList.length;
for(var i = 0; i <= count; i++)
{
var childTitle = childList[i].properties.title;
var childAuthor = childList[i].properties.author;
var child = childList[i];
if(child.isContainer == false)
{
for(var j = 0; j < count; j++)
{
var newChildName = childList[j].properties.name;
var newChild = childList[j];
if((newChild.isContainer == true) && (childTitle.equals(newChildName)))
{
var newSpaceName = rootSpaceName.childByNamePath(newChildName);
var newChildList = newSpaceName.children;
var newCount = newChildList.length;
for(var k = 0; k < newCount; k++)
{
var newNewChildName = newChildList[k].properties.name;
var newNewChildAuthor = newChildList[k].properties.author;
var newNewChild = newChildList[k];
if((newNewChild.isContainer == true) && (newNewChildAuthor.equals(childAuthor)))
{
var currentSpace = newSpaceName.childByNamePath(newNewChildName);
child.move(currentSpace);
}
}
}
else
{
var newSpaceName = rootSpaceName.createFolder(childTitle);
var newNewSpaceName = newSpaceName.createFolder(childAuthor);
child.move(newNewSpaceName);
}
}
}
}
return;
}
main();
var rootSpaceName = companyhome.childByNamePath("mainFolder");
doesn't seem to find the correct folder, instead the value that it returns in the debugger is: A valid SecureContext was not provided in the RequestContext.var newSpaceName = rootSpaceName.createFolder(childTitle);
, I get a pop-up exception stating that org.mozilla.javascript.WrappedExectution: Wrapped java.lang.IllegalArgumentException: Node Name is a mandatory parameter (workspace://SpacesStore/792dd872-5cfe-4a65-a509-4b9979f803d4#41)
. Which I assume is because the original root node cannot be found to begin with?console.log("Write this out");
, but it seemed to keep resulting in an error stating the console was not specified. Does anyone know how to actually write out to the debugger console?
08-22-2012 07:21 PM
var newSpaceName = rootSpaceName.createFolder(childTitle);
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug
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.