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 ...




+ 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?

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

Michi



-- Andreas





--
Michael Wechner
Wyona      -   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