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/10 10:19:45 UTC

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

edith       2004/03/10 01:19:45

  Modified:    src/java/org/apache/lenya/cms/publication
                        CollectionImpl.java
  Log:
  set the attribute documen id, if it already doesn't exist
  
  Revision  Changes    Path
  1.11      +3 -4      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CollectionImpl.java	4 Mar 2004 14:59:03 -0000	1.10
  +++ CollectionImpl.java	10 Mar 2004 09:19:45 -0000	1.11
  @@ -168,10 +168,9 @@
               
               NamespaceHelper helper = getNamespaceHelper();
               Element collectionElement = helper.getDocument().getDocumentElement();
  -            if (!exists()) {
  +            if (collectionElement.getAttribute(ATTRIBUTE_ID) == null | collectionElement.getAttribute(ATTRIBUTE_ID).equals("")) {
                   collectionElement.setAttribute(ATTRIBUTE_ID, this.getId());
  -            }
  -            
  +            }                   
               Element[] existingDocumentElements = helper.getChildren(collectionElement, ELEMENT_DOCUMENT);
               for (int i = 0; i < existingDocumentElements.length; i++) {
                   collectionElement.removeChild(existingDocumentElements[i]);
  
  
  

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