51 Integrating Recent Activities

This chapter describes how to integrate recent activities with a Portal Framework application. Recent Activities stream the most recent application actions.

This chapter includes the following topics:

Note:

For information about using recent activities, see the "Working with Recent Activities" chapter in Using Oracle WebCenter Portal.

51.1 Introduction to Recent Activities

Recent activities enable users to view the most recent changes in your application. For example, the documents tool automatically produces the information that recent activities uses to display the most recent changes to the document library. This is useful to your users who want a quick and easy way to view any additions or changes to a particular area of the application.

Recent activities can track creation, modification, and deletion of the following portal objects:

  • Documents

  • Announcements

  • Discussion forums

  • Pages

  • List definitions

For more information, see Chapter 32, "Integrating Announcements," Chapter 33, "Integrating Discussions," Chapter 28, "Integrating Documents," and Chapter 17, "Enabling Runtime Creation and Management of Pages."

Through APIs, you can control the display of business activities.

See Also:

For information about tracking business activities using APIs, see Java API Reference for Oracle WebCenter Portal.

This section contains the following subsections:

51.1.1 Understanding Recent Activities

Recent activities provides a summary view of recent changes to a variety of tools and services. You can specify the range of time to consider recent by selecting a time range from a list at the top of the task flow. Recorded activities include additions or revisions of pages, documents, discussion forums, and the like.

By default, recent activities works with documents, announcements, discussions, and pages. You can limit what recent activities are tracked. For more information about this setting, see Section 51.3, "Advanced Information for Recent Activities." You can also learn more about using Oracle WebCenter Portal tools and services in Chapter 4, "Preparing Your Application for WebCenter Portal Tools and Services."

Recent activities functionality is similar to the activity stream functionality (for more information, see Section 37.1.1.1, "Activity Stream"). Both track the application activities of integrated tools and services, though the activity stream tracks a broader range of tools and services. For example, recent activities tracks documents, announcements, discussions, and pages. The activity stream tracks those, as well as people, wikis, and blogs. Recent activities tracks activities no matter who performs the action. The activity stream tracks activities performed by a user's connections and includes information about who performed the activity. Recent activities does not include names.

The basic difference between recent activities and the activity stream can be summarized as follows: recent activities provides an overview of what is happening in an application; the activity stream provides an overview of what is happening with a user's connections.

51.1.2 What Happens at Runtime

At runtime, the Recent Activities task flow fetches the latest information about the tools and services that are configured and running in your application. Figure 51-1 shows an example of the Recent Activities task flow at runtime and displays the following activities that have occurred in the application since yesterday:

  • One document has been uploaded or added using the Documents tool

  • Five discussion threads have been modified or added using the Discussions tool

  • One announcement has been modified or added using the Announcements tool

The time range choices (Today, Since Yesterday, and so on) display based on the default values set for the Recent Activities Time Range parameter values at design time (see Table 51-1).

Recent activities uses the search capabilities of WebCenter to query activities for specified periods. Search capabilities are implemented across the following WebCenter Portal tools and services: documents, announcements, discussions, and pages. These services, if configured in an application, respond to queries from recent activities and return items pertinent to the search criteria. Responses to queries (search results) are always based on the search predicate, DCMI_MODIFIED > [start time]. Here start time is one of the time periods that you configured in the Edit Task Flow Binding dialog at design time. Users can select a select a time period in the Show list at runtime.

Figure 51-1 Recent Activities at Runtime

Description of Figure 51-1 follows
Description of ''Figure 51-1 Recent Activities at Runtime''

51.2 Basic Configuration for Recent Activities

This section describes how to add recent activities functionality to your Portal Framework application.

This section contains the following subsections:

51.2.1 Setting up Connections for Recent Activities

You do not need to set up specific connections for recent activities. You only need to ensure that the WebCenter Portal components you want to track are configured.

51.2.2 Adding Recent Activities at Design Time

To use recent activities, you must add its task flow to your application. Ensure that you have at least one of the components it tracks in your application. There is a single Recent Activities task flow available in the WebCenter Portal - Services Catalog, which you can add to your application.

Recent activities automatically picks up other components in your application and looks for recent activities within these components. Before running your application containing recent activities, however, you may want to ensure your application contains at least one of the components you want to monitor.

To add the Recent Activities task flow to your application:

  1. Follow the steps in Section 4.2.1, "How to Prepare Your Application to Consume Tools and Services" to implement security and create a customizable page in your Portal Framework application.

  2. Open the source of the customizable page.

  3. Ensure that your application includes at least one of the components that recent activities tracks.

    Note:

    If you run an application that does not contain one of these components, then recent activities displays an error saying

    Warning: Unable to obtain recent activity data.

  4. In the Resource Palette, open the WebCenter Portal - Services Catalog, then open the Task Flows folder.

  5. Click Recent Activities and drag it onto your page after the <af:form> tag, and select Region.

    Figure 51-2 Edit Task Flow Binding Dialog

    Description of Figure 51-2 follows
    Description of ''Figure 51-2 Edit Task Flow Binding Dialog''

    In the Edit Task Flow Binding dialog shown in Figure 51-3, you can set the values for the time range that displays at runtime. This time range controls what activities display, as you will see in the next section. If you leave these parameters empty, then recent activities uses the default values.

    Table 51-1 describes the possible values for these parameters. The default values specified in this table come from the adf-config.xml file, as described in Section 51.3.1, "Refining the Behavior of Recent Activities."

    Table 51-1 Recent Activities Time Range Parameter Values

    Parameter Values

    groupSpace

    Leave the value of this parameter as null.

    Note: This parameter is only used within WebCenter Portal and is not relevant in non-scoped applications.

    timePeriodShort

    Default value: Today

    Possible values: Today, Yesterday, or a time in minutes

    timePeriodMedium

    Default value: Since Yesterday

    Possible values: Today, Yesterday, or a time in minutes

    timePeriodLong

    Default value: 10080

    (10080 minutes is equivalent to 7 days.)

    Possible values: Today, Yesterday, or a time in minutes

    timePeriodLongest

    Default value: 43200

    (43200 minutes is equivalent to 30 days.)

    Possible values: Today, Yesterday, or a time in minutes


    Figure 51-3 Example of the Edit Task Flow Binding Dialog for Recent Activities

    Description of Figure 51-3 follows
    Description of ''Figure 51-3 Example of the Edit Task Flow Binding Dialog for Recent Activities''

  6. Click OK. The binding appears on your page, as shown in Figure 51-4.

    Figure 51-4 The Recent Activities Task Flow on a Page in the Design View

    Description of Figure 51-4 follows
    Description of ''Figure 51-4 The Recent Activities Task Flow on a Page in the Design View''

  7. Save your project and run your page to the browser.

    Note:

    When you add the Recent Activities task flow to your page, you will see a task flow parameter called groupSpace. The default value of this parameter is null, which tells the task flow to search the entire application for recent activities.

51.2.3 Modifying Recent Activities Task Flow Parameters

The Recent Activities task flow has required and optional task flow binding parameters. You can adjust the parameter values when you drop a task flow onto a page or after you have placed a task flow on a page. For information about modifying parameters, see Section 32.2.2.3, "How to Modify Announcement Task Flow Parameters." The procedure for modifying parameters is identical across all task flows.

51.2.4 Setting Security for Recent Activities

Recent activities uses the security applied to the underlying components being analyzed. So, the information returned by the component only contains content for which the current user has at least View privileges. For example, a user who does not have View privileges to view content in a document library will not see recently added documents in the recent activities view. Similarly, a public user only sees activities returned on components exposed to the public that do not require authentication to view.

51.3 Advanced Information for Recent Activities

In addition to the task flow parameters, you can further refine the behavior of recent activities. This section describes how to perform that refinements. It also describes how you can obtain RSS news feed for recent activities.

This section contains the following subsections:

51.3.1 Refining the Behavior of Recent Activities

You can change a variety of the recent activities parameters after you have added the task flow to your application. When you add the task flow to your page, you also automatically add the following entry to the adf-config.xml file, located in the Application Resources panel, under Descriptors, in the ADF META-INF folder:

  <recentactivityC:adf-recent-activity-config 
 xmlns="http://xmlns.oracle.com/webcenter/recentactivity/config">
     <display-properties numServiceRows="25" shortPeriod="TODAY"
                        mediumPeriod="YESTERDAY" longPeriod="10080"
                        longestPeriod="43200"/>
    <services-filter>
      <exclude/>
    </services-filter>
  </recentactivityC:adf-recent-activity-config>

In this entry, you can change the settings described in Table 51-2.

Table 51-2 Recent Activities Settings in the adf-config.xml File

Setting Description

numServiceRows

Default value: 25

The maximum number of rows displayed for a single component.

If there are more recent activity results than this, the most recent ones up to this number are returned. For example, if there are 32 recently modified documents and this setting is 25 then only the most recent 25 will show up in the results.

shortPeriod

Default value: Today

See Table 51-1. This setting is the same as the timePeriodShort task flow parameter, and is used when the task flow parameter is not specified.

mediumPeriod

Default value: Yesterday

See Table 51-1. This setting is the same as the timePeriodMedium task flow parameter and is used when the task flow parameter is not specified.

longPeriod

Default value: 10080 (Last 7 Days)

See Table 51-1. This setting is the same as the timePeriodLong task flow parameter and is used when the task flow parameter is not specified.

longestPeriod

Default value: 43200 (Last 30 Days)

See Table 51-1. This setting is the same as the timePeriodLongest task flow parameter and is used when the task flow parameter is not specified.

services-filter

Default value: null

Use this tag to filter out components you do not want to track. The following example omits any changes to the Page service from displaying in recent activities:

<services-filter>
  <exclude>oracle.webcenter.page</exclude>
</services-filter>

By default, no components are omitted.

To filter out other components use the service ID values listed in Table G-7.


51.3.2 Obtaining RSS News Feed URL for Recent Activities

You can expose WebCenter Portal functionality in a Portal Framework application. Your Portal Framework application users can find out what is happening in a specific portal through RSS news feeds.

Configure RSS news feeds for recent activities to enable users to view recent activities from within a portal. To obtain the portal RSS news feed URL for recent activities, use either of the following WebCenter Portal APIs:

  • getServiceRssFeedURL

  • GetServiceRssFeedURLbyGUID

To obtain an RSS feed URL, you must identify the portal (by name or GUID) and specify the component required (by service ID). The service ID for recent activities is GroupSpaceWSClient.RECENT_ACTIVITY_SERVICE_ID. For information about how to use these APIs, see Section 56.1.5.3.9, "Retrieving RSS Feed URLs for WebCenter Portal Tools and Services."