To move an object in the BI Beans Catalog, you call the move
method of the BIContext
that contains the object.
The following code moves a crosstab ("SalesCrosstab") from a folder named "MyCrosstabs" to a folder named "SalesFolder." SalesFolder is in the root folder. This code essentially moves "MyCrosstabs/SalesCrosstab" to "SalesFolder/SalesCrosstab".
// ctxRoot is the initial context (root folder) // ctxMyCrosstabs is the PersistenceManager or MDFolder that // contains salesCrosstab // ctxMyCrosstabs is named "MyCrosstabs" BIContext ctxSalesFolder = null; try{ // get the folder to move the crosstab to ctxSalesFolder = ctxRoot.lookup("SalesFolder"); // move SalesCrosstab to the SalesFolder ctxMyCrosstabs.move("SalesCrosstab", ctxSalesFolder); } catch (NamingException ne){ ne.printStackTrace(); }