com.sapportals.wcm.rendering.collection.cm

Class CollectionTreeRenderer2

java.lang.Object
  extended by com.sapportals.wcm.rendering.collection.cm.CollectionTreeRenderer2
All Implemented Interfaces:
ICollectionInfo, IDelegatedReceiver, ILayoutObject, IResourceListProvider, IStartUriReceiver, INodeRenderer, ICollectionRenderer, ICollectionRendererParameterNameConst

public class CollectionTreeRenderer2
extends Object
implements ICollectionRenderer, ICollectionRendererParameterNameConst, IResourceListProvider, ICollectionInfo, IStartUriReceiver, INodeRenderer

This abstract class can be used when implementing new CollectionRenderer-Classes It provides persistence of selections (when mass actions are enabled), takes care of ResourceProperties, offers method to create sorting box in Control Persistence is realized by using IUMPrincipal.setTransientAttribute. This can lead to errounous behavior when the user hasn't worked for some time in the browser and the cache has expired.


Field Summary
static String BASE_BUNDLE
           
static String BLANK
           
static String NBSP
           
static String ON_NAVIGATE
           
static String ON_SELECT_FILTER
           
static String ON_SELECT_SORT
           
static String ON_TOGGLE_FILTER
           
static String ON_TOGGLE_SORT
           
static String RES_CONTENTSOF
           
static String RES_FILESOF
           
static String RES_FOLDERSOF
           
static String RES_SELECTRESOURCE
           
static String RES_SORTASCENDING
           
static String RES_SORTBY
           
static String RES_SORTDESCENDING
           
 
Fields inherited from interface com.sapportals.wcm.rendering.collection.ICollectionRenderer
ORDERED_COLLECTION, SORTED, UNSORTED
 
Fields inherited from interface com.sapportals.wcm.rendering.base.ILayoutObject
DEF_VALUE, KEY, LINE_BREAK
 
