com.ibm.xsp.component
Class UIFileDownload

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIData
              extended by com.ibm.xsp.component.UIDataEx
                  extended by com.ibm.xsp.component.UIFileDownload
All Implemented Interfaces:
FacesAjaxComponent, FacesComponent, FacesDataIterator, FacesRefreshableComponent, FacesRowIndex, FacesThemeHandler, ThemeControl, javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
XspFileDownload

public class UIFileDownload
extends UIDataEx
implements FacesComponent, FacesThemeHandler

Abstract File Download Component which handles creating all the internal components used to display the file available for downloading.

By default, the rendererType property must be set to "com.ibm.faces.AttachmentDownload" This value can be changed by calling the setRendererType() method.

Not intended to be subclassed.


Nested Class Summary
static class UIFileDownload.DownloadVb
          Unit: UIFileDownload.java
static class UIFileDownload.InternalCreated
           
static class UIFileDownload.InternalHref
           
static class UIFileDownload.InternalId
           
static class UIFileDownload.InternalLastModified
           
static class UIFileDownload.InternalName
           
static class UIFileDownload.InternalSizeValue
           
static class UIFileDownload.InternalType
           
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponentBase
javax.faces.component.UIComponentBase.AggregatedIterator, javax.faces.component.UIComponentBase.UnmodifiableIterator
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponent
javax.faces.component.UIComponent.StateMap, javax.faces.component.UIComponent.StateMapEntry
 
Field Summary
static java.lang.String COMPONENT_TYPE
          The standard component type for this component.
 
Fields inherited from class com.ibm.xsp.component.UIDataEx
AJAX_GETROWS, DEFAULT_ROWS_PER_PAGE
 
Fields inherited from class javax.faces.component.UIData
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
UIFileDownload()
          Abstract File Download Component.
 
Method Summary
protected  void bindBasicColumn(UIColumnEx column, UIFileDownload.DownloadVb columnValueBinding)
          Helper Method for binding a value binding to a specific column
 void buildContents(javax.faces.context.FacesContext context, FacesComponentBuilder builder)
          Build the component children and facets, the default implementation is usually:
builder.buildAll(context, this, true); // includeFacets=true
protected  java.lang.String createExpression(java.lang.String propertyName)
          Helper method for creating a value binding expression for a given property
 java.lang.String getCreatedStyleClass()
           
 java.lang.String getCreatedTitle()
           Return the value of the createdTitle property.
 java.util.Date getCreatedValue()
           Return the value of the createdValue property.
 com.ibm.xsp.model.FileDownloadValue getCurrentFileDownloadValue()
          Returns the current FileDownloadValue of this instance, will be null if not set.
 java.lang.String getDeleteImageTitle()
           Return the value of the deleteImageTitle property.
 java.lang.String getDeleteMessage()
           Return the value of the deleteFileMessage property.
 java.lang.String getDeleteStyleClass()
           
 java.util.Date getEffectiveCreatedValue()
           
 java.lang.String getEffectiveFileNameHrefValue()
           
 java.lang.String getEffectiveFileNameValue()
          Note this is a localizable string displayed in the file name column.
 java.util.Date getEffectiveLastModifiedValue()
           
 java.lang.String getEffectiveSizeValue()
          The size value for the current row
 java.lang.String getEffectiveTypeValue()
           
 UIColumnEx getFileCreatedColumn()
           
 UIColumnEx getFileDeleteColumn()
           
 java.lang.String getFileId()
          The id of the current file, available while iterating through the download component.
 UIColumnEx getFileLastModifiedColumn()
           
 UIColumnEx getFileNameColumn()
           
 java.lang.String getFileNameHrefValue()
           Return the value of the filenameTitle property.
 java.lang.String getFileNameTitle()
           Return the value of the filenameTitle property.
 java.lang.String getFileNameValue()
           Return the value of the fileNameValue property.
 UIColumnEx getFileSizeColumn()
           
 UIColumnEx getFileTypeColumn()
           
 java.lang.String getLastModifiedTitle()
           Return the value of the lastModifiedTitle property.
 java.util.Date getLastModifiedValue()
           Return the value of the lastModifiedValue property.
 java.lang.String getModifiedStyleClass()
           
 java.lang.String getNameStyleClass()
           
