Hi Elias,

Instead of replying to your mail, i'll reply to your readme.

> the inherent complexity of a system that's built on patches and
> suggestions for almost 3 years now (DB: flame me later :-). Take a look at
That may be a good thing.  We'll see.

=> no aggregates! what's the use in groups without aggregate functions ?!
i'm not sure this justifies a complete rewrite.

> 1)...
> 2) then, I map schema types to xsl templates.
of course.  Nice schema, by the way.

>3) finally, I try to define the needs of the helper class and move as much
> code away from the logicsheet as possible.
These will hopefully fall into place for you.

> My initial target is to make this implementation of ESQL 100% compatible 

> with the current logicsheet. However, I obsoleted the usage of
> <esql:get(datatype)/> tags because it's meaningless to map JDBC datatypes
> to a weakly-typed environment such as XML text nodes.


Questions:
1) backward compatibility: how big an issue?
If you use a different namespace, it can be none.
i.e:
esql="http://apache.org/cocoon/SQL/v3";

2) multiple connections per logicsheet: would we be needing them? 
nested queries:
 oh yes. OT: wanna see something cool?  see attached: messageboard.xsp.

multiple connections:
 why not? they are no harder than nested queries.  See how they are done now.
I think it is beautiful.

Version history:
0.01: basic functionality, compiles and executes esql example page
cool.

what i want to know is,
is it going to fix your original problem?

I did some more thinking about it.  What are you using as your odbc-jdbc bridge?  I 
spent about a day trying to get esql to work in jdk 1.4 because it has a jdbc2 
compliant bridge driver.  For production work, i use mysql and the gpl'd mysql driver.

I couldn't figure out why it was acting like you were getting an exception, and
 not printing the stack trace for you.  There are a couple of cases where the 
current esql logicsheet will swallow exceptions.  One corner my grouping code 
cuts is always doing a resultSet.getString and a string comparison no matter
what the column type really is.  Some jdbc drivers might not take kindly to
that. I'm not sure.

will your code allow nested groups?
one of my considerations was arbitrary nesting.

Tim
<?xml version="1.0"?>
<xsp:page 
language="java"
xmlns:xsp="http://apache.org/xsp";
xmlns:session="http://apache.org/xsp/session/2.0";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:esql="http://apache.org/cocoon/SQL/v2";>

<xsp:structure>
<xsp:include>java.util.Calendar</xsp:include>
<xsp:include>java.util.Date</xsp:include>
<xsp:include>java.text.SimpleDateFormat</xsp:include>
</xsp:structure>

<xsp:logic>
  private void print_msgs(int bid, int parent ) throws SAXException {
        AttributesImpl xspAttr = new AttributesImpl();
        String lastMonth = null;
        SimpleDateFormat sqlDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -30);
        lastMonth = sqlDate.format( cal.getTime() );
                
    <esql:connection>
      <esql:pool>phantom</esql:pool>
      <esql:execute-query>
                <esql:query>            
          select message.id, parent_id, subject, first_name, last_name, date_posted 
from message left join user on message.user_id=user.id where 
parent_id=<xsp:expr>parent</xsp:expr> and hidden=0 order by date_posted desc
        </esql:query>
                <esql:error-results>
                        <esql:get-stacktrace/>     
                </esql:error-results>
        <esql:results>          
          <ul class="messages">
            <esql:row-results>
              <li><a><xsp:attribute name="href">viewmessage.xsp?id=<esql:get-string 
column="id"/></xsp:attribute><esql:get-string column="subject"/></a> <esql:get-string 
column="user.first_name"/> <esql:get-string column="last_name"/> <em><esql:get-string 
column="date_posted"/></em>
              <xsp:logic>
                if (Integer.parseInt((String)<session:get-attribute 
name="privilege_set" default="0"/>) > 0) {
                  <input type="checkbox" name="marked"><xsp:attribute 
name="value"><esql:get-string column="id"/></xsp:attribute></input>
                }
              </xsp:logic>
              <xsp:logic>print_msgs(0,<esql:get-int column="id"/>);</xsp:logic></li>
            </esql:row-results>                 
          </ul>                             
        </esql:results>         
      </esql:execute-query>
        </esql:connection>
  }
</xsp:logic>

<page>
  <title>Student Consultant Server</title>
  <xsp:logic>
    if (!"".equals(<xsp-request:get-parameter name="hide-threads" default=""/>)) { 
      String markedThreads[] = <xsp-request:get-parameter-values name="marked" 
as="array"/>;
      <esql:connection>
        <esql:pool>phantom</esql:pool>
        <xsp:logic>
          for (int i=0; i &lt; markedThreads.length; i++) {
            <esql:execute-query>
              <esql:query>update message set hidden='1' where 
id=<xsp:logic>markedThreads[i]</xsp:logic></esql:query>
            </esql:execute-query>
          }
        </xsp:logic>
      </esql:connection>
    }
  </xsp:logic>
    <div class="messages" >
      <form>
      <xsp:logic>
              print_msgs(1, 0);
        if (Integer.parseInt((String)<session:get-attribute name="privilege_set" 
default="0"/>) > 0) {
          <input type="submit" name="hide-threads" value="Hide Marked Threads"/>
        }
      </xsp:logic>
      </form>
    </div>
</page>

</xsp:page>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to