Fields inherited from interface com.sapportals.wcm.repository.service.layout.customizing.ICollectionRendererParameterNameConst
BACKGROUNDIMAGEPATH, BACKGROUNDIMAGESTYLE, BACKGROUNDIMAGESTYLE_MULTIPLE, BACKGROUNDIMAGESTYLE_SINGLE, BREADCRUMBSTYLE, BREADCRUMBSTYLE_BACK, BREADCRUMBSTYLE_DRPODOWN, BREADCRUMBSTYLE_HORIZONTAL, BREADCRUMBSTYLE_OFF, BREADCRUMBSTYLE_VERTICAL, BREADCRUMBVISIBILITYSTYLE, BREADCRUMBVISIBILITYSTYLE_DISABLEROOT, BREADCRUMBVISIBILITYSTYLE_INVISIBLE, BREADCRUMBVISIBILITYSTYLE_INVISIBLEROOT, BREADCRUMBVISIBILITYSTYLE_NOICON, BREADCRUMBVISIBILITYSTYLE_STANDARD, COLLECTION_ACTIONSTYLE, COLLECTION_ACTIONSTYLE_BUTTON, COLLECTION_ACTIONSTYLE_HOVER, COLLECTION_ACTIONSTYLE_LINK, COLLECTION_ACTIONSTYLE_MENU, COLLECTION_ACTIONSTYLE_OFF, COLLECTION_ACTIONSTYLE_SMALLBUTTON, COLLECTION_ACTIONSTYLE_TOOLBAR_BUTTON, COLUMNS, COLUMNSPACING, COLUMNSPACINGSTYLE, COLUMNSPACINGSTYLE_FIXED, COLUMNSPACINGSTYLE_MINIMUM, COMPONENTS, EMPTY_COLLECTION_FILE, EMPTY_COLLECTION_KEY, EMPTY_COLLECTION_STYLE, EMPTY_COLLECTION_STYLE_MESSAGE, EMPTY_COLLECTION_STYLE_OFF, EMPTY_COLLECTION_STYLE_TEXT, FILESELECTIONMODE_MULTIPLE, FILESELECTIONMODE_SINGLE, FILTEREXTENSION, FILTERMIMETYPE, FILTERRESOURCETYPE, FOLDERSELECTIONMODE_MULTIPLE, FOLDERSELECTIONMODE_SINGLE, GRIDORDERSTYLE, GRIDORDERSTYLE_COLUMN_MAJOR, GRIDORDERSTYLE_ROW_MAJOR, GROUP_STYLE, GROUP_STYLE_OFF, GROUP_STYLE_PRIMARYCOLOR, GROUP_STYLE_SAPCOLOR, GROUP_STYLE_SECONDARYBOX, GROUP_STYLE_SECONDARYBOXCOLOR, GROUP_STYLE_SECONDARYCOLOR, HEADER_TEXT_STYLE, HTML_FILENAME, IMAGEMAP, ITEMSELECTIONMODE, ITEMSELECTIONMODE_MULTIPLE, ITEMSELECTIONMODE_OFF, ITEMSELECTIONMODE_SINGLE, LINKSSTYLE, LINKSSTYLE_ALL, LINKSSTYLE_EXTERNAL, LINKSSTYLE_INTERNAL, LINKSSTYLE_OFF, LINKSSTYLE_VISIBLE, MASSACTIONSTYLE, MASSACTIONSTYLE_BUTTON, MASSACTIONSTYLE_HOVER, MASSACTIONSTYLE_ICON, MASSACTIONSTYLE_LINK, MASSACTIONSTYLE_MENU, MASSACTIONSTYLE_OFF, MASSACTIONSTYLE_SMALLBUTTON, MASSACTIONSTYLE_TOOLBAR_BUTTON, MASSACTIONSTYLE_VERTICAL_LINK, MAX_NUM_OF_TABS, NO_OF_CHILD_FOR_NODE, NO_TAB_CONTENT, OPEN_NODES_STYLE, OPEN_NODES_STYLE_All, OPEN_NODES_STYLE_LAST_SELECTED, OPENTARGETTYPE, OPENTARGETTYPE_FIXED, OPENTARGETTYPE_NEW, OPENTARGETTYPE_OFF, OPENTARGETTYPE_SELF, PAGER_LINK_COUNT, PAGER_SHOW_NUMBER, PROPERTY_COLUMN_HEADER_STYLE, PROPERTY_COLUMN_HEADER_STYLE_LIST, PROPERTY_COLUMN_HEADER_STYLE_MENUE, PROPERTY_COLUMN_HEADER_STYLE_OFF, PROPERTY_COLUMN_HEADER_STYLE_TABLE, PROPERTY_COLUMN_HEADER_STYLE_TRANSPARENT, PROPERTYCOLUMNS, RESIZEHEIGHTSTYLE, RESIZEHEIGHTSTYLE_COMPACT, RESIZEHEIGHTSTYLE_OFF, RESIZEHEIGHTSTYLE_STRETCH, RESIZEWIDHTSTYLE, RESIZEWIDHTSTYLE_COMPACT, RESIZEWIDHTSTYLE_OFF, RESIZEWIDHTSTYLE_STRETCH, RESOURCE_LIST_FILTER, RESOURCE_LIST_FILTER_DEFAULT, ROWBACKGROUNDSTYLE, ROWS, ROWSPACING, ROWSPACINGSTYLE, ROWSPACINGSTYLE_ALTERNATING, ROWSPACINGSTYLE_BACKGROUND, ROWSPACINGSTYLE_COLUMNALTERNATING, ROWSPACINGSTYLE_COLUMNSEPARATED, ROWSPACINGSTYLE_FIXED, ROWSPACINGSTYLE_LINESEPARATED, ROWSPACINGSTYLE_MINIMUM, ROWSPACINGSTYLE_ROWALTERNATING, ROWSPACINGSTYLE_TRANSPARENT, SHOW_HIDDEN, SHOW_TREE_ROOT_NODE, SHOWFILESSTYLE, SHOWFILESSTYLE_ALL, SHOWFILESSTYLE_NOLINK, SHOWFILESSTYLE_OFF, SHOWFILESTYLE_ONLYLINK, SHOWFOLDERSSTYLE, SHOWFOLDERSSTYLE_ALL, SHOWFOLDERSSTYLE_NOLINK, SHOWFOLDERSSTYLE_OFF, SHOWFOLDERSSTYLE_ONLYLINK, SHOWFOLDERTITLE, SHOWUSERID, SHOWUSERNAME, SORT_ENABLED, SORT_ORDER, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING, SORT_PROPERTY, TAB_BODY_FLAVOR, TAB_STYLE_SAFE, UI_COLL_RENDERER, UI_GROUP_COLLECTION, UI_GROUP_MASS, USE_SCROLL_CONTAINER, VERTICAL_ALIGNMENT, VERTICAL_ALIGNMENT_BASELINE, VERTICAL_ALIGNMENT_BOTTOM, VERTICAL_ALIGNMENT_MIDDLE, VERTICAL_ALIGNMENT_TOP
 
