directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r822741 - /directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
Date Wed, 07 Oct 2009 13:52:50 GMT
Author: seelmann
Date: Wed Oct  7 13:52:50 2009
New Revision: 822741

URL: http://svn.apache.org/viewvc?rev=822741&view=rev
Log:
DIRSTUDIO-515: If entry is an referral we need to send the ManageDsaIT control upon modification

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=822741&r1=822740&r2=822741&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
Wed Oct  7 13:52:50 2009
@@ -47,6 +47,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
@@ -56,7 +57,10 @@
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeModifyRecord;
 import org.apache.directory.studio.ldifparser.model.container.LdifModSpec;
 import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifChangeTypeLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifControlLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifDeloldrdnLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifDnLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifModSpecSepLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifNewrdnLine;
 import org.apache.directory.studio.ldifparser.model.lines.LdifNewsuperiorLine;
@@ -393,7 +397,15 @@
         // check if entry needs to be renamed
         if ( !t0.getDn().equals( t1.getDn() ) )
         {
-            LdifChangeModDnRecord modDnRecord = LdifChangeModDnRecord.create( t0.getDn().getUpName()
);
+            LdifChangeModDnRecord modDnRecord = new LdifChangeModDnRecord( LdifDnLine.create(
t0.getDn().getUpName() ) );
+            if ( t0.isReferral() )
+            {
+                modDnRecord.addControl( LdifControlLine
+                    .create( StudioControl.MANAGEDSAIT_CONTROL.getOid(),
+                        StudioControl.MANAGEDSAIT_CONTROL.isCritical(), StudioControl.MANAGEDSAIT_CONTROL
+                            .getControlValue() ) );
+            }
+            modDnRecord.setChangeType( LdifChangeTypeLine.createModDn() );
             modDnRecord.setNewrdn( LdifNewrdnLine.create( t1.getRdn().getUpName() ) );
             modDnRecord.setNewsuperior( LdifNewsuperiorLine.create( DnUtils.getParent( t1.getDn()
).getUpName() ) );
             modDnRecord.setDeloldrdn( LdifDeloldrdnLine.create1() );
@@ -442,7 +454,13 @@
             }
         }
 
-        LdifChangeModifyRecord record = LdifChangeModifyRecord.create( t1.getDn().getUpName()
);
+        LdifChangeModifyRecord record = new LdifChangeModifyRecord( LdifDnLine.create( t1.getDn().getUpName()
) );
+        if ( t1.isReferral() )
+        {
+            record.addControl( LdifControlLine.create( StudioControl.MANAGEDSAIT_CONTROL.getOid(),
+                StudioControl.MANAGEDSAIT_CONTROL.isCritical(), StudioControl.MANAGEDSAIT_CONTROL.getControlValue()
) );
+        }
+        record.setChangeType( LdifChangeTypeLine.createModify() );
 
         // determine attributes to delete and/or add
         for ( String attributeDescription : attributesToDelAdd )



Mime
View raw message