com.sapportals.wcm.service.notificator

Class AbstractNotification

java.lang.Object
  extended bycom.sapportals.wcm.service.notificator.AbstractNotification
All Implemented Interfaces:
INotification

public abstract class AbstractNotification
extends Object
implements INotification

Base class for Notifications used to notify a recipient.

Copyright 2004 SAP AG


Field Summary
protected  IResourceContext m_Context
          the context to use for the producers.
protected  String m_ID
          unique system ID for this notification event
protected static String XMLSUFFIX
          XML file suffix.
protected static String XSLSUFFIX
          XSL file suffix.
 
Constructor Summary
AbstractNotification(String id, IResourceContext context)
          Create a notification for a given system ID.
 
Method Summary
 IContent getContent(IRecipient recipient, IChannel channel, Properties properties)
          Get the content (depending on recipient and channel).
 String getDescription()
          Get a displayable name (title).
 String getDescription(Locale locale)
          Get a displayable name (title) for a specific locale.
 String getDescription(Locale locale, Object obj1)
           
 String getFromAddress(IChannel channel)
          Get the 'from' address for a specific channel.
 String getID()
          Get a system id for this notification.
protected  Properties getProperties(IRecipient recipient, IChannel channel, Properties properties)
          Get the properties to pass to the pipeline.
protected  IProducer getXmlProducer(IResourceFactory factory, RID xmlRID)
          Get the XML producer for feeding the pipeline.
protected  RID getXmlRID(IResourceFactory factory, String templates, IRecipient recipient)
          Get the uri to use for the XML by trying several locale-specific uris.
protected  IProducer getXslProducer(IResourceFactory factory, RID xslRID)
          Get the XSL producer for feeding the pipeline.
protected  RID getXslRID(IResourceFactory factory, String templates, IChannel channel)
          Get the uri to use for the XSL by trying a channel-specific uri first.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLSUFFIX

protected static final String XMLSUFFIX
XML file suffix.

See Also:
Constant Field Values

XSLSUFFIX

protected static final String XSLSUFFIX
XSL file suffix.

See Also:
Constant Field Values

m_ID

protected String m_ID
unique system ID for this notification event


m_Context

protected IResourceContext m_Context
the context to use for the producers.

Constructor Detail

AbstractNotification

public AbstractNotification(String id,
                            IResourceContext context)
Create a notification for a given system ID.

Parameters:
id - a String with the system notification type.
context - a IResourceContext with the context to use for the notification.
Method Detail

getXmlRID

protected RID getXmlRID(IResourceFactory factory,
                        String templates,
                        IRecipient recipient)
                 throws WcmException
Get the uri to use for the XML by trying several locale-specific uris.

Parameters:
factory - the IResourceFactory to use for getting the resource.
templates - a String with the name of the notificator's template directory.
recipient - the IRecipient to get the XML for.
Returns:
xmlRID
Throws:
WcmException - Exception raised in failure situation

getXslRID

protected RID getXslRID(IResourceFactory factory,
                        String templates,
                        IChannel channel)
                 throws WcmException
Get the uri to use for the XSL by trying a channel-specific uri first.

Parameters:
factory - the IResourceFactory to use for getting the resource.
templates - a String with the name of the notificator's template directory.
channel - the IChannel to get the XSL for.
Returns:
xslRID
Throws:
WcmException - Exception raised in failure situation

getXmlProducer

protected IProducer getXmlProducer(IResourceFactory factory,
                                   RID xmlRID)
                            throws WcmException
Get the XML producer for feeding the pipeline.

Parameters:
factory - the IResourceFactory to get resources from.
xmlRID - TBD: Description of the incoming method parameter
Returns:
an IProducer for the XML.
Throws:
WcmException - Exception raised in failure situation

getXslProducer

protected IProducer getXslProducer(IResourceFactory factory,
                                   RID xslRID)
                            throws WcmException
Get the XSL producer for feeding the pipeline.

Parameters:
factory - the ResourceFactory to get resources from.
xslRID - TBD: Description of the incoming method parameter
Returns:
an IProducer for the XSL.
Throws:
WcmException - Exception raised in failure situation

getProperties

protected Properties getProperties(IRecipient recipient,
                                   IChannel channel,
                                   Properties properties)
Get the properties to pass to the pipeline.

Parameters:
recipient - the IRecipient which will get the message.
channel - the IChannel which will be used for sending the message.
properties - the Properties from the notificator config.
Returns:
the Properties to pass to the pipeline for adding to the XML-/XSL-output.

getID

public String getID()
Description copied from interface: INotification
Get a system id for this notification. For example 'subscription ' for a subcription notification.

Specified by:
getID in interface INotification
Returns:
String is the system id.

getDescription

public String getDescription()
Description copied from interface: INotification
Get a displayable name (title). For example 'Subscription Notification ' for a suscription notification.

Specified by:
getDescription in interface INotification
Returns:
String is the displayable name.

getDescription

public String getDescription(Locale locale)
Description copied from interface: INotification
Get a displayable name (title) for a specific locale.

Specified by:
getDescription in interface INotification
Parameters:
locale - TBD: Description of the incoming method parameter
Returns:
String is the displayable name for the given locale.

getDescription

public String getDescription(Locale locale,
                             Object obj1)

getFromAddress

public String getFromAddress(IChannel channel)
Description copied from interface: INotification
Get the 'from' address for a specific channel.

Specified by:
getFromAddress in interface INotification
Parameters:
channel - a IChannel with the channel to get the from address for.
Returns:
a String with from address for the given channel.

getContent

public IContent getContent(IRecipient recipient,
                           IChannel channel,
                           Properties properties)
                    throws WcmException
Description copied from interface: INotification
Get the content (depending on recipient and channel).

Specified by:
getContent in interface INotification
Parameters:
recipient - TBD: Description of the incoming method parameter
channel - TBD: Description of the incoming method parameter
properties - TBD: Description of the incoming method parameter
Returns:
IContent is the content, wich should depend on the specified channel and the given recipient (e.g. content can differ for WAP- and eMail-channels, or it may depend on the receivers locale).
Throws:
WcmException - Exception raised in failure situation


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.