Is it possible to obtain a list of all Universes in a specific Business Objects Repository solely through the Designer SDK? This topic provides a good way to loop through the Universe objects, but requires connecting via a DSN. Is there a way to use the Designer SDK and avoid the direct database access?
I have tried the following, but it didn’t seem to work. The count for AllUniverses is zero, but there are about 15 universes in the repository.
'Open Designer
Set DesignerApp = New Designer.Application
'Login to designer
Call DesignerApp.LoginAs(UserName, Password, False, RepositoryName)
DesignerApp.Interactive = False
DesignerApp.Visible = False
Set AllUniverses = DesignerApp.Application.Universes
Debug.Print AllUniverses.Count
If I try the same code, only using the BusinessObjects SDK I can get all of the universes.
'Open BusinessObjects
Set BusObjApp = New busobj.Application
'Login to BusinessObjects
Call BusObjApp.LoginAs(UserName, Password, False, RepositoryName)
BusObjApp.Interactive = False
BusObjApp.Visible = False
'Retrieve all of the Universes in BusinessObjects
Set AllUniverses = BusObjApp.Application.Universes
Debug.Print AllUniverses.Count
It’s not a bug. The Application.Universes class is only for those that are open. You need to use the Application.UniverseDomains class instead. The universe count is by domain. Something like this:
Using the Designer SDK, I can get the count and names of all of the universes currently in the repository (by accessing the StoredUniverses property). If we take this one step further, we should be able to loop through each of these universes, open them, modify something, and save them back to the repository. I have attempted just that in the following code.
'Open Designer
Set DesignerApp = New Designer.Application
'Login to Designer
Call DesignerApp.LoginAs(Username, Password, False, RepositoryName)
DesignerApp.Interactive = False
DesignerApp.Visible = False
'Retrieve all of the Universes in BusinessObjects
Set StoredUniverses = DesignerApp.UniverseDomains("Universe").StoredUniverses
'Loop through each Universe
For CurrentUniverse = 1 To StoredUniverses.Count
Debug.Print "Attempting to open: " & StoredUniverses(CurrentUniverse).Name
Set Universe = DesignerApp.Universes.Open(StoredUniverses(CurrentUniverse).Name)
Debug.Print vbTab & Universe.FullName
Universe.Close
Next CurrentUniverse
However, I am unable to open the universe by just using the Universe Name property. When using the Universes.Open method in the past, I used an absolute path (C:\Program Files\Business Objects\BusinessObjects Enterprise 6\Universes\test.unv), however in this case I would like to avoid importing the universe to my local machine. Is it possible to open a StoredUniverse without first importing it to my local machine? Also are there any alternative ways to modify an existing universe in a repository?
Hi Dwayne, sorry, would like to continue such an old topic.
I am using 6.5.1, and yes, there’s .Import method to automate that process. However, .Import is a subroutine and not a function, so it doesn’t have any returned value. It means that we could not use .Import in the similar function as Open as in the Rufus’ code above (to get the FullName).
Is there any way around?