List Info

Thread: Code in opendocument module depends on content-dir configuration




Code in opendocument module depends on content-dir configuration
user name
2006-05-26 09:23:44
Hi Lenya devs,

the opendocument module (CreateOpenDocument) contains code
which
depends on the configuration of the publication's content
directory:


contentDir = pub.getContentDir();
String urlID = "content/" + document.getArea() +
document.getId()
     + "/" + DEFAULT_INDEX + "_" +
document.getLanguage();

if (contentDir == null) {
     destination = SourceNode.CONTEXT_PREFIX
             + Publication.PUBLICATION_PREFIX_URI +
"/"
             + publicationId + "/" + urlID;
} else {
     if (new File(contentDir).isAbsolute()) {
         // Absolute
         destination = SourceNode.FILE_PREFIX + contentDir
                       + File.separator + urlID;
     } else {
         // Relative
         destination = SourceNode.CONTEXT_PREFIX +
contentDir
                       + File.separator + urlID;
     }
}


This violates SoC (the create usecase shouldn't have to
care about
the publication configuration).

Is there a special reason why document.getSourceURI() is not
sufficient
to write the content?

-- Andreas



-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache
Lenya
http://www.wyona.com     
                http://lenya.apache.org
andreas.hartmannwyona.com                     andreasapache.org


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )