Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jdeveloper.html
Class DataWebBeanImpl

java.lang.Object
  extended byoracle.jdeveloper.html.WebBeanImpl
      extended byoracle.jdeveloper.html.DataWebBeanImpl
All Implemented Interfaces:
DataWebBean, WebBean
Direct Known Subclasses:
DataWebBeanImpl, JSRowSetBrowser, JSTreeBrowser, JSViewCurrentRecord

public class DataWebBeanImpl
extends WebBeanImpl
implements DataWebBean

Implements the base methods for a Data Web Bean. Extend this class when you define a Web Bean that must access a data source and that does not need to extend another class.


Field Summary
protected  java.lang.String amName
           
protected  boolean bReleaseApplication
           
protected  java.util.Vector dispAttrs
           
protected  DataSource ds
           
 
Fields inherited from class oracle.jdeveloper.html.WebBeanImpl
application, bUsedInTag, out, page, request, response, session
 
Fields inherited from interface oracle.jdeveloper.html.WebBean
contentFrameName, defaultCaboBase, defaultCaboImageBase, defaultImageBase, defaultJSPBase, defaultNLSFormat, JS_LIBRARIES, JS_NAMEID, JSButtonConstructorLib, JSCalendarConstructorLib, JSContainerConstructorLib, JSDataConstructLib, JSModalPageConstructorLib, JSTableConstructLib, JSToolbarConstructorLib, JSTreeConstructLib, JSUtilitiesLib
 
Constructor Summary
DataWebBeanImpl()
           
 
Method Summary
 void clearDisplayAttributes()
          Clears the list of display attributes specified for the RowSet.
protected  ApplicationModule getApplicationFromContext()
          Use JSPApplicationRegistry.getAppModuleFromContexts , removed deprecation since no alternative is suggested
 java.lang.String getApplicationName()
          Returns the name of the Application Module's property file.
 java.lang.String getAttributeLabel(RowSet rs, AttributeDef aDef)
          Utility method for getting the attribute's label , the label is first located in the AttributeDEf and then in the RowSet VO's attribute list.
 AttributeDef[] getDisplayAttributeDefs()
          returns the array of attributes to be displayed, if the set is not constrained , it will return all of the attribute defs.
 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).
 java.lang.String getRowKey(Row row)
           
 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 application, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.jsp.JspWriter 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.
 void initialize(javax.servlet.ServletContext application, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter out, java.lang.String viewObjectFullName)
          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.
 void internalInitialize()
          Internal initialize.
 boolean isAppStateful()
          Returns true if you are running in statefule mode
 void releaseApplicationResources()
          Releases any application resources associated with this request if setReleaseApplicationResources(true).
 void releaseApplicationResources(java.lang.String releaseMode)
          Release the data web beans application module with the specified release 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)
          Deprecated. Deprecated since 5.0. RowSet is now defined with the DataSource
 boolean shouldDisplayAttribute(AttributeDef attrDef)
          Checks whether an attribute should be displayed by a Web Bean.
 
Methods inherited from class oracle.jdeveloper.html.WebBeanImpl
generateScriptSrc, getCookie, getOut, getRequest, getRequestVariable, getRequestVariable, getUniqueName, initBeanForJS, initBeanForJS, initBeanForJS, initialize, initialize, initialize, render, render, setRequestVariable, setRequestVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdeveloper.html.WebBean
initialize, initialize, render, render
 

Field Detail

ds

protected DataSource ds

dispAttrs

protected java.util.Vector dispAttrs

bReleaseApplication

protected boolean bReleaseApplication

amName

protected java.lang.String amName
Constructor Detail

DataWebBeanImpl

public DataWebBeanImpl()
Method Detail

getApplicationName

public java.lang.String getApplicationName()
Returns the name of the Application Module's property file. The property file typically contains this information:

Specified by:
getApplicationName in interface DataWebBean
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.

Specified by:
getViewObjectName in interface DataWebBean
Returns:
name of the View Object.

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.

Specified by:
clearDisplayAttributes in interface DataWebBean

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").

Specified by:
setDisplayAttributes in interface DataWebBean
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.

Specified by:
getDisplayAttributes in interface DataWebBean
Returns:
a Hashtable containing the names of the attributes to be displayed.

getDisplayAttributeDefs

public AttributeDef[] getDisplayAttributeDefs()
returns the array of attributes to be displayed, if the set is not constrained , it will return all of the attribute defs.

Specified by:
getDisplayAttributeDefs in interface DataWebBean

setRowSet

public void setRowSet(RowSet aQuery)
Deprecated. Deprecated since 5.0. RowSet is now defined with the DataSource

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.

Specified by:
setRowSet in interface DataWebBean
Parameters:
aQuery - the RowSet to be selected.

shouldDisplayAttribute

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

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.

Specified by:
shouldDisplayAttribute in interface DataWebBean

getRowSet

public RowSet getRowSet()
Returns the RowSet of the View Object used by the Web Bean object.

Specified by:
getRowSet in interface DataWebBean
Returns:
the RowSet that the Data Web Bean is using.

initialize

public void initialize(javax.servlet.ServletContext application,
                       javax.servlet.http.HttpSession session,
                       javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       javax.servlet.jsp.JspWriter out,
                       java.lang.String sRowSet)
                throws java.lang.Exception
Initializes this Data Web Bean object to:

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.
Throws:
java.lang.Exception

isAppStateful

public boolean isAppStateful()
Description copied from interface: DataWebBean
Returns true if you are running in statefule mode

Specified by:
isAppStateful in interface DataWebBean

getApplicationFromContext

protected ApplicationModule getApplicationFromContext()
Use JSPApplicationRegistry.getAppModuleFromContexts , removed deprecation since no alternative is suggested


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.

Specified by:
setReleaseApplicationResources in interface DataWebBean
Parameters:
bRelease - true to release application resources associated with the request; false to retain the resources.

releaseApplicationResources

public void releaseApplicationResources()
                                 throws java.lang.Exception
Releases any application resources associated with this request if setReleaseApplicationResources(true). 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.

Throws:
java.lang.Exception

releaseApplicationResources

public void releaseApplicationResources(java.lang.String releaseMode)
                                 throws java.lang.Exception
Release the data web beans application module with the specified release mode.

Throws:
java.lang.Exception

initialize

public void initialize(javax.servlet.ServletContext application,
                       javax.servlet.http.HttpSession session,
                       javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.io.PrintWriter out,
                       java.lang.String viewObjectFullName)
                throws java.lang.Exception
Initializes this Data Web Bean object to:

Specified by:
initialize in interface DataWebBean
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.
viewObjectFullName - 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.
Throws:
java.lang.Exception

initialize

public void initialize(javax.servlet.jsp.PageContext page,
                       java.lang.String sRowSet)
                throws java.lang.Exception
Initializes this Data Web Bean object to:

Specified by:
initialize in interface DataWebBean
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.
Throws:
java.lang.Exception

internalInitialize

public void internalInitialize()
                        throws java.lang.Exception
Description copied from interface: WebBean
Internal initialize. This method should be overriden by any WebBean needing to initialize some internal data after all the base class member have been initialize properly.

Specified by:
internalInitialize in interface WebBean
Overrides:
internalInitialize in class WebBeanImpl
Throws:
java.lang.Exception

getRowKey

public java.lang.String getRowKey(Row row)

handleCommit

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

Specified by:
handleCommit in interface DataWebBean
Throws:
java.lang.Exception

getEditFieldRenderer

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

Specified by:
getEditFieldRenderer in interface DataWebBean
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).

Specified by:
getDisplayFieldRenderer in interface DataWebBean
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

Specified by:
setDisplayFieldRenderer in interface DataWebBean

setEditFieldRenderer

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

Specified by:
setEditFieldRenderer in interface DataWebBean

setDisplayFieldRenderer

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

Specified by:
setDisplayFieldRenderer in interface DataWebBean

setEditFieldRenderer

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

Specified by:
setEditFieldRenderer in interface DataWebBean

getAttributeLabel

public java.lang.String getAttributeLabel(RowSet rs,
                                          AttributeDef aDef)
Utility method for getting the attribute's label , the label is first located in the AttributeDEf and then in the RowSet VO's attribute list. If no label is provided, the attribute name is used.


Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.