directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r656138 - /directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java
Date Wed, 14 May 2008 08:00:21 GMT
Author: pamarcelot
Date: Wed May 14 01:00:21 2008
New Revision: 656138

URL: http://svn.apache.org/viewvc?rev=656138&view=rev
Log:
Fixed some issues when creating new Elements.

Modified:
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java?rev=656138&r1=656137&r2=656138&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerXmlV152IO.java
Wed May 14 01:00:21 2008
@@ -1024,7 +1024,7 @@
         createIndexedAttributes( element, partition.getIndexedAttributes() );
 
         // ContextEntry
-        createContextEntry( element, partition.getContextEntry(), partition.getId() );
+        createContextEntry( element, partition.getContextEntry(), partition.getId(), partition.getSuffix()
);
     }
 
 
@@ -1047,7 +1047,7 @@
             for ( IndexedAttribute indexedAttribute : indexedAttributes )
             {
                 // Adding the 'jdbmIndex' element
-                Element jdbmIndexElement = indexedAttributeElement.element( "jdbmIndex" );
+                Element jdbmIndexElement = indexedAttributeElement.addElement( "jdbmIndex"
);
                 jdbmIndexElement.addAttribute( "attributeId", indexedAttribute.getAttributeId()
);
                 jdbmIndexElement.addAttribute( "cacheSize", "" + indexedAttribute.getCacheSize()
);
             }
@@ -1064,8 +1064,10 @@
      *      the attributes
      * @param id
      *      the partition id
+     * @param dn 
+     *      the dn
      */
-    private void createContextEntry( Element element, Attributes contextEntry, String id
)
+    private void createContextEntry( Element element, Attributes contextEntry, String id,
String dn )
     {
         // Adding the 'contextEntry' element
         element.addElement( "contextEntry" ).setText( "#" + id + "ContextEntry" );
@@ -1081,8 +1083,8 @@
         targetObjectPropertyElement.addAttribute( "name", "targetObject" );
 
         // Adding the targetObject 'ref' element
-        Element targetObjectRefElement = targetObjectPropertyElement
-            .element( new QName( "ref", NAMESPACE_XBEAN_SPRING ) );
+        Element targetObjectRefElement = targetObjectPropertyElement.addElement( new QName(
"ref",
+            NAMESPACE_XBEAN_SPRING ) );
         targetObjectRefElement.addAttribute( "local", "directoryService" );
 
         // Adding the targetMethod 'property' element
@@ -1100,11 +1102,14 @@
         Element argumentsListElement = argumentsPropertyElement
             .addElement( new QName( "list", NAMESPACE_XBEAN_SPRING ) );
 
-        // Adding the arguments 'value' element
-        Element argumentsValueElement = argumentsListElement.addElement( new QName( "value",
new Namespace( "spring",
-            "http://www.springframework.org/schema/beans" ) ) );
+        // Adding the arguments attributes 'value' element
+        Element argumentsAttributesValueElement = argumentsListElement.addElement( new QName(
"value", new Namespace(
+            "spring", "http://www.springframework.org/schema/beans" ) ) );
 
+        // Creating a string buffer to contain the LDIF data
         StringBuffer sb = new StringBuffer();
+
+        // Looping on attributes
         NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
         while ( ne.hasMoreElements() )
         {
@@ -1122,7 +1127,11 @@
             }
         }
 
-        argumentsValueElement.setText( sb.toString() );
+        // Assigning the value to the element
+        argumentsAttributesValueElement.setText( sb.toString() );
+
+        // Adding the arguments dn 'value' element
+        argumentsListElement.addElement( new QName( "value", NAMESPACE_XBEAN_SPRING ) ).setText(
dn );
     }
 
 



Mime
View raw message