cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject Re: Woody: managing persistence sessions
Date Tue, 04 Nov 2003 11:10:18 GMT
Hi Jeremy:

I use other approach in Flow. Example:

function listform(form) {
  var factory = cocoon.getComponent(Packages.o.a.c....JdoPMF.ROLE);
  var bean = new Packages.test.forms.AreasList();
  var handler = new Packages.test.forms.AreaHandler();
  var criteria = new String (cocoon.request.criteria);

  handler.getList(bean, criteria, factory);  // Read from DB

  form.load(bean);
  form.showForm("list-form-display");
  form.save(bean);

  handler.setList(bean, criteria, factory); // Store in DB
  cocoon.releaseComponent(factory);
  // Show a succes page (end page).
  success("Administración de Areas",
          "Actualización de Áreas",
          "Todos los cambios se procesaron existosamente." +
          "¿Desea volver a procesar la lista de áreas?",
          "search");
}

Instead of open a OJB session inside the flow I call an FormHandler (in
Java) with the factory as a parameter. Inside the handle I open the OJB
transaction and close it after it fill the bean with a query.

I don't know if this is the better approach, but it works :-D

We are looking for a more generic solution to almost all the cases.

I hope it would give you more ideas. I will be glad if you share it with
us. :-D

Best Regards,

Antonio Gallardo



Mime
View raw message