You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Felix Röthenbacher <fe...@wyona.com> on 2005/03/18 15:19:13 UTC

Sitetree respresentation in Jackrabbit

Hi

I'm currently working on moving the sitetree into a jackrabbit
repository.

As the repository is structured differently than the existing
sitetree in sitetree.xml, and as the repository has
certain built-in functionality, the question arises how to
represent the document structure in the repository.

Currently, the sitetree looks like this:

<sitetree:site i18n:attr="label" label="Authoring">
   <sitetree:node id="index">
     <sitetree:label xml:lang="en">Home</sitetree:label>
     <sitetree:label xml:lang="de">Home</sitetree:label>
   </sitetree:node>

   <sitetree:node id="tutorial">
     <sitetree:label xml:lang="en">Tutorial</sitetree:label>
     <sitetree:label xml:lang="de">Tutorial</sitetree:label>

     <sitetree:node id="new_doctype">
       <sitetree:label xml:lang="en">Create new doctype</sitetree:label>
     </sitetree:node>
   </sitetree:node>
</sitetree:site>

The name of a node is hold in the id attribute. Further, a node
has different labels for different language versions. A possible
mapping of this sitretree to the repository might look like this:

<sitetree:site xmlns:sitetree="http://apache.org/cocoon/lenya/sitetree/1.0">
   <sitetree:index>
     <sitetree:document xml:lang="en" label="Home"/>
     <sitetree:document xml:lang="de" label="Home"/>
   </sitetree:index>
   <sitetree:tutorial>
     <sitetree:document xml:lang="en" label="Tutorial"/>
     <sitetree:document xml:lang="de" label="Tutorial"/>
     <sitetree:new_doctype>
       <sitetree:document xml:lang="en" label="Create new doctype"/>
     </sitetree:new_doctype>
   </sitetree:tutorial>
<sitetree:site>

whereas the current id of a node is used as the node's
name. A node may contain various language versions,
called document, with the language and its label
attributed.

In a next step, the (binary) content of a document will
be a property (attribute) of that language document
(that's day-dreaming at the moment but it's always wise
to think about future use).

This is a first proposal and any suggestions are very
welcome!

Regards,

Felix


-- 
Felix Röthenbacher                  felix.roethenbacher@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Felix Röthenbacher <fe...@wyona.com>.
Christian Egli wrote:
> Felix Röthenbacher   <fe...@wyona.com> writes:
> 
> 
>>Hi
>>
>>I'm currently working on moving the sitetree into a jackrabbit
>>repository.
>>
>>The name of a node is hold in the id attribute. Further, a node
>>has different labels for different language versions. A possible
>>mapping of this sitretree to the repository might look like this:
>>
>><sitetree:site xmlns:sitetree="http://apache.org/cocoon/lenya/sitetree/1.0">
>>   <sitetree:index>
>>     <sitetree:document xml:lang="en" label="Home"/>
>>     <sitetree:document xml:lang="de" label="Home"/>
>>   </sitetree:index>
>>   <sitetree:tutorial>
>>     <sitetree:document xml:lang="en" label="Tutorial"/>
>>     <sitetree:document xml:lang="de" label="Tutorial"/>
>>     <sitetree:new_doctype>
>>       <sitetree:document xml:lang="en" label="Create new doctype"/>
>>     </sitetree:new_doctype>
>>   </sitetree:tutorial>
>><sitetree:site>
> 
> 
> Hm, I don't quite see the reason why this format needs to be
> changed. Can't you leave as is (speaking of backwards compatibility)?

The reason for choosing the scheme above is that JCR supports nodes
this way. All the methods like getName() or getPath() are related
to the node's names and not using them would be ignorant respective to
the JSR-170 API. But the discussion above is all about the sitetree
representation in the repository itself, the sitetree presentation
through the SiteTree interface will not change (speaking of
backwards compatibility).

