BusinessObjects Board

Problem in accessing Universe foldername using designer SDK

I’m using universe designer SDK to automatically update/make changes in the universe. We have about 175 copy of the same universe with some custom changes done on each universe. We have a requirement to design an application in VB6 or .NET using designer SDK to automatically update the univserses in a loop. My design at a high level is run a select against infostore, get all universes (with universe folder or Path name) and store in a file or table. Then connect to designer, open and import each universe, apply the changes, save and export back into repository… in a loop. I went thru the sggesstions made by several people in this forum, but still having difficulty in open/import universe. I have given sample of my code.

– running a query in infostore to get universe details and store in a file/table
sSQL = “”
sSQL = "SELECT "
sSQL = sSQL & " SI_NAME,SI_REVISIONNUM,SI_SHORTNAME,SI_UPDATE_TS,SI_PARENT_FOLDER,SI_OWNER,SI_PARENT_FOLDER_CUID "
sSQL = sSQL & " FROM CI_APPOBJECTS "
sSQL = sSQL & " WHERE SI_KIND=‘Universe’ "

    oInfoObjects = oInfoStore.Query(sSQL)

– storing in a file
For Cnt = 1 To oInfoObjects.Count
PrintLine(1, oInfoObjects.Item(Cnt).Properties(“SI_PARENT_FOLDER_CUID”).Value & “” & oInfoObjects.Item(Cnt).Properties(“SI_NAME”).Value)
Debug.Print(oInfoObjects.Item(Cnt).Properties.Item(“SI_PARENT_FOLDER_CUID”).Value)
Debug.Print(oInfoObjects.Item(Cnt).Properties.Item(“SI_NAME”).Value)
Next Cnt

    FileClose(1)

–logon to the designer
Call ObjDes.Logon(“userid”, “password”, “server name”, “Enterprise”)

I’m looping thru file and trying to open universe. The arguments for OpenFromEnterprise is universe foldername and universe name. I don’t see specific universe folder name when I run the query in infostore as 'Select * from CI_APPOBJECTS WHERE SI_KIND=‘Universe’. I need to pass foldername to OpenFromEnterprise. Please help how do i do that. OR what else I can use in place of foldername. ( SI_PARENT_FOLDER_CUID is not working as suggested in this forum) Thanks for your help in advance.

Krish


krish.mahal (BOB member since 2006-08-03)

what’s the exception you get when you use


DesignerSDK.Universe universe = designerApp.Universes.OpenFromEnterprise(universeFolderCUID,universeInfoObject.Title,false);

Atul Chowdhury (BOB member since 2003-07-07)

How to get/use universeFolderCUID? universeInfoObject.Title - you mean universe name?

I tried using complete foler path name on the server like “\\c$\Program Files\Business Objects\BusinessObjects Enterprise 11.5\Data<@server name>\storage\universes” only and with concatenating SI_CUID with above path like
"\\c$\Program Files\Business Objects\BusinessObjects Enterprise 11.5\Data<@server name>\storage\universes<SI_CUID>
It did not work for either.

Please give me an example to use the code. Thanks


krish.mahal (BOB member since 2006-08-03)

Something along the lines of this …



InfoObject universeFolder = infostore.query("select * from ci_appobjects where si_name = "my universe folder" and si_kind = 'Folder'");

InfoObject myuniverseObject = infostore.query("select * from ci_appobjects where si_name = "my universe" and si_kind = 'Universe'");

String universeFolderCuid = universeFolder.CUID;
String universeName = myuniverseObject.Title;

DesignerSDK.Universe universe = designerApp.Universes.OpenFromEnterprise(universeFolderCuid,universeName,false);


Atul Chowdhury (BOB member since 2003-07-07)

What is the DesignerSDK?

BOXI provides a .COM api for working with Universes. The automation object is designer.exe and the root Class there is Designer.

The sample code above has a third parameter with the OpenFromEnterprise method !?

But the Universe Designer API Reference just shows two:

Definition
Function OpenFromEnterprise(FolderName As String, UniverseName As String) As Universe

