You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ed...@apache.org on 2004/02/25 16:39:00 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication CollectionImpl.java

edith       2004/02/25 07:39:00

  Modified:    src/java/org/apache/lenya/cms/publication
                        CollectionImpl.java
  Log:
  when collection is saved, additional XML is preserved
  
  Revision  Changes    Path
  1.8       +8 -6      cocoon-lenya/src/java/org/apache/lenya/cms/publication/CollectionImpl.java
  
  Index: CollectionImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/CollectionImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CollectionImpl.java	9 Jan 2004 11:14:39 -0000	1.7
  +++ CollectionImpl.java	25 Feb 2004 15:39:00 -0000	1.8
  @@ -203,12 +203,14 @@
        */
       protected void save() throws DocumentException {
           try {
  -            NamespaceHelper helper =
  -                new NamespaceHelper(
  -                    Collection.NAMESPACE,
  -                    Collection.DEFAULT_PREFIX,
  -                    ELEMENT_COLLECTION);
  +            
  +            NamespaceHelper helper = getNamespaceHelper();
               Element collectionElement = helper.getDocument().getDocumentElement();
  +            
  +            Element[] existingDocumentElements = helper.getChildren(collectionElement, ELEMENT_DOCUMENT);
  +            for (int i = 0; i < existingDocumentElements.length; i++) {
  +                collectionElement.removeChild(existingDocumentElements[i]);
  +            }
   
               Document[] documents = getDocuments();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org