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/03/04 15:59:03 UTC

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

edith       2004/03/04 06:59:03

  Modified:    src/java/org/apache/lenya/cms/publication
                        CollectionImpl.java Collection.java
  Log:
  save method made public
  
  Revision  Changes    Path
  1.10      +6 -2      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CollectionImpl.java	1 Mar 2004 16:18:16 -0000	1.9
  +++ CollectionImpl.java	4 Mar 2004 14:59:03 -0000	1.10
  @@ -163,11 +163,14 @@
        * Saves the XML source of this collection.
        * @throws DocumentException when something went wrong.
        */
  -    protected void save() throws DocumentException {
  +    public void save() throws DocumentException {
           try {
               
               NamespaceHelper helper = getNamespaceHelper();
               Element collectionElement = helper.getDocument().getDocumentElement();
  +            if (!exists()) {
  +                collectionElement.setAttribute(ATTRIBUTE_ID, this.getId());
  +            }
               
               Element[] existingDocumentElements = helper.getChildren(collectionElement, ELEMENT_DOCUMENT);
               for (int i = 0; i < existingDocumentElements.length; i++) {
  @@ -193,6 +196,7 @@
       /**
        * Creates an element to store a document.
        * @param helper The namespace helper of the document.
  +     * @param document The document.
        * @return An XML element.
        * @throws DocumentException when something went wrong.
        */
  
  
  
  1.6       +6 -1      cocoon-lenya/src/java/org/apache/lenya/cms/publication/Collection.java
  
  Index: Collection.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/Collection.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Collection.java	1 Mar 2004 16:18:17 -0000	1.5
  +++ Collection.java	4 Mar 2004 14:59:03 -0000	1.6
  @@ -92,4 +92,9 @@
        */
       int size() throws DocumentException;
       
  +    /**
  +     * Saves the XML source of this collection.
  +     * @throws DocumentException when something went wrong.
  +     */
  +    void save() throws DocumentException;
   }
  
  
  

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