org.rcfaces.core.component
Class ServiceComponent

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.rcfaces.core.internal.component.CameliaBaseComponent
              extended by org.rcfaces.core.component.ServiceComponent
All Implemented Interfaces:
StateHolder, IClientDataCapability, IComponentLocaleCapability, IComponentTimeZoneCapability, IErrorEventCapability, IFilterCapability, IPropertyChangeEventCapability, IServerDataCapability, IServiceEventCapability, org.rcfaces.core.internal.capability.IComponentLifeCycle, org.rcfaces.core.internal.capability.IRCFacesComponent, org.rcfaces.core.internal.manager.IClientDataManager, org.rcfaces.core.internal.manager.IContainerManager, org.rcfaces.core.internal.manager.IServerDataManager, org.rcfaces.core.internal.manager.ITransientAttributesManager

public class ServiceComponent
extends org.rcfaces.core.internal.component.CameliaBaseComponent
implements IClientDataCapability, IServerDataCapability, IPropertyChangeEventCapability, IServiceEventCapability, IFilterCapability, IErrorEventCapability, IComponentLocaleCapability, IComponentTimeZoneCapability, org.rcfaces.core.internal.manager.IClientDataManager, org.rcfaces.core.internal.manager.IServerDataManager

The service Component is a non-visual component.

It allows to (synchronously or asynchronously) call AJAX services from the client.

The service Component has the following capability :

The default service renderer is linked to the f_service javascript class. f_service extends f_object, fa_serializable, fa_eventTarget, fa_filterProperties, fa_commands


Field Summary
protected static Set CAMELIA_ATTRIBUTES
           
static String COMPONENT_TYPE
           
 
Fields inherited from class org.rcfaces.core.internal.component.CameliaBaseComponent
engine
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
ServiceComponent()
           
ServiceComponent(String componentId)
           
 
Method Summary
 void addErrorListener(IErrorListener listener)
          Adds a listener to the component for the error event
 void addPropertyChangeListener(IPropertyChangeListener listener)
          Adds a listener to the component for the propertyChange event
 void addServiceEventListener(IServiceEventListener listener)
          Adds a listener to the component for the service event
protected  Set getCameliaFields()
           
 String getClientData(String name)
          Retrieves the data associated to a variable
 String getClientData(String name, FacesContext facesContext)
           
 int getClientDataCount()
          Returns the number of variable associated to the component.
 Map getClientDataMap()
          Returns a map containing the couples variable-data
 Map getClientDataMap(FacesContext facesContext)
           
 Locale getComponentLocale()
          Returns the locale defined for the component
 Locale getComponentLocale(FacesContext facesContext)
          See getComponentLocale() for more details
 TimeZone getComponentTimeZone()
          Returns the timeZone defined for the component.
 TimeZone getComponentTimeZone(FacesContext facesContext)
          See getComponentTimeZone() for more details
 IFilterProperties getFilterProperties()
          Return an object that represent the filter to use on the server side.
 IFilterProperties getFilterProperties(FacesContext facesContext)
          See getFilterProperties() for more details
 Object getServerData(String name)
          Retrieves an object data associated to a key
 Object getServerData(String name, FacesContext facesContext)
           
 int getServerDataCount()
          Returns the number of keys associated to the component.
 Map getServerDataMap()
          Returns a Map object containing keys and associated data objects
 Map getServerDataMap(FacesContext facesContext)
           
 String getServiceId()
          Returns the service id.
 String getServiceId(FacesContext facesContext)
          Returns the service id.
 boolean isComponentLocaleSetted()
          Returns true if the attribute "componentLocale" is set.
 boolean isComponentTimeZoneSetted()
          Returns true if the attribute "componentTimeZone" is set.
 boolean isEnableViewState()
           
 boolean isEnableViewState(FacesContext facesContext)
           
 boolean isEnableViewStateSetted()
          Returns true if the attribute "enableViewState" is set.
 boolean isFilterPropertiesSetted()
          Returns true if the attribute "filterProperties" is set.
 boolean isServiceIdSetted()
          Returns true if the attribute "serviceId" is set.
 String[] listClientDataKeys()
          Returns the list of variable associated to the component.
 String[] listClientDataKeys(FacesContext facesContext)
           
 FacesListener[] listErrorListeners()
          Returns a list of Error listener for the component
 FacesListener[] listPropertyChangeListeners()
          Returns a list of propertyChange listener for the component
 String[] listServerDataKeys()
          Returns a list of the keys defined for the component
 String[] listServerDataKeys(FacesContext facesContext)
           
 FacesListener[] listServiceEventListeners()
          Returns a list of service listener for the component
 String removeClientData(String name)
          Removes the variable name and the data associated to it
 void removeErrorListener(IErrorListener listener)
          Removes a listener from the component for the error event
 void removePropertyChangeListener(IPropertyChangeListener listener)
          Removes a listener from the component for the propertyChange event
 Object removeServerData(String name)
          Removes a key and the data object associated to it
 void removeServiceEventListener(IServiceEventListener listener)
          Removes a listener from the component for the service event
 String setClientData(String name, String value)
          Associates data to variable name.
 void setClientData(String name, javax.el.ValueExpression value)
           
 void setComponentLocale(Locale componentLocale)
          Sets the locale for the component
 void setComponentLocale(String locale)
           
 void setComponentTimeZone(String timeZone)
           
 void setComponentTimeZone(TimeZone componentTimeZone)
          Sets the timeZone for component.
 void setEnableViewState(boolean enableViewState)
           
 void setFilterProperties(IFilterProperties filterProperties)
          Sets an object that represent the filter to use on the server side.
 void setFilterProperties(String properties)
           
 Object setServerData(String name, Object value)
          Associates and object to a key for the component on the server side
 void setServerData(String name, javax.el.ValueExpression value)
           
 void setServiceId(String serviceId)
          Sets the service id.
 
