You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Drew Buschhorn (JIRA)" <ji...@apache.org> on 2008/01/15 18:29:35 UTC
[jira] Created: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
[PATCH] Fix for Paginator when accessing out of bounds Pagination page
----------------------------------------------------------------------
Key: COCOON-2162
URL: https://issues.apache.org/jira/browse/COCOON-2162
Project: Cocoon
Issue Type: Improvement
Components: Blocks: (Undefined)
Affects Versions: 2.1.11, 2.1.10
Reporter: Drew Buschhorn
Priority: Minor
Attachments: paginator.diff
The Paginator transformer for apache cocoon will allow out of page-range requests.
I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
Example:
http://localhost/samples/paginator/text(5)
will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Drew Buschhorn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559314#action_12559314 ]
Drew Buschhorn commented on COCOON-2162:
----------------------------------------
Thought about that, but I have two objections:
1. Generally back-ends should be no smarter than necessary: asking for a page that is beyond the created pages should throw an error (not be silently corrected) esp. since one could catch the 404 error in the sitemap and load the last page.
2. I'm not smart enough to know how to access the number of pages created by the paginator outside of the java-class, so I dont know how to find out how many pages it will create without asking it for the largest page that doesnt throw a 404 error.
*shrug*
tried setting it to catch things <0, but that throws a indexOutOfBounds java error that I didnt feel like learning how to catch.
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Drew Buschhorn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Drew Buschhorn updated COCOON-2162:
-----------------------------------
Attachment: paginator.diff
svn diff of Paginator.java
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Drew Buschhorn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560029#action_12560029 ]
Drew Buschhorn commented on COCOON-2162:
----------------------------------------
That would be a great idea, but unfortunately I dont know how to throw that in cocoon. If you'd like to make the mod or can point me in the right direction (is it in the avalon framework, maybe?) I'd be happy to take a look at it.
http://www.jdocs.com/page/LibraryContents?id=4&c=X
List of cocoon exceptions that I could find.
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (COCOON-2162) [PATCH] Fix for
Paginator when accessing out of bounds Pagination page
Posted by "Drew Buschhorn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560029#action_12560029 ]
dbuschho edited comment on COCOON-2162 at 1/17/08 11:23 AM:
------------------------------------------------------------------
That would be a great idea, but unfortunately I dont know how to throw that in cocoon. If you'd like to make the mod or can point me in the right direction (is it in the avalon framework, maybe?) I'd be happy to take a look at it.
http://www.jdocs.com/page/LibraryContents?id=4&c=X
List of cocoon exceptions that I could find.
I found that by creating a FileNotFoundException.java file and extending the ResourceNotFoundException class into it, one can call a FileNotFoundException, but it still comes up ResourceNotFound in the title and heading.
As I said, I dont really know java, so any suggestions would be fine, though this route might be more trouble than it's worth.
was (Author: dbuschho):
That would be a great idea, but unfortunately I dont know how to throw that in cocoon. If you'd like to make the mod or can point me in the right direction (is it in the avalon framework, maybe?) I'd be happy to take a look at it.
http://www.jdocs.com/page/LibraryContents?id=4&c=X
List of cocoon exceptions that I could find.
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Drew Buschhorn (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Drew Buschhorn updated COCOON-2162:
-----------------------------------
Attachment: screenshot-1.jpg
This is what should happen, I believe.
Made after applying patch.
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Vadim Gritsenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559988#action_12559988 ]
Vadim Gritsenko commented on COCOON-2162:
-----------------------------------------
One thing I would change in patch though - it would be better to throw PageNotFoundException which would extend ResourceNotFoundException, this would allow error hander to distinguish missing file vs missing page.
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Vadim Gritsenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559984#action_12559984 ]
Vadim Gritsenko commented on COCOON-2162:
-----------------------------------------
I think 404 is appropriate for this case. Requested resource is indeed does not exist, and it should be up to the component user to handle it however he likes it.
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COCOON-2162) [PATCH] Fix for Paginator when
accessing out of bounds Pagination page
Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559305#action_12559305 ]
Jörg Heinicke commented on COCOON-2162:
---------------------------------------
Instead of a 404 I would rather send the last page if the requested page number is greater than the last page number and the first page if it is less than the first page 0 or 1 (depends on whether index is 0 or 1-based).
> [PATCH] Fix for Paginator when accessing out of bounds Pagination page
> ----------------------------------------------------------------------
>
> Key: COCOON-2162
> URL: https://issues.apache.org/jira/browse/COCOON-2162
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: (Undefined)
> Affects Versions: 2.1.10, 2.1.11
> Reporter: Drew Buschhorn
> Priority: Minor
> Attachments: paginator.diff, screenshot-1.jpg
>
>
> The Paginator transformer for apache cocoon will allow out of page-range requests.
> I've added the below logic-test into my own copy of cocoon, and that seems to fix the problem.
> Please let me know if you think 1. this is valid and 2. that it should be placed into svn for the 2.1.x version of cocoon.
> Example:
> http://localhost/samples/paginator/text(5)
> will return a valid empty file before patch (despite there being only 4 pages worth of data to paginate)
> after patch, returns ResourceNotFound/404.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.