You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "James M Snell (JIRA)" <ji...@apache.org> on 2011/08/23 02:41:29 UTC

[jira] [Created] (ABDERA-287) Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)

Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)
-------------------------------------------------------------------------------------------------------

                 Key: ABDERA-287
                 URL: https://issues.apache.org/jira/browse/ABDERA-287
             Project: Abdera
          Issue Type: Improvement
            Reporter: James M Snell
         Attachments: uritemplate_update.txt

Updated URI Template implementation based on the latest version of the URI Templates specification. 

http://tools.ietf.org/html/draft-gregorio-uritemplate-06

This is NOT a drop in replacement for the existing URI Template implementation. The URI Template spec has changed significantly.

Example:

    HashMap<String,String> map = new HashMap<String,String>();
    map.put("semi",";");
    map.put("dot",".");
    map.put("comma",",");
    
    HashMap<String,Object> context = new HashMap<String,Object>();
    context.put("dom","example.com");
    context.put("dub","me/too");
    //context.put("foo","That's right!");
    context.put("hello","Hello World!");
    context.put("half","50%");
    context.put("var","value");
    context.put("who","fred");
    context.put("base","http://example.com/home/");
    context.put("path","/foo/bar");
    context.put("list", new String[] {"red", "green", "blue"});
    context.put("keys", map);
    context.put("v",6);
    context.put("x",1024);
    context.put("y",768);
    context.put("empty","");
    context.put("empty_keys",new HashMap<String,String>());
    context.put("foo", CharBuffer.wrap("That's right!"));

    
    Template template = 
      new Template("http://www{.list*}{/list*}{?foo,var,hello}{&half,x,y}#{var}");
    
    System.out.println(template.expand(context));

Expands to:

  http://www.red.green.blue/red/green/blue?foo=That%27s%20right%21&var=value&hello=Hello%20World%21&half=50%25&x=1024&y=768#value



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ABDERA-287) Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)

Posted by "ant elder (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ABDERA-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13090162#comment-13090162 ] 

ant elder commented on ABDERA-287:
----------------------------------

Well that looks interesting James. What do you want to happen with this now - how would it be integrated into Abdera? 
(and just to remind, you do still have commit access here)

> Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-287
>                 URL: https://issues.apache.org/jira/browse/ABDERA-287
>             Project: Abdera
>          Issue Type: Improvement
>            Reporter: James M Snell
>         Attachments: uritemplate_update.txt
>
>
> Updated URI Template implementation based on the latest version of the URI Templates specification. 
> http://tools.ietf.org/html/draft-gregorio-uritemplate-06
> This is NOT a drop in replacement for the existing URI Template implementation. The URI Template spec has changed significantly.
> Example:
>     HashMap<String,String> map = new HashMap<String,String>();
>     map.put("semi",";");
>     map.put("dot",".");
>     map.put("comma",",");
>     
>     HashMap<String,Object> context = new HashMap<String,Object>();
>     context.put("dom","example.com");
>     context.put("dub","me/too");
>     //context.put("foo","That's right!");
>     context.put("hello","Hello World!");
>     context.put("half","50%");
>     context.put("var","value");
>     context.put("who","fred");
>     context.put("base","http://example.com/home/");
>     context.put("path","/foo/bar");
>     context.put("list", new String[] {"red", "green", "blue"});
>     context.put("keys", map);
>     context.put("v",6);
>     context.put("x",1024);
>     context.put("y",768);
>     context.put("empty","");
>     context.put("empty_keys",new HashMap<String,String>());
>     context.put("foo", CharBuffer.wrap("That's right!"));
>     
>     Template template = 
>       new Template("http://www{.list*}{/list*}{?foo,var,hello}{&half,x,y}#{var}");
>     
>     System.out.println(template.expand(context));
> Expands to:
>   http://www.red.green.blue/red/green/blue?foo=That%27s%20right%21&var=value&hello=Hello%20World%21&half=50%25&x=1024&y=768#value

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ABDERA-287) Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ABDERA-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13090268#comment-13090268 ] 

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

Well, it's an update for the existing uri template impl that's already
there. For now, unless there's major reason to get it into trunk, keeping
the patch available in jira is sufficient I think. People who want to play
around with it can patch their source.

