edmiRemoteWriteXMLFile
dmiError edmiRemoteWriteXMLFile(SdaiServerContext serverContextId, SdaiString remoteModelRepositoryName, SdaiString remoteModelName, SdaiSelect pSel, SdaiString remoteHeaderModelRepositoryName, SdaiString remoteHeaderModelName, SdaiString remoteXmlConfigName, SdaiString xmlFileName, SdaiString diagnosticFileName, SdaiString encodingEdm, SdaiString encodingXml, SdaiUnsignedInt options, SdaiInteger *nbWarnings, SdaiInteger *nbErrors, SdaiErrorCode *sdaiError, SdaiUnsignedInt *edmiInvocationId);
Generates an XML file from an existing edmModel population in a remote EDMdatabase. This function is a higher level implementation of edmiRemoteWriteXMLDocument. In addition to the features of edmiRemoteWriteXMLDocument, the header model name and repository info stored in the XML file may be optionally overruled by values given as input parameters. Writing XML data and diagnostics to allocated strings in memory is not possible with this function. Use edmiRemoteWriteXMLDocument if this feature is required.
Arguments
1 | Type | Name | Comment |
2 | SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
3 | SdaiString | remoteModelRepositoryName | The name of the edmRepository that contains the edmModel with the population to export to an XML file. Repository names are case sensitive. |
4 | SdaiString | remoteModelName | The name of the edmModel that contains the population to be exported to an XML file. Model names are case sensitive. |
5 | SdaiSelect | pSel | A tSdaiSelect structure that contains the data to be exported to an XML file. This argument will only be used when the argument <remoteRepositoryName> is NULL or contains an empty string. Currently, this select structure may only contain two types of data. Either a single instanceId or an aggregate of instanceIds. |
6 | SdaiString | remoteHeaderModelRepositoryName | The name of the edmRepository that contains the header model of the edmModel. Repository names are case sensitive. |
7 | SdaiString | remoteHeaderModelName | The name of the header model. Model names are case sensitive. |
8 | SdaiString | remoteXmlConfigName | The name of the XML configuration to apply. XML Configurations are unique within the scope of an Express Schema. |
9 | SdaiString | xmlFileName | The name of the file to be created on the local file system. |
10 | SdaiString | diagnosticFileName | Specifies the file name for diagnostic information generated by this function. If no file name is supplied, i.e. the <diagnosticFileName> argument is set to NULL, all diagnostic information will be written to the current output device. The current output device can be defined by the edmiDefineOutputFunction operation. |
11 | SdaiString | encodingEdm | The encoding that was be applied on the XML data when it was used to populate the edmModel. Valid encoding are:
|
12 | SdaiString | encodingXml | The encoding that will be applied on the XML file. Valid encoding are:
|
13 | SdaiUnsignedInt | options | See the description of all available options below. |
14 | SdaiInteger | nbWarnings | Address of a variable that will receive the number of warnings that resulted from the execution of this function. |
15 | SdaiInteger | nbErrors | Address of a variable that will receive the number of errors that resulted from the execution of this function. |
16 | SdaiErrorCode | sdaiError | Variable that will receive an error code if the XML data was rejected due to reasons found in the data it self. System errors will not be returned in this argument. |
17 | SdaiUnsignedInt | edmiInvocationId | Currently unused |
Return Value
Â
Options
 Â
Option | Comment |
INCLUDE_HEADER | Include a header element in the XML file. |
INCLUDE_CONFIGURATION | Include a configuration element in the XML file. |
INCLUDE_SCHEMA | Include the schema elements in the XML file. |
EXTRACT_SHALLOW | Only the instanceIds that are explicitly listed will be included in the XML file. No reference paths will be followed. By default, the entire mesh of referenced instances will be included in the XML file. |
EDM_IDENTIFIERS | Specifies that the instanceIds will be used as xmlIds in the XML document. This will simplify comparison between the InstanceIds and the xmlIds. |
Â
Example
Â
 EdmiError rstat, error; SdaiServerContext localContext, remoteContext; SdaiModel myModelId; SdaiInstance instId; SdaiInteger nErr, nWrn; tSdaiSelect sel; . . . /* Create an instance in the local database */ instId = edmiCreateInstanceAndPutAttrsBN(myModelId, "PERSON", 3, "FIRST_NAME", sdaiSTRING, "LUCY", "LAST_NAME", sdaiSTRING, "SCHMIDT", "SEX", sdaiENUMERATION, "FEMALE"); /* Put lucy into a select struct */ sel.nTypes = 0; sel.type = sdaiINSTANCE; sel.typeList = NULL; sel.value.instVal = instId; /* Define Local Db Context */ rstat = edmiDefineServerContext("MyLocalDbContext", "Johnny", "Supervisor", "cf37ftr", "LOCAL_DB", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &localContext); /* Write xml to file */ rstat = edmiRemoteWriteXMLFile(localContext, NULL, NULL, &sel, NULL, NULL, "friends", "c:/xml/lucy.xml", NULL, "UTF-8", "UTF-8", INCLUDE_CONFIGURATION, &nWrn, &nErr, &error, NULL); /* Define Remote Server Context */ rstat = edmiDefineServerContext("MyRemoteServerContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &remoteContext); /* Read xml into remote database */ rstat = edmiRemoteReadXMLFile(remoteContext, "DataRepository", "MyFriends", NULL, NULL, "c:/xml/lucy.xml", NULL, "NETWORK", ADD_TO_EXISTING_MODEL, &nWrn, &nErr, &error, NULL); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â