jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: XPath - Emergency
Date Tue, 01 Jul 2008 15:33:35 GMT
It should be session.getItem("/turnguard:BookmarkSpace"). The jcr:root
is only for the specific Xpath <-> JCR mapping.

Regards,
Alex

On Tue, Jul 1, 2008 at 5:22 PM, jakobitsch juergen <tschyrgie@yahoo.com> wrote:
> hi there,
>
> System.out.println("1"+session.getItem("/jcr:root/turnguard:BookmarkSpace").getPath());
>
> ==> javax.jcr.PathNotFoundException
>
> XPathQuery : /jcr:root/turnguard:BookmarkSpace works
>
> System.out.println("2"+session.getItem("/jcr:root/turnguard:BookmarkSpace/turnguard:Bookmark[1]").getPath());
>
> ==> javax.jcr.PathNotFoundException
>
> XPathQuery : /jcr:root/turnguard:BookmarkSpace/turnguard:Bookmark[1] works
>
> version -> 1.4
>
> thanks j
>
>
>
> ----- Original Message ----
> From: Alexander Klimetschek <aklimets@day.com>
> To: users@jackrabbit.apache.org
> Sent: Tuesday, July 1, 2008 4:43:37 PM
> Subject: Re: XPath - Emergency
>
> Hi!
>
> The code looks ok to me. Only the repository.xml (posted on the dev
> list mail) contains a superfluous <SearchIndex> element at the end (it
> can only be used inside a <Workspace> - and hence in the
> workspace.xml), but that shouldn't be a problem, since it is simply
> ignored by the config parser IIRC.
>
> Are there any exceptions, maybe in the logs?
>
> Can you read the nodes and properties with a direct access
> (session.getItem("/path/to/node/or/property"))?
>
> What version of Jackrabbit do you use?
>
> Regards,
> Alex
>
> On Tue, Jul 1, 2008 at 12:04 PM, jakobitsch juergen <tschyrgie@yahoo.com> wrote:
>> aloha,
>>
>> what am i doing wrong , none of the following xpath queries gives any result
>> using the following structure
>>
>>                         Node root = session.getRootNode();
>>                         Node BookmarkSpace = root.getNode("turnguard:BookmarkSpace");
>>                         Node NewBookmark = BookmarkSpace.addNode("turnguard:Bookmark");
>>                         NewBookmark.addMixin("mix:referenceable");
>>                         NewBookmark.addMixin("mix:versionable");
>>                         NewBookmark.setProperty("turnguard:BookmarkTitle", RequestContainer.getValueFor("BookmarkTitle"));
>>                         NewBookmark.setProperty("turnguard:BookmarkUrl", RequestContainer.getValueFor("BookmarkUrl"));
>>
>>
>> NewBookmark.setProperty("turnguard:BookmarkDescription",
>> RequestContainer.getValueFor("BookmarkDescription"));
>>
>>            NewBookmark.setProperty("turnguard:In",
>> session.getNodeByUUID(RequestContainer.getValueFor("ParentFolderUUID")));
>>                              session.save();
>>
>> 1. i cant query for jcr:uuid
>>
>> //turnguard:BookmarkSpace/turnguard:Bookmark[@jcr:uuid='cf6b0cac-97f9-4a98-b479-b31e717d2236']
>>
>> (i tried every combination with double-slashes, jcr:root in front, with @ and without,...)
>>
>> 2. i cant query for element
>>
>> //element(*,nt:unstructured)
>> //element(*,nt:base)
>>
>> nothing...
>>
>> 3. i'm far from getting rep:similar to work
>>
>> used the query from the wiki.. :(
>>
>> 4. i'm far from getting turnguard:Bookmarks that have a certain folder-uuid in turnguard:In
>>
>>
>> ===============
>> //element(*,jackrabbit:help) ??
>>
>> wkr turnguard
>>
>>
>>
>>
>>
>
>
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
>
>
>
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message