Dylan's BI Study Notes

My notes about Business Intelligence, Data Warehousing, OLAP, and Master Data Management

ODI SDK: List Folder

Listing folders is a bit more complex than listing projects.  ODI folder structure allows nested folders.

Here is my experiment:

//List Folders
import oracle.odi.core.persistence.IOdiEntityManager;
import oracle.odi.domain.project.OdiProject;
import oracle.odi.domain.project.OdiFolder;
import oracle.odi.domain.project.finder.IOdiProjectFinder;
import oracle.odi.domain.project.finder.IOdiFolderFinder;

IOdiEntityManager mgr = odiInstance.getTransactionalEntityManager()

// First, get project
OdiProject p = ((IOdiProjectFinder)mgr.getFinder(OdiProject.class)).findByCode("NEW_PROJECT")

// Find folders under the project

// This method will get only the immediate folders
FolderList1 =  p.getFolders()
println('--- direct folders under the project --')
for (f in FolderList1)
{
println( f.getName() )
}

// This method lists all folders
FolderList2 = ((IOdiFolderFinder)mgr.getFinder(OdiFolder.class)).findByProject(p.getCode())
println('--- all folders in the project --')
for (f in FolderList2)
{
println( f.getName() )
}

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s