none
ECMA 2 not show report Statistic (Full Export Profile) RRS feed

  • Question

  • Hi all.

    I start follow example

    http://technet.microsoft.com/en-us/library/hh859456%28v=ws.10%29.aspx
    and i create profile as "Full Export Profile", run profile is success, 4 file is exported, and data is right as well. 

    <?xml version="1.0" encoding="ISO-8859-1"?>
    -<root>-<item><IDTEXT>7B6U96M32LH5EFS1E</IDTEXT><OID>LUR1SF27WWFUKVV9PGET6F</OID><STRPOS>TZRFW8H35B3FQY9CC65JDKLUMYUZGBASH1905540Z0AWZR8</STRPOS><STRPAR/></item>-<item><IDTEXT>VHROYR3VBZSF56HDJRFWKH4MDC07VCYSVPYVYAS0Q6ASS</IDTEXT><OID>MZD62UJY20I89FZUH8KCWRZ5MKS9K2I6ZU6P</OID><STRPOS>CSVR6YPLMXSN1EHJRH4GLTICNNFEBIH20CG0F7SVX89CMP7</STRPOS><STRPAR/></item></root>

    but Export statistic don't show any thing.

    Export Statistic

    Adds :0

    Updates :0

    Renames :0

    Deletes :0

    Delete Adds :0

    Here is my code

    I create a class implement some interface as

    Public Class EzmaExtension
        Implements IMAExtensible2CallExport, IMAExtensible2CallImport, IMAExtensible2GetCapabilities, IMAExtensible2GetParameters, IMAExtensible2GetSchema

    ..

    and this is body

    Public ReadOnly Property Capabilities As MACapabilities Implements IMAExtensible2GetCapabilities.Capabilities
            Get
                Dim myCapabilities As New MACapabilities()

                myCapabilities.ConcurrentOperation = True
                myCapabilities.ObjectRename = False
                myCapabilities.DeleteAddAsReplace = True
                myCapabilities.DeltaImport = False
                myCapabilities.DistinguishedNameStyle = MADistinguishedNameStyle.None
                myCapabilities.ExportType = MAExportType.AttributeUpdate
                myCapabilities.NoReferenceValuesInFirstExport = False
                myCapabilities.Normalizations = MANormalizations.None
                myCapabilities.FullExport = True
                Return myCapabilities
            End Get
        End Property

    Public Function PutExportEntries(csentries As IList(Of CSEntryChange)) As PutExportEntriesResults Implements IMAExtensible2CallExport.PutExportEntries

            Dim exportEntriesResults As New PutExportEntriesResults
            Try

                Dim exportfiles() As String = {"T054.xml", "T100.xml", "T101.xml", "T120.xml"}
                'Dim exportfiles() As String = {"T054.xml", "T100.xml"}

                For Each exportfile As String In exportfiles

                    xmlSettings.Encoding = System.Text.Encoding.GetEncoding(&H6FAF)

                    m_xmlWriterExport = XmlTextWriter.Create(MAUtils.MAFolder + "\" + exportfile, xmlSettings)
                    m_xmlWriterExport.WriteStartElement(Nodes.Root)

                    For Each csEntryChange As CSEntryChange In csentries
                        If csEntryChange.ObjectModificationType = ObjectModificationType.Add OrElse csEntryChange.ObjectModificationType = ObjectModificationType.Replace Then
                            m_xmlWriterExport.WriteStartElement(Nodes.Item)

                            Select Case exportfile.ToUpper
                                Case "T054.XML"
                                    m_xmlWriterExport.WriteElementString(Nodes.IDTEXT, If((csEntryChange.AttributeChanges.Contains("IDTEXT")), csEntryChange.AttributeChanges("IDTEXT").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.OID, If((csEntryChange.AttributeChanges.Contains("OID")), csEntryChange.AttributeChanges("OID").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.STRPOS, If((csEntryChange.AttributeChanges.Contains("STRPOS")), csEntryChange.AttributeChanges("STRPOS").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.STRPAR, If((csEntryChange.AttributeChanges.Contains("STRPAR")), csEntryChange.AttributeChanges("STRPAR").ValueChanges(0).Value.ToString(), ""))
                                Case "T100.XML"
                                    m_xmlWriterExport.WriteElementString(Nodes.PNUMID, csEntryChange.DN.ToString())                               

                                    m_xmlWriterExport.WriteElementString(Nodes.EFTERNAMN, If((csEntryChange.AttributeChanges.Contains("EFTERNAMN")), csEntryChange.AttributeChanges("EFTERNAMN").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.FOERNAMN, If((csEntryChange.AttributeChanges.Contains("FOERNAMN")), csEntryChange.AttributeChanges("FOERNAMN").ValueChanges(0).Value.ToString(), ""))
                                Case "T101.XML"
                                    m_xmlWriterExport.WriteElementString(Nodes.PNUMID, csEntryChange.DN.ToString())

                                    m_xmlWriterExport.WriteElementString(Nodes.ADDRESS1, If((csEntryChange.AttributeChanges.Contains("ADDRESS1")), csEntryChange.AttributeChanges("ADDRESS1").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.POSTNR, If((csEntryChange.AttributeChanges.Contains("POSTNR")), csEntryChange.AttributeChanges("POSTNR").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.POSTADR, If((csEntryChange.AttributeChanges.Contains("POSTADR")), csEntryChange.AttributeChanges("POSTADR").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.TELNR1, If((csEntryChange.AttributeChanges.Contains("TELNR1")), csEntryChange.AttributeChanges("TELNR1").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.MOBIL, If((csEntryChange.AttributeChanges.Contains("MOBIL")), csEntryChange.AttributeChanges("MOBIL").ValueChanges(0).Value.ToString(), ""))

                                    'm_xmlWriterExport.WriteElementString(Nodes.ADRART, "") 'csEntryChange.AttributeChanges("ADRART").ValueChanges(0).Value.ToString())
                                    m_xmlWriterExport.WriteElementString(Nodes.ADRART, If((csEntryChange.AttributeChanges.Contains("ADRART")), csEntryChange.AttributeChanges("ADRART").ValueChanges(0).Value.ToString(), ""))
                                Case "T120.XML"
                                    m_xmlWriterExport.WriteElementString(Nodes.PNUMID, csEntryChange.DN.ToString())

                                    m_xmlWriterExport.WriteElementString(Nodes.OID, If((csEntryChange.AttributeChanges.Contains("OID")), csEntryChange.AttributeChanges("OID").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.FTGOID, If((csEntryChange.AttributeChanges.Contains("FTGOID")), csEntryChange.AttributeChanges("FTGOID").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.ANSTDAT, If((csEntryChange.AttributeChanges.Contains("ANSTDAT")), csEntryChange.AttributeChanges("ANSTDAT").ValueChanges(0).Value.ToString(), ""))

                                    m_xmlWriterExport.WriteElementString(Nodes.ARBHEL, If((csEntryChange.AttributeChanges.Contains("ARBHEL")), csEntryChange.AttributeChanges("ARBHEL").ValueChanges(0).Value.ToString(), ""))
                            End Select

                            m_xmlWriterExport.WriteEndElement()

                            For Each attributeChange As AttributeChange In csEntryChange.AttributeChanges
                                If Not csEntryChange.ChangedAttributeNames.Contains(attributeChange.Name) Then
                                    csEntryChange.ChangedAttributeNames.Add(attributeChange.Name)
                                End If
                            Next

                            Dim csEntryChangeResult As CSEntryChangeResult = csEntryChangeResult.Create(Guid.NewGuid(), csEntryChange.AttributeChanges, MAExportError.Success)

                            exportEntriesResults.CSEntryChangeResults.Add(csEntryChangeResult)
                        End If
                    Next
                    m_xmlWriterExport.WriteEndElement()

                    m_xmlWriterExport.Close()
                Next
            Catch ex As Exception
              
            Finally
                If Not m_xmlWriterExport Is Nothing Then
                    m_xmlWriterExport.Close()
                End If
            End Try
            Return exportEntriesResults
        End Function

    Public Function GetSchema(configParameters As KeyedCollection(Of String, ConfigParameter)) As Schema Implements IMAExtensible2GetSchema.GetSchema
            Dim personType As Microsoft.MetadirectoryServices.SchemaType = Microsoft.MetadirectoryServices.SchemaType.Create("person", False)

            personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute("PNUMID", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("IDTEXT", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("OID", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("STRPOS", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("STRPAR", AttributeType.String))

            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("BIRTHDATE", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("EFTERNAMN", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("FOERNAMN", AttributeType.String))

            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("ADDRESS1", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("POSTNR", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("POSTADR", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("TELNR1", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("MOBIL", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("ADRART", AttributeType.String))

            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("FTGOID", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("ANSTDAT", AttributeType.String))
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("ARBHEL", AttributeType.String))


            Dim sch As Schema = Schema.Create()
            sch.Types.Add(personType)

            Return sch
        End Function

    Structure Nodes

            Public Const Root As String = "root"
            Public Const PartitionDN As String = "partition-dn"
            Public Const FullExport As String = "full-export"
            Public Const Item As String = "item"
            Public Const IDTEXT As String = "IDTEXT"
            Public Const OID As String = "OID"
            Public Const STRPOS As String = "STRPOS"
            Public Const STRPAR As String = "STRPAR"

            Public Const PNUMID As String = "PNUMID"
            Public Const BIRTHDATE As String = "BIRTHDATE"
            Public Const EFTERNAMN As String = "EFTERNAMN"
            Public Const FOERNAMN As String = "FOERNAMN"

            Public Const ADDRESS1 As String = "ADDRESS1"
            Public Const POSTNR As String = "POSTNR"
            Public Const POSTADR As String = "POSTADR"
            Public Const TELNR1 As String = "TELNR1"
            Public Const MOBIL As String = "MOBIL"
            Public Const ADRART As String = "ADRART"

            Public Const FTGOID As String = "FTGOID"
            Public Const ANSTDAT As String = "ANSTDAT"
            Public Const ARBHEL As String = "ARBHEL"
        End Structure

    Please help me.

    Thanks




    Wednesday, December 25, 2013 7:22 AM

Answers

All replies

  • It's a known issue.

    Thanks, Brian

    Sunday, February 9, 2014 5:47 PM
    Moderator
  • I would note that the sample code is filling exportEntriesResults with nonsense GUIDs:

    Dim csEntryChangeResult As CSEntryChangeResult = csEntryChangeResult.Create(Guid.NewGuid(), csEntryChange.AttributeChanges, MAExportError.Success)

    Use the csEntryChange.ObjectId here instead of Guid.NewGuid().  In fact I'm surprised FIM tolerates this at all.

    Also, the second argument to CSEntryChangeResult.Create should be null if there are no anchor attribute changes to apply.


    Steve Kradel, Zetetic LLC

    Sunday, February 9, 2014 8:30 PM