cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject cvs commit: xml-cocoon2/src/webapp/samples/docs/samples/xsp esql.xsp
Date Wed, 04 Dec 2002 21:43:39 GMT
tcurdt      2002/12/04 13:43:39

  Modified:    src/webapp/samples/docs/samples/xsp esql.xsp
  Log:
  also show the limit feature
  
  Revision  Changes    Path
  1.2       +88 -60    xml-cocoon2/src/webapp/samples/docs/samples/xsp/esql.xsp
  
  Index: esql.xsp
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/docs/samples/xsp/esql.xsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- esql.xsp	2 Jul 2002 13:06:39 -0000	1.1
  +++ esql.xsp	4 Dec 2002 21:43:38 -0000	1.2
  @@ -13,67 +13,95 @@
   
      <esql:connection>
        <esql:pool>personnel</esql:pool>
  -     <esql:execute-query>
  -       <esql:query>select * from department</esql:query>
  -       <esql:results>
  -         <esql:row-results>
  -           <para><esql:get-string column="name"/></para>
  -           <esql:get-columns/>
  -         </esql:row-results>
  -       </esql:results>
  -     </esql:execute-query>
  -
  -        <hr/>
  -
  -        <para>
  -          Below departments and employees are printed. This uses the grouping
  -          feature in esql.
  -        </para>
  -        
  -        <esql:execute-query>
  -          <esql:query>
  -            SELECT department.name, employee.id, employee.name as empName FROM department,
employee
  -            WHERE department.id = employee.department_id  ORDER BY department.name
  -          </esql:query>
  -          <esql:results>
  -            <esql:row-results>
  -              <esql:group group-on='name'><!-- grouping -->
  -                <Department>
  -                  <xsp:attribute name='name'><esql:get-string column='name'/></xsp:attribute>
  -                  <h2><esql:get-string column='name'/></h2>
  -                  <esql:member><!-- grouping -->
  -                    <para><employee><esql:get-string column='empName'/></employee></para>
  -                  </esql:member><!--grouping -->
  -                </Department>
  -              </esql:group><!-- grouping -->
  -            </esql:row-results>
  -          </esql:results>
  -        </esql:execute-query>
  -
  -        <hr/>
  -
  -        <para>
  -          Without the grouping feature, the result would look like this:
  -        </para>
  -
  -        <esql:execute-query>
  -          <esql:query>
  -            SELECT department.name, employee.id, employee.name as empName FROM department,
employee
  -            WHERE department.id = employee.department_id  ORDER BY department.name
  -          </esql:query>
  -          <esql:results>
  -            <esql:row-results>
  -              <Department>
  -                <xsp:attribute name='name'><esql:get-string column='name'/></xsp:attribute>
  -                <h2><esql:get-string column='name'/></h2>
  -                <para><employee><esql:get-string column='empName'/></employee></para>
  -              </Department>
  -            </esql:row-results>
  -          </esql:results>
  -        </esql:execute-query>
  +
  +
  +       <para>
  +           Below you see all guys from the departments
  +       </para>
  +
  +       <esql:execute-query>
  +         <esql:query>select * from employee</esql:query>
  +         <esql:results>
  +           <esql:row-results>
  +             <para><esql:get-string column="name"/></para>
  +             <!-- uncomment if you want columns to become tags -->
  +             <!-- <esql:get-columns/> -->
  +           </esql:row-results>
  +         </esql:results>
  +       </esql:execute-query>
  +
  +       <hr/>
  +
  +       <para>
  +           Below you see just some of the guys
  +       </para>
  +
  +       <esql:execute-query>
  +         <esql:query>select * from employee</esql:query>
  +         <esql:use-limit-clause>jdbc</esql:use-limit-clause>
  +         <esql:skip-rows>1</esql:skip-rows>
  +         <esql:max-rows>2</esql:max-rows>
  +         <esql:results>
  +           <esql:row-results>
  +             <para><esql:get-string column="name"/></para>
  +           </esql:row-results>
  +           <para>
  +             But there is a total of <esql:row-count/> employees.
  +           </para>
  +         </esql:results>
  +       </esql:execute-query>
  +
  +       <hr/>
  +
  +       <para>
  +           Below departments and employees are printed.
  +           Without the grouping feature, the result would look like this:
  +       </para>
  +
  +       <esql:execute-query>
  +         <esql:query>
  +           SELECT department.name, employee.id, employee.name as empName FROM department,
employee
  +           WHERE department.id = employee.department_id  ORDER BY department.name
  +         </esql:query>
  +         <esql:results>
  +           <esql:row-results>
  +             <Department>
  +               <xsp:attribute name='name'><esql:get-string column='name'/></xsp:attribute>
  +               <h2><esql:get-string column='name'/></h2>
  +               <para><employee><esql:get-string column='empName'/></employee></para>
  +             </Department>
  +           </esql:row-results>
  +         </esql:results>
  +       </esql:execute-query>
  +
  +       <hr/>
  +
  +       <para>
  +         This uses the grouping feature in esql.
  +       </para>
  +
  +       <esql:execute-query>
  +         <esql:query>
  +           SELECT department.name, employee.id, employee.name as empName FROM department,
employee
  +           WHERE department.id = employee.department_id  ORDER BY department.name
  +         </esql:query>
  +         <esql:results>
  +           <esql:row-results>
  +             <esql:group group-on='name'><!-- grouping -->
  +               <Department>
  +                 <xsp:attribute name='name'><esql:get-string column='name'/></xsp:attribute>
  +                 <h2><esql:get-string column='name'/></h2>
  +                 <esql:member><!-- grouping -->
  +                   <para><employee><esql:get-string column='empName'/></employee></para>
  +                 </esql:member><!--grouping -->
  +               </Department>
  +             </esql:group><!-- grouping -->
  +           </esql:row-results>
  +         </esql:results>
  +       </esql:execute-query>
   
         </esql:connection>
  -      
  +
      </content>
     </page>
   </xsp:page>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message