Methods inherited from class org.rcfaces.core.internal.component.CameliaBaseComponent
clearListeners, confirmListenerAppend, constructPhase, constructTemplate, decodePhase, encodeBegin, encodeChildren, encodeEnd, getAsyncRenderer, getCameliaValueAlias, getChildren, getChildrenListState, getFamily, getRendererType, getTransientAttribute, getValueExpression, hasDefaultProperties, initializeComponent, initializePhase, isClientRendered, isRendered, isTemplateComponent, processDecodes, processEngineUpdates, processEngineValidators, processUpdates, processValidators, queueEvent, renderPhase, restoreState, saveState, setDefaultProperties, setRendered, setTransientAttribute, setValueExpression, toString, updatePhase, validationPhase, verifyAsyncDecode
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, findComponent, getAttributes, getChildCount, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendersChildren, getValueBinding, invokeOnComponent, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.rcfaces.core.internal.manager.IContainerManager
getChildCount
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values

CAMELIA_ATTRIBUTES

protected static final Set CAMELIA_ATTRIBUTES
Constructor Detail

ServiceComponent

public ServiceComponent()

ServiceComponent

public ServiceComponent(String componentId)
Method Detail

setClientData

public void setClientData(String name,
                          javax.el.ValueExpression value)
Specified by:
setClientData in interface org.rcfaces.core.internal.manager.IClientDataManager

setClientData

public String setClientData(String name,
                            String value)
Description copied from interface: IClientDataCapability
Associates data to variable name.

Specified by:
setClientData in interface IClientDataCapability
Specified by:
setClientData in interface org.rcfaces.core.internal.manager.IClientDataManager
Parameters:
name - the variable to associate data to
value - the data to associate to the variable
Returns:
the data previously associated with the variable (empty if none)

setServerData

public void setServerData(String name,
                          javax.el.ValueExpression value)
Specified by:
setServerData in interface org.rcfaces.core.internal.manager.IServerDataManager

setServerData

public Object setServerData(String name,
                            Object value)
Description copied from interface: IServerDataCapability
Associates and object to a key for the component on the server side

Specified by:
setServerData in interface IServerDataCapability
Specified by:
setServerData in interface org.rcfaces.core.internal.manager.IServerDataManager
Parameters:
name - key used to retrieve the object associated
value - object to associate
Returns:
the object previously associated to teh key (null if none)

setComponentLocale

public void setComponentLocale(String locale)

setComponentTimeZone

public void setComponentTimeZone(String timeZone)

getClientData

public String getClientData(String name,
                            FacesContext facesContext)

getServerData

public Object getServerData(String name,
                            FacesContext facesContext)

getClientDataMap

public Map getClientDataMap(FacesContext facesContext)

getServerDataMap

