Skip navigation links
SAP NetWeaver 7.50 SP 13 KMC

Package com.sapportals.wcm.rendering.collection

Contains interfaces for flexible rendering of collections or lists of resources.

See: Description

Package com.sapportals.wcm.rendering.collection Description

Contains interfaces for flexible rendering of collections or lists of resources.

Package Specification

Purpose
Detailed Concept
Interfaces and Classes
Configuration
Implementation Notes

Purpose

The collection renderer package is one of several packages in the KM framework that enable flexible rendering of explorer controls. Its task is to render a folder and its children or a list of resources and to allow the selection of these resources. For the execution of this task, it may delegate some of its responsibiliteis to classes from the packages uicommand and resourcerenderer. Instances of ICollectionRenderer are provided by the CollectionRendererFactory . An ICollectionRenderer can, for example, display a list of resources as a table, list, grid or as an image with clickable sections.

Detailed Concept

LayoutController can delegate the task of rendering lists of resources to an ICollectionRenderer. As the selection of an ICollectionRenderer  is dynamic and not defined at compilation time, it enables a more flexible user interface. A layoutcontroller can decide to render nothing by itself and to let the rendering classes perform the task. With this approach, the user interface can be created by choosing an ILayoutController   that, in turn, uses these collection renderer classes to perform the rendering. In this way, a different UIs can be created, using only the configuration. No new code is required to meet special requirements.

The package also enables the selection of resources for a mass command. In a standard use-case, an AbstractProxyControl is used as the command-executing instance. When it executes the command, it finds out all classes that implement the IResourceListProvider  interface and returns their list of selected resources.

Interfaces and Classes

The ICollectionRenderer defines the layout of the list of resources it renders. The list may be retrieved from the parent collection or provided by other framework components (like a search result list). The core responsibility of the renderer is to filter the given list of resources, sort them and display them to the user. However, implementations of the ICollectionRenderer can decide to focus on rendering only.

The ICollectionRenderer extends the ILayoutObject interface. The methods getSupportedParameters()and setParameters() play a central role in the configuration of the renderer. The behavior of most collection renderers can be customized. (for example, to control the number of columns displayed in a grid-layout) .With the get method, the renderer publishes the customizing parameters that it understands. With the set method, it receives values for these parameters.

The CollectionRendererFactory  is the central and only entry point for obtaining valid and ready-to-use instances of ICollectionRenderer. It is responsible for checking the current configuration and returning the fitting class or, if none is defined , the default class. The instance returned by the factory is already fully configured. 

The IResourceListProvider interface enables the selection of resources. Classes that implement the interface can return a list of resources that can be used for mass commands. The outermost container control , AbstractProxyControl , can decide to use the interface's resetSelection method to clear all selections if the user navigates to a different folder. 

Configuration

Collection renderes can be configured at two locations in the ConfigurationFramework. They are referenced in the CollectionRendererSettings under Content Management->UserInterface->Settings->CollectionRendererSettings and they are defined under Content Management->UserInterface->Mapping->CollectionRenderer

The following attributes are available:

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

A table with collection renderer settings is not provided because in the configuration framework plugin for collection renderer settings, different configuration classes are defined with different attributes. Details can be found in the documentation of the configuration.

Implementation Notes

The ICollectionRenderer object and CollectionRendererFactory work in close coordination with other elements of the KM framework related to rendering. When, for example, a particular folder and its resource have to be rendered with an ICollectionRenderer, 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 layout controllers's render method. It can use the ICollectionRendererFactory to retrieve ICollectionRenderer instances. The ICollectionRenderer uses IResourceRenderers, that are provided by the ResourceRendererFactory, to further delegate rendering. It also uses ICommands, provided by the UICommandFactory, to delegate the creation of commands for the displayed resources.

Skip navigation links
SAP NetWeaver 7.50 SP 13 KMC

Copyright 2018 SAP AG Complete Copyright Notice