cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bert Van Kets" <b...@vankets.com>
Subject Re: woody, flow and database confusion
Date Wed, 18 Feb 2004 18:01:56 GMT
Thanks for the help Chris,

Here's copy of the script:

-------------------------------------------------------------
cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/woody2.js");

function linksForm_JDO(form) {
  // Get OJB factory
  var factory =
cocoon.getComponent(Packages.org.apache.cocoon.ojb.jdo.components.JdoPMF.ROL
E);
  // Create a empty Bean
  var linksBean = new Packages.be.bvar.admin.links.LinksBean();
  var dao = new Packages.be.bvar.admin.links.LinksDAO();
  // Fill some initial data to the bean
  linksBean.setID(1);
  // Load bean based on the given PrimaryKey
  dao.retrieve(linksBean, factory);
  // Load the Bean to the form
  form.load(linksBean);
  // Let woody handle the form
  form.showForm("links-form-display");
  // Update the Bean based on user input
  form.save(linksBean);
  // Update Bean in Database
  dao.update(linksBean, factory);
  // Clean up the operation
  cocoon.releaseComponent(factory);
  // Send response to the user
  cocoon.request.setAttribute("linksForm", form.getWidget());
  cocoon.sendPage("links-success-pipeline");
}
-------------------------------------------------------------

As you can see it almost a copy of the flowscript used in the ojb/woody
sample.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message