Rewind is a new feature in Teradata Viewpoint 13.0 that enables the user to move back in time to see what the portal looked like in the past. This is especially useful for investigating problems because the user can view the state of the system before, during, and after the problem occurred.
Your portlet should support rewind if it displays time-based information. For example, monitoring portlets that show the current state of a system or application should support Rewind. Rewind is not applicable to a portlet that allows the user to type in queries and view the results.
The first step is to implement Refresh capability. See the topic Adding Dynamic Updates with AJAX for instructions.
Next, you need to enable Rewind using the vp:registerPortlet tag in your summary view. The four rewind parameters to this tag are:
Here is an example from the MyQueries portlet:
<vp:registerPortlet
context='${context}'
dependencies='SessionController,TableController'
elementId='${context}_portlet'
refreshUrl='${refreshUrl}'
refreshExtraArguments='system,filterName'
refreshTarget='#${context}_portlet'
refreshInterval='30000'
supportsRefresh='true'
supportsManualRefresh='true'
supportsPause='true'
supportsRewind='true'
supportsOptOut='true'
rewindEventType='FAST'
rewindJoinType='OPT-OUT'
refreshResultType='SCRIPT' />
In addition, you need to include two other tags: vp:portletMenu and vp:timestamp. The portletMenu tag adds the refresh/pause/rewind menu to the portlet header bar and the timestamp tag sets the current time in the header bar.
Here is an example:
<vp:portletMenu context="${context}" />
<vp:timestamp context="${context}" time="${collectTime}"/>
This example assumes that the page attribute collectTime contains the current time. You'll see how to set this value next.
You normally use the same controller method to handle both Refresh and Rewind requests. You need to modify this controller to always get data for a specific time instead of getting only the most recent data.
There are two request parameters to look for in your controller:
In addition to collecting the correct data, the controller also needs to provide data for the vp:timestamp tag. The timestamp tag should always be given the time stamp for the data being displayed. In most cases this is the time stamp passed to the controller method in the browser request. The following code is an example of how to set the data for the timestamp tag.
public void summary(ControllerContext ctx)
{
String timestamp = ctx.getParameter("timestamp");
ctx.addViewObject("collectTime", timestamp);
// get portlet data for timestamp
}