cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19138] New: - [Contrib][SQLTransformer][Paginator] Made SQLTransformer paginatable.
Date Fri, 18 Apr 2003 02:43:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19138>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19138

[Contrib][SQLTransformer][Paginator] Made SQLTransformer paginatable.

           Summary: [Contrib][SQLTransformer][Paginator] Made SQLTransformer
                    paginatable.
           Product: Cocoon 2
           Version: Current CVS 2.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: general components
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: bhtek@yahoo.com


Hi,

Thanks to idea and code from Irv Salisbury III, I made some
changes to src/blocks/database/.../transformation/SQLTransformer
and made it "Paginator"able.

With this patch, you can set page-size and current-page via
the sitemap and have paging done via result set controls rather
than filtering through a Paginator Transformer.

While that transformer works, in the case of a database query,
it just seemed a tad wasteful not to do the paging at a lower
level.

I have made some changes to the Paginator code as well to allow
calls from PagingSQLTransformer to spit out paging related tags.
This will ease any transition of switching from using the
paginator transformer to using this PagingSQLTransformer.

Before using PagingSQLTransformer,

  <map:match pattern="{1}/view/Show[:punct:]*([0-9]*)[:punct:]*" type="regexp">
    <map:generate src="xsp/view/display-all.xsp"/>
    <map:transform type="sql">
      <map:parameter name="use-connection" value="photo"/>
      <map:parameter name="show-nr-of-rows" value="true"/>
    </map:transform>
    <map:transform type="paginator" src="pagesheets/display.xml"/>
    <map:transform src="stylesheets/view/display-all.xsl"/>
    <map:act type="request">
    <map:transform src="stylesheets/page/simple-page2html.xsl">
      <map:parameter name="app-context" value="{context}"/>
      <map:parameter name="requestURI" value="{requestURI}"/>
    </map:transform>
    </map:act>
    <map:transform src="stylesheets/page/simple-pagination.xsl"/>
    <map:serialize/>
  </map:match>
  
Using PagingSQLTransformer,

  <map:match pattern="{1}/view/Show[:punct:]*([0-9]*)[:punct:]*" type="regexp">
    <map:generate src="xsp/view/display-all.xsp"/>
    <map:transform type="sql">
      <map:parameter name="use-connection" value="photo"/>
      <map:parameter name="show-nr-of-rows" value="true"/>
      <map:parameter name="page-size" value="10"/>
      <map:parameter name="current-page" value="{1}"/>
      <map:parameter name="pagesheet-source" value="pagesheets/display.xml"/>
    </map:transform>
    <map:transform src="stylesheets/view/display-all.xsl"/>
    <map:act type="request">
    <map:transform src="stylesheets/page/simple-page2html.xsl">
      <map:parameter name="app-context" value="{context}"/>
      <map:parameter name="requestURI" value="{requestURI}"/>
    </map:transform>
    </map:act>
    <map:transform src="stylesheets/page/simple-pagination.xsl"/>
    <map:serialize/>
  </map:match>

I made some patch to the Paginator code that should fix bug
#13865.

Further changes to the Paginator code now allows, multiple
range-links too.

One of the inconsistency (maybe) from all these changes is that
I make it so that "page-size" is configured for the SQLTransformer
and the pagesheet/rules/count/num is ignored. I have not figure
out a way to use both easily. I will have to do some more thinking
on that. What is easier to understand? Comments?

This is my first time contributing in a "patch" sort of way to
any open source project, so excuse me if I get any procedure
wrong.

Boon

Mime
View raw message