Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-03


oracle.adf.view.rich.help
Class ELHelpProvider

java.lang.Object
  extended by oracle.adf.view.rich.help.HelpProvider
      extended by oracle.adf.view.rich.help.ELHelpProvider


public class ELHelpProvider
extends HelpProvider

This class implements a basic HelpProvider that pulls help text from an EL expression that resolves to a java.util.Map. This HelpProvider must be registered before it can be used; here is an example (see HelpProvider for details):

 <adf-settings xmlns="http://xmlns.oracle.com/adf/settings">
  <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/settings">
   <help-provider prefix="MYAPP_">
     <help-provider-class> oracle.adf.view.rich.help.ELHelpProvider </help-provider-class>
     <property>
       <property-name>helpSource</property-name>
       <value>#{customTranslationMap.contents}</value>
     </property>
   </help-provider>
  </adf-faces-config>
 </adf-settings>
 

Example jsp fragment:

 <af:inputText label="Credit Card" helpTopicid="MYAPP_CREDIT_CARD"/>
 

The helpSource parameter's value is an EL expression. The EL expression should point to a java.util.Map<String, String>. This Map has keys/values like this:

 key=MYAPP_CREDIT_CARD_DEFINITION;value = This is your MasterCard or Visa number.
 key=MYAPP_CREDIT_CARD_INSTRUCTIONS'value= Enter 16 digits. You may use spaces.
 

All of the HelpTopic objects returned by this class have implementations for HelpTopic.getInstructions() and HelpTopic.getDefinition() as described above, and at getHelpTopic(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String). However, HelpTopic.getExternalUrl() always returns null. This may be overridden by subclassing this class and implementing getExternalUrl(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String).


Constructor Summary
ELHelpProvider()
           

 

Method Summary
protected  java.lang.String getExternalUrl(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String topicId)
          Gets the externalUrl for a HelpTopic.
 java.lang.String getHelpSource()
          Gets the translation source EL string that this HelpProvider will evaluate and pull help information from.
 HelpTopic getHelpTopic(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String topicId)
          Creates a HelpTopic instance for the given topicId.
 void setHelpSource(java.lang.String helpSource)
          Sets the translation source EL string that this HelpProvider will evaluate and pull help information from.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ELHelpProvider

public ELHelpProvider()

Method Detail

setHelpSource

public void setHelpSource(java.lang.String helpSource)
Sets the translation source EL string that this HelpProvider will evaluate and pull help information from. The translation source is an EL string, like #{customTranslationMap.contents} and it must resolve to a java.util.Map.

This property is required, and can only be set once.


getHelpSource

public java.lang.String getHelpSource()
Gets the translation source EL string that this HelpProvider will evaluate and pull help information from. The translation source EL must resolve to a java.util.Map.

getHelpTopic

public final HelpTopic getHelpTopic(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component,
                                    java.lang.String topicId)
Creates a HelpTopic instance for the given topicId.
Specified by:
getHelpTopic in class HelpProvider
Parameters:
topicId - This topicId is used to form two keys to look up resources in the Map. The two keys are formed by appending "_INSTRUCTIONS" and "_DEFINITION" to the topicId. For example, if the topicId is "foo" the two Map keys will be "foo_INSTRUCTIONS" and "foo_DEFINITION". The resource value of the former is used as the return for HelpTopic.getInstructions() and the value of the latter is used for HelpTopic.getDefinition().

See the example in the class documentation above.

component - the component that this HelpTopic is for. This may be null. Help implementors may provide different help depending on the component state, eg: when the component is disabled.
Returns:
A HelpTopic instance. HelpTopic.getInstructions() and HelpTopic.getDefinition() return values as described above. However, HelpTopic.getExternalUrl() always returns null. A subclass may change that behaviour by overriding getExternalUrl(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String).
See Also:
getExternalUrl(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)

getExternalUrl

protected java.lang.String getExternalUrl(javax.faces.context.FacesContext context,
                                          javax.faces.component.UIComponent component,
                                          java.lang.String topicId)
Gets the externalUrl for a HelpTopic. This implementation always returns null. Subclasses may override this method to provide a link to an external help site.
Parameters:
component - This component that this URL is for. The component may be null, if it is unknown. This is the same parameter that was passed into getHelpTopic(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
topicId - This is the same parameter that was passed into getHelpTopic(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
Returns:
a URL string.
See Also:
HelpTopic.getExternalUrl()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1)
E10684-03


Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.