As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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");
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"; }
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; }