The instance element is a member of the following categories:
Namespace -- http://xmlns.oracle.com/bibeans
Group -- BI uiXML elements
Type of element -- Definition
The instance element defines a declarative binding to a Java instance to customize a UIX page. Use code insight to insert the instance element within a callback element to specify the method that the callback should execute.
class -- (Required) Full path of the Java class for the method that you want the callback to execute.
method -- Name of the static method to call. If this attribute
is not set, then the callback searches for a method using the following sequence:
(1) Looks for the sharedInstance
method; (2) Calls a default constructor.
The instance element is a child of either the biSessionCallback element or the preRenderingCallback element.
The method that the instance element specifies must satisfy the following requirements:
The method must have no arguments.
The method must return an instance of the oracle.dss.addins.uix.BajaPageCallback
interface.
The following XML fragment shows a biSessionCallback element that is defined with an instance element. The instance element returns an instance of a class that modifies the BIUser property of the BISession object before a presentation is loaded from the BI Beans Catalog.
<!-- Definition of biSessionCallback that uses an instance --> <biSessionCallback> <instance class = "myPackage.Class1", method = "getHandler"/> </biSessionCallback>
The following code is an example of the class and method that the sample callback will use.
//First, define a class that returns an instance of the handler //that changes the value of the BIUser property Class1 { public static pageCallback getHandler () { return new ChangeUserClass(); } } //Then, define the handler class that performs the change //Assume that userName holds the valid user for the load operation. //Retrieve the BISession object and change its BIUser property. ChangeUserClass implements BajaPageCallback { public static void changeBIUser (BajaContext context, Page page) { BISession session = BIHandler.getBISession (context, page); if (session != null) { HttpSession httpSession = (String) httpSession.getValue(LOGINKEY); BIUser user = new BIUser (userName); session.setBIUser (user); } } }