Hello,

I got a problem with the copy of a document ; i ve got  a  document
available in several languages, and i want to copy just one language version
to a place.

I get the source document in the wanted language :

 public Document getStandardDocument(String template, String language)
throws DocumentBuildException, ProcessingException {
       
         String templatename = getStandardComponentsLocation() + "/" +
template;
        SiteTreeNode templateNode = siteTree.getNode( templatename );
       
        DocumentBuilder builder = getPublication().getDocumentBuilder();
        String url = builder.buildCanonicalUrl(getPublication(), getArea(),
templateNode.getAbsoluteId());
        org.apache.lenya.cms.publication.Document document =
builder.buildDocument(getPublication(), url);
        org.apache.lenya.cms.publication.Document docLang =
builder.buildLanguageVersion(document, language);
       
        return docLang;
       
    }

and in an other class I take this document (template_document) and copy it
to the destination 
 
...
                  //new id : the new parent is the current pduc
                String newIdCopy = pduc.getId() + "/" +
template_document.getNodeId();
                String newLanguage = template_document.getLanguage();
                String copyUrl = builder.buildCanonicalUrl(getPublication(),
getArea(), newIdCopy, newLanguage);
                org.apache.lenya.cms.publication.Document
destinationDocument = builder.buildDocument(getPublication(), copyUrl );
               
                log.debug("Language:" + template_document.getLanguage());
                log.debug("now copying from " + template_document.getId() +
" to " + destinationDocument.getId());       
                getPublication().copyDocument (template_document,
destinationDocument );


but the copyDocument method copy all the language versions of the
template_document to the destination document.

How can i copy just the wanted language version?

thanks in advance,
-- 
View this message in context: 
http://www.nabble.com/copy-a-document-in-just-one-language-version-tp16558220p16558220.html
Sent from the Lenya - Users mailing list archive at Nabble.com.


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

Reply via email to