Repository.XFRACAS.ImportXFRACASXMLString: Difference between revisions
Albert Szeto (talk | contribs) (Created page with '{{Template:APIClass|Repository Class|Repository}} Uploads an import file bytestream for processing and returns the system ID == Method Syntax == {{APIName|'''ImportXFRACASXMLStri…') |
Albert Szeto (talk | contribs) No edit summary |
||
Line 48: | Line 48: | ||
{{APIComment|Connect to the desired Synthesis repository.}} | {{APIComment|Connect to the desired Synthesis repository.}} | ||
Dim Success As Boolean = False | Dim Success As Boolean = False | ||
Success = MyRepository. | Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName") | ||
{{APIComment|Get the list of XFRACAS Entities in the current project in the connected repository.}} | {{APIComment|Get the list of XFRACAS Entities in the current project in the connected repository.}} |
Revision as of 19:06, 17 October 2013
Uploads an import file bytestream for processing and returns the system ID
Method Syntax
ImportXFRACASXMLString(
ByVal
entityID
As Integer
,
ByVal
ImportType
As
XFRACASImportType,
ByVal
xmlString
As String
,
ByVal
fileTitle
As String
,
ByVal
fileDescription
As String
)
As Integer
Uploads an import file bytestream for processing and returns the system ID of the uploaded
Parameters
entityID The ID of the entity to import into.
ImportType The type of XFRACAS Import to utilize.
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.
Dim Success As Boolean = False Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")
Get the list of XFRACAS Entities in the current project in the connected repository.
Dim ListOfXFRACASEntities() As NameIdPair ListOfXFRACASEntities = MyRepository.GetAllXFRACASEntities()
Search the Entities for the desired Entity name, to find the Entity ID
Dim DesiredEntityID As Integer For Each Entity As NameIdPair In ListOfXFRACASEntities() If Entity.Name = "DesiredEntityName" DesiredEntityID = Entity.ID Exit For End If Next
Define an XML string.
Dim xmlString As 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.
Dim ImportXMLSystemID As Integer ImportXMLSystemID = MyRepository.ImportXFRACASXMLString(DesiredEntityID, XFRACASImportType.Incident, xmlString, "XMLFileTitle", "XMLFileDescription")