SAP NetWeaver '04

com.sapportals.wcm.rendering.resource
Class AbstractResourceRenderer

[contained in: com.sap.km.cm.ui.flex.par - km.shared.ui.flex.resource_api.jar]
com.sapportals.wcm.rendering.resource.AbstractResourceRenderer
All Implemented Interfaces:
ILayoutObject, IResourceRenderer

public abstract class AbstractResourceRenderer
implements IResourceRenderer


Field Summary
static java.lang.String BLANK
           
static java.lang.String CM_RND_ACTION
           
static java.lang.String CM_RND_CHILDCOUNT
           
static java.lang.String CM_RND_CHILDCOUNT_WITH_BRACKETS
           
static java.lang.String CM_RND_COLLABORATION_STATUS
           
static java.lang.String CM_RND_CONTENT_LINK
           
static java.lang.String CM_RND_DESCRIPTION
           
static java.lang.String CM_RND_DISPLAYNAME
           
static java.lang.String CM_RND_ICON
           
static java.lang.String CM_RND_IMAGE
           
static java.lang.String CM_RND_LOCK
           
static java.lang.String CM_RND_SUBSCRIPTION
           
static java.lang.String COMMA
           
static java.lang.String DEFAULT_VISIBLE_PROPERTIES
           
static java.lang.String NBSP
           
 
Fields inherited from interface com.sapportals.wcm.rendering.resource.IResourceRenderer
LINK_CONTENT, LINK_CONTENT_ONLY_FOLDERS, LINK_DETAILS, LINK_OFF
 
Fields inherited from interface com.sapportals.wcm.rendering.base.ILayoutObject
DEF_VALUE, KEY, LINE_BREAK
 
Constructor Summary
AbstractResourceRenderer()
          Constructor for the AbstractResourceRenderer object
AbstractResourceRenderer(IProxy proxy, IResource res)
          Constructor for the AbstractResourceRenderer object
 
Method Summary
 java.lang.String getAlias()
          implementation of the ILayoutObject-interface ************
protected  java.lang.String getCustomImage(IPropertyName propertyName)
          returns the complete path to access the custom image-file specified for the current IResource of the renderer.
protected  java.lang.String getDefaultIcon()
           
 IProperty getProperty(IPropertyName name)
          Gets the property attribute of the AbstractResourceRenderer object
 java.util.Map getPropertyBag()
           
 java.util.List getPropertyListByMetaName(IMetaName metaName)
          Gets the propertyListByMetaName attribute of the AbstractResourceRenderer object
protected  IPropertyNameList getPropertyNameList()
           
protected  IResource getResource()
           
 ResourceStateType getResourceState()
          Gets the resourceState attribute of the AbstractResourceRenderer object
protected  com.sapportals.wcm.control.util.property.IPropertyColumn[] getVisibleProperties()
           
protected  void initialize()
          This method is called by the constructor.
protected  IResourceRenderer initNewInstance(IResourceRenderer rr)
           
protected  boolean isPreviewEnabled()
          checks, if the current ui implements functionality to preview a resource.
protected  boolean isVisible()
           
 com.sapportals.htmlb.Component render()
          renders the current IResource depending on the configuration available for this resource and on the implementation of the rendering class.
 com.sapportals.htmlb.Component render(IProperty property, int linktype)
          Description of the Method
 com.sapportals.htmlb.Component render(IProperty property, java.lang.String target)
          Description of the Method
 com.sapportals.htmlb.Component render(java.lang.String displayname, int linktype)
          Description of the Method
 com.sapportals.htmlb.Component renderAction()
          Description of the Method
protected  com.sapportals.htmlb.Component renderContentLink(com.sapportals.htmlb.Component comp)
          creates a link to show the content of the given resource.
protected  com.sapportals.htmlb.Component renderContentLink(IResource resource, com.sapportals.htmlb.Component comp)
          creates a link to show the content of the given resource.
protected  com.sapportals.htmlb.Component renderDetailsLink(IResource resource, com.sapportals.htmlb.Component comp)
           
static com.sapportals.htmlb.Component renderEmptyTextView()
          can be used by methods that cannot render their result (e.g. because of exceptions or missing/invalid parameters) and cannot return null .
 com.sapportals.htmlb.Component renderIcon()
          Description of the Method
 com.sapportals.htmlb.Component renderIconContentlink()
          Description of the Method
 com.sapportals.htmlb.Component renderImage()
          Description of the Method
 com.sapportals.htmlb.Component renderImageContentlink()
          Description of the Method
 com.sapportals.htmlb.Component renderMetaProperty(IMetaName metaName, boolean hasContentLink)
          Description of the Method
 void setAlias(java.lang.String alias)
          Sets the alias attribute of the AbstractResourceRenderer object
 void setPropertyBag(java.util.Map propertyBag)
          Set a property bag for the resource.
 void setPropertyNameList(IPropertyNameList propnamelist)
          Sets the propertyNameList attribute of the AbstractResourceRenderer object
 void setResource(IResource resource)
          Sets the resource attribute of the AbstractResourceRenderer object
 void setResourceState(ResourceStateType type)
          implementation of the IResourceRenderer-interface *************
protected  void writeDebugInformation()
           
 
Methods inherited from interface com.sapportals.wcm.rendering.resource.IResourceRenderer
render
 
Methods inherited from interface com.sapportals.wcm.rendering.base.ILayoutObject
getConfiguration, getFlavor, getNewInstance, getParameter, getParameters, getSupportedParameters, is508enabled, setFlavor, setParameter, setParameters, setProxy
 

Field Detail

NBSP

public static final java.lang.String NBSP

BLANK

public static final java.lang.String BLANK

COMMA

public static final java.lang.String COMMA

CM_RND_ACTION

public static final java.lang.String CM_RND_ACTION

CM_RND_DISPLAYNAME

public static final java.lang.String CM_RND_DISPLAYNAME

CM_RND_ICON

public static final java.lang.String CM_RND_ICON

CM_RND_IMAGE

public static final java.lang.String CM_RND_IMAGE

CM_RND_DESCRIPTION

public static final java.lang.String CM_RND_DESCRIPTION

CM_RND_LOCK

public static final java.lang.String CM_RND_LOCK

CM_RND_CHILDCOUNT

public static final java.lang.String CM_RND_CHILDCOUNT

CM_RND_CHILDCOUNT_WITH_BRACKETS

public static final java.lang.String CM_RND_CHILDCOUNT_WITH_BRACKETS

CM_RND_COLLABORATION_STATUS

public static final java.lang.String CM_RND_COLLABORATION_STATUS

CM_RND_CONTENT_LINK

public static final java.lang.String CM_RND_CONTENT_LINK

CM_RND_SUBSCRIPTION

public static final java.lang.String CM_RND_SUBSCRIPTION

DEFAULT_VISIBLE_PROPERTIES

public static final java.lang.String DEFAULT_VISIBLE_PROPERTIES
Constructor Detail

AbstractResourceRenderer

public AbstractResourceRenderer(IProxy proxy,
                                IResource res)
Constructor for the AbstractResourceRenderer object
Parameters:
proxy - Description of the param
res - Description of the param

AbstractResourceRenderer

public AbstractResourceRenderer()
Constructor for the AbstractResourceRenderer object
Method Detail

initNewInstance

protected final IResourceRenderer initNewInstance(IResourceRenderer rr)

getAlias

public final java.lang.String getAlias()
implementation of the ILayoutObject-interface ************
Specified by:
getAlias in interface ILayoutObject
Returns:
The alias value

setAlias

public final void setAlias(java.lang.String alias)
Sets the alias attribute of the AbstractResourceRenderer object
Specified by:
setAlias in interface ILayoutObject
Parameters:
alias - The new alias value

setResourceState

public final void setResourceState(ResourceStateType type)
implementation of the IResourceRenderer-interface *************
Specified by:
setResourceState in interface IResourceRenderer
Parameters:
type - The new resourceState value