protected  NumberConverter getNumberConverter()
          Returns the number converter used to format the file size.
 java.lang.String getSizeStyleClass()
           
 java.lang.String getSizeTitle()
           Return the value of the sizeTitle property.
 java.lang.String getSizeValue()
           Return the value of the sizeValue property.
 java.lang.String getStyleKitFamily()
          The styleKitFamily is basically the default themeId, to use if the "themeId" property is not set on this control instance in the XPage source.
 java.lang.String getTypeStyleClass()
           
 java.lang.String getTypeTitle()
           Return the value of the typeTitle property.
 java.lang.String getTypeValue()
           Return the value of the typeValue property.
 void initAfterContents(javax.faces.context.FacesContext context)
          Perform component initialization after it's children and facets are added.
protected  void initBasicColumn(javax.faces.context.FacesContext context, java.lang.String columnTitle, javax.faces.convert.Converter converter, java.lang.String styleClass, javax.faces.el.ValueBinding columnValue)
           
 void initBeforeContents(javax.faces.context.FacesContext context)
          Perform component initialization before its children and facets are added.
protected  void initFileDeleteColumn(javax.faces.context.FacesContext context)
          Helper method to create the delete control.
 boolean isAllowDelete()
          Get the boolean value of the allowDelete property.
 boolean isDisplayCreated()
           Return the value of the displayCreated property.
 boolean isDisplayLastModified()
           Return the value of the displayLastModified property.
 boolean isDisplaySize()
           Return the value of the displaySize property.
 boolean isDisplayType()
           Return the value of the displayType property.
 boolean isHideWhen()
           Return the value of the hideWhen property.
 boolean isReadOnlyMode(javax.faces.context.FacesContext context)
           
 boolean isRendered()
           
 void processRestoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
protected  java.lang.Object resolveValue()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object _state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAllowDelete(boolean allowDelete)
          Set boolean value for the allowDelete property.
 void setCreatedStyleClass(java.lang.String styleClass)
           
 void setCreatedTitle(java.lang.String createdTitle)
           Set the value of the createdTitle property.
 void setCreatedValue(java.util.Date created)
           Set the value of the createdValue property.
 void setDeleteImageTitle(java.lang.String deleteImageTitle)
           Sets the value of the deleteImageTitle property.
 void setDeleteMessage(java.lang.String deleteMessage)
           Sets the value for the deleteMessage property.
 void setDeleteStyleClass(java.lang.String styleClass)
           
 void setDisplayCreated(boolean displayCreated)
           Set the value of the displayCreated property.
 void setDisplayLastModified(boolean displayLastModified)
           Set the value of the displayLastModified property.
 void setDisplaySize(boolean displaySize)
           Set the value of the displaySize property.
 void setDisplayType(boolean displayType)
           Set the value of the displayType property.
 void setFileNameHrefValue(java.lang.String href)
           Set the value of the filenameTitle property.
 void setFileNameTitle(java.lang.String fileNameTitle)
           Set the value of the filenameTitle property.
 void setFileNameValue(java.lang.String fileNameValue)
           Set the value of the fileNameValue property.
 void setHideWhen(boolean hideWhen)
           Set the value of the hideWhen property.
 void setLastModifiedTitle(java.lang.String lastModifiedTitle)
           Set the value of the lastModifiedTitle property.
 void setLastModifiedValue(java.util.Date vb)
           Set the value of the lastModifiedValue property.
 void setModifiedStyleClass(java.lang.String styleClass)
           
 void setNameStyleClass(java.lang.String styleClass)
           
 void setSizeStyleClass(java.lang.String styleClass)
           
 void setSizeTitle(java.lang.String sizeTitle)
           Set the value of the sizeTitle property.
 void setSizeValue(java.lang.String sizeValue)
           Set the value of the sizeValue property.
 boolean setThemeProperty(java.lang.String name, java.lang.Object value)
          Implemented by components which handle setting their own default styles
 void setTypeStyleClass(java.lang.String styleClass)
           
 void setTypeTitle(java.lang.String typeTitle)
           Set the value of the typeTitle property.
 void setTypeValue(java.lang.String typeValue)
           Set the value of the typeValue property.
 
