AnsweredAssumed Answered

create webform from webscript - metadata extraction problem

Question asked by davidg on Mar 3, 2009
Latest reply on Aug 28, 2009 by rdifrango
I have successfully created a slight variant of the WCM metadata extraction example for a press_release from the alfresco recommended example

I am now generating the required XML form from javascript.

I have checked in the nodebrowser that ALL the correct aspects are present and the required properties.

My problem seems to be that the
  • renditions are not being generated. I assumed that they would be generated if the form aspect(and the others) was correctly configured,
  • metadata extract - not being triggered

  • If I subsequently open and save(without edit) the form using the web client, the txt and html renditions are generated and the metadata is extracted.

    Do I need to do an additional generate renditions step in javascript?
    Any suggestions?

    The code I use is as follows:

    var timestamp = new Date().getTime();
    var storeRootNode = avm.lookupStoreRoot(storeName);
    var path = storeRootNode.path + "/ROOT";
    var node = avm.lookupNode(path);

    var fileName= "pr " + timestamp + ".xml";
    var pressReleaseDocF= node.createNode(fileName, "wcm:avmplaincontent");["cm:name"] = fileName;

    var props= new Array(2);
    props["wca:parentformname"] = "press-release";
    props["wca:originalparentpath"] = "dgtest–admin–preview:/www/avm_webapps/ROOT";
    pressReleaseDocF.addAspect("wca:forminstancedata", props);;

    var props= new Array(2);
    props["cm:title"] = fileName;
    pressReleaseDocF.addAspect("cm:titled", props);;

    var prNs= new Namespace("pr", "");
    var pressReleaseXml2=  <pr:press_release xmlns:pr=""

    pressReleaseXml2.prNs::title= "pr title "+timestamp;
    pressReleaseXml2.prNs::overview= "the abstract";
    pressReleaseXml2.prNs::location=  "pr location";
    pressReleaseXml2.prNs::body=  "pr body";
    pressReleaseXml2.prNs::include_media_contacts=  "true";
    pressReleaseXml2.prNs::launch_date=  "2009-02-04";
    pressReleaseXml2.prNs::expiration_date=  "2009-04-06";
    pressReleaseXml2.prNs::numtimes=  "1";

    pressReleaseDocF.content = pressReleaseXml2.toXMLString();;