Business Components

oracle.jdeveloper.html
Interface DataWebBean

All Known Implementing Classes:
DataWebBeanImpl

public interface DataWebBean
extends WebBean

Defines the base methods for a Data Web Bean. Implement this interface when you define a Web Bean that must access a data source.


Field Summary
static int DEFAULT_RANGE_SIZE
           
 
Fields inherited from interface oracle.jdeveloper.html.WebBean
contentFrameName, defaultCaboBase, defaultCaboImageBase, defaultImageBase, defaultJSPBase, JS_LIBRARIES, JS_NAMEID, JSButtonConstructorLib, JSCalendarConstructorLib, JSContainerConstructorLib, JSDataConstructLib, JSModalPageConstructorLib, JSTableConstructLib, JSToolbarConstructorLib, JSTreeConstructLib, JSUtilitiesLib
 
Method Summary
 void clearDisplayAttributes()
          Clears the list of display attributes specified for the RowSet.
 java.lang.String getApplicationName()
          Returns the name of the Application Module's property file.
 AttributeDef[] getDisplayAttributeDefs()
          Returns an array of AttributeDef objects representing the set of columns to be visualized.
 java.util.Vector getDisplayAttributes()
          Returns a Hashtable containing the names of the attributes to be displayed.
 HTMLFieldRenderer getDisplayFieldRenderer(Row row, AttributeDef attrDef)
          Retrieves the default field renderer for a specified attribute definition (that is, the attribute metadata).
 HTMLFieldRenderer getEditFieldRenderer(Row row, AttributeDef attrDef)
          Retrieves the default field renderer for a specified attribute definition (that is, the attribute metadata).
 RowSet getRowSet()
          Returns the RowSet of the View Object used by the Web Bean object.
 java.lang.String getViewObjectName()
          Returns the name of the View Object to which this Data Web Bean is bound.
 void handleCommit()
          Handles commit logic properly reagrdles of stateful/stateless runtime mode.
 void initialize(javax.servlet.jsp.PageContext page, java.lang.String sRowSet)
          Initializes this Data Web Bean object to: Access the page object of the JSP. Connect to a database through an Application Module and access a data source represented by one of the Application Module's View Objects.
 void initialize(javax.servlet.ServletContext appContext, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter out, java.lang.String sRowSet)
          Initializes this Data Web Bean object to: Access the important objects of the JSP: application, session, request, response, and out. Connect to a database through an Application Module and access a data source represented by one of the Application Module's View Objects.
 boolean isAppStateful()
          Returns true if you are running in statefule mode
 void setDisplayAttributes(java.lang.String sAttrs)
          Sets the list of the RowSet's attributes that will be displayed.
 void setDisplayFieldRenderer(AttributeDef attrDef, HTMLFieldRenderer rdr)
          Assigns an instance-level display field renderer to be used in the DataWebBean
 void setDisplayFieldRenderer(int nIndex, HTMLFieldRenderer rdr)
          Assigns an instance-level display field renderer to be used in the DataWebBean
 void setEditFieldRenderer(AttributeDef attrDef, HTMLFieldRenderer rdr)
          Assigns an instance-level edit field renderer to be used in the DataWebBean
 void setEditFieldRenderer(int nIndex, HTMLFieldRenderer rdr)
          Assigns an instance-level edit field renderer to be used in the DataWebBean
 void setReleaseApplicationResources(boolean bRelease)
          Enables or disables the release of application resources associated with this request.
 void setRowSet(RowSet aQuery)
          Internal: Applications should not use this method.
 boolean shouldDisplayAttribute(AttributeDef attrDef)
          Checks whether an attribute should be displayed by a Web Bean.
 
Methods inherited from interface oracle.jdeveloper.html.WebBean
initialize, initialize, internalInitialize, render, render
 

Field Detail

DEFAULT_RANGE_SIZE

public static final int DEFAULT_RANGE_SIZE
Method Detail

setRowSet

public void setRowSet(RowSet aQuery)
Internal: Applications should not use this method.

Allows the override of the default RowSet that was retrieved by using the initialize() function.

The setRowSet() function sets up the RowSet by clearing the field renderers if the selected row is null, otherwise, it populates the row with its field renderers.

Parameters:
aQuery - the RowSet to be selected.

getRowSet

public RowSet getRowSet()
Returns the RowSet of the View Object used by the Web Bean object.
Returns:
the RowSet that the Data Web Bean is using.

getApplicationName

public java.lang.String getApplicationName()
Returns the name of the Application Module's property file. The property file typically contains this information:
  • database connection mode and password
  • name and path of the cascading style sheet associated with the application
  • name and path of the directory where images associated with the application can be stored
  • Application Module's name
  • whether the Application Module is stateful
  • JNDI path

Returns:
the name of the Application Module's property file.

getViewObjectName

public java.lang.String getViewObjectName()
Returns the name of the View Object to which this Data Web Bean is bound.

Returns:
name of the View Object.

setReleaseApplicationResources

public void setReleaseApplicationResources(boolean bRelease)
Enables or disables the release of application resources associated with this request. Only the last Data Web Bean on a page should set this value to true because it releases the Application Module that is associated with the page being processed.

