com.ibm.xsp.model
Interface DataSource

All Superinterfaces:
DataPublishingObject
All Known Subinterfaces:
DocumentDataSource, ModelDataSource, ViewDataSource
All Known Implementing Classes:
AbstractDataSource, AbstractDocumentDataSource, AbstractViewDataSource, DominoDocumentData, DominoViewData

public interface DataSource
extends DataPublishingObject


Method Summary
 java.lang.String getBeanId()
          The unique id under which the associated data object will be stored.
 DataContainer getDataContainer()
          Return the associated data container
 java.lang.String getRequestParamPrefix()
          Return the request parameter prefix to be used by this data source.
 java.lang.String getScope()
          Return the scope identifier under which the data object will be stored.
 java.lang.String getUniqueId()
          The id identifying the data.
 java.lang.String getVar()
          Return the user settable request-scope attribute under which the data object will be exposed.
 java.lang.String[] getVars()
          Return the request-scope attribute names under which various objects associated with this data source will be exposed, including getVar() variable name.
 boolean isIgnoreRequestParams()
          /** Return true if request parameters should be ignored .
 boolean isReadonly()
          Return true if this is a read only data object
 void refresh()
          Refresh the current state of the data object
 boolean save(javax.faces.context.FacesContext context, boolean removeFromManager)
          Save the current state of the data object.
 void setIgnoreRequestParams(boolean ignore)
          Set a flag to indicate if request parameters should be ignored.
 void setRequestParamPrefix(java.lang.String prefix)
          Set the request parameter prefix to be used by this data source.
 void setScope(java.lang.String scope)
          Set the scope identifier under which the data object will be stored.
 void setVar(java.lang.String var)
          Set the user settable request-scope attribute under which the data object will be exposed.
 
Methods inherited from interface com.ibm.xsp.model.DataPublishingObject
popData, pushData
 

Method Detail

getBeanId

java.lang.String getBeanId()
The unique id under which the associated data object will be stored. This id is used to store the document in the scope. When the data container is not shared, this is a unique id identifying the data source instance precisely, even when it is located in a repeat. When the data is shared, then it returns the unique id.


getUniqueId

java.lang.String getUniqueId()
The id identifying the data. This id identify the data based on the parameters (ex: database name, document id,...). This is used to check a data container and guess if it contains the expected data.


getVars

java.lang.String[] getVars()
Return the request-scope attribute names under which various objects associated with this data source will be exposed, including getVar() variable name.


getVar

java.lang.String getVar()
Return the user settable request-scope attribute under which the data object will be exposed.


setVar

void setVar(java.lang.String var)
Set the user settable request-scope attribute under which the data object will be exposed.


getScope

java.lang.String getScope()
Return the scope identifier under which the data object will be stored.


setScope

void setScope(java.lang.String scope)
Set the scope identifier under which the data object will be stored.


isReadonly

boolean isReadonly()
Return true if this is a read only data object


isIgnoreRequestParams

boolean isIgnoreRequestParams()
/** Return true if request parameters should be ignored .

Most data sources have a mechanism where the values of some of their properties can be read from the request parameters to the XPage, for example if you have an XPage containing a document data source and you open that XPage with a URL like /page1.xsp?documentId=AAAA, then the document data source will behave as if it were configured with the "documentId" property set to the value "AAA" in the XPage source.

If you do not want a data source to read property values from the request parameters at the end of the URL, then the data source should be configured with ignoreRequestParameters="true".

A related behavior is, if you have multiple data sources in an XPage, then by default they would both read the same request parameters from the URL and they would both be configured to point to the same document. To avoid that behavior you can configure one or both of the data sources with a request parameter prefix, so the data source reads the parameters values with the specified prefix before their parameter name.

See Also:
getRequestParamPrefix()

setIgnoreRequestParams

void setIgnoreRequestParams(boolean ignore)
Set a flag to indicate if request parameters should be ignored.


getRequestParamPrefix

java.lang.String getRequestParamPrefix()
Return the request parameter prefix to be used by this data source.

See Also:
isIgnoreRequestParams()

setRequestParamPrefix

void setRequestParamPrefix(java.lang.String prefix)
Set the request parameter prefix to be used by this data source.


save

boolean save(javax.faces.context.FacesContext context,
             boolean removeFromManager)
             throws FacesExceptionEx
Save the current state of the data object. Save returns false if there is a user validation error, or an exception for other errors. In case of a user error, then the data source should add an error message to the queue.

Returns:
Throws:
FacesExceptionEx

refresh

void refresh()
Refresh the current state of the data object


getDataContainer

DataContainer getDataContainer()
                               throws FacesExceptionEx
Return the associated data container

Throws:
FacesExceptionEx