SAP NetWeaver '04

Package com.sapportals.wcm.rendering.resource

Contains interfaces for rendering a resource on the user interface.

See:
          Description

Interface Summary
IResourceRenderer This interface is used to render a single IResource and its Properties.
 

Class Summary
AbstractResourceRenderer  
ResourceNavigationRenderer This class can be used to take care of the complete rendering of a resource.
ResourceRendererFactory This class is a singleton factory, creating new instances of IResourceRenderer.
 

Package com.sapportals.wcm.rendering.resource Description

Contains interfaces for rendering a resource on the user interface.

Package Specification

Purpose
Detailed Concept
Interfaces and Classes
Configuration
Implementation Notes

Purpose

The resource renderer package is one of several packages in the KM framework that enable flexible rendering of explorer controls. Its task is to render a single resource. It may use classes from the package uicommand to delegate some of its responsibilities. Instances of the IResourceRenderer are provided by the ResourceRendererFactory and can easily be requested from it. An IResourceRenderer can display a resource as a whole or just return Components that render a single property of the resource.

Detailed Concept

IResourceRenderer can be used by controls or ICollectionRenderer objects to delegate the task of rendering a resource or individual properties of a resource. As the selection of an IResourceRenderer is dynamic and not defined at compilation time, it allows for a more flexible user interface. A control or ICollectionRenderer might decide to render nothing by itself and let all be done by a rendering class. The IResourceRenderer can again delegate some of its rendering to helper classes - especially the command rendering can be done by the classes from the uicommand package.  

No persistence is defined for IResourceRenderer, as the selection of resources is handled by the ICollectionRenderer  and navigation and actions by the AbstractProxyControl.

Interfaces and Classes

The IResourceRenderer defines the layout of the resource it is responsible for rendering. This can either be the complete resource or just individual properties of the resource. This is reflected in the different methods of the class: The render() method without parameters is called to render the resource exactly as defined by the renderer. If the calling class wants more control over the layout, it can call render() methods with parameters. These methods only return small htmlb components which can be combined as desired by the calling class.

IResourceRenderer extends the ILayoutObject interface. The methods getSupportedParameters() and setParameters() are central for the configuration of the renderer. With the get method, the renderer publishes the list of parameters it accepts to modify the way in which it renders a list of resources, e.g. the style for primary texts of a resource. With the set method, it receives values for these parameters and changes the rendering of the resource accordingly.

The ResourceRendererFactory  is the central and only entry point to obtain valid and ready-to-use instances. It is responsible for checking the current configuration and returning the fitting class or, if none is defined, the default class. The instance tath is returned is already fully configured. 

Configuration

Resource renderers can be configured at two locations in the configuration framework. They are referenced under ResourceRendererSettings (Content Management -> UserInterface ->Settings -> ResourceRendererSettings) and they are defined under ResourceRenderer (Content Management ->UserInterface ->Mapping ->ResourceRenderer).

The following attributes are available:

Property Required Description
renderingclass Yes Class that implements the IResourceRenderer interface
description No Short description of the controls and flavors used within this layout controller
alias Yes Unique name to identify the IResourceRenderer to use. Within the configuration, only the alias is used, never the original Java name of the class.

Different implementations of IResourceRendereruse different configuration parameters. Details can be found in the documentation for the configuration of the resource renderer settings.

Implementation Notes

The IResourceRenderer object and ResourceRendererFactory work in close coordination with other elements of the KM framework related to rendering. When, for example, a particular folder or resource has to be rendered with an IResourceRenderer, the process is as follows:

An AbstractProxyControl instance is informed, via an event, that a folder must be rendered. In response, the proxy requests an ILayoutController object from the LayoutControllerFactory. It then calls the render method of the ILayoutControllerlayout controller. This can use several controls to render the folder. These controls use the ICollectionRendererFactory to retrieve ICollectionRenderer instances.  The ICollectionRendereruses IResourceRenderers,that are provided by the ResourceRendererFactory, to further delegate rendering. It also uses IUICommands, provided by the UICommandFactory, to delegate the creation of commands for the displayed resources.


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.