getResourceState

public final ResourceStateType getResourceState()
Gets the resourceState attribute of the AbstractResourceRenderer object
Specified by:
getResourceState in interface IResourceRenderer
Returns:
The resourceState value

setResource

public final void setResource(IResource resource)
Sets the resource attribute of the AbstractResourceRenderer object
Specified by:
setResource in interface IResourceRenderer
Parameters:
resource - The new resource value

render

public com.sapportals.htmlb.Component render()
                                      throws WcmException
Description copied from interface: IResourceRenderer
renders the current IResource depending on the configuration available for this resource and on the implementation of the rendering class. This might lead to very different layouts and available functionality. If a calling class (e.g. an ICollectionRenderer requires a more uniform rendering, it can call the different render-methods that allow the rendering of single attributes of the current IResource .
Specified by:
render in interface IResourceRenderer
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

render

public com.sapportals.htmlb.Component render(IProperty property,
                                             int linktype)
                                      throws WcmException
Description of the Method
Specified by:
render in interface IResourceRenderer
Parameters:
property - Description of the param
linktype - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

render

public com.sapportals.htmlb.Component render(java.lang.String displayname,
                                             int linktype)
                                      throws WcmException
Description of the Method
Specified by:
render in interface IResourceRenderer
Parameters:
displayname - Description of the param
linktype - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

render

public com.sapportals.htmlb.Component render(IProperty property,
                                             java.lang.String target)
                                      throws WcmException
Description of the Method
Specified by:
render in interface IResourceRenderer
Parameters:
property - Description of the param
target - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderAction

public com.sapportals.htmlb.Component renderAction()
                                            throws WcmException
Description of the Method
Specified by:
renderAction in interface IResourceRenderer
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderIcon

public com.sapportals.htmlb.Component renderIcon()
                                          throws WcmException
Description of the Method
Specified by:
renderIcon in interface IResourceRenderer
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderIconContentlink

public com.sapportals.htmlb.Component renderIconContentlink()
                                                     throws WcmException
Description of the Method
Specified by:
renderIconContentlink in interface IResourceRenderer
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderImage

public com.sapportals.htmlb.Component renderImage()
                                           throws WcmException
Description of the Method
Specified by:
renderImage in interface IResourceRenderer
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderImageContentlink

public com.sapportals.htmlb.Component renderImageContentlink()
                                                      throws WcmException
Description of the Method
Specified by:
renderImageContentlink in interface IResourceRenderer
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

setPropertyNameList

public final void setPropertyNameList(IPropertyNameList propnamelist)
Sets the propertyNameList attribute of the AbstractResourceRenderer object
Specified by:
setPropertyNameList in interface IResourceRenderer
Parameters:
propnamelist - The new propertyNameList value

initialize

protected void initialize()
This method is called by the constructor. It is supposed to initialize the list of parameters, that the renderer understands and uses to modify the result of its render methods. If this method is not overwritten by the extending class, no parameters will be passed to this class and its behavior remains unchanged regardless of settings done for this resource (e.g. in iView settings)

getResource

protected final IResource getResource()
Returns:
the value of the member variable.

getPropertyNameList

protected final IPropertyNameList getPropertyNameList()
Returns:
the value of the member variable.

getDefaultIcon

protected final java.lang.String getDefaultIcon()
                                         throws WcmException
Returns:
the complete path to the default icon for the current resource.
Throws:
WcmException - Description of the Exception
WdfException, - that holds the WcmException thrown in the called framework methods.

renderContentLink

protected com.sapportals.htmlb.Component renderContentLink(IResource resource,
                                                           com.sapportals.htmlb.Component comp)
                                                    throws WcmException
creates a link to show the content of the given resource. If the resource is an ICollection, the link will navigate into the contents of this collection. If a preview control is available, the link will trigger an eent to display the contents in this control. Otherwise, the resource will be displayed in a new browser window. If a WcmException is thrown while execution, the given Component will be returned without a link.
Parameters:
comp - Description of the param
resource - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderContentLink

protected com.sapportals.htmlb.Component renderContentLink(com.sapportals.htmlb.Component comp)
                                                    throws WcmException
creates a link to show the content of the given resource. If the resource is an ICollection, the link will navigate into the contents of this collection. If a preview control is available, the link will trigger an eent to display the contents in this control. Otherwise, the resource will be displayed in a new browser window. If a WcmException is thrown while execution, the given Component will be returned without a link.
Parameters:
comp - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

renderDetailsLink

protected com.sapportals.htmlb.Component renderDetailsLink(IResource resource,
                                                           com.sapportals.htmlb.Component comp)
                                                    throws WcmException
Parameters:
resource - Description of the param
comp - Description of the param
Returns:
a link to the details-iView of the given IResource . This link will open a new browser-window. It uses the RendererResourceLink to calculate the link-reference
Throws:
WcmException - Description of the Exception

renderEmptyTextView

public static com.sapportals.htmlb.Component renderEmptyTextView()
can be used by methods that cannot render their result (e.g. because of exceptions or missing/invalid parameters) and cannot return null .
Returns:
an invisible piece of html.

isVisible

protected final boolean isVisible()
Returns:
The visible value

getCustomImage

protected final java.lang.String getCustomImage(IPropertyName propertyName)
                                         throws WcmException
returns the complete path to access the custom image-file specified for the current IResource of the renderer. If none is specified or if an exception occurs, the method returns null. If an exception occurs, the default-icon is returned. The caught exception WcmException is self-logging, so no logging is needed. Please note, that a user with missing permissions will not be able to retrieve the custom image and therefore the default image is returned, although a custom image is defined for the resource.
Parameters:
propertyName - Description of the param
Returns:
The customImage value
Throws:
WcmException - Description of the Exception
WdfException - If also the default icon is not available

getVisibleProperties

protected final com.sapportals.wcm.control.util.property.IPropertyColumn[] getVisibleProperties()
Returns:
an IPropertyColumn[] that is created out of the information from the IParameters set for this renderer. Might return null

isPreviewEnabled

protected boolean isPreviewEnabled()
checks, if the current ui implements functionality to preview a resource. This depends on the mimetype of the current resource and the current ILayoutController
Returns:
The previewEnabled value

writeDebugInformation

protected final void writeDebugInformation()

renderMetaProperty

public com.sapportals.htmlb.Component renderMetaProperty(IMetaName metaName,
                                                         boolean hasContentLink)
                                                  throws WcmException
Description of the Method
Specified by:
renderMetaProperty in interface IResourceRenderer
Parameters:
metaName - Description of the param
hasContentLink - Description of the param
Returns:
Description of the Return Value
Throws:
WcmException - Description of the Exception

getProperty

public IProperty getProperty(IPropertyName name)
                      throws WcmException
Gets the property attribute of the AbstractResourceRenderer object
Parameters:
name - Description of the param
Returns:
The property value
Throws:
WcmException - Exception raised in failure situation

getPropertyListByMetaName

public java.util.List getPropertyListByMetaName(IMetaName metaName)
                                         throws WcmException
Gets the propertyListByMetaName attribute of the AbstractResourceRenderer object
Parameters:
metaName - Description of the param
Returns:
The propertyListByMetaName value
Throws:
WcmException - Exception raised in failure situation

getPropertyBag

public java.util.Map getPropertyBag()
Specified by:
getPropertyBag in interface IResourceRenderer
Returns:
Returns a property bag for a resource contained in the list. Returns null if the specified resource is not contained in the list or no property bag is associated with the resource.

setPropertyBag

public void setPropertyBag(java.util.Map propertyBag)
                    throws WcmException
Set a property bag for the resource.
Specified by:
setPropertyBag in interface IResourceRenderer
Parameters:
propertyBag - Properties to store.
Throws:
WcmException - If the specified resource is not contained in the list.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.