com.sapportals.wcm.rendering.resource

Class ResourceRendererFactory

java.lang.Object
  extended bycom.sapportals.wcm.rendering.base.AbstractFactory
      extended bycom.sapportals.wcm.rendering.resource.ResourceRendererFactory
All Implemented Interfaces:
IFactoryInfoProvider

public final class ResourceRendererFactory
extends AbstractFactory

This class is a singleton factory, creating new instances of IResourceRenderer. These instances are ready-to-use, as the factory takes care of the initialization. This includes the setting of the member variables of the renderer. See IResourceRenderer for details. The factory reads out mapping information from the configuration framework. It uses the mapping entries in the configuration to create in internal HashMap that holds an instance of each IResourceRenderer specified in the configuration. The alias-attribute of the mapping is used as the key for the HashMap entries. The factory reacts on events from the config. If an event is received, the HashMap is cleared and all instances are newly created. If an exception occurs while filling the map, the map is cleared again and only the default-renderer specified in this factory will be usable.


Nested Class Summary
 
Nested classes inherited from class com.sapportals.wcm.rendering.base.IFactoryInfoProvider
IFactoryInfoProvider.MappingInformation
 
Field Summary
 
Fields inherited from class com.sapportals.wcm.rendering.base.AbstractFactory
category, classkey, configclass, configplugin, CONFIGURATION_FORMAT_LIST, CONFIGURATION_FORMAT_TABLE, CONFIGURATION_FORMAT_TABLE_NO_HEADER, default_config, default508_config, default508class, defaultclass, descriptiveName
 
Method Summary
 String getFactoryName()
           
static ResourceRendererFactory getInstance()
           
 IResourceRenderer getResourceRenderer(IProxy proxy, IResource outerResource, IResource resource, IFlavor flavor)
          returns a new instance of an IResourceRenderer.
 IResourceRenderer getResourceRenderer(IProxy proxy, ITypedResourceList list, IResource resource, IFlavor flavor)
          returns a new instance of an IResourceRenderer.
 String getResourceRendererConfiguration(String format)
          returns a formatted list including all configured IResourceRenderer with their attributes and settings.
 HashSet getSupportedPreviewMimetypes()
           
protected  void initialize()
          This method is called when the class, that extends AbstractFactory, is instantiated for the first time.
 void prepareSupportedPreviewMimetypes()
           
 
Methods inherited from class com.sapportals.wcm.rendering.base.AbstractFactory
configEvent, getConfigListenerId, getConfiguration, getLastReloadTime, getLayoutObject, getLayoutObject, getMappings, getStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

protected void initialize()
                   throws WcmException
Description copied from class: AbstractFactory
This method is called when the class, that extends AbstractFactory, is instantiated for the first time. It uses the ConfigurationFramework to retrieve the ILayoutObjects and their settings from the present configuration. When this method is called at a later point of time (e.g. when an update-event from the configuration framework is fired, the existing ILayoutObjects and settings are deleted and reloaded from the configuration. When reloading, the old configuration will be kept until the complete reloading has been finished. At that time, the new configuration will replace the existing one. If exceptions or errors occured when reloading the configuration, the old configuration will be removed anyways and only the default classes will be available.

Overrides:
initialize in class AbstractFactory
Throws:
WcmException - thrown when the configuration-framework throws any kind of exception. If this happens, all classes, mapping etc. that have been read out are reset again. Only the default ILayoutObject and the default ILayoutObject for 508-rendering that are set in the class that extends this AbstractFactory are available. This information is logged with attribute . If classes specified in the IConfigurable returned from the Configuration Framework do not exist or do not implement the ILayoutObject interface, the exception is caught and the information is logged with attribute .

getInstance

public static ResourceRendererFactory getInstance()
Returns:
the singleton instance of the ResourceRendererFactory. When this method is first called, the singleton instance reads out the configuration and fills its internal HashMap of IResourceRenderer

getResourceRenderer

public IResourceRenderer getResourceRenderer(IProxy proxy,
                                             IResource outerResource,
                                             IResource resource,
                                             IFlavor flavor)
                                      throws WcmException
returns a new instance of an IResourceRenderer. The factory first checks, if section 508-conform rendering is needed for the current user It then passes all given parameters to the ICustomizingController, which will return the correct alias-name of an IResourceRenderer. If no renderer can be found in the factory's HashMap of renderers, the factory will return the coded default-renderer. The renderer has already the given resource set as its resource to render

Parameters:
proxy - the proxy that acts as the outermost container of the current rendering process.
Throws:
WcmException

getResourceRenderer

public IResourceRenderer getResourceRenderer(IProxy proxy,
                                             ITypedResourceList list,
                                             IResource resource,
                                             IFlavor flavor)
                                      throws WcmException
returns a new instance of an IResourceRenderer. The factory first checks, if section 508-conform rendering is needed for the current user It then passes all given parameters to the ICustomizingController, which will return the correct alias-name of an IResourceRenderer. If no renderer can be found in the factory's HashMap of renderers, the factory will return the coded default-renderer. The resource-attribute of the renderer will not be set.

Parameters:
proxy - the proxy that acts as the outermost container of the current rendering process.
Throws:
WcmException

getSupportedPreviewMimetypes

public HashSet getSupportedPreviewMimetypes()

prepareSupportedPreviewMimetypes

public void prepareSupportedPreviewMimetypes()

getResourceRendererConfiguration

public String getResourceRendererConfiguration(String format)
returns a formatted list including all configured IResourceRenderer with their attributes and settings. This is only used for documentation purposes.

Parameters:
format - the format requested. See AbstractFactory for supported formats
Returns:
the formatted list

getFactoryName

public String getFactoryName()
Returns:
a human-readable name of the factory, must not be null


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.