|Oracle® Fusion Middleware Developer's Guide for Oracle WebCenter
11g Release 1 (11.1.1)
Part Number E10148-02
This chapter explains how to integrate the Announcements service into a custom WebCenter application.
This chapter includes the following sections:
Announcements can show either forum-level announcements or global announcements (that is, announcements not specific to a forum).
With the Announcements service, you can do the following:
Create an announcement by clicking the Create icon, and then send it to a distribution list.
Edit an existing announcement by clicking the Edit icon next to the announcement.
Delete an existing announcement by clicking the Delete icon next to the announcement.
See the latest announcement data by clicking the Refresh icon on the Anouncement view.
Personalize the Announcements view. You can select to display announcements sent today, this week, this month, or all announcements. A Show list provides options for displaying announcements created within the selected time range.
Manage announcements, such as publishing announcements on a later date and specifying auto-expire on certain dates.
The Announcements service is integrated with many WebCenter Web 2.0 services, such as the RSS, Search (to search announcement text), Instant Messaging and Presence (IMP), and Recent Activities services. Use the Links service to link announcements to other services, such as Discussions.
Figure 12-1 shows a sample announcement.
Figure 12-1 Sample Announcement From the Task Flow
For more information about the service at runtime, see Oracle Fusion Middleware User's Guide for Oracle WebCenter.
Note:You can see the Announcements service in action in the sample application, as described in Chapter 2, "Introduction to the WebCenter Sample Application."
For information on installing the discussions server, see Oracle Fusion Middleware Installation Guide for Oracle WebCenter.
This section describes required steps for adding this service to your application. It contains the following subsections:
To take advantage of the Announcements service, you must first create a connection to the discussions server from your custom WebCenter application. To do so, ensure that you have the connection information for the discussions server.
The Announcements service requires a WebCenter Discussion connection to the discussions server. When you create a WebCenter Discussion connection or set a connection as active, both the Announcements and Discussions services will use this same connection. If you already have an existing connection, then you can skip this section and see Section 12.2.2, "Adding the Announcements Service at Design Time."
If you do not have an existing connection, then you must create a new WebCenter Discussion connection.
Note:While you can set up the connections to back-end servers at design time in Oracle JDeveloper, you can later add, delete, or modify connections in your deployed environment using Enterprise Manager Fusion Middleware Control. For more information, see Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
To set up the Announcements connection:
In Oracle JDeveloper, open the application in which you plan to consume Announcements.
Note:If you already created a WebCenter Discussion connection for the Discussions service, then that will be used by default for the Announcements service. No extra configuration is required.
In the Resource Palette, click the New icon and select New Connection, WebCenter Discussion Connection.
On the Name page, select to create the connection in Application Resources. (A connection in Application Resources will be available only for that application, while a connection in IDE Connections will be available for all applications you create. If you plan to use the connection in other applications, then select IDE Connections so you do not need to re-create it.)
For Connection Name, enter a meaningful name; for example,
Select the Set as default connection checkbox. You can have more than one connection, but only one can be active (default). If you have different discussions servers (for example, for each page in a space), then do not select the checkbox, but the service requires that one connection be marked as the active connection (Figure 12-2).
Note:After you create a connection as the active connection, you cannot edit it so that it is not the default. To use a different default connection, you must create a new connection and mark that as the default connection.
Figure 12-2 Create Discussion Connections, Step 1
On the General page, enter values for the required parameters:
forum.url: The URL for your discussions server instance. For example:
admin.user: The user name of your discussions server administrator; for example,
admin. This account is used by the Discussions and Announcement services to perform administrative operations on behalf of WebCenter users.
Optionally, enter values for the other parameters:
connection.time.out: The time (in seconds) the service should wait for the server to respond while making the connection. If the discussions server does not respond in the given time, then it will abort the connection and report an error.
forum.connection.secure: Whether the connection should be secured. If it should be secured, then additional configuration about WS-Security is required on the next page. The accepted value for this parameter is true or false.
Figure 12-3 Create Discussions Connection, Step 2
Click Test Connection, and if it is successful, then click Next.
On the Create Discussion Connection - Step 3 of 3 page, you can enable client-side WS-Security (Figure 12-4).
First obtain the client-side certificate and store it in a local directory. Then click the Add Secured Property button to add each of the following additional parameters in your WebCenter Discussion connection to secure WS-Service calls:
keystore.location: The certificate file path in your local directory.
keystore.password: The keystore password.
keystore.type: The keystore type associated with the certificate, for example, JKS.
encryption.key.alias: The key alias to be used for encryption.
encryption.key.password: The password for accessing the encryption key.
Make sure your property key and value are the same as in the certificate.
Note:If values should be secured, then add them by clicking the Add Secured Property button.
Figure 12-4 Create Discussions Connection, Step 3
Click Finish. Your connection should now appear as a node under Application Resources - Connections.
This section explains a basic incorporation of the Announcement service.
The announcement task flows let you add a main view or a sidebar view of announcements to your page.
Table 12-1 Announcement Task Flows
|Task Flow||Required Parameters||Description|
This task flow displays a view with that allows the user to see all current announcements and perform operations based on their privileges.
For a Moderator, all command buttons are shown, but for a Reader, only the refresh and personalization options are shown. The personalization option lets users select the number of days to display announcements.
This task flow displays a view that shows various categories of quick links to announcements.
The look and feel of this view changes with the optional parameter values given for rendering the task flow region.
For information on how to add this task flow, see Section 12.3.1, "How to Add the Announcements - Sidebar View Task Flow."
Follow the steps described in Chapter 3, "Preparing Your Development Environment" to implement security and create a new ustomizable page in your application.
Open the page on which you want to add the service.
In the Resource Palette, expand IDE Connections, File System, webcenter_services_root, Announcements, and ADF Task Flows.
Drag Announcements from the Resource Palette and drop it onto the page inside of the
When prompted, select Region as the way to create the task flow (and confirm with Add Library). This operation may take a moment to complete.
In the Edit Task Flow Binding dialog, you can enter a value for the
If global announcements are required, then do not specify a value for
If announcements from a specific forum are required (for example, when a forum is reserved for each group), then enter a value for
parentId; for example,
Note:If you created a connection in IDE and not in the application, then the connection must be added to the application. For example, in the Resource Palette under IDE Connections, right-click the connection and select Add to Application.
Save and run your page.
Figure 12-5 shows the Announcements view at runtime. The runtime view is based on the value that was provided for the
Figure 12-5 Announcements View at Runtime
Note:All instances of the Announcements task flow in an application run against the active discussions server, and it serves no purpose to add more than one Announcements task flow instance. This is true for all service task flows that require connections to back-end servers, such as task flows from the Discussions and Mail services.
In a non-secured custom WebCenter application, identity propagation cannot happen. A user will be a guest (or anonymous) user who can view only public categories and forums. In a non-secured application, the
parentId (forum ID) from which announcements are fetched should be a public forum. If the forum is not public, then an error is reported. If the
parentId parameter is not specified, then WebCenter cannot fetch global announcements (that is, announcements not scoped to a forum): global announcements are not available for public users.
In an ADF-secured custom WebCenter application, identity propagation is enabled. Based on the identity, appropriate permissions are matched and corresponding actions are enabled.
The user name that you use to log in to the application will be used to log in to the discussions server. The recommended approach is to have the discussions server and the custom WebCenter application point to the same identity store. To simplify the login process for your custom WebCenter application, you should use the same login credentials for the application as you do for the discussions server. This way, your users can log into the application once and automatically connect to the discussions server.
Note:The Announcements services requires that the identity store be LDAP-based; that is, not file-based with
For information about configuring ADF security, see Section 3.5, "Implementing Security in Your Application."
This section describes optional features available with this service.
The Announcements - Sidebar View is similar to the Announcements view in that it displays announcements and provides tools to create, edit, and delete announcements. It also provides controls for determining when an announcement is published and when it expires. After you create an announcement, you can select the Mail icon next to the announcement to mail the announcement to anyone you choose.
The Announcements - Sidebar View task flow lets you present announcements to end users where manage controls are not needed. Based on the content, it can render in a default view or a custom view.
To add the Announcements - Sidebar View to your custom WebCenter application, follow the same instructions that you did for the Announcements task flow in Section 12.2.2, "Adding the Announcements Service at Design Time," but drag and drop Announcements - Sidebar View onto the page.
Figure 12-6 Edit Task Flow Binding Dialog for Announcements - Sidebar View
Table 12-2 describes the Announcements - Sidebar View parameters. The look and feel of the Announcements - Sidebar View changes with the values provided for these parameters. For more information, see Section 12.3.2, "Customizing Announcements Views."
Table 12-2 Announcements - Sidebar View Task Flow Parameters
The forum ID in the discussions server under which announcement objects are maintained. For example,
If this parameter is not specified, then announcements default to global announcements.
A Boolean value representing whether to remove the announcement title (subject) and show the announcement body as is.
The default value is
The number of announcements to display announcement details in plain text (that is, the body of the announcement). Users can click the title to display the full announcement content in rich text mode.
The value you enter for
For announcements that display announcement body in plain text, this value specifies how many characters to display for each announcement.
Enter an Expression Language (EL) expression. For example, when the value is set to the EL expression
If no value is specified, then it will display 200 characters. If a non-valid positive integer value is specified, then it will display all characters in plain text.
This parameter takes effect in conjunction with
Figure 12-7 shows the Announcements - Sidebar View at runtime with the
freeFlowView parameter set to
Figure 12-7 Announcements - Sidebar View with freeFlowView Parameter
Figure 12-8 shows the Announcements - Sidebar View at runtime with the
freeFlowView parameter set to false (or empty), the
expandedAnnouncements parameter set to 2, and the
truncateAt parameter set to 20.
Figure 12-8 Announcements - Sidebar View with Optional Parameters