Constructor Summary
CollectionTreeRenderer2()
           
 
Method Summary
protected  void filterResourceList(IResource resource, IResourceList list)
           
 String getAlias()
           
 IResourceList getChildren(IResource resource)
          Implementation of ICollectionInfo
 IResourceList getChildren(IResource resource, boolean visible, boolean collections, boolean links)
           
 int getChildrenCount(IResource resource, boolean visible, boolean collections, boolean links)
           
protected  ComponentValueMap getComponentValueMap()
           
 String getConfiguration(String format)
          returns the supported parameters and the default values the class uses
 IFlavor getFlavor()
           
 String getID()
           
 ILayoutObject getNewInstance()
           
 String getParameter(IParameterName key)
           
 IParameters getParameters()
          returns all parameters used in this layout object.
 ICollection getParentCollection()
           
protected  IProxy getProxy()
           
 IResourceContext getResourceContext()
           
 String getResourceListID()
           
 IResourceList getSelectedResources()
           
 IParameterName[] getSupportedParameters()
          returns all parameters which are used in this layout object.
 boolean hasChildren(IResource resource)
           
 boolean is508enabled()
           
 boolean isAncestorOf(IResource parent, IResource child)
           
 boolean isCollection(IResource resource)
           
 IRenderingEvent onEvent(com.sapportals.htmlb.event.Event event)
           
 void readInputData(com.sapportals.htmlb.page.DynPage page)
          reads out the input of the modifiable Components rendered by the implementing class.
 void refresh()
          asks the implementing class to refresh its list of IResource objects.
 com.sapportals.htmlb.Component render()
           
 com.sapportals.htmlb.Component renderAll()
           
protected  com.sapportals.htmlb.Component renderDecorations(com.sapportals.htmlb.Component comp)
           
 com.sapportals.htmlb.Component renderNodeComponent(IResource resource)
           
 void resetSelection()
          clears the list of selected resources
protected  void set508enabled(boolean imp508)
           
 void setAlias(String alias)
          set the alias
 void setFlavor(IFlavor impFlavor)
          is called from the factory after instantiating a new layout object to set the flavor information coming from the Control or ILayoutController , asking for special instances of the IResourceRenderer used by the implementing class
 String setParameter(IParameterName key, String value)
           
 void setParameters(IParameters parameters)
          is called from the factory after initializing this layout object.
 void setParentCollection(ICollection parent)
          is called from the factory after instantiating a new collection renderer to set the collection which has to be rendered.
 void setProxy(IProxy proxy)
          is called from the factory after instantiating a new layout object to set the proxy which is needed as possible target for actions.
 void setResourceContext(IResourceContext context)
          sets the context-attribute for the renderer.
 void setResourceListID(String value)
           
 void setSortDefinition(SortDefinition sd)
          sets the sort-definition attribute for the implementing class.
 void setStartUri(String startUri)
           
 void setSupportedParameters(IParameterName[] impKeys)
           
 void setTypedResourceList(ITypedResourceList typedresourcelist)
          is called from the factory after instantiating a new collection renderer to set the resourceList which has to be rendered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RES_CONTENTSOF

public static final String RES_CONTENTSOF
See Also:
Constant Field Values

RES_FILESOF

public static final String RES_FILESOF
See Also:
Constant Field Values

