[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;
}



+                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}. This is not
prohibited by the current architecture. 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.


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