You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Jeremy Stell-Smith <je...@gmail.com> on 2005/08/24 09:28:08 UTC
getting a node from a value
hey guys,
shouldn't there be a direct way to get Nodes from a multivalued
reference property? something like :
Node [] getNodes() on the Property class
or even :
Node getNode() on the Value class
instead I'm finding myself going through :
ItemManager itemMgr = ((SessionImpl) session).getItemManager();
Value[] values = property.getValues();
for (Value value : values) {
Node node = (Node) itemMgr.getItem(new NodeId(value.getString()));
...
}
I don't like this because it's ugly, it's using jackrabbit specific
calls for something that shouldn't and it is hard to mock.
can we add one of the first two calls?
Jeremy Stell-Smith
Re: getting a node from a value
Posted by Jeremy Stell-Smith <je...@gmail.com>.
thanks, that answers my question
On 8/24/05, Marcel Reutegger <ma...@gmx.net> wrote:
> Hi Jeremy,
>
> See: http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/1709
>
> regards
> marcel
>
> Jeremy Stell-Smith wrote:
> > hey guys,
> >
> > shouldn't there be a direct way to get Nodes from a multivalued
> > reference property? something like :
> >
> >
> > Node [] getNodes() on the Property class
> >
> > or even :
> >
> > Node getNode() on the Value class
> >
> > instead I'm finding myself going through :
> >
> > ItemManager itemMgr = ((SessionImpl) session).getItemManager();
> > Value[] values = property.getValues();
> > for (Value value : values) {
> > Node node = (Node) itemMgr.getItem(new NodeId(value.getString()));
> > ...
> > }
> >
> > I don't like this because it's ugly, it's using jackrabbit specific
> > calls for something that shouldn't and it is hard to mock.
> >
> > can we add one of the first two calls?
> >
> > Jeremy Stell-Smith
> >
> >
>
Re: getting a node from a value
Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Jeremy,
See: http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/1709
regards
marcel
Jeremy Stell-Smith wrote:
> hey guys,
>
> shouldn't there be a direct way to get Nodes from a multivalued
> reference property? something like :
>
>
> Node [] getNodes() on the Property class
>
> or even :
>
> Node getNode() on the Value class
>
> instead I'm finding myself going through :
>
> ItemManager itemMgr = ((SessionImpl) session).getItemManager();
> Value[] values = property.getValues();
> for (Value value : values) {
> Node node = (Node) itemMgr.getItem(new NodeId(value.getString()));
> ...
> }
>
> I don't like this because it's ugly, it's using jackrabbit specific
> calls for something that shouldn't and it is hard to mock.
>
> can we add one of the first two calls?
>
> Jeremy Stell-Smith
>
>