|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.xsp.complex.ValueBindingObjectImpl com.ibm.xsp.model.AbstractDataSource
public abstract class AbstractDataSource
Nested Class Summary | |
---|---|
protected static class |
AbstractDataSource.RuntimeProperties
|
Field Summary | |
---|---|
static java.lang.String[] |
NO_VARS
|
Constructor Summary | |
---|---|
AbstractDataSource()
Construct an AbstractDataSource instance |
Method Summary | |
---|---|
protected void |
beginRuntimeProperties()
Initialize RuntimeProperties |
protected abstract java.lang.String |
composeUniqueId()
Compute a unique ID for shared documents. |
protected java.lang.String |
computeUniqueBeanId()
Compute an unique ID used by the data source when the document is not shared. |
protected AbstractDataSource.RuntimeProperties |
createRuntimeProperties()
Create a new AbstractDataSource.RuntimeProperties instance |
protected void |
endRuntimeProperties()
Reset the current Runtime preperties to null |
java.lang.String |
getBeanId()
Get the bean id. |
DataContainer |
getDataContainer()
Return the associated data object |
protected DataContainer |
getDataContainer(javax.faces.context.FacesContext context)
|
abstract java.lang.Object |
getDataObject()
Return the default data object |
java.lang.String |
getEffectiveScope()
Same as getScope() only defaulting to "view" if null. |
java.lang.String |
getRequestParamPrefix()
Return the request parameter prefix to be used by this data source. |
protected AbstractDataSource.RuntimeProperties |
getRuntimeProperties()
Return the current Runtime Properties |
java.lang.String |
getScope()
Return the scope identifier under which the data object will be stored. |
java.lang.String |
getUniqueId()
Get the unique Id for this data source. |
java.lang.String |
getVar()
Return the 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 DataSource.getVar() variable name. |
protected UIViewRootEx |
getViewRoot(javax.faces.context.FacesContext context)
|
protected boolean |
hasRuntimeProperties()
The data source needs its parameters to be computed just once when the data is first accessed, and every time the page is rendered again. |
protected void |
initializeRuntimeProperties(AbstractDataSource.RuntimeProperties rtProps)
Initialize Runtime Properties. |
protected boolean |
isDataShared()
Check if the document used by this data source can be shared. |
boolean |
isIgnoreRequestParams()
/** Return true if request parameters should be ignored . |
protected boolean |
isNestedInUIIterator()
Check if an ancestor component for the component this datasource is associated with is Data Iterator, e.g UIData or UIDataIterator |
abstract boolean |
isReadonly()
Return true if this is a read only data object |
abstract DataContainer |
load(javax.faces.context.FacesContext context)
Load the associated data container |
void |
popData(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.Map<java.lang.String,java.lang.Object> requestMap)
Pop the data associated with this data source from the request map, note, if values were added to the shadowedData list during DataPublishingObject.pushData(FacesContext, UIComponent, Map, List) , then it is not necessary to
remove them from the request map in this method (as the calling class will
remove them). |
protected java.lang.String |
prefixRequestParam(java.lang.String paramName)
|
void |
pushData(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.Map<java.lang.String,java.lang.Object> requestMap,
java.util.List<DataPublisher.ShadowedObject> shadowedData)
Push the data associated with this data source into the request map |
void |
putDataContainer(javax.faces.context.FacesContext facesContext,
DataContainer data)
|
abstract void |
readRequestParams(javax.faces.context.FacesContext context,
java.util.Map<java.lang.String,java.lang.Object> requestMap)
Read the request parameters for this data source |
void |
refresh()
Refresh the current state of the data object |
protected void |
removeBean(javax.faces.context.FacesContext facesContext)
|
boolean |
removeBean(javax.faces.context.FacesContext facesContext,
java.lang.String scope)
Remove the bean if it correspond to the scope parameter. |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
boolean |
save(javax.faces.context.FacesContext context,
boolean removeFromManager)
Save the current state of the data object |
abstract boolean |
save(javax.faces.context.FacesContext context,
DataContainer data)
Save the current state of the data object |
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setIgnoreRequestParams(boolean ignoreRequestParams)
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 request-scope attribute under which the data object will be exposed. |
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl |
---|
getComponent, getFacesContext, getValueBinding, isTransient, setComponent, setTransient, setValueBinding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] NO_VARS
Constructor Detail |
---|
public AbstractDataSource()
AbstractDataSource
instance
Method Detail |
---|
public final java.lang.String getBeanId()
getBeanId
in interface DataSource
public final java.lang.String getUniqueId()
getUniqueId
in interface DataSource
protected boolean isDataShared()
protected java.lang.String computeUniqueBeanId()
protected boolean isNestedInUIIterator()
protected abstract java.lang.String composeUniqueId()
protected boolean hasRuntimeProperties()
protected AbstractDataSource.RuntimeProperties getRuntimeProperties()
protected AbstractDataSource.RuntimeProperties createRuntimeProperties()
AbstractDataSource.RuntimeProperties
instance
protected void initializeRuntimeProperties(AbstractDataSource.RuntimeProperties rtProps)
rtProps
- Runtime Propertiesprotected void beginRuntimeProperties()
protected void endRuntimeProperties()
null
public java.lang.String[] getVars()
DataSource
DataSource.getVar()
variable name.
getVars
in interface DataSource
public java.lang.String getVar()
getVar
in interface DataSource
public void setVar(java.lang.String var)
setVar
in interface DataSource
public java.lang.String getScope()
getScope
in interface DataSource
public java.lang.String getEffectiveScope()
getScope()
only defaulting to "view" if null.
public void setScope(java.lang.String scope)
setScope
in interface DataSource
public boolean isIgnoreRequestParams()
DataSource
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.
isIgnoreRequestParams
in interface DataSource
DataSource.isIgnoreRequestParams()
public void setIgnoreRequestParams(boolean ignoreRequestParams)
setIgnoreRequestParams
in interface DataSource
public java.lang.String getRequestParamPrefix()
getRequestParamPrefix
in interface DataSource
DataSource.isIgnoreRequestParams()
public void setRequestParamPrefix(java.lang.String prefix)
setRequestParamPrefix
in interface DataSource
public DataContainer getDataContainer()
getDataContainer
in interface DataSource
public void refresh()
DataSource
refresh
in interface DataSource
public boolean save(javax.faces.context.FacesContext context, boolean removeFromManager) throws FacesExceptionEx
save
in interface DataSource
FacesExceptionEx
public void pushData(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.Map<java.lang.String,java.lang.Object> requestMap, java.util.List<DataPublisher.ShadowedObject> shadowedData) throws FacesExceptionEx
DataPublishingObject
pushData
in interface DataPublishingObject
FacesExceptionEx
public void popData(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.Map<java.lang.String,java.lang.Object> requestMap) throws FacesExceptionEx
DataPublishingObject
DataPublishingObject.pushData(FacesContext, UIComponent, Map, List)
, then it is not necessary to
remove them from the request map in this method (as the calling class will
remove them). This method should do any further tidying up required.
popData
in interface DataPublishingObject
FacesExceptionEx
public boolean removeBean(javax.faces.context.FacesContext facesContext, java.lang.String scope)
facesContext
- scope
- public abstract java.lang.Object getDataObject()
public abstract boolean isReadonly()
isReadonly
in interface DataSource
public abstract boolean save(javax.faces.context.FacesContext context, DataContainer data) throws FacesExceptionEx
FacesExceptionEx
public abstract DataContainer load(javax.faces.context.FacesContext context) throws java.io.IOException
context
-
java.io.IOException
public abstract void readRequestParams(javax.faces.context.FacesContext context, java.util.Map<java.lang.String,java.lang.Object> requestMap)
context
- public java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class ValueBindingObjectImpl
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class ValueBindingObjectImpl
protected UIViewRootEx getViewRoot(javax.faces.context.FacesContext context)
public void putDataContainer(javax.faces.context.FacesContext facesContext, DataContainer data)
protected DataContainer getDataContainer(javax.faces.context.FacesContext context)
protected void removeBean(javax.faces.context.FacesContext facesContext)
protected java.lang.String prefixRequestParam(java.lang.String paramName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |