If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Do NOT assign new id during import

Started by manias, 07 Mar 2017 08:12:47 AM

Previous topic - Next topic

manias

Good day, Gurus!

I try to set option "Do not assign new id during import" for deployment objects, like in Import tool.

I look for method (setDeploymentOptionEnum) from sdk_samples:

//set up your deployment deployment options
private Option[] setDeploymentOptionEnum(String nameOfArchive,String[] ListOfFolders )
{
Option[] deploymentOptions = null;
int num = 0;
int eOptionCount=0;

String[] deployOptionEnumBoolean = { "archiveOverwrite",
"dataSourceSelect", "namespaceSelect", "namespaceThirdParty",
"objectPolicies", "packageHistories", "packageOutputs",
"packageSchedules", "packageSelect", "recipientsSelect",
"takeOwnership" };

String[] deployOptionEnumResolution = { "dataSourceConflictResolution",
"namespaceConflictResolution",
"objectPoliciesConflictResolution",
"ownershipConflictResolution",
"packageHistoriesConflictResolution",
"packageOutputsConflictResolution",
"packageSchedulesConflictResolution",
"recipientsConflictResolution" };

eOptionCount=2;  // for import
deploymentOptions = new DeploymentOption[eOptionCount + deployOptionEnumBoolean.length
                                         + deployOptionEnumResolution.length];

// Define the deployment ( import) options

        deploymentOptions[num]   = this.setImportDeploymentOptionPackageInfo(ListOfFolders);

//same as in Export
deploymentOptions[++num] = this.setDeploymentOptionString(nameOfArchive);
deploymentOptions[++num] = this.setArchiveOverWrite(true);
deploymentOptions[++num] = this.setDataSourceSelect(true);
deploymentOptions[++num] = this.setNameSpaceSelect(true);
deploymentOptions[++num] = this.setNameSpaceThirdParty(false);
deploymentOptions[++num] = this.setObjectPolicies(true);
deploymentOptions[++num] = this.setPackageHistories(true);
deploymentOptions[++num] = this.setPackageOutputs(true);
deploymentOptions[++num] = this.setPackageSchedules(true);
deploymentOptions[++num] = this.setPackageSelect(true);
deploymentOptions[++num] = this.setRecipientsSelect(true);
deploymentOptions[++num] = this.setTakeOwnership(false);
deploymentOptions[++num] = this.setDataSourceConflictResolution(true);
deploymentOptions[++num] = this.setNamespaceConflictResolution(true);
deploymentOptions[++num] = this.setObjectPoliciesConflictResolution(true);
deploymentOptions[++num] = this.setOwnershipConflictResolution(true);
deploymentOptions[++num] = this.setPackageHistoriesConflictResolution(true);
deploymentOptions[++num] = this.setPackageOutputsConflictResolution(true);
deploymentOptions[++num] = this.setPackageSchedulesConflictResolution(true);
deploymentOptions[++num] = this.setRecipientsConflictResolution(true);
/*// use default value
deploymentOptions[++num] = this.setDataSourceSelect(false);  // default
deploymentOptions[++num] = this.setNameSpaceSelect(false);  // default
deploymentOptions[++num] = this.setNameSpaceThirdParty(true);  // default
deploymentOptions[++num] = this.setObjectPolicies(false);    //default
deploymentOptions[++num] = this.setPackageHistories(false);   //default
deploymentOptions[++num] = this.setPackageOutputs(false);   //default
deploymentOptions[++num] = this.setPackageSchedules(false);   //default
deploymentOptions[++num] = this.setPackageSelect(true);    //default
deploymentOptions[++num] = this.setRecipientsSelect(false); //default
deploymentOptions[++num] = this.setTakeOwnership(true);  // default is false
deploymentOptions[++num] = this.setDataSourceConflictResolution(true);
deploymentOptions[++num] = this.setNamespaceConflictResolution(true);
deploymentOptions[++num] = this.setObjectPoliciesConflictResolution(true);
deploymentOptions[++num] = this.setOwnershipConflictResolution(true);
deploymentOptions[++num] = this.setPackageHistoriesConflictResolution(true);
deploymentOptions[++num] = this.setPackageOutputsConflictResolution(true);
deploymentOptions[++num] = this.setPackageSchedulesConflictResolution(true);
deploymentOptions[++num] = this.setRecipientsConflictResolution(true);
*/
return deploymentOptions;
} //setDeploymentOptionEnum


and I can't find an option from option List that would relate to "Do not assign new id during import".

Maybe someone met with it, and know name of the option?

I tried to find it in SDK Developer Guide, but without successfull.

Many thanks, Egor!

manias

#1
So.. to manage ID's during import, need to use preserveStoreIDs method in deploymentOptionEnum class (https://www.ibm.com/support/knowledgecenter/en/SSEP7J_10.2.2/com.ibm.swg.ba.cognos.dg_sdk.10.2.2.doc/r_d15e1264308.html). To use option "Do not assign new ID during import" in SDK, need to use "true" value for method preserveStoreIDs.

setter method in my Import class:


private DeploymentOptionBoolean setPreserveStoreIDs(boolean setValue) {
DeploymentOptionBoolean deployOptionBool = new DeploymentOptionBoolean();
deployOptionBool.setName(DeploymentOptionEnum.fromString("preserveStoreIDs"));
deployOptionBool.setValue(setValue);

return deployOptionBool;
}



Egor.

bdbits

Thank you for posting back with the solution. This may help someone in the future.

(I am not an SDK guy and did not know the answer, either.)