none
How to return a CSEntryChange with ObjectModificationType Delete in an ECMA2 MA RRS feed

  • Question

  • I'm trying to return a CSEntryChange with ObjectModificationType Delete in my implementation of IMAExtensible2CallImport.GetImportEntries:

    var entry = CSEntryChange.Create();
    entry.ObjectType = "SomeObjectType";
    entry.DN = "SomeDN";
    entry.ObjectModificationType = ObjectModificationType.Delete;
    

    However, when that entry is returned, I get a "missing-anchor-component" error in the console. The anchor attribute, in this case, is called "Name".

    However, if I try to add the attribute to the AttributeChanges collection with CreateAttributeAdd, I get an exception:

    System.ArgumentException: AttributeModificationType Add is invalid when the ObjectModificationType is set to Delete.

    Example:

    entry.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("Name", "SomeName"));

    However, the "CreateAttributeDelete" operation does not let me specify a value for the attribute.

    How am I supposed to pass the anchor attribute value in this case?

    I could not find any example in the documentation.


    Paolo Tedesco - http://cern.ch/idm

    Monday, September 22, 2014 12:05 PM

Answers

  • Found it:

    entry.AnchorAttributes.Add("Name", "SomeName");


    Paolo Tedesco - http://cern.ch/idm

    • Marked as answer by Paolo Tedesco Monday, September 22, 2014 1:03 PM
    Monday, September 22, 2014 1:03 PM

All replies

  • I just tried with CreateAttributeReplace, CreateAttributeUpdate amd CreateAttributeDelete, and I always get the same exception: AttributeModificationType XXX is invalid when the ObjectModificationType is set to Delete.

    So the error message here is misleading - you just cannot touch the AttributeChanges collection with a deleted object.

    At this point, what should I do to specify the anchor attribute for a deleted object?


    Paolo Tedesco - http://cern.ch/idm

    Monday, September 22, 2014 12:32 PM
  • Found it:

    entry.AnchorAttributes.Add("Name", "SomeName");


    Paolo Tedesco - http://cern.ch/idm

    • Marked as answer by Paolo Tedesco Monday, September 22, 2014 1:03 PM
    Monday, September 22, 2014 1:03 PM