You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2003/12/01 15:35:50 UTC
Documents and language versions
Hi Lenya developers,
currently I'm designing the publication API and
just became aware of a problem with the handling
of language versions.
At the moment, a document refers to a language
version. This makes sense if you think in terms
of XML sources. But it is complicated to declare
dependence semantics. (With "dependence" I mean
that a document can't exist without another one.
I think this concept is quite useful to define
site structures.)
Imagine a sitetree. It is allowed to have arbitrary
language versions for all sitetree nodes. It is not
possible to say that one document depends on another
one, because it depends on "one of the language
versions" of its parent node.
If we see a document as the union of all its language
versions - or introduce another term describing this
"group" - could we use this as the basis for document
dependence abstraction?
Please tell me what you think.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org
Re: Documents and language versions
Posted by Andreas Hartmann <an...@apache.org>.
Michael Trindler wrote:
[...]
>>If we see a document as the union of all its language
>>versions - or introduce another term describing this
>>"group" - could we use this as the basis for document
>>dependence abstraction?
>
> Yes! At least two dependency types (between the "groups") should be
> supported:
> - "inter-language" : (e.g.) child may go live if parent of any language
> version is live
> - "intra-language" : (e.g.) child may go live only if parent of same
> language version is live
This sounds very interesting ... By now, I only had the idea of
"strong" dependence - for a pair of documents d1 and d2, you can
determine if d1 depends on d2. But this seems to be too strict.
I introduce "<" as the "depends" relation in D x D (D is the set
of documents). So it should be possible to define
d1 < d2 iff the existence of d1 implies the existence of one
language version of d2
d1 < d2 iff the existence of d1 implies the existence of the
same language version of d2
> (I imagine that users would like to implement either of these cases.)
The definition of "<" would depend on the implementation
(or configuration) of the site structure management component.
>
> Will your idea also result in an easier and more flexible creation of the
> navigation tree? (In the "intra-language"-case the navigation tree contains
> the same-language-version, whereas in the "inter-language"-case only a
> other-language-parent may exist.)
The purpose behind these thoughts is to integrate the
structural requirements of the site into the site
structure management component. At the moment, these
requirements depend on the implementation of the publication-
specific operations (e.g., the "publish" task). This
can lead to inconsistencies if the publication-specific
operations fail.
So, if you see the following layers:
+-----------------------------------------------+
| Publication-specific operations |
+-----------------------------------------------+
| Publication layer |
| +-------------------------------+
| | Site structure management |
+-----------------------------------------------+
you would invoke
publication.copyDocument(d1, d2)
If a sitetree is used and the parent of d2 does
not exist, an exception is thrown. This prevents
the client (publication-specific operations) from
creating an inconsistent state.
If you have a "depends-on" ("<") relation between
documents, you could do the following:
Document[] requiredDocuments
= publication.getRequiredDocuments(d2);
if (all required documents exist) {
publication.copyDocument(d1, d2)
}
else {
error("could not copy document!");
}
This would allow the implementation of operations
that do not depend on a specific site structure
management component.
> Does there also exist a "downward"-dependency (?) :
> - "complete" : (e.g.) parent "group" may be deleted only if ALL language
> versions of (all) children "groups" are deleted
The relation is the same. You would check if there
are any documents which depend on the "group" document.
> - "complete cascade" (?) : (e.g.) parent "group" are deleted including all
> children "groups"
An implication of the "<" relation is that you can
order document sets by dependence. This means, you
can securely delete a set of documents in the correct
order (starting with the document which no other
documents depend on). This is for instance the basis
for operations on subtrees or group structures.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org
Re: Documents and language versions
Posted by Michael Trindler <mi...@id.unizh.ch>.
From: "Andreas Hartmann" <an...@apache.org>
> Hi Lenya developers,
[]
> dependence semantics. (With "dependence" I mean
> that a document can't exist without another one.
> I think this concept is quite useful to define
> site structures.)
>
> Imagine a sitetree. It is allowed to have arbitrary
> language versions for all sitetree nodes. It is not
> possible to say that one document depends on another
> one, because it depends on "one of the language
> versions" of its parent node.
>
> If we see a document as the union of all its language
> versions - or introduce another term describing this
> "group" - could we use this as the basis for document
> dependence abstraction?
Yes! At least two dependency types (between the "groups") should be
supported:
- "inter-language" : (e.g.) child may go live if parent of any language
version is live
- "intra-language" : (e.g.) child may go live only if parent of same
language version is live
(I imagine that users would like to implement either of these cases.)
Will your idea also result in an easier and more flexible creation of the
navigation tree? (In the "intra-language"-case the navigation tree contains
the same-language-version, whereas in the "inter-language"-case only a
other-language-parent may exist.)
Does there also exist a "downward"-dependency (?) :
- "complete" : (e.g.) parent "group" may be deleted only if ALL language
versions of (all) children "groups" are deleted
- "complete cascade" (?) : (e.g.) parent "group" are deleted including all
children "groups"
Michael
>
> Please tell me what you think.
>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-dev-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org