Methods inherited from class com.ibm.xsp.component.UIDataEx
_xspCleanTransientData, broadcast, computeDataModelKey, createDataModel, encodeBegin, encodeEnd, getAjaxUrl, getAjaxUrl, getData, getDataModel, getDataSource, getIndexVar, getLastCreatedDataModel, getNonChildClientId, getRefreshId, getRowCount, getRowCount, getRows, getValue, gotoFirstPage, gotoLastPage, gotoNextPage, gotoPage, gotoPreviousPage, gotoRow, handles, invokeOnComponent, isNestedInDataIterator, isPartialExecute, isPartialRefresh, processAjaxGetRows, processAjaxRequest, processDecodes, processUpdates, processValidators, publishControlData, queueEvent, resetDataModel, revokeControlData, setData, setDataModel, setIndexVar, setRowIndex, setRows, setValue, setValueBinding, setVar, visitTree
 
Methods inherited from class javax.faces.component.UIData
getClientId, getFamily, getFirst, getFooter, getHeader, getRowData, getRowIndex, getVar, isRowAvailable, setFirst, setFooter, setHeader
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
_xspGetStateId, _xspGetStateMap, _xspRestoreAttribute, _xspRestoreState, _xspSaveState, isVisitable, markInitialState, setControlState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xsp.component.FacesDataIterator
getFirst, getRowIndex, setFirst
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values
Constructor Detail

UIFileDownload

public UIFileDownload()
Abstract File Download Component.

Method Detail

getStyleKitFamily

public java.lang.String getStyleKitFamily()
Description copied from interface: ThemeControl
The styleKitFamily is basically the default themeId, to use if the "themeId" property is not set on this control instance in the XPage source. For example, "InputField.EditBox" is used for most Edit Box controls. See Domino/xsp/nsf/themes/webstandard.theme for more examples.

The implementation may return different values depending on the configuration of the current control, for example the Button control returns a different value and looks different when it is configured as a cancel button.

Specified by:
getStyleKitFamily in interface ThemeControl
Overrides:
getStyleKitFamily in class UIDataEx
Returns:
a non-null themeId corresponding to the configuration for this type of control in a theme file.

setThemeProperty

public boolean setThemeProperty(java.lang.String name,
                                java.lang.Object value)
Description copied from interface: FacesThemeHandler
Implemented by components which handle setting their own default styles

Specified by:
setThemeProperty in interface FacesThemeHandler
Parameters:
name - TODO
value - TODO
Returns:
TODO

getTypeStyleClass

public java.lang.String getTypeStyleClass()

getSizeStyleClass

public java.lang.String getSizeStyleClass()

getNameStyleClass

public java.lang.String getNameStyleClass()

getModifiedStyleClass

public java.lang.String getModifiedStyleClass()

getCreatedStyleClass

public java.lang.String getCreatedStyleClass()

getDeleteStyleClass

public java.lang.String getDeleteStyleClass()

setTypeStyleClass

public void setTypeStyleClass(java.lang.String styleClass)

setSizeStyleClass

public void setSizeStyleClass(java.lang.String styleClass)

setNameStyleClass

public void setNameStyleClass(java.lang.String styleClass)

setModifiedStyleClass

public void setModifiedStyleClass(java.lang.String styleClass)

setCreatedStyleClass

public void setCreatedStyleClass(java.lang.String styleClass)

setDeleteStyleClass

public void setDeleteStyleClass(java.lang.String styleClass)

getNumberConverter

protected NumberConverter getNumberConverter()
Returns the number converter used to format the file size.

Returns:
NumberConverter

buildContents

public void buildContents(javax.faces.context.FacesContext context,
                          FacesComponentBuilder builder)
                   throws javax.faces.FacesException
Description copied from interface: FacesComponent
Build the component children and facets, the default implementation is usually:
builder.buildAll(context, this, true); // includeFacets=true

Specified by:
buildContents in interface FacesComponent
Throws:
javax.faces.FacesException

isRendered

public boolean isRendered()
Overrides:
isRendered in class javax.faces.component.UIComponentBase

initFileDeleteColumn

protected void initFileDeleteColumn(javax.faces.context.FacesContext context)
Helper method to create the delete control.

Parameters:
context -

isReadOnlyMode

public boolean isReadOnlyMode(javax.faces.context.FacesContext context)

initBasicColumn