RES_FOLDERSOF

public static final String RES_FOLDERSOF
See Also:
Constant Field Values

RES_SORTBY

public static final String RES_SORTBY
See Also:
Constant Field Values

RES_SORTDESCENDING

public static final String RES_SORTDESCENDING
See Also:
Constant Field Values

RES_SORTASCENDING

public static final String RES_SORTASCENDING
See Also:
Constant Field Values

RES_SELECTRESOURCE

public static final String RES_SELECTRESOURCE
See Also:
Constant Field Values

BASE_BUNDLE

public static final String BASE_BUNDLE
See Also:
Constant Field Values

ON_SELECT_SORT

public static final String ON_SELECT_SORT
See Also:
Constant Field Values

ON_TOGGLE_SORT

public static final String ON_TOGGLE_SORT
See Also:
Constant Field Values

ON_SELECT_FILTER

public static final String ON_SELECT_FILTER
See Also:
Constant Field Values

ON_TOGGLE_FILTER

public static final String ON_TOGGLE_FILTER
See Also:
Constant Field Values

ON_NAVIGATE

public static final String ON_NAVIGATE
See Also:
Constant Field Values

NBSP

public static final String NBSP
See Also:
Constant Field Values

BLANK

public static final String BLANK
See Also:
Constant Field Values
Constructor Detail

CollectionTreeRenderer2

public CollectionTreeRenderer2()
Method Detail

getNewInstance

public ILayoutObject getNewInstance()
Specified by:
getNewInstance in interface ILayoutObject
Returns:
a new instance of the implementing class

setStartUri

public void setStartUri(String startUri)
Specified by:
setStartUri in interface IStartUriReceiver

renderAll

public com.sapportals.htmlb.Component renderAll()
                                         throws com.sapportals.wcm.WcmException
Specified by:
renderAll in interface ICollectionRenderer
Returns:
Component an htmlb-Component that will be displayed. The calling class can include this component in another htmlb-Component.
Throws:
com.sapportals.wcm.WcmException

render

public com.sapportals.htmlb.Component render()
                                      throws com.sapportals.wcm.WcmException
Throws:
com.sapportals.wcm.WcmException

renderDecorations

protected com.sapportals.htmlb.Component renderDecorations(com.sapportals.htmlb.Component comp)
                                                    throws com.sapportals.wcm.WcmException
Throws:
com.sapportals.wcm.WcmException

getComponentValueMap

protected ComponentValueMap getComponentValueMap()
                                          throws com.sapportals.wcm.WcmException
Throws:
com.sapportals.wcm.WcmException

setProxy

public final void setProxy(IProxy proxy)
Description copied from interface: ILayoutObject
is called from the factory after instantiating a new layout object to set the proxy which is needed as possible target for actions. ICollectionRenderer can use IResourceRenderer and IUICommand to render the given resource. These classes need the proxy for the rendering of their links. The implementing class needs the proxy to retrieve these classes using the respecting factory-classes ResourceRendererFactory and UICommandFactory

Specified by:
setProxy in interface ILayoutObject
Parameters:
proxy - the WdfPfoxy that acts as an outer container for the rendering

getProxy

protected final IProxy getProxy()

setFlavor

public final void setFlavor(IFlavor impFlavor)
Description copied from interface: ILayoutObject
is called from the factory after instantiating a new layout object to set the flavor information coming from the Control or ILayoutController , asking for special instances of the IResourceRenderer used by the implementing class

Specified by:
setFlavor in interface ILayoutObject

getFlavor

public final IFlavor getFlavor()
Specified by:
getFlavor in interface ILayoutObject
Returns:
the flavor set for the implementing class

is508enabled

public final boolean is508enabled()
Specified by:
is508enabled in interface ILayoutObject
Returns:
flag, if this class renders its output in a way that is suited for blind people of people with viewing disabilities

set508enabled

protected final void set508enabled(boolean imp508)

getConfiguration

public final String getConfiguration(String format)
Description copied from interface: ILayoutObject
returns the supported parameters and the default values the class uses

Specified by:
getConfiguration in interface ILayoutObject

