03-15-2009 12:31 PM
03-15-2009 01:15 PM
03-28-2009 10:02 AM
03-28-2009 04:33 PM
model.toWho = (args.param != null) ? args.param : person.properties.userName;
model.store = avm.lookupStore("alfrescosample–admin");
model.webappFolder = avm.webappsFolderPath;
var storeRootNode = avm.lookupStoreRoot(args.store);
model.rootNode = storeRootNode;
if (storeRootNode != null) {
var path = storeRootNode.path + "/ROOT/media/releases/content";
model.path = path;
var node = avm.lookupNode(path);
model.node = node;
var timestamp = new Date().getTime();
// Creates the new node
var fileName = "mioContenuto_" + timestamp + ".xml";
var contentNode = node.createNode(fileName, "wcm:avmplaincontent");
// Sets the file name
contentNode.properties["cm:name"] = fileName;
// Adding the aspect for the web forms
var props= new Array(2);
props["wca:parentformname"] = "company-footer";
props["wca:originalparentpath"] = "alfrescosample–admin–preview:/www/avm_webapps/ROOT";
contentNode.addAspect("wca:forminstancedata", props);
contentNode.save();
// Creates the xml content
var pressReleaseXml2= <pr:company_footer xmlns:pr="http://www.alfresco.org/alfresco/pr"
xmlns:alf="http://www.alfresco.org"
xmlns:chiba="http://chiba.sourceforge.net/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<pr:name>Alfresco</pr:name>
<pr:body>Body xml</pr:body>
</pr:company_footer>;
contentNode.content = pressReleaseXml2.toXMLString();
contentNode.save();
// TODO: trigger the renditions
} else {
logger.log("No store: " + args.store);
}
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.