public Map getServerDataMap(FacesContext facesContext)

listClientDataKeys

public String[] listClientDataKeys(FacesContext facesContext)

listServerDataKeys

public String[] listServerDataKeys(FacesContext facesContext)

setFilterProperties

public void setFilterProperties(String properties)

getClientDataCount

public int getClientDataCount()
Description copied from interface: IClientDataCapability
Returns the number of variable associated to the component.

Specified by:
getClientDataCount in interface IClientDataCapability
Returns:
number of variable

listClientDataKeys

public String[] listClientDataKeys()
Description copied from interface: IClientDataCapability
Returns the list of variable associated to the component.

Specified by:
listClientDataKeys in interface IClientDataCapability
Returns:
a list of variables

removeClientData

public String removeClientData(String name)
Description copied from interface: IClientDataCapability
Removes the variable name and the data associated to it

Specified by:
removeClientData in interface IClientDataCapability
Parameters:
name - the variable to associate data to
Returns:
the data that was associated to the variable

getClientData

public String getClientData(String name)
Description copied from interface: IClientDataCapability
Retrieves the data associated to a variable

Specified by:
getClientData in interface IClientDataCapability
Parameters:
name - the variable to associate data to
Returns:
the data associated to the variable

getClientDataMap

public Map getClientDataMap()
Description copied from interface: IClientDataCapability
Returns a map containing the couples variable-data

Specified by:
getClientDataMap in interface IClientDataCapability
Returns:
a map

listServerDataKeys

public String[] listServerDataKeys()
Description copied from interface: IServerDataCapability
Returns a list of the keys defined for the component

Specified by:
listServerDataKeys in interface IServerDataCapability
Returns:
list of keys

getServerDataMap

public Map getServerDataMap()
Description copied from interface: IServerDataCapability
Returns a Map object containing keys and associated data objects

Specified by:
getServerDataMap in interface IServerDataCapability
Returns:
a map

getServerDataCount

public int getServerDataCount()
Description copied from interface: IServerDataCapability
Returns the number of keys associated to the component.

Specified by:
getServerDataCount in interface IServerDataCapability
Returns:
number of keys

getServerData

public Object getServerData(String name)
Description copied from interface: IServerDataCapability
Retrieves an object data associated to a key

Specified by:
getServerData in interface IServerDataCapability
Parameters:
name - the key to retrieve
Returns:
the data object associated to the key

removeServerData

public Object removeServerData(String name)
Description copied from interface: IServerDataCapability
Removes a key and the data object associated to it

Specified by:
removeServerData in interface IServerDataCapability
Parameters:
name - the key to remove
Returns:
the data object that was associated to the key (null if none)

addPropertyChangeListener

public final void addPropertyChangeListener(IPropertyChangeListener listener)
Description copied from interface: IPropertyChangeEventCapability
Adds a listener to the component for the propertyChange event

Specified by:
addPropertyChangeListener in interface IPropertyChangeEventCapability
Parameters:
listener - the propertyChange listener to add

removePropertyChangeListener

public final void removePropertyChangeListener(IPropertyChangeListener listener)
Description copied from interface: IPropertyChangeEventCapability
Removes a listener from the component for the propertyChange event

Specified by:
removePropertyChangeListener in interface IPropertyChangeEventCapability
Parameters:
listener - the propertyChange listener to remove

listPropertyChangeListeners

public final FacesListener[] listPropertyChangeListeners()
Description copied from interface: IPropertyChangeEventCapability
Returns a list of propertyChange listener for the component

Specified by:
listPropertyChangeListeners in interface IPropertyChangeEventCapability
Returns:
propertyChange listeners' list

addServiceEventListener

public final void addServiceEventListener(IServiceEventListener listener)
Description copied from interface: IServiceEventCapability
Adds a listener to the component for the service event

Specified by:
addServiceEventListener in interface IServiceEventCapability
Parameters:
listener - the service listener to add

removeServiceEventListener

public final void removeServiceEventListener(IServiceEventListener listener)
Description copied from interface: IServiceEventCapability
Removes a listener from the component for the service event

Specified by:
removeServiceEventListener in interface IServiceEventCapability
Parameters:
listener - the service listener to remove

listServiceEventListeners

public final FacesListener[] listServiceEventListeners()
Description copied from interface: IServiceEventCapability
Returns a list of service listener for the component