setParentCollection

public void setParentCollection(ICollection parent)
Description copied from interface: ICollectionRenderer
is called from the factory after instantiating a new collection renderer to set the collection which has to be rendered. Instead of this method, the setTypedResourceList(ITypedResourceList resourcelist) method is called, i.e. when a search result has to be rendered.

Specified by:
setParentCollection in interface ICollectionRenderer
Parameters:
parent - the collection to render (and whose chidren to render)

getParentCollection

public final ICollection getParentCollection()

setTypedResourceList

public final void setTypedResourceList(ITypedResourceList typedresourcelist)
Description copied from interface: ICollectionRenderer
is called from the factory after instantiating a new collection renderer to set the resourceList which has to be rendered. Instead of this method, the setParentCollection(ICollection collection) method is called, i.e. when a folder has to be rendered

Specified by:
setTypedResourceList in interface ICollectionRenderer
Parameters:
typedresourcelist - the resourcelist to render (and whose members to render)

getParameter

public final String getParameter(IParameterName key)
Specified by:
getParameter in interface ILayoutObject
Returns:
the current entry for the given key or null. Note: a returned null does not indicate, that the ILayoutObject does not support this parameter!

getSupportedParameters

public final IParameterName[] getSupportedParameters()
Description copied from interface: ILayoutObject
returns all parameters which are used in this layout object. Only parameters listed here will be set from the factory.

Specified by:
getSupportedParameters in interface ILayoutObject
Returns:
a collection of all parameters that are used in the instance of the implementing class to modify the rendered output.
See Also:
ILayoutObject.setParameters(com.sapportals.wcm.repository.service.layout.customizing.IParameters)

setSupportedParameters

public final void setSupportedParameters(IParameterName[] impKeys)

getParameters

public final IParameters getParameters()
Description copied from interface: ILayoutObject
returns all parameters used in this layout object.

Specified by:
getParameters in interface ILayoutObject
Returns:
the hashtable of all parameters that are supported and set by the implementing class

resetSelection

public final void resetSelection()
Description copied from interface: IResourceListProvider
clears the list of selected resources

Specified by:
resetSelection in interface IResourceListProvider

setParameters

public final void setParameters(IParameters parameters)
Description copied from interface: ILayoutObject
is called from the factory after initializing this layout object. Only parameters listed in the IParameterName[] getSupportedParameters() are set by the factory. With this method the rendering of the implementing class can be influenced. Classes can - but do not have to - react on the parameters supplied in this method

Specified by:
setParameters in interface ILayoutObject
Parameters:
parameters - - the parameters retrieved from different sources (iView, OTH...) that influence the way the implementing class renders its output. If the parameter is not found in the class' getSupportedParameters, the value will not be set as parameter for this class. If for a certain key, no value is found in the given IParameters, the default value set in the class will not be overwritten. Example: The class returns as supported parameters the keys "A", "B". It has set the default parameters, so we find the key-value pairs: "A" -> a "B" -> b This method is called, with the following hashtable entries: "A" -> aa "C" -> cc After the method is called, the class holds following key-vlaue pairs: "A" -> aa (overwritten by passed hashtable values) "B" -> b (not overwritten, because the hashtable returned null for this key The key-value pair "C" -> cc is not used in the class, because the key was not found in its getSupportedParameters

setParameter

public final String setParameter(IParameterName key,
                                 String value)
Specified by:
setParameter in interface ILayoutObject
Parameters:
key - - the key of the parameter
value - - the value of the parameter Overwrites an existing entry of the parameters or adds it, if it is not set. Note: The Layout Object may not act on this parameter. To retrieve a list of supported parameters from an ILayoutObject instance

getSelectedResources

public final IResourceList getSelectedResources()
Specified by:
getSelectedResources in interface IResourceListProvider
Returns:
the list of resources that have been selected (e.g. by marking check boxes on a control) - must not return null

setResourceListID

public final void setResourceListID(String value)

getResourceListID

public final String getResourceListID()

renderNodeComponent

public com.sapportals.htmlb.Component renderNodeComponent(IResource resource)
                                                   throws com.sapportals.wcm.WcmException
