Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
EdmiError edmiRemoteReadXMLDocument(SdaiServerContext serverContextId,
                                     SdaiString        remoteRepositoryName, 
                                     SdaiString        remoteModelName, 
                                     SdaiString        xmlFileName, 
                                     SdaiString        xmlString, 
                                     SdaiString        xmlDiagNosticFile, 
                                     SdaiString        *xmlDiagnosticString, 
                                     SdaiString        encodingEdm, 
                                     SdaiOptions       options, 
                                     SdaiString        *encodingXmlDocument, 
                                     SdaiInteger       *nbWarnings, 
                                     SdaiInteger       *nbErrors, 
                                     SdaiInvocationId  *edmiInvocationId);

Reads an XML document into an existing edmModel in a remote EDMdatabase

...

.

...

The imported data will be added to any existing data in the model. In case incremental import is not required, the model must be manually emptied, e.g with edmiRemoteDeleteModelContents, before invoking this function.

...

Arguments

...

1TypeNameComment
2SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

3SdaiString

remoteRepositoryName

The name of the edmRepository in which to populate an existing edmModel with the XML data stored in the file specified by the <xmlFileName> argument. The XML data will be appended to any existing population of the edmModel. The edmRepository and the edmModel must exist in the remote _remote  EDMdatabase _
Repository names are case sensitive.

4SdaiString

remoteModelName

The name of the edmModel to populate. The <remoteRepositoryName> and <remoteModelName> arguments uniquely identify an existing edmModel in the remote EDMdatabase.
  Model names are case sensitive.

5SdaiString

xmlFileName

The name of the file, on the local file system, containing the XML data to read. If <xmlFileName> is NULL, data will be read from the string given in the argument <xmlString>.

6SdaiString

xmlString

The string containing the XML data to be read. If the <xmlFileName> argument is not NULL and contains anything but an empty string, this argument will be neglected.

7SdaiString

xmlDiagNosticFile

The name of the file, on the local file system, that will receive the diagnostics from the parsing of the XML data. If <xmlDiagnosticFile> is NULL, the parsing diagnostics will be written to the string given in the argument <xmlDiagnosticString>.

8SdaiString

xmlDiagnosticString

Variable that will receive the address of an allocated string containing the diagnostics from the parsing of the XML data. If the <xmlDiagnosticFile> argument is not NULL and contains anything but an empty string, this argument will be neglected.

9SdaiString

encodingEdm

The encoding that will be used by EDM. Valid encodings 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"
    If this argument is NULL or contains an empty string, the default value will be the encoding that is specified within the XML document.
10SdaiOptions

options

See the description of all available options below.
Multipple Multiple options may be specified by using the bitwise OR operator.

11SdaiString

encodingXmlDocument

Variable that will receive the encoding of the data in the XML document

12SdaiInteger

nbWarnings

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

13SdaiInteger

nbErrors

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

14SdaiInvocationId

edmiInvocationId

Currently unused

Options: Descriptions:

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

 

Options

...

  

OptionComment

SHOW_STATISTICS

Show statistics when parsing the XML data.

XML_PARSE_TRACE

Trace the parsing of the XML data.

PARSE_ONLY

The XML document will be parsed only, i.e. only checked for syntactical correctness. No data will be stored in the EDMdatabase.

CONTINUE_STORING_ON_ERROR

Ignore errors when populating the data model from the XML document, e. E.g, entities that do not exist in the Express schema will simply be ignored. By default, the import will be abrupted stopped in case of erroneous data.

 Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
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,

Example

...

 

Code Block
languagecpp
 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 (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"