[ 
https://issues.apache.org/jira/browse/ABDERA-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605975#action_12605975
 ] 

James M Snell commented on ABDERA-168:
--------------------------------------

You could use a URI Template to do this by setting the template pattern and 
passing in the current uri parameters in the context with the appropriate 
changes for the page. e.g. something like:

  Template template = new Template("?{-join|&|a,b,c,d,page}");
  Map<String,Object> context = new HashMap<String,Object>();
  context.put("a", request.getParameter("a"));
  context.put("b", request.getParameter("b"));
  context.put("c", request.getParameter("c"));
  context.put("d", request.getParameter("c"));
  context.put("page", 2);
  String queryString = template.expand(context);

you can then append the expanded querystring to the base request uri

> Generating page links
> ---------------------
>
>                 Key: ABDERA-168
>                 URL: https://issues.apache.org/jira/browse/ABDERA-168
>             Project: Abdera
>          Issue Type: Improvement
>    Affects Versions: 0.4.0
>            Reporter: Remy Gendron
>            Priority: Minor
>
> Hello all,
> I'm adding glue code in my application to automatically generate and add 
> paging links to a returned feed.
> I have the necessary information to decide if a link should be there.
> I know how to compute the URI parameters to target another page.
> I know how to add a link to a feed with the FeedPagingHelper class.
> My question is: Is there an easy way provided by Abdera to generate the link 
> by altering the current request URI parameters? I need to pass thru all the 
> current parameters that define the feed content returned (eg 
> ?q=xxx&author=yyy&max-results=10) but alter the start-index parameter to 
> target the new page.
> I can do it manually by getting this information from the RequestContext and 
> building the new link. But I see a bunch of getLink() methods in the adapter 
> classes. Is there an easy (or recommended) way of generated new links based 
> on the current request that I haven't seen?
> Another question would be... do you make the paging links relative to the 
> base URI or do paging links need to be absolute as the examples in RFC5005 
> seem to indicate?
> Thank you,
> Rémy

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to