Specified by:
renderNodeComponent in interface INodeRenderer
Throws:
com.sapportals.wcm.WcmException

filterResourceList

protected final void filterResourceList(IResource resource,
                                        IResourceList list)
                                 throws com.sapportals.wcm.WcmException
Throws:
com.sapportals.wcm.WcmException

getAlias

public String getAlias()
Specified by:
getAlias in interface ILayoutObject
Returns:
the alias

setAlias

public void setAlias(String alias)
set the alias

Specified by:
setAlias in interface ILayoutObject

getChildren

public IResourceList getChildren(IResource resource)
                          throws ResourceException,
                                 AccessDeniedException
Implementation of ICollectionInfo

Specified by:
getChildren in interface ICollectionInfo
Throws:
ResourceException
AccessDeniedException

getChildren

public IResourceList getChildren(IResource resource,
                                 boolean visible,
                                 boolean collections,
                                 boolean links)
                          throws ResourceException,
                                 AccessDeniedException
Specified by:
getChildren in interface ICollectionInfo
Throws:
ResourceException
AccessDeniedException

getChildrenCount

public int getChildrenCount(IResource resource,
                            boolean visible,
                            boolean collections,
                            boolean links)
                     throws ResourceException,
                            AccessDeniedException
Specified by:
getChildrenCount in interface ICollectionInfo
Throws:
ResourceException
AccessDeniedException

hasChildren

public boolean hasChildren(IResource resource)
                    throws ResourceException
Specified by:
hasChildren in interface ICollectionInfo
Throws:
ResourceException

isCollection

public boolean isCollection(IResource resource)
Specified by:
isCollection in interface ICollectionInfo

isAncestorOf

public boolean isAncestorOf(IResource parent,
                            IResource child)
                     throws ResourceException
Specified by:
isAncestorOf in interface ICollectionInfo
Throws:
ResourceException

setSortDefinition

public void setSortDefinition(SortDefinition sd)
Description copied from interface: ICollectionRenderer
sets the sort-definition attribute for the implementing class. This definition is used to specify the property the list is sorted by as well as the direction (top-down vs. bottom-up) of the sorting.

Specified by:
setSortDefinition in interface ICollectionRenderer

onEvent

public IRenderingEvent onEvent(com.sapportals.htmlb.event.Event event)
Specified by:
onEvent in interface IDelegatedReceiver

readInputData

public void readInputData(com.sapportals.htmlb.page.DynPage page)
Description copied from interface: ICollectionRenderer
reads out the input of the modifiable Components rendered by the implementing class.

Specified by:
readInputData in interface ICollectionRenderer

refresh

public void refresh()
Description copied from interface: ICollectionRenderer
asks the implementing class to refresh its list of IResource objects. This is needed, if a list that is displayed by this is modified after this has created its internal representation of these resources. This call is only useful, if the setParentCollection or setTypedResourceList method has been invoked in advance. This method can be very expensive, depending on the size of the resource list and the ordering and filtering calls that have to be carried out. In a standard scenario, this call is not needed, as the IProxyControl will refresh automatically all resource-list representations that use the proxy as persistence-layer. Implementations such as the AbstractCollectionRenderer may not react on this method at all, as they do not persist their resource list representations and therefore always have an up-to-date representation.

Specified by:
refresh in interface ICollectionRenderer

setResourceContext

public void setResourceContext(IResourceContext context)
Description copied from interface: ICollectionRenderer
sets the context-attribute for the renderer. Must not be null

Specified by:
setResourceContext in interface ICollectionRenderer

getResourceContext

public IResourceContext getResourceContext()
Specified by:
getResourceContext in interface ICollectionRenderer
Returns:
the context-attribute of the renderer. Does not return null

getID

public String getID()
Specified by:
getID in interface IResourceListProvider
Specified by:
getID in interface ICollectionRenderer
Returns:
the ID of the renderer. The renderer can obtain an ID that will be unique within one browser window by using the return value of IProxy's method register. This ID will be stable over http-requests.


Copyright 2011 SAP AG Complete Copyright Notice