05-26-2009 04:28 PM
var message = "createTitleContentFolderByNameAndTitleId failed";
var exception = "";
var success = false;
var folderName = args.folderName;
var titleId = args.titleId;
try
{
if((folderName == null) || (folderName == "") || (titleId == null) || (titleId == ""))
{
message = "Expected folderName and titleId as arguments";
}
else
{
// Locate content folder for use as a template
var templateQuery = "//.[@cm:name='Title Content Folders']/*[@cm:name='" + folderName + "']";
message = "Searching against XPath query: " + templateQuery;
var templateResults = companyhome.childrenByXPath(templateQuery);
// Locate title folder (target parent)
var titleQuery = "//.[@bm:title_id=" + titleId + "]";
message = "Searching against XPath query: " + titleQuery;
var titleResults = companyhome.childrenByXPath(titleQuery);
if((templateResults.length > 0) && (titleResults.length > 0))
{
var templateFolder = templateResults[0];
var titleFolder = titleResults[0];
var newContentFolder = templateFolder.copy(titleFolder, true);
newContentFolder.name = templateFolder.name;
if(newContentFolder != null)
{
message = "Content folder created";
success = true;
}
}
else
{
message = "Could not locate content folder or title folder";
}
}
}
catch (e)
{
exception = e.description;
}
model.message = message;
model.exception = exception;
model.success = success;
05-28-2009 01:34 PM
06-19-2009 11:04 AM
06-19-2009 12:33 PM
06-22-2009 09:47 AM
06-23-2009 03:51 PM
I suspect the "Inherit permissions" flag isn't being copied correctly, but please raise a JIRA in order for the issue to get attention.
Thanks,
Mike
12-02-2009 02:48 PM
04-29-2010 05:28 AM
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.