|
|
Choosing A Webhost: |
svn commit: r520932 - /lenya/trunk/src/impl/java/org/apache/lenya/cms/publi: msg#00020cms.lenya.cvs
Author: andreas Date: Wed Mar 21 09:16:05 2007 New Revision: 520932 URL: http://svn.apache.org/viewvc?view=rev&rev=520932 Log: Duplicate meta data instead of copying when copying a document to a different area. This fixes bug 40061. Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java?view=diff&rev=520932&r1=520931&r2=520932 ============================================================================== --- lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java (original) +++ lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java Wed Mar 21 09:16:05 2007 @@ -101,7 +101,7 @@ * Copies meta data from one document to another, whereas both documents * will have completely identical meta data afterwards (including workflow * etc.). This is only useful if the source document will be deleted - * afterwards. + * afterwards or for creating a new area version (e.g., during publishing). * @param source * @param destination * @throws PublicationException @@ -408,7 +408,12 @@ destinationDoc = sourceDoc.getAreaVersion(destinationArea); copyDocumentSource(sourceDoc, destinationDoc); } else { - destinationDoc = addVersion(sourceDoc, destinationArea, language); + if (language.equals(sourceDoc.getLanguage()) && !destinationArea.equals(sourceDoc.getArea())) { + destinationDoc = duplicateVersion(sourceDoc, destinationArea, language); + } + else { + destinationDoc = addVersion(sourceDoc, destinationArea, language); + } } SiteStructure destSite = sourceDoc.getPublication().getArea(destinationArea).getSite(); @@ -596,7 +601,23 @@ */ public void copyDocumentSource(Document sourceDocument, Document destinationDocument) throws PublicationException { + copyContent(sourceDocument, destinationDocument); + copyMetaData(sourceDocument, destinationDocument); + } + + /** + * Duplicates a document source. Meta data are duplicated as they are. + * @param sourceDocument The source document. + * @param destinationDocument The destination document. + * @throws PublicationException when something went wrong. + */ + public void duplicateDocumentSource(Document sourceDocument, Document destinationDocument) + throws PublicationException { + copyContent(sourceDocument, destinationDocument); + copyMetaData(sourceDocument, destinationDocument); + } + protected void copyContent(Document sourceDocument, Document destinationDocument) throws PublicationException { boolean useBuffer = true; OutputStream destOutputStream = null; @@ -625,9 +646,6 @@ } catch (Exception e) { throw new PublicationException(e); } - - copyMetaData(sourceDocument, destinationDocument); - } /**
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r520931 - /lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java, andreas |
|---|---|
| Next by Date: | svn commit: r520933 - /lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl, andreas |
| Previous by Thread: | svn commit: r520931 - /lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java, andreas |
| Next by Thread: | svn commit: r520933 - /lenya/trunk/src/webapp/lenya/xslt/menu/menu2xhtml.xsl, andreas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |