Michael Wechner wrote:
Andreas Hartmann wrote:
Hi Lenya devs,
we're talking about "leaves" and "branches", but I have to admit
that I don't know exactly what these terms mean.
well, one could also use the terms
files/folders (resp. directories)
or
resources/collections (WebDAV)
or
jcr-properties/jcr-nodes (JCR)
Hmmm, that would mean to introduce a general concept that could
be applied to various specific implementations. This requires a
general abstraction layer above these implementations which contains
the notion of leaves and branches:
+---------+
| Creator |
+---------+
|
+-----------------------+
| tree-based repository |
+-----------------------+
| | |
+-------+ +-----+ +--------+
| Files | | JCR | | WebDAV |
+-------+ +-----+ +--------+
At the moment we don't have this repository abstraction, we just
operate on sources.
BTW, IIUC WebDAV is rather an interface to provide a client-side
abstraction, whereas JCR and Files are an internal storage mechanism.
I could imagine something like
+-----------+
| Client |
+-----------+
|
v
+-----------+
| WebDAV |
+-----------+
|
| - some arbitrary mapping
v
+------------------------------+
| repository (JCR, Files, ...) |
+------------------------------+
Or did I get this entirely wrong?
But anyway, IMO the leaf/branch issue on the repository side is not
related to the Creator interface. The Creator is related to the site
structure, not to the internal representation of the files. The user
doesn't care whether a document is stored as a child file/node of
another document, she cares whether it is a child in the site structure
(which are entirely different things in the Lenya core, though they can
be related in specific publications).
Imagine you have a tree-like site structure and a flat-file storage.
The parent-child relations are managed by the SiteManager component.
So it doesn't make sense to use a leaf/branch concept on the file system
(storage), but the SiteManager has to know the difference between a leaf
and a branch. At the moment, there is no such concept. If we introduce
it, we're restricted to trees again (what about topic maps etc.?).
IIUC leaf/branch are used to distinguish node types in a tree-like
structure. In Lenya, there's no general concept of a tree, apart
from the tree implied by the URL space:
/foo/bar/index
/foo/baz/index
/foo/baz/xyz
foo
/ \
bar baz
/ / \
index index xyz
If we're talking about this tree, then it would be possible to introduce
the leaf/branch concept in the framework. But that leads to a
restriction:
It is not possible to prevent the creation of nodes which are not
URL tree children of the current document.
Assume you have a URI structure like this:
/news
/news_page1
/news_page2
/tv
/tv_page1
/tv_page2
/...
where /news is the main page of a section and other pages are
separated using the underscore character. In this case it would not
be possible to restrict creation using the URL space tree.
I don't really understand what the restriction is resp. what cannot
be restricted. Can you give another example?
OK, I'll try :)
Lets assume that Lenya states the following contract:
"A tree is formed by the URL space. A child node is separated from
the parent node by a slash (/). A leaf node may have no children."
This means that the Creator can avoid the following:
/foo/leaf
/foo/leaf/bar <- not allowed! error message
But if someone uses the underscore instead of the slash to separate
parents from children, the Creator has no chance to interfere:
/foo_leaf
/foo_leaf_bar <- allowed by the creator
----
Another example:
Let's assume the SiteManager has a certain knowledge about document
relations which is derived from meta data. If a document is created,
the user adds a meta data term containing the section. For instance
/news
/msg2005-05-14-005 <- meta: section="news"
/tv
/msg2005-05-15-302 <- meta: section="tv"
There is a inherent tree structure which is known by the SiteManager
(for instance the SiteManager will not allow to delete the "news"
node as long as the "msg2005-05-14-005" exists).
If you want to create a section that can't have children (for instance
a "contact" section), you can't use the URL space tree for this
purpose.
----
This means that the above contract is a restriction - it restricts
the parent-child relation to the slash-separated URL space. I just
wanted to illustrate that such a contract is very specific, even
if it does look general on the first glance.
IMO the most reasonable way to use the leaf/branch concept is to add
it to the SiteManager, which would mean a restriction tree structures.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]