AnsweredAssumed Answered

javascript create WebForm e4x problem - abstract

Question asked by davidg on Feb 27, 2009
it seems I am not able to create a new xml field called "abstract" simply using e4x.

I have tried a number of "trickier" approaches without success.

The following code all works successfully as long as I do not try to create the "abstract" field

Can anyone identify the problem or a workaround.

Thanks

The following code tries to use a webscript to create a press-release web form…

error line makked below
ERROR: Failed to execute script '/au/createPressRelease.get.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts)': missing name after :: operator

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

pressReleaseDocF.addAspect("cm:titled");
pressReleaseDocF.properties["wca:parentformname"] = "press-release";

//pressReleaseDocF.addAspect("wca:forminstancedata");
//pressReleaseDocF.properties["wca:parentformname"] = "press-release";
//pressReleaseDocF.properties["wca:originalparentpath"] = "dgtest–admin–preview:/www/avm_webapps/ROOT";

var prNs= new Namespace("pr", "http://www.alfresco.org/alfresco/pr");
var pressReleaseXml2=  <pr:press_release 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:press_release>;

pressReleaseXml2.prNs::title= "pr title "+timestamp;
pressReleaseXml2.prNs::abstract= "the abstract";  // <<<<====### THIS FAILS
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-03-06";
pressReleaseXml2.prNs::numtimes=  "1";

pressReleaseDocF.content = pressReleaseXml2.toXMLString();
pressReleaseDocF.save();

Outcomes