org.apache.myfaces.custom.outputlinkdynamic
Class AbstractOutputLinkDynamic

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.html.HtmlOutputLink
                  extended by org.apache.myfaces.custom.outputlinkdynamic.AbstractOutputLinkDynamic
All Implemented Interfaces:
javax.faces.component.StateHolder, javax.faces.component.ValueHolder, org.apache.myfaces.component.ForceIdAware, org.apache.myfaces.component.UserRoleAware

public abstract class AbstractOutputLinkDynamic
extends javax.faces.component.html.HtmlOutputLink
implements org.apache.myfaces.component.UserRoleAware, org.apache.myfaces.component.ForceIdAware

Extends standard outputLink but links to a dynamically rendered resource (image, file, ...).

Version:
$Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (Wed, 03 Sep 2008) $ Warning, this component is far from ready. It's more a proof of concept right now. TODO : Remove the need to include .get for the last part of the method expressions : getBytesMethod="#{graphicImageDynamicBean.upImage.getBytes}" TODO : Make a similar download component to download files TODO : Use shorter URLs
Author:
Sylvain Vieujot (latest modification by $Author: lu4242 $)

Field Summary
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.html.HtmlOutputLink
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Fields inherited from interface org.apache.myfaces.component.UserRoleAware
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR
 
Constructor Summary
AbstractOutputLinkDynamic()
           
 
Method Summary
abstract  java.lang.String getEnabledOnUserRole()
          If user is in given role, this component will be rendered normally.
 java.lang.Class getResourceRendererClass()
          The class which implements org.apache.myfaces.custom.dynamicResources.ResourceRenderer.
abstract  java.lang.String getVisibleOnUserRole()
          If user is in given role, this component will be rendered normally.
abstract  boolean isForceId()
          If true, this component will force the use of the specified id when rendering.
abstract  boolean isForceIdIndex()
          If false, this component will not append a '[n]' suffix (where 'n' is the row index) to components that are contained within a "list." This value will be true by default and the value will be ignored if the value of forceId is false (or not specified.)
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
abstract  void setEnabledOnUserRole(java.lang.String userRole)
           
abstract  void setForceId(boolean forceId)
           
abstract  void setForceIdIndex(boolean forceIdIndex)
           
 void setImageRendererClass(java.lang.Class resourceRendererClass)
           
abstract  void setVisibleOnUserRole(java.lang.String userRole)
           
 
Methods inherited from class javax.faces.component.html.HtmlOutputLink
getAccesskey, getCharset, getCoords, getDir, getFamily, getHreflang, getLang, getOnblur, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRel, getRev, getShape, getStyle, getStyleClass, getTabindex, getTarget, getTitle, getType, isDisabled, setAccesskey, setCharset, setCoords, setDir, setDisabled, setHreflang, setLang, setOnblur, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRel, setRev, setShape, setStyle, setStyleClass, setTabindex, setTarget, setTitle, setType
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractOutputLinkDynamic

public AbstractOutputLinkDynamic()
Method Detail

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.html.HtmlOutputLink

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.html.HtmlOutputLink

setImageRendererClass

public void setImageRendererClass(java.lang.Class resourceRendererClass)

getResourceRendererClass

public java.lang.Class getResourceRendererClass()
The class which implements org.apache.myfaces.custom.dynamicResources.ResourceRenderer. The resource renderer is responsible for resource the image. The class must have a default constructor. Any request scoped attribute or managed bean is not available when this resource renderer is instantiated and used. The resource renderer must render the binary data for the resource by using the parameters passed by nested f:param elements and/or using session or application scoped beans.

Returns:

getEnabledOnUserRole

public abstract java.lang.String getEnabledOnUserRole()
If user is in given role, this component will be rendered normally. If not, no hyperlink is rendered but all nested tags (=body) are rendered.

Specified by:
getEnabledOnUserRole in interface org.apache.myfaces.component.UserRoleAware
Returns:

setEnabledOnUserRole

public abstract void setEnabledOnUserRole(java.lang.String userRole)
Specified by:
setEnabledOnUserRole in interface org.apache.myfaces.component.UserRoleAware

getVisibleOnUserRole

public abstract java.lang.String getVisibleOnUserRole()
If user is in given role, this component will be rendered normally. If not, nothing is rendered and the body of this tag will be skipped.

Specified by:
getVisibleOnUserRole in interface org.apache.myfaces.component.UserRoleAware
Returns:

setVisibleOnUserRole

public abstract void setVisibleOnUserRole(java.lang.String userRole)
Specified by:
setVisibleOnUserRole in interface org.apache.myfaces.component.UserRoleAware

isForceId

public abstract boolean isForceId()
If true, this component will force the use of the specified id when rendering.

Specified by:
isForceId in interface org.apache.myfaces.component.ForceIdAware
Returns:

setForceId

public abstract void setForceId(boolean forceId)
Specified by:
setForceId in interface org.apache.myfaces.component.ForceIdAware

isForceIdIndex

public abstract boolean isForceIdIndex()
If false, this component will not append a '[n]' suffix (where 'n' is the row index) to components that are contained within a "list." This value will be true by default and the value will be ignored if the value of forceId is false (or not specified.)

Specified by:
isForceIdIndex in interface org.apache.myfaces.component.ForceIdAware
Returns:

setForceIdIndex

public abstract void setForceIdIndex(boolean forceIdIndex)
Specified by:
setForceIdIndex in interface org.apache.myfaces.component.ForceIdAware


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.