Versions Compared

Key

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

...

Code Block
languagecpp
themeConfluence
EdmiError edmiRemoteImportModel (SdaiServerContext serverContextId,
                                  SdaiString        remoteRepositoryName, 
                                  SdaiString        remoteModelName, 
                                  SdaiString        localRepositoryName, 
                                  SdaiString        localModelName, 
                                  SdaiString        diagnosticFile, 
                                  SdaiString        remoteSchemaName, 
                                  SdaiUnsignedInt   options, 
                                  SdaiInteger       *nWarnings, 
                                  SdaiInteger       *nErrors, 
                                  EdmiError         *sdaiError, 
                                  SdaiInvocationId  *edmiInvocationId); 


Imports the population of an edmModel located in a local EDMdatabase

...

into a remote EDMdatabase

...

. If the remote edmModel exists, it may be overwritten or have its population incremented by that of the imported local edmModel.

...

If the underlying Express Schema of the local edmModel does not exist in the remote EDMdatabase

...

, it may optionally be uploaded from the local EDMdatabase

...

.

...

Arguments

...

TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiString

remoteRepositoryName

The name of the edmRepository in the remote _ EDMdatabase _ that contains or shall eventually contain the edmModel specified by the argument <remoteModelName>. Repository names are case sensitive.

SdaiString

remoteModelName

The name of the edmModel to create, update or overwrite in the remote _ EDMdatabase _ . Model names are case sensitive.

SdaiString

localRepositoryName

The name of the edmRepository in the local _ EDMdatabase _ that contains the edmModel to import into the remote _ EDMdatabase {_} . Repository names are case sensitive.

SdaiString

localModelName

The name of the edmModel in the local _ EDMdatabase _ to import into the remote _ EDMdatabase {_} . Model names are case sensitive.

SdaiString

diagnosticFile

The name of an optional file that will receive the diagnostic information resulting from importing the population of the edmModel. If this argument is NULL, the diagnostics will be written to the _ EDMinterface _ current output device. The _ EDMinterface _ current output device can be defined by the edmiDefineOutputFunction operation

SdaiString

remoteSchemaName

The name of the Express Schema in the remote _ EDMdatabase _ to be used as base for the imported data. If this Express Schema does not exist in the remote _ EDMdatabase, it may be automatically uploaded by using one of the options_ options  UPLOADING_SCHEMA_IF_REQUIRED or UPLOADING_SCHEMA

SdaiUnsignedInt

options

See list of available options below.
Options may be combined by the bitwise OR operator.

SdaiInteger

nWarnings

Variable that will receive the number of warnings resulting from the importing of the edmModel

SdaiInteger

nErrors

Variable that will receive the number of errors resulting from the importing of the edmModel

EdmiError

sdaiError

Variable that will receive any _ EDMinterface _ error code resulting from the imported data it self. System errors in general wil will not be returned in this variable.

SdaiInvocationId

edmiInvocationId

Currently not used.

Options: Descriptions:

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

 

Options

...

  

OptionComment

DELETING_EXISTING_MODEL

If the edmModel that is specified by the argument <remoteModelName> already exists it will be deleted and recreated before the local edmModel is imported.

DELETE_INSTANCES_WITH_REFS

If an edmModel is implicitly created, this option will disable one of the models built in features, thereby improving its data manipulation performance.
This option enables deletion of referenced instances without removing of the references them selves.
Use this option with extreme care. Never on models that are meant to remain persistent in the _ EDMdatabase _ . This option may lead to inconsistent populations containing references to nonexisting non existing instances.

DELETE_INSTANCE_REFS_ON_DELETE

If an edmModel is implicitly created, this option will disable one of the models built in features, thereby improving its data manipulation performance.
This option causes all external references to an instance to be deleted automatically when the instance it self is deleted.
Use this option with care. Preferably not on models that are meant to remain persistent in the _ EDMdatabase _ .

UNPACKED_MODEL

No garbage collection for the edmModel when data is freed on data deletion or data change. The disk space used for the actual edmModel will normally increase.
This option can influence the system performance.

USER_CONTROLLED_INVERSE

