Repository.XFRACAS.ImportXFRACASXMLString: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 18: Line 18:
== Usage Example ==
== Usage Example ==


{{APIComment| Code Block}}
         '{{APIComment|Declare a new repository connection class.}}
         '{{APIComment|Declare a new repository connection class.}}
         {{APIPrefix|Private WithEvents MyRepository As New [[Repository Class|Repository]]}}<br>
         {{APIPrefix|Private WithEvents MyRepository As New [[Repository Class|Repository]]}}<br>
Line 32: Line 31:
         '{{APIComment|Import the XML byte array into the entity desired.  In this example, we assume the XML string type describes an Incident.}}
         '{{APIComment|Import the XML byte array into the entity desired.  In this example, we assume the XML string type describes an Incident.}}
         {{APIPrefix|Dim}}ImportXMLSystemID{{APIPrefix|As Integer}}
         {{APIPrefix|Dim}}ImportXMLSystemID{{APIPrefix|As Integer}}
         ImportXMLSystemID = MyRepository.[[Repository.ImportXFRACASXMLString|ImportXFRACASXMLString]](DesiredEntityID, [[XFRACASImportType]].Incident, xmlString, "XMLFileTitle", "XMLFileDescription")
         ImportXMLSystemID = MyRepository.XFRACAS.[[Repository.ImportXFRACASXMLString|ImportXFRACASXMLString]](DesiredEntityID, [[XFRACASImportType]].Incident, xmlString, "XMLFileTitle", "XMLFileDescription")
 
 
===Reformatted Usage Example===
{{APIComment|Declare a new repository connection class.}}
        Private WithEvents MyRepository As New [[Repository Class|Repository]]
 
{{APIComment|Connect to the desired Synthesis repository.}}
        Dim Success As Boolean = False
        Success = MyRepository.[[Repository.ConnectToSQLRepository|ConnectToSQLRepository]]("SQLServerPath", "SQLDatabaseName")
 
{{APIComment|Set the Desired Entity ID to import into.}}
        Dim DesiredEntityID As Integer
        DesiredEntityID = '{{APIComment|Set the entity ID}}
 
{{APIComment|Define an XML string.}}
        Dim xmlString As String = Nothing
        'populate the xmlString with the XML text
 
{{APIComment|Import the XML byte array into the entity desired.  In this example, we assume the XML string type describes an Incident.}}
        Dim ImportXMLSystemID As Integer
        ImportXMLSystemID = MyRepository.[[Repository.ImportXFRACASXMLString|ImportXFRACASXMLString]](DesiredEntityID, [[XFRACASImportType]].Incident, xmlString, "XMLFileTitle", "XMLFileDescription")

Revision as of 15:56, 27 May 2015


Uploads an import file bytestream for processing and returns the system ID

Syntax

  • ImportXFRACASXMLString( entityID As Integer, ImportType As XFRACASImportType , xmlString As String, fileTitle As String, fileDescription As String)As Integer

Parameters

entityID: The ID of the entity to import into.
ImportType: The type of XFRACAS Import to utilize, specified as XFRACASImportType.
xmlString: The string consisting of the XML to import.
fileTitle: The file title of the XML file byte array to import.
fileDescription: A description of the XML to import.

Usage Example

       ' Declare a new repository connection class. 
       Private WithEvents MyRepository As New Repository
' Connect to the desired Synthesis repository. DimSuccessAs Boolean=False Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")
' Set the Desired Entity ID to import into. Dim DesiredEntityID As Integer DesiredEntityID = ' Set the entity ID
' Define an XML string DimxmlStringAs String=Nothing ' populate the xmlString with the XML text
' Import the XML byte array into the entity desired. In this example, we assume the XML string type describes an Incident. DimImportXMLSystemIDAs Integer ImportXMLSystemID = MyRepository.XFRACAS.ImportXFRACASXMLString(DesiredEntityID, XFRACASImportType.Incident, xmlString, "XMLFileTitle", "XMLFileDescription")