> 
> One of the reasons that it should stay as it is is the fact that the
> navigation framework uses the sitetree.xml to generate the
> navigational elements (such as bread crumb, etc) by applying simple
> xsl transformations to the xml in sitetree.xml. Ok you could argue
> that it should not use the file directly. This could be recitified by
> creating a generator that generates xml based on the SiteTree
> Interface.

That's a good point (see also Josias' mail). Directly accessing the
sitetree.xml file will not be possible anymore if the sitetree is
hosted in the repository. A custom generator for the sitetree will
be a good solution for that problem.

> 
> But for the xsl transformations to remain simple the xpath for the
> nodes has to be constant. It will be next to impossible to select some
> specific nodes if you encode the node name in the element name. For
> example, in the navigation framework you'll often see things like
> 
>   <xsl:template match="nav:site/nav:node[@id='foo']/nav:node">
> 
> This will be very hard with the scheme you propose.
> 

The sitetree generator will transform the sitetree from either the
SiteTree interface or directly from the repository to the representation
used so far, in a way that it can be used with the existing framework.

Thanks for your pointers!

- Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Christian Egli <ch...@wyona.net>.
Felix Röthenbacher   <fe...@wyona.com> writes:

> Hi
> 
> I'm currently working on moving the sitetree into a jackrabbit
> repository.
> 
> The name of a node is hold in the id attribute. Further, a node
> has different labels for different language versions. A possible
> mapping of this sitretree to the repository might look like this:
> 
> <sitetree:site xmlns:sitetree="http://apache.org/cocoon/lenya/sitetree/1.0">
>    <sitetree:index>
>      <sitetree:document xml:lang="en" label="Home"/>
>      <sitetree:document xml:lang="de" label="Home"/>
>    </sitetree:index>
>    <sitetree:tutorial>
>      <sitetree:document xml:lang="en" label="Tutorial"/>
>      <sitetree:document xml:lang="de" label="Tutorial"/>
>      <sitetree:new_doctype>
>        <sitetree:document xml:lang="en" label="Create new doctype"/>
>      </sitetree:new_doctype>
>    </sitetree:tutorial>
> <sitetree:site>

Hm, I don't quite see the reason why this format needs to be
changed. Can't you leave as is (speaking of backwards compatibility)?

One of the reasons that it should stay as it is is the fact that the
navigation framework uses the sitetree.xml to generate the
navigational elements (such as bread crumb, etc) by applying simple
xsl transformations to the xml in sitetree.xml. Ok you could argue
that it should not use the file directly. This could be recitified by
creating a generator that generates xml based on the SiteTree
Interface.

But for the xsl transformations to remain simple the xpath for the
nodes has to be constant. It will be next to impossible to select some
specific nodes if you encode the node name in the element name. For
example, in the navigation framework you'll often see things like

  <xsl:template match="nav:site/nav:node[@id='foo']/nav:node">

This will be very hard with the scheme you propose.

-- 
Christian Egli       christian.egli@wyona.net   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Felix Röthenbacher <fe...@wyona.com>.
Josias Thoeny wrote:
> On Fri, 2005-03-18 at 15:28 +0100, Andreas Hartmann wrote:
> 
>>Felix Röthenbacher wrote:
>>
>>[...]
>>
>>
>>>whereas the current id of a node is used as the node's
>>>name.
>>
>>Does this imply any restrictions re. the document ID?
> 
> 
> I guess it won't be allowed to create a document with the ID "site" or
> "document". I mean, these would be reserved names in Lenya. Right?

Thanks for the pointer! Maybe the user space and system space should be
mapped to two different namespaces?

