com.fatwire.cs.ui.view.renderer
Class AssetRenderUtil

java.lang.Object
  extended by com.fatwire.cs.ui.view.renderer.AssetRenderUtil

public class AssetRenderUtil
extends java.lang.Object

This class is a generic asset utility class to provide operation helper methods to create, display and render asset attributes in JSF UI componets.


Field Summary
static java.lang.String CONTENT
           
static java.lang.String MARKETING
           
static java.lang.String META_DATA
           
static java.lang.String RELATIONS
           
 
Constructor Summary
AssetRenderUtil()
           
 
Method Summary
static void addStandardConverters(ValueHolder component, AttributeDef def)
          Add all neccessary converters for component based upon definition.
static void addValueBinding(UIComponent component, AttributeDataBinding bindingPattern, int index)
          Used to create standard binding for component based upon current asset data in session
static RenderedComponents createRenderComponents(java.lang.String label, UIComponent controls, java.lang.String toolTip, java.lang.String labelStyle)
          Basic Implementation to create and render an attribute.
static RenderedComponents createRenderedComponents(java.lang.String label, java.util.List<UIComponent> controls, java.lang.String toolTip, java.lang.String labelStyle)
          Basic implementation delegated out from attribute renderers for outside classes to use.
static UIComponent displayAsset(AssetId assetID, java.lang.String bindingPattern)
          Properly display an asset, possibly as a link if appropriate.
static UIComponent displayAsset(AssetId assetID, java.lang.String bindingPattern, java.lang.String attrId)
          Properly display an asset, possibly as a link if appropriate
static UIComponent displayAssetWithoutLink(AssetId assetID, java.lang.String bindingPattern)
          Properly display an asset, with any link
static AssetEditPane getDefaultAssetEditPane(Asset asset)
          This method returns the default asset edit pane.
static java.lang.String getLabelText(java.lang.Object value)
          Adds a colon to the label
static void placeControlsAndLabel(RenderedComponents renderedComponents)
          Places the controls and label in two columns.If the renderers need a different layout they can overwrite it.
static HtmlRowLayout renderAttribute(java.lang.String label, UIComponent controls, java.lang.String toolTip, java.lang.String labelStyle)
          Basic Implementation to render an attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT

public static final java.lang.String CONTENT
See Also:
Constant Field Values

META_DATA

public static final java.lang.String META_DATA
See Also:
Constant Field Values

RELATIONS

public static final java.lang.String RELATIONS
See Also:
Constant Field Values

MARKETING

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

AssetRenderUtil

public AssetRenderUtil()
Method Detail

displayAsset

public static UIComponent displayAsset(AssetId assetID,
                                       java.lang.String bindingPattern)
                                throws UIException
Properly display an asset, possibly as a link if appropriate. The display type is considered.

Parameters:
assetID -
bindingPattern -
Returns:
Generic UI JSF component Container component
Throws:
UIException

displayAsset

public static UIComponent displayAsset(AssetId assetID,
                                       java.lang.String bindingPattern,
                                       java.lang.String attrId)
                                throws UIException
Properly display an asset, possibly as a link if appropriate

Parameters:
assetID -
bindingPattern - value binding
attrId - attribute identfier
Returns:
JSF component Generic UI Container component
Throws:
UIException

displayAssetWithoutLink

public static UIComponent displayAssetWithoutLink(AssetId assetID,
                                                  java.lang.String bindingPattern)
                                           throws UIException
Properly display an asset, with any link

Parameters:
assetID - the Asset ID
bindingPattern - value binding
Returns:
Generic UI Container component
Throws:
UIException

renderAttribute

public static HtmlRowLayout renderAttribute(java.lang.String label,
                                            UIComponent controls,
                                            java.lang.String toolTip,
                                            java.lang.String labelStyle)
                                     throws UIException
Basic Implementation to render an attribute. Convenience utiltiy for outside renderers to replicate the look and feel of our UI.

Parameters:
label - to display
controls - the actual data replresentation
toolTip - tool tip to pop up in the label onMouseover
labelStyle - style used (I.E Changes for required fields)
Returns:
Throws:
UIException

createRenderComponents

public static RenderedComponents createRenderComponents(java.lang.String label,
                                                        UIComponent controls,
                                                        java.lang.String toolTip,
                                                        java.lang.String labelStyle)
                                                 throws UIException
Basic Implementation to create and render an attribute. Convenience utiltiy for outside renderers to replicate the look and feel of our UI.

Parameters:
label - to display
controls - the actual data replresentation
toolTip - tool tip to pop up in the label onMouseover
labelStyle - style used (I.E Changes for required fields)
Throws:
UIException

createRenderedComponents

public static RenderedComponents createRenderedComponents(java.lang.String label,
                                                          java.util.List<UIComponent> controls,
                                                          java.lang.String toolTip,
                                                          java.lang.String labelStyle)
                                                   throws UIException
Basic implementation delegated out from attribute renderers for outside classes to use. This creates all of the rendererd components which will eventually be formated via the placeControlsAndLabel method.

Parameters:
label - to display
controls - the actual data replresentation
toolTip - tool tip to pop up in the label onMouseover
labelStyle - style used (I.E Changes for required fields)
Returns:
Throws:
UIException

placeControlsAndLabel

public static void placeControlsAndLabel(RenderedComponents renderedComponents)
Places the controls and label in two columns.If the renderers need a different layout they can overwrite it.

Parameters:
renderedComponents - the set of componetes for label and controls

getLabelText

public static java.lang.String getLabelText(java.lang.Object value)
Adds a colon to the label

Parameters:
value -
Returns:
String

addStandardConverters

public static void addStandardConverters(ValueHolder component,
                                         AttributeDef def)
Add all neccessary converters for component based upon definition.

Parameters:
component - ValueHolder component used to add converters to. list of components created in createComponents
def - attribute defintion

addValueBinding

public static void addValueBinding(UIComponent component,
                                   AttributeDataBinding bindingPattern,
                                   int index)
Used to create standard binding for component based upon current asset data in session

Parameters:
component - to be bound
bindingPattern - of attribute
index - of data

getDefaultAssetEditPane

public static AssetEditPane getDefaultAssetEditPane(Asset asset)
This method returns the default asset edit pane. This method tries to get the default entries from the database if its not found it creates Content , MetaData.And it adds the userdefined fields to Content tab and system defined fields to MetaDataTab.If it found the default edit pane in the database it adds the field it does not have it to the tabs and returns it.

Parameters:
asset - the required asset for edit pane
Returns:
AssetEditPane.
Throws:
AssetAccessException


Copyright (c) 2003 - 2011 FatWire Corporation All Rights Reserved.