protected void initBasicColumn(javax.faces.context.FacesContext context,
                               java.lang.String columnTitle,
                               javax.faces.convert.Converter converter,
                               java.lang.String styleClass,
                               javax.faces.el.ValueBinding columnValue)
Parameters:
context -
columnTitle - Title of the column this is addressing
converter - a converter used to convert the value.
styleClass - the style class for the column header
columnValue - a value binding that provides a default implementation for the column value, or will delegate to the value the user has set

bindBasicColumn

protected void bindBasicColumn(UIColumnEx column,
                               UIFileDownload.DownloadVb columnValueBinding)
Helper Method for binding a value binding to a specific column

Parameters:
column -
columnValueBinding -

createExpression

protected java.lang.String createExpression(java.lang.String propertyName)
Helper method for creating a value binding expression for a given property

Parameters:
propertyName -
Returns:

getDeleteMessage

public java.lang.String getDeleteMessage()

Return the value of the deleteFileMessage property. Contents:

Used as the prompt text when 'delete file' image control is clicked.


setDeleteMessage

public void setDeleteMessage(java.lang.String deleteMessage)

Sets the value for the deleteMessage property. Contents:

Used to override the prompt value displayed when 'delete' image control is clicked.


getDeleteImageTitle

public java.lang.String getDeleteImageTitle()

Return the value of the deleteImageTitle property. Contents:

Used for the title of the 'delete file' image control.


setDeleteImageTitle

public void setDeleteImageTitle(java.lang.String deleteImageTitle)

Sets the value of the deleteImageTitle property. Contents:

Used to override the title value for the 'delete file' image control.


getFileNameTitle

public java.lang.String getFileNameTitle()

Return the value of the filenameTitle property. Contents:

Used to override the default value for the file name title on the column header.


setFileNameHrefValue

public void setFileNameHrefValue(java.lang.String href)

Set the value of the filenameTitle property. Contents:


getFileNameHrefValue

public java.lang.String getFileNameHrefValue()

Return the value of the filenameTitle property. Contents:

Used to override the default value for the file name title on the column header.


setFileNameValue

public void setFileNameValue(java.lang.String fileNameValue)

Set the value of the fileNameValue property. Contents:


getFileNameValue

public java.lang.String getFileNameValue()

Return the value of the fileNameValue property. Contents:

used to override the default value (valuebinding) for the file names.


getLastModifiedTitle

public java.lang.String getLastModifiedTitle()

Return the value of the lastModifiedTitle property. Contents:

Holds the value of he column header for Last Modified


getCreatedTitle

public java.lang.String getCreatedTitle()

Return the value of the createdTitle property. Contents:

Holds the value of he column header for Created


setLastModifiedValue

public void setLastModifiedValue(java.util.Date vb)

Set the value of the lastModifiedValue property. Contents:


getLastModifiedValue

public java.util.Date getLastModifiedValue()

Return the value of the lastModifiedValue property. Contents:

Holds the value for the valueBinding for Last Modified, used to override the default valueBinding set up internally on this component.


setCreatedValue

public void setCreatedValue(java.util.Date created)

Set the value of the createdValue property. Contents:


getCreatedValue

public java.util.Date getCreatedValue()

Return the value of the createdValue property. Contents:

Holds the value for the valueBinding for Created, used to override the default valueBinding set up internally on this component.


getSizeTitle

public java.lang.String getSizeTitle()

Return the value of the sizeTitle property. Contents:

Display the size of the file to users.


setSizeValue

public void setSizeValue(java.lang.String sizeValue)

Set the value of the sizeValue property. Contents:


getSizeValue

public java.lang.String getSizeValue()

Return the value of the sizeValue property. Contents:

Display the size of the file to users.


getTypeTitle

public java.lang.String getTypeTitle()

Return the value of the typeTitle property. Contents:

Used to set the title of the File Type Column header, use this to override the default column header for file type.


setTypeValue

public void setTypeValue(java.lang.String typeValue)

Set the value of the typeValue property. Contents:


getTypeValue

public java.lang.String getTypeValue()

Return the value of the typeValue property. Contents:

Used to override the default value associated with the file type.


isDisplayLastModified

public boolean isDisplayLastModified()

Return the value of the displayLastModified property. Contents:

Display the last modified date of the file to users.


isDisplayCreated

public boolean isDisplayCreated()