Specified by:
listServiceEventListeners in interface IServiceEventCapability
Returns:
service listeners' list

getFilterProperties

public IFilterProperties getFilterProperties()
Description copied from interface: IFilterCapability
Return an object that represent the filter to use on the server side.

Specified by:
getFilterProperties in interface IFilterCapability
Returns:
filter

getFilterProperties

public IFilterProperties getFilterProperties(FacesContext facesContext)
See getFilterProperties() for more details


isFilterPropertiesSetted

public final boolean isFilterPropertiesSetted()
Returns true if the attribute "filterProperties" is set.

Returns:
true if the attribute is set.

setFilterProperties

public void setFilterProperties(IFilterProperties filterProperties)
Description copied from interface: IFilterCapability
Sets an object that represent the filter to use on the server side.

Specified by:
setFilterProperties in interface IFilterCapability
Parameters:
filterProperties - filter

addErrorListener

public final void addErrorListener(IErrorListener listener)
Description copied from interface: IErrorEventCapability
Adds a listener to the component for the error event

Specified by:
addErrorListener in interface IErrorEventCapability
Parameters:
listener - the load listener to add

removeErrorListener

public final void removeErrorListener(IErrorListener listener)
Description copied from interface: IErrorEventCapability
Removes a listener from the component for the error event

Specified by:
removeErrorListener in interface IErrorEventCapability
Parameters:
listener - the load listener to remove

listErrorListeners

public final FacesListener[] listErrorListeners()
Description copied from interface: IErrorEventCapability
Returns a list of Error listener for the component

Specified by:
listErrorListeners in interface IErrorEventCapability
Returns:
load listeners' list

getComponentLocale

public Locale getComponentLocale()
Description copied from interface: IComponentLocaleCapability
Returns the locale defined for the component

Specified by:
getComponentLocale in interface IComponentLocaleCapability
Returns:
the defined locale

getComponentLocale

public Locale getComponentLocale(FacesContext facesContext)
See getComponentLocale() for more details


isComponentLocaleSetted

public final boolean isComponentLocaleSetted()
Returns true if the attribute "componentLocale" is set.

Returns:
true if the attribute is set.

setComponentLocale

public void setComponentLocale(Locale componentLocale)
Description copied from interface: IComponentLocaleCapability
Sets the locale for the component

Specified by:
setComponentLocale in interface IComponentLocaleCapability
Parameters:
componentLocale - locale to define

getComponentTimeZone

public TimeZone getComponentTimeZone()
Description copied from interface: IComponentTimeZoneCapability
Returns the timeZone defined for the component.

Specified by:
getComponentTimeZone in interface IComponentTimeZoneCapability
Returns:
the defined timeZone

getComponentTimeZone

public TimeZone getComponentTimeZone(FacesContext facesContext)
See getComponentTimeZone() for more details


isComponentTimeZoneSetted

public final boolean isComponentTimeZoneSetted()
Returns true if the attribute "componentTimeZone" is set.

Returns:
true if the attribute is set.

setComponentTimeZone

public void setComponentTimeZone(TimeZone componentTimeZone)
Description copied from interface: IComponentTimeZoneCapability
Sets the timeZone for component.

Specified by:
setComponentTimeZone in interface IComponentTimeZoneCapability
Parameters:
componentTimeZone - timeZone to define

getServiceId

public String getServiceId()
Returns the service id.

Returns:
service id

getServiceId

public String getServiceId(FacesContext facesContext)
Returns the service id.

Returns:
service id

setServiceId

public void setServiceId(String serviceId)
Sets the service id.

Parameters:
serviceId - service id

isServiceIdSetted

public boolean isServiceIdSetted()
Returns true if the attribute "serviceId" is set.

Returns:
true if the attribute is set.

isEnableViewState

public boolean isEnableViewState()

isEnableViewState

public boolean isEnableViewState(FacesContext facesContext)

setEnableViewState

public void setEnableViewState(boolean enableViewState)

isEnableViewStateSetted

public boolean isEnableViewStateSetted()
Returns true if the attribute "enableViewState" is set.

Returns:
true if the attribute is set.

getCameliaFields

protected Set getCameliaFields()
Overrides:
getCameliaFields in class org.rcfaces.core.internal.component.CameliaBaseComponent


Copyright © 2006-2011 Vedana. All Rights Reserved.