Creating Folders

To create a folder in the BI Beans Catalog, you call the createSubcontext method of the parent folder.

When you use the persistence service to create a folder in the root folder, you call the createSubcontext method of the InitialPersistenceManager. The createSubcontext method returns a PersistenceManager.

When you use the MetadataManager to create a folder in the root folder, you call the createSubcontext method of the MDRoot. The createSubcontext method returns an MDFolder.

Several subclasses of the MDFolder represent objects in Oracle OLAP. You cannot create new metadata objects through the MetadataManager. Use Oracle Enterprise Manager to maintain the objects in Oracle OLAP.

Example: Creating a folder through the persistence service

The following code creates a subfolder in the root folder. This code assumes that the initial context is named pmRoot.


PersistenceManager pmMyFolder = null; try {   pmMyFolder = (PersistenceManager)pmRoot.createSubcontext("MyFolder"); } catch (NamingException ne){   ne.printStackTrace(); }

Example: Creating a folder through the MetadataManager

The following code creates a subfolder in the root folder. This code assumes that the MetadataManager is named m_manager. Note that the folders are created in the BI Beans Catalog. You cannot create metadata objects in Oracle OLAP through the MetadataManager.


//m_manager is the MetadataManagerMDRoot root = null; MDFolder mdMyFolder = null; try {    mdRoot = m_manager.getMDRoot();    mdMyFolder = (MDFolder)MDRoot.createSubcontext("MyFolder"); } catch (MetadataManagerException mme){    mme.printStackTrace(); } catch (NamingException ne){    ne.printStackTrace(); }