Michael Wechner wrote:
Andreas Hartmann wrote:

[EMAIL PROTECTED] wrote:

[...]

     public boolean existsInAnyLanguage() throws DocumentException {
         boolean exists = false;
+ String[] languages = getLanguages();
+
+        if (languages.length > 0) {


This would IMO be sufficient:

public boolean existsInAnyLanguage() throws DocumentException {
    return getLanguages().length > 0;
}


I think so too, whereas I would leave the debug messages, because they are really helpful.

I don't know why the code was as it was, but it definitely did too much ...

That's true :)
Probably for historical reasons.
Thanks for refactoring it.

+ log.warn("Document (" + this + ") exists in at least one language: " + languages.length); + String[] allLanguages = getPublication().getLanguages(); + if (languages.length == allLanguages.length) log.warn("Document (" + this + ") exists even in all languages of this publication");



This is not necessarily correct.

Imagine that the document languages are {en, de}
and the publication languages are {de, fr}.


right ....

This is not
prohibited by the current architecture.


I think we should rathe question why all languages need to be defined within publication.xconf and
not just the default language. Any idea?

It helps, for instance, to build widgets for language selection.
Going through the whole site to see which languages exist doesn't
scale with the current repo implementations.


If we want to disallow
this case, we have to check on startup if documents exist in
languages which are not declared in publication.xconf.


I don't think that makes sense

Neither do I. A possibility to ensure the consistency in JCR would be
to use references from documents to "language nodes", but this should
probably be handled by the Lenya repo layer.

-- Andreas


--
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                     [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to