Is there a newer (another) SDK for Universes available?

Thanks,
bernd


BerndB :de: (BOB member since 2006-05-17)

BerndB -

Didn’t mean to confuse you!

I remember there being a namespace collision with another assembly using “Designer”…maybe Desktop.Designer or something …i’m forgetting now.

So “DesignerSDK” is really just the Designer application class renamed to a new namespace and assembly, using:


tlbimp designer.tlb /namespace:DesignerSDK /out:Designer

Also, as far as parameters, the LAST one is optional [boolean], which is equivalent to “OpenFromEnterprise LOCKED?” and enforces whether the Universe should be retrieved with “lock” status on/off.

And Universe Path can be substituted w/ Universe folder CUID so you don’t have to use the messy path convention.

Hope that clears things up.


Atul Chowdhury (BOB member since 2003-07-07)

DataHog, Thanks for the clarification!

Now I’m wondering how you manage designer.tlb and the other api (the stuff with the InfoObject and infostore.query) together in one application. Is the other api also .COM or do you work in .NET?

I ask as I thing that krish.mahal has the same question, because he is dumping the query result to a file. This suggests that he is using a two step approach (two different api’s)…

To krish.mahal:
Can you illustrate the code that you use to parse the lines from the file?
Have you add some debug.print before and after the OpenFromEnterprise?

bernd


BerndB :de: (BOB member since 2006-05-17)

Have a look to this topic


gana3000 :fr: (BOB member since 2007-04-19)

ObjUniverse = ObjDes.Universes.OpenFromEnterprise(“Sample Universe Folder”, “Sample_Universe”)

The above code imports the universe in the standard local path “C:\Documents and Settings<user name>\Application Data\Business Objects\Business Objects 11.5\Universes@servername”. I want to get this imported in a pre-defined path. eg: C:\Universes… how can i accomplish that.

Krish


krish.mahal (BOB member since 2006-08-03)

umh…to specify a path…
I think that the method OpenFromEnterprise depend to your designer set up!
i.e. maybe, you have to modify the path into Designer: Options/Save tab
Manually or automatically… I don’t know


gana3000 :fr: (BOB member since 2007-04-19)

You can try something with the SetInstallDirectory() in the Reporter SDK.

But this method is not available in the Designer SDK.

bernd


Sets the path of the directory where BusinessObjects is installed.

Definition
Sub SetInstallDirectory(DirectoryID As boDirectoryID, Path As String, Temporary As Boolean)

Syntax
var.SetInstallDirectory(DirectoryID, Path, Temporary)

var is the name of the Application variable that you declare.

DirectoryID is the directory you want to set. This can be one of the following values:

boBusObjDirectory(0)
 BusinessObjects directory
 
boDocumentDirectory(1) 
 UserDocs directory
 
boTemplateDirectory(2) 
 Template directory
 
boUniverseDirectory(3) 
 Universe directory
 
boLocDataDirectory(5) 
 Local Data directory
 
boSharedDataDirectory(6) 
 Shared Data directory
 
boAddInsDirectory(8)
 AddIns directory
 

Path is the new path you wish to assign to the directory variable.

Temporary is a Boolean which determines whether or not changes are lost when BusinessObjects is closed. If it is set to TRUE, then changes are only applied while BusinessObjects is running. If it is set to FALSE, changes are made permanently.

BerndB :de: (BOB member since 2006-05-17)

I stumbled on this thread and thought I would give another solution for the initial issue.

Assuming you know the folder you want to import from, use the following:

to get the CUID for the universe folder named “devUnis”


Dim uniApp as Designer.Application
Dim folderCUID As String

uniApp = New Designer.Application
uniApp.Visible = False
uniApp.Interactive = False

'NOTE: YOU MUST BE ON LINE (LOGGED IN) TO GET THE ROOT FOLDER
uniApp.Logon(uid, pwd, svr, secType)
folderCUID = uniApp.UniverseRootFolder.Folders.Item("devUnis").CUID


cablegp (BOB member since 2003-06-04)