abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Primmer" <david.prim...@gmail.com>
Subject Re: Feedback from implementing an AtomPub(-like!) server on top of JCR
Date Wed, 30 Jul 2008 22:46:32 GMT
On Wed, Jul 30, 2008 at 2:03 PM, James Abley <james.abley@gmail.com> 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:
>
>    /
>     * {@inheritDoc}
>     */
>    @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

Mime
View raw message