cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Urs Iwert" <urs.iw...@sysinf.ch>
Subject How do I use session parameters in a ESQL-Logicsheet
Date Thu, 14 Jul 2005 15:19:32 GMT
Hi

I need data from a database using ESQL-Logicsheet. The sql statement
must be filtered depending on the current session (user logon) and on
session parameters. The session parameters are used, because there are
quite a lot of parameters and all of them are used to query different
data.

What if done yet

- Logon using session framework
- Saving parameters in a session using <setxml/>
- ESQL LogicSheet to access data (all records by now)

What's missing is the last step to bring the filter criterias to the
where clause of my sql statement. This has to be done before execution
of the sql statement. Here is a simplified example 

<xsp:page 
  language="java" 
  xmlns:xsp="http://apache.org/xsp" 
  xmlns:esql="http://apache.org/cocoon/SQL/v2">
  
  <content>
    <esql:connection>
      <esql:pool>mysql-pool</esql:pool>
      <esql:execute-query>
      
        <!-- how do I bring the filter criterias to sql statement below
-->
        <esql:query>
          select group_id, lastname, firstname, birthdate,  from
customer
          where group_id = [session variable group_id]
            and birthdate <= [session variable date]
          order by lastname, firstname
        </esql:query>
          
        <esql:results>
          <customer>
            <esql:row-results>
              <lastname><esql:get-string column="lastname"/></lastname>
              <firstname><esql:get-string
column="firstname"/></firstname>
            </esql:row-results>
          </customer>
        </esql:results>
        
      </esql:execute-query>
    </esql:connection>
  </content>
</xsp:page>


Thanks in advance
Urs


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


Mime
View raw message