09-08-2011 04:26 AM
var filePlan = companyhome.childByNamePath(space.name + "/rm/documentLibrary");
var series = filePlan.children;
var newSeries = filePlan.createFolder("Test folder");
newSeries.addAspect("{http://www.alfresco.org/model/rmcustom/1.0}customRecordSeriesProperties");
newSeries.addAspect("{http://www.alfresco.org/model/content/1.0}titled");
newSeries.addAspect("{http://www.alfresco.org/model/recordsmanagement/1.0}filePlanComponent");
newSeries.addAspect("{http://www.alfresco.org/model/recordsmanagement/1.0}recordComponentIdentifier");
09-08-2011 07:13 AM
var filePlan = companyhome.childByNamePath(space.name + "/rm/documentLibrary");
var series = filePlan.children;
var templateSeries = series[0];
if (templateSeries != null) {
var newSeries = templateSeries.copy(filePlan, false);
newSeries.name = "Test folder";
}
11-02-2011 09:52 AM
var filePlan = companyhome.childByNamePath("Sites/rm/documentLibrary");
if (filePlan != undefined){
var testSerie = createSeries(filePlan, "S123456");
}
function createSeries(folder, name){
if (folder.childByNamePath(name) != undefined){
return folder.childByNamePath(name);
}
var series = folder.createNode(name, "dod:recordSeries");
series.addAspect("rma:filePlanComponent");
//Unique Identifier
var props = new Array(1);
props["rma:identifier"] = createUniqueIdentifier(series);
series.addAspect("rma:recordComponentIdentifier", props);
return series;
}
function createUniqueIdentifier(serieNode){
//Unique Identifier
var d = new Date();
var year = d.getFullYear();
var dbid = serieNode.properties["sys:node-dbid"] + "";
var recordId = year + "-" + padString(dbid, 10);
return recordId;
}
//Create Unique Identifier
function padString(s, len){
var result = s;
for (i = 0; i < (len - s.length); i++){
result = "0" + result;
}
return result;
}
11-02-2011 10:07 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.