Parameters:
bRelease - true to release application resources associated with the request; false to retain the resources.

initialize

public void initialize(javax.servlet.ServletContext appContext,
                       javax.servlet.http.HttpSession session,
                       javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.io.PrintWriter out,
                       java.lang.String sRowSet)
                throws java.lang.Exception
Initializes this Data Web Bean object to:
  • Access the important objects of the JSP: application, session, request, response, and out.
  • Connect to a database through an Application Module and access a data source represented by one of the Application Module's View Objects. The parameter sRowSet provides the necessary information, specifying a properties file generated by the Web Application Wizard and a View Object. The properties file contains the name of an Application Module and a database connnect string. The View Object must be associated with the Application Module.

Parameters:
application - the JSP page's ServletContext.
session - the JSP page's HttpSession.
request - the JSP page's HttpServletRequest.
response - the JSP page's HttpServletResponse.
out - the PrintWriter to render to.
sRowSet - a string that specifies a Business Component JSP Application's properties file and a View Object. Its format is properties file.View Object where properties file is the name of the properties file without the .properties extension and View Object is the name of a View Object associated with the Application Module specified in the properties file.

initialize

public void initialize(javax.servlet.jsp.PageContext page,
                       java.lang.String sRowSet)
                throws java.lang.Exception
Initializes this Data Web Bean object to:
  • Access the page object of the JSP.
  • Connect to a database through an Application Module and access a data source represented by one of the Application Module's View Objects. The parameter sRowSet provides the necessary information, specifying a properties file generated by the Web Application Wizard and a View Object. The properties file contains the name of an Application Module and a database connnect string. The View Object must be one of those associated with the Application Module.
Parameters:
page - the JSP page's PageContext.
sRowSet - a string that specifies a Business Component JSP Application's properties file and a View Object. Its format is properties file.View Object where properties file is the name of the properties file without the .properties extension and View Object is the name of a View Object associated with the Application Module specified in the properties file.

clearDisplayAttributes

public void clearDisplayAttributes()
Clears the list of display attributes specified for the RowSet. The result is that the Web Bean will now display all of the RowSet's attributes.

setDisplayAttributes

public void setDisplayAttributes(java.lang.String sAttrs)
Sets the list of the RowSet's attributes that will be displayed. This is useful for limiting the set of attributes that are to be displayed by the Web Bean. If this function is not called, all attributes are displayed, except those of type Row and RowSet.

Specify the attributes as a comma-delimited list. For example, to display the attributes EmpNo, Ename, and Job, enter setDisplayAttributes("EmpNo, Ename, Job").

Parameters:
sAttrs - names of the attributes to be displayed.

getDisplayAttributes

public java.util.Vector getDisplayAttributes()
Returns a Hashtable containing the names of the attributes to be displayed. This function can return null.

Returns:
a Vector containing the names of the attributes to be displayed.

getDisplayAttributeDefs

public AttributeDef[] getDisplayAttributeDefs()
Returns an array of AttributeDef objects representing the set of columns to be visualized.

shouldDisplayAttribute

public boolean shouldDisplayAttribute(AttributeDef attrDef)
Checks whether an attribute should be displayed by a Web Bean. This function returns false if the attribute:

  • of type Row or RowSet.
  • is not in the Display Attribute List as configured with the setDisplayAttributes() function.

In either of these cases, the attribute will not be displayed.

Note, if the setDisplayAttributes() function has not been called, all attributes are displayed except Row or RowSet attributes.


isAppStateful

public boolean isAppStateful()
Returns true if you are running in statefule mode

handleCommit

public void handleCommit()
                  throws java.lang.Exception
Handles commit logic properly reagrdles of stateful/stateless runtime mode. Call this function after you make any data changes.

getEditFieldRenderer

public HTMLFieldRenderer getEditFieldRenderer(Row row,
                                              AttributeDef attrDef)
Retrieves the default field renderer for a specified attribute definition (that is, the attribute metadata).

Parameters:
attrDef - an attribute definition.
Returns:
default field renderer for the attribute definition.

getDisplayFieldRenderer

public HTMLFieldRenderer getDisplayFieldRenderer(Row row,
                                                 AttributeDef attrDef)
Retrieves the default field renderer for a specified attribute definition (that is, the attribute metadata).

Parameters:
attrDef - an attribute definition.
Returns:
default field renderer for the attribute definition.

setDisplayFieldRenderer

public void setDisplayFieldRenderer(AttributeDef attrDef,
                                    HTMLFieldRenderer rdr)
Assigns an instance-level display field renderer to be used in the DataWebBean

setEditFieldRenderer

public void setEditFieldRenderer(AttributeDef attrDef,
                                 HTMLFieldRenderer rdr)
Assigns an instance-level edit field renderer to be used in the DataWebBean

setDisplayFieldRenderer

public void setDisplayFieldRenderer(int nIndex,
                                    HTMLFieldRenderer rdr)
Assigns an instance-level display field renderer to be used in the DataWebBean

setEditFieldRenderer

public void setEditFieldRenderer(int nIndex,
                                 HTMLFieldRenderer rdr)
Assigns an instance-level edit field renderer to be used in the DataWebBean

Business Components