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


1TypeNameComment
2SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

3SdaiString

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.

4SdaiString

remoteModelName

The name of the edmModel that contains the population to be exported to an XML formatted document. Model names are case sensitive.

5SdaiString

remoteHeaderModelRepositoryName

The name of the edmRepository that contains the header model of the edmModel. Repository names are case sensitive.

6SdaiString

remoteHeaderModelName

The name of the header model. Model names are case sensitive.

7SdaiInstance

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.

8SdaiInteger

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.

9SdaiInteger

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.

10SdaiInteger

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.

11SdaiSelect

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.

12SdaiInstance

xmlConfigurationId

The id of the XML configuration to apply.

13SdaiString

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>.

14SdaiString

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,

15SdaiString

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>.

16SdaiString

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,

17SdaiString

encodingEdm

The encoding that was be applied on the XML data when it was used to populate the edmModel. Valid encodings are;

  • "UTF-8",
  • "UTF-16",
  • "ISO-10646-UCS-2",
  • "ISO-10646-UCS-4",
  • "ISO-LATIN-1",
  • "ISO-LATIN-2",
  • "ISO-8859-3",
  • "ISO-8859-4",
  • "ISO-8859-5",
  • "ISO-8859-6",
  • "ISO-8859-7",
  • "ISO-8859-8",
  • "ISO-8859-9",
  • "ISO-2022-jp",
  • "SHIFT_JIS",
  • "EUC-JP"

     
    Default value is UTF-8.
18SdaiString

encodingOut

The encoding that will be applied on the XML document. Valid encoding are;

  • "UTF-8",
  • "UTF-16",
  • "ISO-10646-UCS-2",
  • "ISO-10646-UCS-4",
  • "ISO-LATIN-1",
  • "ISO-LATIN-2",
  • "ISO-8859-3",
  • "ISO-8859-4",
  • "ISO-8859-5",
  • "ISO-8859-6",
  • "ISO-8859-7",
  • "ISO-8859-8",
  • "ISO-8859-9",
  • "ISO-2022-jp",
  • "SHIFT_JIS",
  • "EUC-JP"
    Default value is UTF-8.
19SdaiOptions

options

See the description of all available options below.

20SdaiInteger

nbWarnings

Variable that will receive the number of warnings that resulted from the execution of the function.

21SdaiInteger

nbErrors

Variable that will receive the number of errors that resulted from the execution of the function.

22SdaiInvocationId

edmiInvocationId

Currently unused

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

 

Options


  

OptionComment

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.