cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Scott Medd <o...@eepulse.com>
Subject porting old DatabaseAction to modular DatabaseAction
Date Fri, 29 Sep 2006 14:31:46 GMT
Ah, the eccentricities of legacy code.  We are porting an old pre-2.0 Cocoon
app over to latest and greatest (Oracle 8i => 10g, Cocoon 2.0 beta => 2.1.9,
etc).

We've worked out and around most of the issues, but one that I thought
would be trivial has stumped the developer and I couldn't find a good
answer for him (or get it working either).

Our old application set a 'last accessed' field in the user record every
time they viewed a report (served from cocoon).  It used a DatabaseUpdateAction
to do this, using the now unsupported 'type="now"' for the value, like so:

<?xml version="1.0"?>
<employee>
  <connection>measurecom</connection>
  <table name="employee">
    <keys>
      <key param="p_emp_id" dbcol="emp_id" type="string" mode="manual"/>
    </keys>
    <values>
      <value dbcol="last_report_access" type="now"/>
    </values>
  </table>
</employee>

We have attempted to modify this to use the new modular DatabaseUpdateAction,
which of course has to use the DateInputModule to grab the current date.
I've looked at all the old discussions, but I can't find a good example of
grabbing input from components other than the request- ones.

Our attempt at translating the above (at last guess) is:

<?xml version="1.0"?>
<employee>
  <connection>measurecom</connection>
  <table name="employee">
    <keys>
      <key name="emp_id" type="string" param="employee.emp_id" />
    </keys>
    <values>
      <value name="last_report_access" type="date">
        <mode name="datemeta" type="all">
        <input-module name="date"/>
        </mode>
      </value>
    </values>
  </table>
</employee>

Are we close?  Is there some better document to read than the ones I've
been perusing?

Thanks for any insight,
Owen
--
eePulse, Inc.
http://www.eepulse.com

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


Mime
View raw message