Fwiw, I've been playing around with a significant update to the i18n module,
fixing bugs, improving performance, and finally getting around to the ICU
support for the unicode stuff. When I'm done with that i'll submit the patch
for that as well.
https://issues.apache.org/jira/browse/ABDERA-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13090162#comment-13090162]
now - how would it be integrated into Abdera?
http://tools.ietf.org/html/draft-gregorio-uritemplate-06)
-------------------------------------------------------------------------------------------------------
URI Templates specification.
implementation. The URI Template spec has changed significantly.
{.list*}{/list*}{?foo,var,hello}{&half,x,y}#{var}");
http://www.red.green.blue/red/green/blue?foo=That%27s%20right%21&var=value&hello=Hello%20World%21&half=50%25&x=1024&y=768#value


> Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-287
>                 URL: https://issues.apache.org/jira/browse/ABDERA-287
>             Project: Abdera
>          Issue Type: Improvement
>            Reporter: James M Snell
>         Attachments: uritemplate_update.txt
>
>
> Updated URI Template implementation based on the latest version of the URI Templates specification. 
> http://tools.ietf.org/html/draft-gregorio-uritemplate-06
> This is NOT a drop in replacement for the existing URI Template implementation. The URI Template spec has changed significantly.
> Example:
>     HashMap<String,String> map = new HashMap<String,String>();
>     map.put("semi",";");
>     map.put("dot",".");
>     map.put("comma",",");
>     
>     HashMap<String,Object> context = new HashMap<String,Object>();
>     context.put("dom","example.com");
>     context.put("dub","me/too");
>     //context.put("foo","That's right!");
>     context.put("hello","Hello World!");
>     context.put("half","50%");
>     context.put("var","value");
>     context.put("who","fred");
>     context.put("base","http://example.com/home/");
>     context.put("path","/foo/bar");
>     context.put("list", new String[] {"red", "green", "blue"});
>     context.put("keys", map);
>     context.put("v",6);
>     context.put("x",1024);
>     context.put("y",768);
>     context.put("empty","");
>     context.put("empty_keys",new HashMap<String,String>());
>     context.put("foo", CharBuffer.wrap("That's right!"));
>     
>     Template template = 
>       new Template("http://www{.list*}{/list*}{?foo,var,hello}{&half,x,y}#{var}");
>     
>     System.out.println(template.expand(context));
> Expands to:
>   http://www.red.green.blue/red/green/blue?foo=That%27s%20right%21&var=value&hello=Hello%20World%21&half=50%25&x=1024&y=768#value

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (ABDERA-287) Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James M Snell updated ABDERA-287:
---------------------------------

    Attachment: uritemplate_update.txt

> Updated URI Template Implementation (based on http://tools.ietf.org/html/draft-gregorio-uritemplate-06)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-287
>                 URL: https://issues.apache.org/jira/browse/ABDERA-287
>             Project: Abdera
>          Issue Type: Improvement
>            Reporter: James M Snell
>         Attachments: uritemplate_update.txt
>
>
> Updated URI Template implementation based on the latest version of the URI Templates specification. 
> http://tools.ietf.org/html/draft-gregorio-uritemplate-06
> This is NOT a drop in replacement for the existing URI Template implementation. The URI Template spec has changed significantly.
> Example:
>     HashMap<String,String> map = new HashMap<String,String>();
>     map.put("semi",";");
>     map.put("dot",".");
>     map.put("comma",",");
>     
>     HashMap<String,Object> context = new HashMap<String,Object>();
>     context.put("dom","example.com");
>     context.put("dub","me/too");
>     //context.put("foo","That's right!");
>     context.put("hello","Hello World!");
>     context.put("half","50%");
>     context.put("var","value");
>     context.put("who","fred");
>     context.put("base","http://example.com/home/");
>     context.put("path","/foo/bar");
>     context.put("list", new String[] {"red", "green", "blue"});
>     context.put("keys", map);
>     context.put("v",6);
>     context.put("x",1024);
>     context.put("y",768);
>     context.put("empty","");
>     context.put("empty_keys",new HashMap<String,String>());
>     context.put("foo", CharBuffer.wrap("That's right!"));
>     
>     Template template = 
>       new Template("http://www{.list*}{/list*}{?foo,var,hello}{&half,x,y}#{var}");
>     
>     System.out.println(template.expand(context));
> Expands to:
>   http://www.red.green.blue/red/green/blue?foo=That%27s%20right%21&var=value&hello=Hello%20World%21&half=50%25&x=1024&y=768#value

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira