25 Integrating the Recent Activities Service

This chapter describes how to integrate the Recent Activities service into your custom WebCenter application. This service enables you to display the most recent changes to the services in your application.

This chapter includes the following sections:

For information about using the Recent Activities service, see Chapter "Working with the Recent Activities Service" in Oracle Fusion Middleware User's Guide for Oracle WebCenter.

25.1 Introduction to the Recent Activities Service

Oracle WebCenter Services are preconfigured to work with the Recent Activities service. Recent Activities enable users to view the most recent changes to the services in your application. For example, once you add the Documents service, it automatically produces the information that the Recent Activities service will use to display the most recent changes to the document library. This service 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.

The Recent Activities service can track information from the following WebCenter Services:

  • Documents added by the Documents service

  • Announcements created by the Announcements service

  • Discussion Forums created by the Discussions service

  • Pages created or modified by the Page service

For more information about these services, see Chapter 16, "Integrating the Announcements Service," Chapter 17, "Integrating the Discussions Service," Chapter 14, "Integrating the Documents Service," and Chapter 6, "Enabling Runtime Creation and Management of Pages."

This section contains the following subsections:

25.1.1 Understanding the Recent Activities Service

The Recent Activities service provides a summary view of recent changes to a variety of 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, the Recent Activities service works with the Documents, Announcements, Discussions, and Page services. You can narrow the services that the Recent Activities service tracks. For more information about this setting, see the next section, Section 25.3, "Advanced Information for the Recent Activities Service." You can also learn more about using Oracle WebCenter services in Section 1.1.4, "Introduction to Oracle WebCenter Services."

Note:

You can see the Recent Activities service in action in the sample application, as described in Chapter 2, "Introduction to the WebCenter Sample Application."

The Recent Activities service compares somewhat to Activity Stream (for more information, see Section 20.1.1.1, "Activity Stream"). Both track the application activities of integrated services, though Activity Stream tracks a broader range of services. For example, Recent Activities tracks the Documents, Announcements, Discussions, and Page services. Activity Stream tracks these services as well as People Connections and Wikis and Blogs. Recent Activities tracks activities no matter who performs the action. 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 these two services can be summarized as follows: Recent Activities provides an overview of what is happening in an application. Activity Stream provides an overview of what is happening with a user's connections.

25.1.2 What Happens at Runtime

At runtime, the Recent Activities task flow fetches latest information about the services that are configured and running in your application. Figure 25-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 service

  • five discussion threads have been modified or added using the Discussions service

  • one announcement has been modified or added using the Announcements service

The time range choices (Last 30 days, 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 25-1).

The Recent Activities service uses the search capabilities of WebCenter to query activities for specified periods. Search capabilities are implemented across the following WebCenter services: Documents, Announcements, Discussions, and Pages. These services, if configured in an application, respond to queries of the Recent Activities service 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. You can select a select a time period in the Show dropdown list at runtime.

Figure 25-1 Recent Activities Service at Runtime

Description of Figure 25-1 follows
Description of "Figure 25-1 Recent Activities Service at Runtime"

25.2 Basic Configuration for the Recent Activities Service

This section describes how to add the Recent Activities service to your custom WebCenter application.

This section contains the following subsections:

25.2.1 Setting up Connections for the Recent Activities Service

You do not need to set up specific connections for the Recent Activities service. You only need to ensure that the service(s) you are tracking with the Recent Activities service is configured. For more information about setting up connections for other services, see the individual services chapters in this guide.

25.2.2 Adding the Recent Activities Service at Design Time

To use the Recent Activities service, you must add its task flow to your application. Ensure that you have at least one of the services it tracks in your application. There is a single Recent Activities task flow available in the WebCenter Services Catalog, which you can add to your application to display information about services in your application to your users.

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

To add the Recent Activities task flow to your application:

  1. Follow the steps in Section 4.1.1, "How to Prepare Your Application to Consume Services" to implement security and create a customizable page in your custom WebCenter application.

  2. Open the source of the customizable page.

  3. Ensure that your application includes at least one of the services that the Recent Activities service tracks.

    Note:

    If you run an application that does not contain one of these services, the Recent Activities service displays an error saying Warning: Unable to obtain recent activity data.
  4. Create a new external application by right-clicking the ViewController project in your application, then choosing New.

  5. In the New Gallery, under General, select External Applications, then select External Application from the Items list.

  6. Click OK.

  7. In the Application Name field, enter a name for your application, such as MyExternalApplication, then click Next.

  8. On the General page, leave the Login URL field empty.

  9. In the User Name/ID Field Name field, enter a user name. The user name should match the login credentials of the servers you are tracking. For example, if you are tracking the Documents service with Oracle Content Server, the login credentials must match those of the user on Oracle Content Server.

  10. In the Password Field Name field, enter a password.

  11. Under Authentication Details, choose POST, then click Next.

  12. On the Additional Fields page, click the Add Field button.

  13. For the Field Name, enter Account.

  14. Select the Display to User checkbox.

    Figure 25-2 Additional Fields Page

    Description of Figure 25-2 follows
    Description of "Figure 25-2 Additional Fields Page"

  15. Click Finish.

  16. In the Resource Palette, open the WebCenter Services Catalog, then open the Task Flows folder.

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

    Figure 25-3 Edit Task Flow Binding Dialog

    Description of Figure 25-3 follows
    Description of "Figure 25-3 Edit Task Flow Binding Dialog"

    In the Edit Task Flow Binding dialog shown in Figure 25-4, 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, the Recent Activities service will use the default values of the service.

    Table 25-1 describes the possible values for these parameters.

    Table 25-1 Recent Activities Time Range Parameter Values

    Parameter Values

    groupSpace

    Leave the value of this parameter as null.

    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 25-4 Example of the Edit Task Flow Binding Dialog for the Recent Activities Service

    Description of Figure 25-4 follows
    Description of "Figure 25-4 Example of the Edit Task Flow Binding Dialog for the Recent Activities Service"

  18. Click OK. The binding displays on your page, as shown in Figure 25-5.

    Figure 25-5 The Recent Activities Task Flow on a Page in the Design View

    Description of Figure 25-5 follows
    Description of "Figure 25-5 The Recent Activities Task Flow on a Page in the Design View"

  19. 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.

25.2.3 Setting Security for the Recent Activities Service

The Recent Activities service uses the security applied to the underlying services being analyzed. So, the information returned by the services 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 will only see activities returned on services exposed to the public, and do not require authentication to view.

25.3 Advanced Information for the Recent Activities Service

This section explains that in addition to the task flow parameters, you can further refine the behavior of the Recent Activities service. It also describes how you can obtain RSS news feed for your Recent Activities service.

This section contains the following subsections:

25.3.1 Refining the Behavior of the Recent Activities Service

You can change a variety of the Recent Activities service parameters after you have added it 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>

You can change the settings described in Table 25-2 in this entry.

Table 25-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 service.

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 25-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 25-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 25-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 25-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 services you do not wish to track with this service. The following example omits any changes to the Page service from displaying in the Recent Activities service:

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

By default, no services are omitted.


25.3.2 Obtaining RSS News Feed URL for the Recent Activities Service

You can expose Oracle WebCenter Spaces functionality in a custom WebCenter application. Your custom application users can find out what is happening in a specific group space through RSS news feeds.

Configure RSS news feeds for the Recent Activities service to enable users to view group space recent activities from within a custom application. To obtain the group space RSS news feed URL for the Recent Activities service, use either of the following WebCenter Spaces APIs:

  • getServiceRssFeedURL

  • GetServiceRssFeedURLbyGUID

To obtain an RSS feed URL, you must identify the group space (by name or GUID) and specify the service required (by service ID). The service ID for the Recent Activities service is GroupSpaceWSClient.RECENT_ACTIVITY_SERVICE_ID. For information about how to use these APIs, see Section 27.2.5.3.8, "Retrieving RSS Feed URLs for Group Space Services."