cancel
Showing results for 
Search instead for 
Did you mean: 

IDT SDK - getting connection for DataFoundation table

Former Member
0 Kudos

Hello,

I retrive universe from repository, open local DataFoundation and getting tables.

Now I want to know which connection (repository SI_ID) using each table. Any ideas?

My code:


String localPath = cmsService.retrieveUniverse("MY_UNIVERSE.unx", LOCAL_FOLDER, true);

SlResource loadedRes = localService.load(localPath);

RelationalBusinessLayer businessLayer = (RelationalBusinessLayer) loadedRes;

String localDFPath = businessLayer.getDataFoundationPath();

SlResource resource = localService.load(localDFPath);

DataFoundation dataFoundation = null;

if (resource instanceof MonoSourceDataFoundation) {

            dataFoundation = (MonoSourceDataFoundation) resource;

} else if (resource instanceof MultiSourceDataFoundation) {

            dataFoundation = (MultiSourceDataFoundation) resource;

}

List<Table> tables = dataFoundation.getTables();

for (Table table : tables) {

          System.out.println("Table: " + table.getName() + " using connection: ????");

}

BO 4.1 SP3

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thomasz,

In the loaded data foundation you check wether the foundation is of type MonoSource or MultiSource.

If MonoSource you read the DataFoundation as MonoSourceDataFoundation and receive the connection path directly from the object.

If MultiSource you iterate the DataFederationSourceInfo objects you get from MultiSourceDataFoundation.getSourceInfos().  Each DataFederationSourceInfo gives you a connection path.

Hope ith helps.

Bernd

Former Member
0 Kudos

Hi

Former Member
0 Kudos

Hi Tomasz,

Yes this is true.

You can use the path to load the resource as a Connection/ConnectionShortcut (SL SDK type). From the ConnectionShortcut object you get the connection path.

This is the pat in CMS!

Something like /Connections/<connection_name>  or

/Connections/<folder_name>/<connection_name>.

We map the CMS connection path to an info object and get the SI_ID from this info object.

Bernd

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Tomasz,

Please refer the Object Model Diagram of Semantic Layer SDKs & its API Reference.

I believe you have to get the Data  Foundation instance for each table & on the basis of the type of DataFoundation i.e. Single Source or Multi Source you can retrieve the  connection path or connection source info whichever is applicable & after that you can get/set the connection info.

Hope this helps.

Thanks,

Shailendra

former_member4998
Active Contributor
0 Kudos

Hi

To check the connection information for IDT universe

  • To check a secured connection, in the repository resources view, open a session on the repository where the connection is published and The Connection folder or sub folder, double click connection name.
  • Then check the Server, connection name, Connection Type, Repository Folder, and general information.

Please find the below link.


Former Member
0 Kudos

Mate, I know that!

I need do it in my Java code (via IDT SDK)