05-09-2011 04:19 AM
05-10-2011 05:13 AM
resultString = "create_space.failed";
var parentNodeId = 'User Homes/',
spaceName = 'facturas',
spaceTitle = "Carpeta de pruebas" ,
spaceDescription = "Descripcion de la carpeta de pruebas"
templateId = '';
var nodeNew;
if ((spaceName == null) || (spaceName == ""))
{
resultString = "create_space.missing_name";
}
else
{
var nodeParent = search.findNode("workspace://SpacesStore/" + parentNodeId);
// Copy from template?
if ((templateId != null) && (templateId != ""))
{
nodeTemplate = search.findNode("workspace://SpacesStore/" + templateId);
nodeNew = nodeTemplate.copy(nodeParent, true);
nodeNew.name = spaceName;
}
else
{
nodeNew = nodeParent.createFolder(spaceName);
}
// Always add title & description, default icon
nodeNew.properties["cm:title"] = spaceTitle;
nodeNew.properties["cm:description"] = spaceDescription;
nodeNew.properties["app:icon"] = "space-icon-default";
nodeNew.save();
// Add uifacets aspect for the web client
nodeNew.addAspect("app:uifacets");
if (nodeNew != null)
{
resultString = "space_created";
resultCode = true;
}
}
"exception" : "org.alfresco.scripts.ScriptException - 04100119 Failed to execute script 'workspace:\/\/SpacesStore\/6b697df7-38b1-4a87-804d-5426c80d8b1c': 04100118 TypeError: Cannot call method \"createFolder\" of null (workspace:\/\/SpacesStore\/6b697df7-38b1-4a87-804d-5426c80d8b1c#29)",
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.