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


1TypeNameComment
2SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

3SdaiString

remoteModelRepositoryName

The name of the edmRepository that contains the edmModel with the population to export to an XML file. Repository names are case sensitive.

4SdaiString

remoteModelName

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

5SdaiSelect

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.

6SdaiString

remoteHeaderModelRepositoryName

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

7SdaiString

remoteHeaderModelName

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

8SdaiString

remoteXmlConfigName

The name of the XML configuration to apply. XML Configurations are unique within the scope of an Express Schema.

9SdaiString

xmlFileName

The name of the file to be created on the local file system.

10SdaiString

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.

11SdaiString

encodingEdm

The encoding that was be applied on the XML data when it was used to populate the edmModel. 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.
12SdaiString

encodingXml

The encoding that will be applied on the XML file. 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.
13SdaiUnsignedInt

options

See the description of all available options below.

14SdaiInteger

nbWarnings

Address of a variable that will receive the number of warnings that resulted from the execution of this function.

15SdaiInteger

nbErrors

Address of a variable that will receive the number of errors that resulted from the execution of this function.

16SdaiErrorCode

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.

17SdaiUnsignedInt

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