> 
> - Josias
> 
> 
>>>A node may contain various language versions,
>>>called document, with the language and its label
>>>attributed.
>>
>>Sounds reasonable.
>>
>>
>>
>>>In a next step, the (binary) content of a document will
>>>be a property (attribute) of that language document
>>>(that's day-dreaming at the moment but it's always wise
>>>to think about future use).
>>>
>>>This is a first proposal and any suggestions are very
>>>welcome!
>>
>>Thanks a lot!
>>I hope I find the time to look at the code soon.
>>
>>-- Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Josias Thoeny <jo...@wyona.com>.
On Fri, 2005-03-18 at 15:28 +0100, Andreas Hartmann wrote:
> Felix Röthenbacher wrote:
> 
> [...]
> 
> > whereas the current id of a node is used as the node's
> > name.
> 
> Does this imply any restrictions re. the document ID?

I guess it won't be allowed to create a document with the ID "site" or
"document". I mean, these would be reserved names in Lenya. Right?

- Josias

> 
> > A node may contain various language versions,
> > called document, with the language and its label
> > attributed.
> 
> Sounds reasonable.
> 
> 
> > In a next step, the (binary) content of a document will
> > be a property (attribute) of that language document
> > (that's day-dreaming at the moment but it's always wise
> > to think about future use).
> > 
> > This is a first proposal and any suggestions are very
> > welcome!
> 
> Thanks a lot!
> I hope I find the time to look at the code soon.
> 
> -- Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Andreas Hartmann <an...@apache.org>.
Felix Röthenbacher wrote:
> Andreas Hartmann wrote:
> 
>> Felix Röthenbacher wrote:
>>
>> [...]
>>
>>> whereas the current id of a node is used as the node's
>>> name.
>>
>>
>>
>> Does this imply any restrictions re. the document ID?
>>
> 
> Excerpt from the JSR-170 spec (4.6 Path Syntax):
> 
> simplename ::= nonspacestring [[string] nonspacestring]
> string ::= [string] char
> char ::= nonspace | space
> nonspacestring ::= [nonspacestring] nonspace
> nonspace ::= /* Any Unicode character except
>                 '/', ':', '[', ']', '*',
>                 ''' (the single quote),
>                 '"' (the double quote),
>                 any whitespace character */
> space ::= /* ' ' (the space character) */

That should be sufficient :)

Thanks,
-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Felix Röthenbacher <fe...@wyona.com>.
Andreas Hartmann wrote:
> Felix Röthenbacher wrote:
> 
> [...]
> 
>> whereas the current id of a node is used as the node's
>> name.
> 
> 
> Does this imply any restrictions re. the document ID?
> 

Excerpt from the JSR-170 spec (4.6 Path Syntax):

simplename ::= nonspacestring [[string] nonspacestring]
string ::= [string] char
char ::= nonspace | space
nonspacestring ::= [nonspacestring] nonspace
nonspace ::= /* Any Unicode character except
                 '/', ':', '[', ']', '*',
                 ''' (the single quote),
                 '"' (the double quote),
                 any whitespace character */
space ::= /* ' ' (the space character) */

> 
>> A node may contain various language versions,
>> called document, with the language and its label
>> attributed.
> 
> 
> Sounds reasonable.
> 
> 
>> In a next step, the (binary) content of a document will
>> be a property (attribute) of that language document
>> (that's day-dreaming at the moment but it's always wise
>> to think about future use).
>>
>> This is a first proposal and any suggestions are very
>> welcome!
> 
> 
> Thanks a lot!
> I hope I find the time to look at the code soon.
> 
> -- Andreas
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Sitetree respresentation in Jackrabbit

Posted by Andreas Hartmann <an...@apache.org>.
Felix Röthenbacher wrote:

[...]

> whereas the current id of a node is used as the node's
> name.

Does this imply any restrictions re. the document ID?


> A node may contain various language versions,
> called document, with the language and its label
> attributed.

Sounds reasonable.


> In a next step, the (binary) content of a document will
> be a property (attribute) of that language document
> (that's day-dreaming at the moment but it's always wise
> to think about future use).
> 
> This is a first proposal and any suggestions are very
> welcome!

Thanks a lot!
I hope I find the time to look at the code soon.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org