Return the value of the displayCreated property. Contents:

Display the created date of the file to users.


isDisplaySize

public boolean isDisplaySize()

Return the value of the displaySize property. Contents:

Display the size of the file to users.


isDisplayType

public boolean isDisplayType()

Return the value of the displayType property. Contents:

Display the type of the file to users.


isHideWhen

public boolean isHideWhen()

Return the value of the hideWhen property. Contents:

Hide the file download field when no files are available for download.


getFileTypeColumn

public UIColumnEx getFileTypeColumn()

getFileDeleteColumn

public UIColumnEx getFileDeleteColumn()

getFileCreatedColumn

public UIColumnEx getFileCreatedColumn()

getFileLastModifiedColumn

public UIColumnEx getFileLastModifiedColumn()

getFileSizeColumn

public UIColumnEx getFileSizeColumn()

getFileNameColumn

public UIColumnEx getFileNameColumn()

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 UIDataEx

processRestoreState

public void processRestoreState(javax.faces.context.FacesContext context,
                                java.lang.Object state)
Overrides:
processRestoreState in class javax.faces.component.UIComponentBase

saveState

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

setDisplayLastModified

public void setDisplayLastModified(boolean displayLastModified)

Set the value of the displayLastModified property.


setDisplayCreated

public void setDisplayCreated(boolean displayCreated)

Set the value of the displayCreated property.


setDisplaySize

public void setDisplaySize(boolean displaySize)

Set the value of the displaySize property.


setDisplayType

public void setDisplayType(boolean displayType)

Set the value of the displayType property.


setFileNameTitle

public void setFileNameTitle(java.lang.String fileNameTitle)

Set the value of the filenameTitle property.


setHideWhen

public void setHideWhen(boolean hideWhen)

Set the value of the hideWhen property.


setCreatedTitle

public void setCreatedTitle(java.lang.String createdTitle)

Set the value of the createdTitle property.


setLastModifiedTitle

public void setLastModifiedTitle(java.lang.String lastModifiedTitle)

Set the value of the lastModifiedTitle property.


setSizeTitle

public void setSizeTitle(java.lang.String sizeTitle)

Set the value of the sizeTitle property.


setTypeTitle

public void setTypeTitle(java.lang.String typeTitle)

Set the value of the typeTitle property.


isAllowDelete

public boolean isAllowDelete()

Get the boolean value of the allowDelete property.

When true this adds a control to allow a user to delete a file.

Returns:
boolean

setAllowDelete

public void setAllowDelete(boolean allowDelete)

Set boolean value for the allowDelete property.

When true this adds a control to allow a user to delete a file.

Parameters:
boolean -

initBeforeContents

public void initBeforeContents(javax.faces.context.FacesContext context)
                        throws javax.faces.FacesException
Description copied from interface: FacesComponent
Perform component initialization before its children and facets are added.

Specified by:
initBeforeContents in interface FacesComponent
Throws:
javax.faces.FacesException

initAfterContents

public void initAfterContents(javax.faces.context.FacesContext context)
                       throws javax.faces.FacesException
Description copied from interface: FacesComponent
Perform component initialization after it's children and facets are added.

Specified by:
initAfterContents in interface FacesComponent
Throws:
javax.faces.FacesException

getEffectiveSizeValue

public java.lang.String getEffectiveSizeValue()
The size value for the current row


getEffectiveFileNameHrefValue

public java.lang.String getEffectiveFileNameHrefValue()

getEffectiveLastModifiedValue

public java.util.Date getEffectiveLastModifiedValue()

getEffectiveCreatedValue

public java.util.Date getEffectiveCreatedValue()

getEffectiveFileNameValue

public java.lang.String getEffectiveFileNameValue()
Note this is a localizable string displayed in the file name column. To get the file name id use getFileId()

Returns:

getFileId

public java.lang.String getFileId()
The id of the current file, available while iterating through the download component.


getEffectiveTypeValue

public java.lang.String getEffectiveTypeValue()

resolveValue

protected java.lang.Object resolveValue()
Overrides:
resolveValue in class UIDataEx

getCurrentFileDownloadValue

public com.ibm.xsp.model.FileDownloadValue getCurrentFileDownloadValue()
Returns the current FileDownloadValue of this instance, will be null if not set.