If an edmModel is implicitly created, this option will disable one of the models built in features, thereby improving its data manipulation performance.
This option prevents automatic update and maintenance of the INVERSE attributes in the actual model.
Use this option with care. Preferably not on models that are meant to remain persistent in the _ EDMdatabase _ .

NO_INSTANCE_REFERENCES

If an edmModel is implicitly created, this option will disable one of the models built in features, thereby improving its data manipulation performance.
This option prevents the creation and maintenance of "instance references tables". As a result of this, the following operations will not work:

  1. The built in function USEDIN.
  2. The _ EDMinterface _ operations: edmiUsedIn, edmiUsedInBN, and edmiGetInstanceReferences
  3. The ExpressX function xpxGetInstanceReferences
    Use this option with care. Preferably not on models that are meant to remain persistent in the _ EDMdatabase _ .

LOG_TO_STDOUT

Any logged information will be written to the _ EDMinterface _ current output device. The _ EDMinterface _ current output device can be defined by the edmiDefineOutputFunction operation.

ADD_TO_EXISTING_MODEL

The population of the imported local edmModel will be added to the population of the existing remote edmModel. The imported data must be based on the same underlying Express Schema as that of the existing edmModel.
This option enables merging of populations from two or more edmModels.

LOG_TO_FILE

Any logged information will be stored in the file specified by the <diagnosticFile> argument.

DELETING_EXISTING_SCHEMAS

If the option UPLOADING_SCHEMA is used and the Express Schema already exists in the remote EDMdatabase, the remote Express Schema will be overwritten by that used for the local edmModel.

UPLOADING_SCHEMA

The Express Schema used for the edmModel in the local EDMdatabase, will be uploaded to the remote EDMdatabase. Use the option DELETING_EXISTING_SCHEMAS if you want to overwrite an existing remote version of the Express Schema.

UPLOADING_SCHEMA_IF_REQUIRED

The Express Schema used for the edmModel in the local EDMdatabase, will be uploaded to the remote _ EDMdatabase _ , but only if it does not already exist.

LOG_ERRORS_AND_WARNINGS_ONLY

Limits the logging to include nothing but the instances that generate errors or warnings.

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, error;
SdaiInteger nWrn, nErr;
SdaiServerContext myContext;
SdaiModel modelId;
SdaiInstance instId;
SdaiOptions options;
SdaiRepository repId =  

Example

...

 

Code Block
languagecpp
 EdmiError rstat, error;
 SdaiInteger nWrn, nErr;
 SdaiServerContext myContext;
 SdaiModel modelId;
 SdaiInstance instId;
 SdaiOptions options;
 SdaiRepository repId = sdaiOpenRepositoryBN("MyRepository");

...


  
 /* Create Server Context */

...


 rstat = edmiDefineServerContext("MyContext",

...


 "Johnny", "Supervisor", "cf37ftr",

...

 
 "TCP", "9090", "MyServerHost",

...

 
 NULL, NULL, NULL, NULL, NULL, &myContext);

...

 
  
 /* Export the model from the remote database */

...


 options = LOG_TO_FILE;

...


 options |= DELETING_EXISTING_MODEL;

...


 rstat = edmiRemoteExportModel(myContext,

...


 "DataRepository", "Friends",

...

 
 "MyRepository", "MyFriends",

...

 
 "c:/tmp/friends.export.diagnostics",

...

 
 "FRIENDS_SCHEMA", options,

...

 
 &nWrn, &nErr, &error);

...

 
 /* Work locally */

...


 modelId = sdaiOpenModelBN(repId, "MyFriends", sdaiRW);

...


 instId = edmiCreateInstanceAndPutAttrsBN(modelId, "FRIEND", 2,

...


 "FIRST_NAME", sdaiSTRING, "Lucy",

...

 
 "LAST_NAME", sdaiSTRING, "Schmidt");

...

 
 /* Import the model into the remote database */

...


 options = LOG_TO_FILE;

...


 options |= DELETING_EXISTING_MODEL;

...


 rstat = edmiRemoteImportModel(myContext,

...


 "DataRepository", "Friends",

...

 
 "MyRepository", "MyFriends",

...

 
 "c:/tmp/friends.import.diagnostics",

...

 
 "FRIENDS_SCHEMA", options,

...

  
 &nWrn, &nErr, &error, NULL);

...

 
 . . .

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"