SAP NetWeaver '04

com.sapportals.wcm.service.notificator
Class AbstractNotification

[contained in: com.sap.netweaver.bc.rf.service.par - bc.rf.global.service.notificator_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.service.notificator.AbstractNotification
All Implemented Interfaces:
INotification

public abstract class AbstractNotification
extends java.lang.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  java.lang.String m_ID
          unique system ID for this notification event
protected static java.lang.String XMLSUFFIX
          XML file suffix.
protected static java.lang.String XSLSUFFIX
          XSL file suffix.
 
Constructor Summary
AbstractNotification(java.lang.String id, IResourceContext context)
          Create a notification for a given system ID.
 
Method Summary
 IContent getContent(IRecipient recipient, IChannel channel, java.util.Properties properties)
          Get the content (depending on recipient and channel).
 java.lang.String getDescription()
          Get a displayable name (title).
 java.lang.String getDescription(java.util.Locale locale)
          Get a displayable name (title) for a specific locale.
 java.lang.String getDescription(java.util.Locale locale, java.lang.Object obj1)
           
 java.lang.String getFromAddress(IChannel channel)
          Get the 'from' address for a specific channel.
 java.lang.String getID()
          Get a system id for this notification.
protected  java.util.Properties getProperties(IRecipient recipient, IChannel channel, java.util.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, java.lang.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, java.lang.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 java.lang.String XMLSUFFIX
XML file suffix.

XSLSUFFIX

protected static final java.lang.String XSLSUFFIX
XSL file suffix.

m_ID

protected java.lang.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(java.lang.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,
                        java.lang.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,
                        java.lang.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 java.util.Properties getProperties(IRecipient recipient,
                                             IChannel channel,
                                             java.util.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 java.lang.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
Following copied from interface: com.sapportals.wcm.service.notificator.INotification
Returns:
String is the system id.

getDescription

public java.lang.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
Following copied from interface: com.sapportals.wcm.service.notificator.INotification
Returns:
String is the displayable name.

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Description copied from interface: INotification
Get a displayable name (title) for a specific locale.
Specified by:
getDescription in interface INotification
Following copied from interface: com.sapportals.wcm.service.notificator.INotification
Parameters:
locale - TBD: Description of the incoming method parameter
Returns:
String is the displayable name for the given locale.

getDescription

public java.lang.String getDescription(java.util.Locale locale,
                                       java.lang.Object obj1)

getFromAddress

public java.lang.String getFromAddress(IChannel channel)
Description copied from interface: INotification
Get the 'from' address for a specific channel.
Specified by:
getFromAddress in interface INotification
Following copied from interface: com.sapportals.wcm.service.notificator.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,
                           java.util.Properties properties)
                    throws WcmException
Description copied from interface: INotification
Get the content (depending on recipient and channel).
Specified by:
getContent in interface INotification
Following copied from interface: com.sapportals.wcm.service.notificator.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

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.