You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Marcel Reutegger <ma...@gmx.net> on 2008/11/04 14:00:56 UTC

Re: xpath: how to node.getName() from row?

Marc Speck wrote:
> I have a query like
> //*[jcr:contains(.,"whatever")/(@jcr:name | @jcr:primaryType |
> @f:myProperty)
> to retrieve some excerpts. I need a RowIterator for the excerpt (=can't use
> NodeIterator) and some custom properties in the result table (= no default
> properties in the table).
> 
> Unfortunatelly,
> currentRow.getValue(JcrConstants.JCR_NAME).getString();
> throws an error. I hacked around it with using JcrConstants.JCR_PATH but is
> there a better way to retrieve the name of a node from a row?

no, there isn't.

org.apache.jackrabbit.util.Text.getName(row.getValue("jcr:path").getString())

is the best you can do.

regards
 marcel

Re: xpath: how to node.getName() from row?

Posted by Marc Speck <ma...@gmail.com>.
ok, thanks for the confirmation.
Marc


On Tue, Nov 4, 2008 at 2:00 PM, Marcel Reutegger
<ma...@gmx.net>wrote:

> Marc Speck wrote:
> > I have a query like
> > //*[jcr:contains(.,"whatever")/(@jcr:name | @jcr:primaryType |
> > @f:myProperty)
> > to retrieve some excerpts. I need a RowIterator for the excerpt (=can't
> use
> > NodeIterator) and some custom properties in the result table (= no
> default
> > properties in the table).
> >
> > Unfortunatelly,
> > currentRow.getValue(JcrConstants.JCR_NAME).getString();
> > throws an error. I hacked around it with using JcrConstants.JCR_PATH but
> is
> > there a better way to retrieve the name of a node from a row?
>
> no, there isn't.
>
>
> org.apache.jackrabbit.util.Text.getName(row.getValue("jcr:path").getString())
>
> is the best you can do.
>
> regards
>  marcel
>