follow this thread for history
urlFor in RouteManager does not let you null out vars
http://www.mail-archive.com/[EMAIL PROTECTED]/msg02666.html
https://issues.apache.org/jira/browse/ABDERA-162
davep
On Thu, Jul 31, 2008 at 4:40 AM, James Abley <[EMAIL PROTECTED]> wrote:
> 2008/7/30 David Primmer <[EMAIL PROTECTED]>:
>> On Wed, Jul 30, 2008 at 2:03 PM, James Abley <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> I've got my first version up and running. It does POST of media assets
>>> to a collection, GET of entries and PUT of the same entries.
>>>
>>> Just some observations which most likely are due to my lack of
>>> experience with the code base. I extended
>>> AbstractEntityCollectionAdapter, so all of my comments relate to this
>>> class.
>>>
>>> 1. I overrode getHref(RequestContext) like so:
>>>
>>> /
>>> * [EMAIL PROTECTED]
>>> */
>>> @Override
>>> public String getHref(RequestContext request) {
>>>
>>> /*
>>> * FIXME We override the default implementation to ensure that
>>> variables bound for parameter substitution are
>>> * available for URI Templates / Routes.
>>> */
>>> Map<String, String> params = new HashMap<String, String>();
>>>
>>> Target target = request.getTarget();
>>>
>>> for (String param : target.getParameterNames()) {
>>> params.put(param, target.getParameter(param));
>>> }
>>>
>>> return request.urlFor("feed", params);
>>> }
>>>
>>> Otherwise I was getting back links like
>>>
>>> /contextpath/base//
>>>
>>> rather than
>>>
>>> /contextpath/base/workspace/collection-name
>>>
>>> I'm not sure what I'm missing here. I should be able to submit a test
>>> case and maybe patch if it is a genuine problem, although I used JMock
>>> rather than EasyMock.
>>
>> can't comment on the rest but this is the intended behavior. this was
>> recently changed. what you did, used to be done by default and it was
>> hard to undo it when you didn't want the request env pulled in.
>>
>> davep
>>
>
> Thanks Dave,
>
> I've tried to track down why the behaviour changed as you say.
>
> $ svn praise
> server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionAdapter.java
> ...
> 616540 dandiep public String getHref(RequestContext request) {
> 617214 dandiep return request.urlFor("feed", hrefParams);
> 616540 dandiep }
> ...
>
> $ svn log -r 617214
> server/src/main/java/org/apache/abdera/protocol/server/impl/AbstractCollectionAdapter.java
> ------------------------------------------------------------------------
> r617214 | dandiep | 2008-01-31 20:22:54 +0000 (Thu, 31 Jan 2008) | 1 line
>
> Having issues today.. didn't mean to commit this.
> ------------------------------------------------------------------------
>
> Going back one more change points me at
> https://issues.apache.org/jira/browse/ABDERA-95.
>
> I've had a look at the commits around that area but am none the wiser
> as to why the code is the way it is. Any pointers?
>
> Cheers,
>
> James
>