edmiRemoteWriteXMLDocument
Â
EdmiError edmiRemoteWriteXMLDocument (SdaiServerContext serverContextId, SdaiString remoteRepositoryName, SdaiString remoteModelName, SdaiString remoteHeaderModelRepositoryName, SdaiString remoteHeaderModelName, SdaiInstance instanceBuffer[], SdaiInteger startIndex, SdaiInteger maxNumberOfInstances, SdaiInteger *actualNumberOfInstances, SdaiSelect pSel, SdaiInstance xmlConfigurationId, SdaiString xmlFileName, SdaiString *xmlString, SdaiString xmlDiagnosticFile, SdaiString *xmlDiagnosticString, SdaiString encodingEdm, SdaiString encodingOut, SdaiOptions options, SdaiInteger *nbWarnings, SdaiInteger *nbErrors, SdaiInvocationId *edmiInvocationId);
Generates an XML document from the population of an edmModel in a remote EDMdatabase
Arguments
1 | Type | Name | Comment |
2 | SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
3 | SdaiString | remoteRepositoryName | The name of the edmRepository that contains the edmModel with the population to export to an XML formatted document.Repository names are case sensitive. |
4 | SdaiString | remoteModelName | The name of the edmModel that contains the population to be exported to an XML formatted document. Model names are case sensitive. |
5 | SdaiString | remoteHeaderModelRepositoryName | The name of the edmRepository that contains the header model of the edmModel. Repository names are case sensitive. |
6 | SdaiString | remoteHeaderModelName | The name of the header model. Model names are case sensitive. |
7 | SdaiInstance | instanceBuffer | A null-terminated buffer that contains all the instanceIds to be exported to the XML document. This argument will only be used when the argument <remoteRepositoryName> is NULL or contains an empty string. |
8 | SdaiInteger | startIndex | The index of the first <instanceBuffer> element to export to the XML document. The index counts from zero. This argument will only be used when the argument <remoteRepositoryName> is NULL or contains an empty string. |
9 | SdaiInteger | maxNumberOfInstances | The number of <instanceBuffer> elements, starting from <startIndex>, to export to the XML document. This argument will only be used when the argument <remoteRepositoryName> is NULL or contains an empty string. |
10 | SdaiInteger | actualNumberOfInstances | Variable that will receive the number of <instanceBuffer> elements that was actually exported to the XML document. This argument will only be used when the argument <remoteRepositoryName> is NULL or contains an empty string. |
11 | SdaiSelect | pSel | A tSdaiSelect structure that contains the data to be exported to an XML document. This argument will only be used when both the argument <instanceBuffer> is NULL and the argument <remoteRepositoryName> is NULL or contains an empty string. |
12 | SdaiInstance | xmlConfigurationId | The id of the XML configuration to apply. |
13 | SdaiString | xmlFileName | Name of the file to be created on the local file system. If <xmlFileName> is NULL or contains an enmpty string, XML data will be exported to the string variable given in the argument <xmlString>. |
14 | SdaiString | xmlString | Variable that will receive the address of a string that containins the exported XML data. This argument will only be used when the <xmlFileName> argument is NULL or contains an empty string, |
15 | SdaiString | xmlDiagnosticFile | Name of the file, on the local file system, that will receive the diagnostics from the exporting of XML data. If this argument is NULL or contains an empty string, the diagnostics will be written to the string given in the argument <xmlDiagnosticString>. |
16 | SdaiString | xmlDiagnosticString | Variable that will receive the address of an allocated string containing the diagnostics from the exporting of the XML data. This argument will only be used when the <xmlDiagnosticFile> argument is NULL or contains an empty string, |
17 | SdaiString | encodingEdm | The encoding that was be applied on the XML data when it was used to populate the edmModel. Valid encodings are;
|
18 | SdaiString | encodingOut | The encoding that will be applied on the XML document. Valid encoding are;
|
19 | SdaiOptions | options | See the description of all available options below. |
20 | SdaiInteger | nbWarnings | Variable that will receive the number of warnings that resulted from the execution of the function. |
21 | SdaiInteger | nbErrors | Variable that will receive the number of errors that resulted from the execution of the function. |
22 | SdaiInvocationId | edmiInvocationId | Currently unused |
Return Value
Â
Options
 Â
Option | Comment |
INCLUDE_HEADER | Include a header element in the XML document |
INCLUDE_CONFIGURATION | Include a configuration element in the XML document |
INCLUDE_SCHEMA | Include the schema elements in the XML document. |
EXTRACT_SHALLOW | Only the instanceIds that are explicitly listed will be included in the XML document. No reference paths will be followed. By default, the entire mesh of referenced instances will be included in the document. |
EDM_IDENTIFIERS | Specifies that the EDMdatabase instanceIds will be used as xmlIds in the XML document. This will simplify comparison between the EDMdatabase InstanceIds and the xmlIds. |
Â
Example
Â
 EdmiError rstat; SdaiServerContext localContext, remoteContext; SdaiModel myModelId; SdaiSchema schemaId; SdaiInstance instId, xmlConfigId; SdaiInteger nInst, nErr, nWrn; SdaiString xmlString, xmlEncoding; . . . /* Create an instance in the local database */ instId = edmiCreateInstanceAndPutAttrsBN(myModelId, "PERSON", 3, "FIRST_NAME", sdaiSTRING, "LUCY", "LAST_NAME", sdaiSTRING, "SCHMIDT", "SEX", sdaiENUMERATION, "FEMALE"); /* Get predefined xml config id */ rstat = edmiGetSchema("SOCIAL_NETWORK", &schemaId); rstat = edmiGetXMLConfigurationId(schemaId, "friends", &xmlConfigId); /* Define Local Db Context */ rstat = edmiDefineServerContext("MyLocalDbContext", "Johnny", "Supervisor", "cf37ftr", "LOCAL_DB", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &localContext); /* Write xml to string */ rstat = edmiRemoteWriteXMLDocument(localContext, NULL, NULL, NULL, NULL, &instId, 0, 1, &nInst, NULL, xmlConfigId, NULL, &xmlString, "c:/tmp/xml.dignostics", NULL, "UTF-8", "UTF-8", INCLUDE_CONFIGURATION, &nWrn, &nErr, 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 = edmiRemoteReadXMLDocument(remoteContext, "DataRepository", "MyFriends", NULL, xmlString, NULL, NULL, "UTF-8", 0, &xmlEncoding, &nWrn, &nErr, NULL); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â