|SAP NetWeaver '04|
|PREV PACKAGE NEXT PACKAGE||FRAMES NO FRAMES|
|ISubscription||Represents a single subscription and provides methods to define, modify and access the details of a subscription.|
|ISubscriptionAttributes||Represents the customizable attributes of a subscription.|
|ISubscriptionCondition||Defines the conditions for which events lead to a notification.|
|ISubscriptionConditionEvent||Represents an event a user can subscribe to.|
|ISubscriptionConditionInterval||Defines the intervals at which a subscription has to be checked for changes
|ISubscriptionConditionRecursionLevel||A Recursion level defines which hierarchy level is relevant for a subscription on a collection.|
|ISubscriptionList||A list of
|ISubscriptionListIterator||An iterator for an
|ISubscriptionManager||Provides methods for creating, modifying, and accessing subscriptions that belong to this
|SubscriptionUtils||Certain utility methods for obtaining a repository's subscription service.|
|SubscriptionException||The exception thrown by the subscription service.|
Provides a service that creates and manages subscriptions for resources.
A subscription enables users to keep track of changes that are made to resources in a repository. Users can create a subscription to a resource and specify that they want to be informed whenever the resource changes. Subscriptions can have many different forms. They can be created for various resource types and different recipients. They can return information about resources using different channels and at individually configured intervals.
A subscription is defined with a number of elements. These are:
The subscription API comprises a number of interrelated interfaces that center around the ISubscriptionManager and ISubscription interfaces.
The ISubscriptionManager interface defines the core functions for creating and administrating subscriptions in general. It is the starting point for working with subscriptions. It supplies instances of all the objects required for a subscription, stores default settings and knows which settings are supported for different resource types. In addition it is responsible for controlling the subscription process. It checks the resources as required to find out whether a condition is met. If it registers that a condition related to the subscription is met, it generates a message (INotification ) and sends it to the recipients using the predefined communication channel.
The ISubscription interface represents an individual subscription. It stores all the relevant information about a subscription and offers all the methods that are required to manipulate it. In summary, it defines who (recipients) will be notified how (channel), when (condition) and about what (resources).
The following UML Diagram illustrates the interrelationships
between the subscription manager and the other interfaces of the
In addition to the above, the interface of the package includes the SubscriptionUtils class that implements methods for accessing subscription managers.
The following shows code extracts. For a complete example, see the KM subscription service in the PDK.
Creating a Subscription
The code sample creates a subscription for the current user to
resource using default
attributes, conditions and channel. The user that becomes the
owner of the subscription is provided by the context:
ISubscriptionManager subscriptionManager = SubscriptionUtils.getSubscriptionManager(resource); ISubscription simpleSubscription = subsciptionManager.createSubscription( resource.getContext(), // the context "mySimpleSubscription", // the name of the subscription null, // use default condition resource, null, // use default channel null, // use user from context as recipient null // use default attributes );
Defining a Notification Text
The code sample shows how to specify the text that is included in the notification for a subscription:
ISubscriptionAttributes attributes = new SubscriptionAttributes(); attributes.setNotificationText("your annotation here");
are specified in the last parameter of the
The SubscriptionManager can be configured with the parameters
shown in the table.
The parameters are set with the help of the user interface of the Content Management configuration framework.
For more information, see the Administering Content Management document.
The parameters in the table that are not required have default values that are used if no value is specified.
|serviceuser||No||User used for polling of resources. Default: anonymous user.|
||No||Class for converting the technical events
from the framework into
semantic events that are used to trigger notifications for subscriptions.
||No||The minimum time interval (in seconds)
between 2 changes to a document that allows
2 notification messages to be sent.
Default: 1 sec.
||No||List of operations that generate an
administrative notification (a list with the following
values: create, delete, update, updaterecipient, updateresource).
Default: create, update_recipient.
||No||Flag to enable or disable admin
notifications being sent to the ActionInbox.
||No||Flag to enable or disable notifications
being sent to the ActionInbox.
|poolid||Yes||Connection pool for database access.|
||No||The value of the from field in messages sent by
the subscription service.
If this field is not set, the recipients can not see who or what sent the notification.
It is advisable to use an administrative account to keep track off invalid e-mail addresses
or delivery failures.
The following shows a sample configuration for the subscription service:
|EMAIL.from||Subscription Service <firstname.lastname@example.org>|
|SMS.from||Subscription Service <email@example.com>|
If the parameter ridtracking
is set to true, the subscription follows the subscribed
resource. If it is set to false, the subscription follows the
Consider a subscription S for the resource /xyz/A
If A is renamed to B, the behavior is as follows: With RID tracking enabled, the subscription S points to xyz/B, with RID-tracking disabled it still points to /xyz/A
If A is removed, the behavior is as follows: With RID tracking enabled, the subscription S is also deleted, with RID tracking disabled, it remains unchanged.
Enabling RID tracking increases the system load because each event is handled by the subscription service. To detect a change, a database lookup is performed for each MOVE, RENAME and DELETE event. Note that RID tracking only functions for repositories where eventing is enabled.
The following sequence diagram shows the implementation of the subscription service for the CM repository.
When the subscription service is used, the two global services Scheduler and Notificator have to be available as well. If one of these is not available at startup (see the log-file for details), the subscription service is also not available.
The subscription service is a repository service. See the package com.sapportals.wcm.repository.manager to find out how to assign a repository service to a repository.
|SAP NetWeaver '04|
|PREV PACKAGE NEXT PACKAGE||FRAMES NO FRAMES|