|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.xsp.util.DataPublisher
public class DataPublisher
This is used by UIComponent
s to publishing "var"s to the requestMap,
and saving any previous value that was present under that name in a list of
DataPublisher.ShadowedObject
s. Each push or publish method should be paired with the
corresponding pop or revoke method, so that once this control has finished
its own rendering, later controls on the XPage will see the old value for the
variable name.
The main methods of interest are the push/pop methods. The publish/revoke
methods are only provided as a convenience; they provide default push/pop
behaviors for controls that do not have any getVar method, just publish the
values associated with the interface FacesDataProvider
,
the FacesPropertyProvider
control, and for the UIViewRoot control, it also
handles the UIViewRootEx.getResources()
vars.
Nested Class Summary | |
---|---|
static class |
DataPublisher.ShadowedObject
Saves any previous value that was present in the RequestMap |
Field Summary | |
---|---|
static java.lang.String |
DATASOURCE
The data source var suffix; often data sources will publish their data source object under the variable name: var+".DATASOURCE" so that the data source object can be retrieved by controls that need to access the data source itself rather than the data that it publishes. |
static java.lang.String |
READONLY
The readonly var suffix; often data sources will publish a boolean under the variable name: var+".READONLY" indicating whether the data source is read-only. |
Constructor Summary | |
---|---|
DataPublisher()
|
Method Summary | |
---|---|
java.util.List<DataPublisher.ShadowedObject> |
createShadowedList()
|
void |
encodeDatasources(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Data source rendering. |
protected javax.faces.context.FacesContext |
getFacesContext()
Available to be called by subclasses, the FacesContext for this request. |
protected java.util.Map<java.lang.String,java.lang.Object> |
getRequestMap()
|
boolean |
isAllowCreateViewPublish(javax.faces.component.UIComponent component)
Examines the control ancestors to see if this control should publish during the createView phase. |
void |
popCompositeData(java.util.List<DataPublisher.ShadowedObject> shadowed,
javax.faces.component.UIComponent component,
PropertyMap propertyMap)
|
void |
popDataSource(java.util.List<DataPublisher.ShadowedObject> shadowed,
javax.faces.component.UIComponent component,
DataSource data)
Helper method to pop a component data instance |
void |
popObjects(java.util.List<DataPublisher.ShadowedObject> shadowed)
|
void |
popPublishingObject(java.util.List<DataPublisher.ShadowedObject> shadowed,
javax.faces.component.UIComponent component,
DataPublishingObject resource)
Helper method to pop a component data instance |
java.util.List<DataPublisher.ShadowedObject> |
publishControlData(javax.faces.component.UIComponent component)
Expose the component data and and component data context values associated with the specified component as request scoped variables. |
void |
pushCompositeData(java.util.List<DataPublisher.ShadowedObject> shadowedData,
javax.faces.component.UIComponent component,
PropertyMap propertyMap)
|
java.util.List<DataPublisher.ShadowedObject> |
pushDataSource(javax.faces.component.UIComponent component,
DataSource data)
Helper method to push a component data instance |
void |
pushObject(java.util.List<DataPublisher.ShadowedObject> shadowed,
java.lang.String var,
java.lang.Object data)
Helper method to push an object into the request map |
void |
pushPublishingObject(javax.faces.component.UIComponent component,
java.util.List<DataPublisher.ShadowedObject> shadowedData,
DataPublishingObject bundle)
|
java.util.List<DataPublisher.ShadowedObject> |
pushShadowObjects(java.util.List<DataPublisher.ShadowedObject> shadowed,
java.lang.String... vars)
For the given variable names, if non-empty, save the request map value of the variable to the shadowed list, creating the list if it is null. |
void |
revokeControlData(java.util.List<DataPublisher.ShadowedObject> shadowedData,
javax.faces.component.UIComponent component)
Remove the component data and and component data context values associated with the specified component from the request scope. |
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 READONLY
public static final java.lang.String DATASOURCE
ModelDataSource
implementers corresponding to the value being
repeated over, so that the ModelDataSource.getDataModel()
data
model can be used to iterate through the data source.
Constructor Detail |
---|
public DataPublisher()
Method Detail |
---|
protected javax.faces.context.FacesContext getFacesContext()
protected java.util.Map<java.lang.String,java.lang.Object> getRequestMap()
public boolean isAllowCreateViewPublish(javax.faces.component.UIComponent component)
FacesDataIterator
s do not iterate during the createView phase.
component
-
public java.util.List<DataPublisher.ShadowedObject> publishControlData(javax.faces.component.UIComponent component) throws javax.faces.FacesException
javax.faces.FacesException
public void pushCompositeData(java.util.List<DataPublisher.ShadowedObject> shadowedData, javax.faces.component.UIComponent component, PropertyMap propertyMap)
public void pushPublishingObject(javax.faces.component.UIComponent component, java.util.List<DataPublisher.ShadowedObject> shadowedData, DataPublishingObject bundle) throws javax.faces.FacesException
javax.faces.FacesException
public void popPublishingObject(java.util.List<DataPublisher.ShadowedObject> shadowed, javax.faces.component.UIComponent component, DataPublishingObject resource)
component
- TODOpublic void revokeControlData(java.util.List<DataPublisher.ShadowedObject> shadowedData, javax.faces.component.UIComponent component) throws javax.faces.FacesException
javax.faces.FacesException
public void popCompositeData(java.util.List<DataPublisher.ShadowedObject> shadowed, javax.faces.component.UIComponent component, PropertyMap propertyMap)
public java.util.List<DataPublisher.ShadowedObject> pushShadowObjects(java.util.List<DataPublisher.ShadowedObject> shadowed, java.lang.String... vars)
popObjects(List)
.
The difference between this and pushObject(List, String, Object)
is that this doesn't actually publish a value in the request map.
It only saves the old values that were present under the variable names.
Normally you would use pushObject(List, String, Object)
instead,
which both publishes the new value and saves the old value in the same method.
This method is only used in the repeating controls, which first save the old values,
then repeatedly publish different new values as they iterate, and finally restore the old values.
shadowed
- vars
-
public void pushObject(java.util.List<DataPublisher.ShadowedObject> shadowed, java.lang.String var, java.lang.Object data)
public java.util.List<DataPublisher.ShadowedObject> createShadowedList()
public void popObjects(java.util.List<DataPublisher.ShadowedObject> shadowed)
public java.util.List<DataPublisher.ShadowedObject> pushDataSource(javax.faces.component.UIComponent component, DataSource data)
public void popDataSource(java.util.List<DataPublisher.ShadowedObject> shadowed, javax.faces.component.UIComponent component, DataSource data)
public void encodeDatasources(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |