Skip navigation links
SAP NetWeaver 7.50 SP 13 KMC

Package com.sapportals.wcm.repository.service.timebasedpublish

Provides a service that controls when resources in a repository are visible or hidden.

See: Description

Package com.sapportals.wcm.repository.service.timebasedpublish Description

Provides a service that controls when resources in a repository are visible or hidden.

Package Specification

Purpose

Time-based publishing is a repository service that can control when resources are visible or hidden. With the help of the service, information can automatically be made public or withdrawn at a specific time. This is useful to ensure that users are only presented with up-to-date information and are not overwhelmed by a large amount of outdated material. A common situation where time-dependent publishing is very useful is the handling of financial reports that publicize the quarterly results of a company. These reports have to be published on a certain date and are no longer of interest when a certain period of time has elapsed. Time-based publishing makes it easy to automatically publicize and withdraw this information at the right time.

Time-based publishing is also referred to as time-dependent publishing.

Detailed Concept

Time-based publishing is only active when it is enabled for a folder. When it is active, dates can be set to specify when resources in the folder:

Dates cannot be set for folders within a folder. They can be set for links.

An important capability of the service enables other services in the KM Framework to keep track of the visibility of resources. Methods of the service determine which resources have recently been hidden or become visible and send corresponding events. The events inform other services of changes in visibility and enable them to react appropriately. For example, when a subscription service receives an event that a resource has been hidden, it can react and inform subscribers that that the resource has been withdrawn.

A resource is always visible for an author regardless of any time-based publishing settings associated with the resource.

Interfaces and Classes

The central interface of the service is ITimebasedPublishingManager. It offers a method to activate the service for a folder and to set the dates for the visibility of a resource. It also provides the handleVisibleResources and handleInvisibleResources methods that are used to monitor changes in visibility and send corresponding events to alert other services.

The events that are sent by the manager are defined in the ITimebasedPublishingEvent class. They are triggered when the date on which the visibility of a resource must change is reached. The class distinguishes between events that are triggered before and after a resource becomes visible or is hidden. For example, the EVENT_TYPE_PRE_START informs that the time to become visible is reached, but the resource is not yet visible. The EVENT_TYPE_START informs that the time to become visible is reached and that the resource has actually become visible. The distinction between a PRE and START event is useful in the KM framework It allows a time lag between visibility date and actual visbility which enables the framework to maintain a consistent state. For more information on the time lag, see the Implementation Notes section below.

The data that enables the time-based publishing service to function is persisted in the properties of a resource. For example, the dates on which a resource is hidden or becomes visible are stored as properties of the resource. The names of the properties are stored in IPropertyName objects that are accessed with the methods of the class TimebasedPublishConstants.

Configuration

No parameters are available to configure the time-dependent publishing service.

Implementation Notes

For time-based publishing to function:

When the above requirements are met, the dates when individual resources within a folder are visible or hidden can be set. These dates are stored as application properties of a resource.

The service works in close coordination with the scheduler service and a namespace filter. The process is as follows:
When a folder where time-based publishing is enabled is opened, it is the task of the filter to find out which resources can be displayed. The filter calls the isVisible method of the ITimebasedPublishServiceManager to determine which resources can be displayed. There can be a time lag of up to 15 minutes between the moment when a resource is set to become visible and the point in time when the filter finds out that it must actually be displayed. The time lag is necessary because of the role of two scheduled tasks in the process.

Every 15 minutes, 2 tasks are executed to find out for which resources a change in visibility is required. When the resources are identified, the tasks send corresponding events for each of theses resources. Other services respond to the events and in this way are able to deal with the change in visibility of a resource appropriately. To avoid inconsistent states, the filter is only informed of changes in the visibility after the scheduler tasks have run and triggered events to inform other services. The time lag between the date set in the time-based publishing service and the actual visbility date registerd by the filter ensure a consistent state in the framework.

Note that you can set the time intervals at which the 2 scheduler tasks are executed with the configuration parameters of the scheduler service.

Related Documentation

Skip navigation links
SAP NetWeaver 7.50 SP 13 KMC

Copyright 2018 SAP AG Complete Copyright Notice