Oracle® Fusion Middleware Developer's Guide for Oracle WebCenter 11g Release 1 (11.1.1.4.0) E10148-12 |
|
![]() Previous |
![]() Next |
This chapter explains how to integrate the Polls service into a WebCenter Portal application at design time. For more information about using polls, see "Working with the Polls Service" in the Oracle Fusion Middleware User's Guide for Oracle WebCenter Spaces.
This chapter includes the following sections:
The Polls service lets you create, edit, and take online polls on your application pages. Polls let you survey your audience (such as their opinions and their experience level), check whether they can recall important information, and gather feedback on the efficacy of presentations.
This section includes the following subsections:
In addition to taking available polls, the Polls service lets you do the following:
Quickly create and publish polls.
Customize an existing poll; for example, add or change questions, and publish (open) and close the poll.
Take a specific or the most recently-published poll
View poll results
See the status of all polls and available actions for each poll, such as edit, delete, publish, analyze, and clear results.
The Polls service is integrated with the Instant Messaging and Presence service in the Polls Manager.
In a WebCenter Portal application, the Polls service requires a connection to WebCenter database schema. For details about setting up a database connection, see Section 7.2.2, "Setting Up a Database Connection."
At runtime, users can quickly create polls with just a name and a question. Figure 37-1 shows a sample quick view poll.
WebCenter application administrators can access the Polls Manager, which lets you create polls with multiple questions or with templates. The Actions dropdown list lets continue designing the poll, publish the polls, analyze results, clear results, and delete the poll (Figure 37-2).
Polls created through the Polls Manager must be published and open to be taken. Users cannot take unpublished or closed polls.
For more information about the service at runtime, see Oracle Fusion Middleware User's Guide for Oracle WebCenter Spaces.
This section describes required steps for adding this service to your application. It includes the following subsections:
The Polls service requires a connection to the database where the WebCenter schema is installed. For details about setting up a database connection, see Section 7.2.2, "Setting Up a Database Connection."
This section explains a basic incorporation of the Polls service. It includes the following sections:
Section 37.2.2.2, "How to Add the Polls Quick View to Your Page"
Section 37.2.2.3, "How to Modify the Polls Service Task Flow Parameters"
The Polls service includes the task flows described in Table 37-1.
Table 37-1 Polls Task Flows
Task Flow | Description |
---|---|
This task flow displays a view that enables users to create one-question polls to be published immediately. Each quick poll needs its own Polls - Quick View task flow on the page. |
|
This task flow allows users to perform administrative operations on the polls. Any user who has access to this task flow can perform the administrative operations, such as edit or delete the poll. |
|
This task flow displays the most recently-published available poll, unless it is set to a specific poll in the |
|
This task flow displays the results of a poll as a graph for the supplied |
The Polls - Quick View task flow display polls and provides tools to create, edit, and delete polls. It also provides controls for determining when a poll when it expires. This task flow lets you present polls to end users where manage controls are not needed.
To add the Polls Quick View task flow to your WebCenter Portal application:
Open the page on which you want to add the service.
In the Resource Palette, expand My Catalogs, WebCenter Services Catalog, and Task Flows.
Drag Polls - Quick View from the Resource Palette and drop it onto the page inside of the af:form
begin
and end
tags.
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.
Click OK.
Save and run your page.
The Polls service task flows have optional task flow binding parameters.
In addition to providing required values for successful task flow rendering, you can use task flow parameters to customize the appearance and behavior of a task flow instance. For example, you can use parameter values to set which poll to display.
You can adjust the parameter values when you drop the task flows onto a page or after you have placed a task flow on a page:
Navigate to the Edit Task Flow Binding dialog by clicking the Bindings tab at the bottom of the page (next to the Source tab).
Under Executables, you'll see the task flow you added. Figure 37-4 shows an example of a Search task flow in the Executables section.
Select the task flow, and next to the Executables heading, click the Edit selected element (pencil) icon.
In the Edit Task Flow Binding dialog Figure 37-4, revise the binding parameter values as required.
Figure 37-4 Edit Task Flow Binding Dialog for Polls Manager Task Flow
When you are finished, click OK.
Save and run your page to see the results.
Table 37-2 describes the properties that are unique to the Polls task flows.
Table 37-2 Polls Service Task Flow Parameters
Property | Description |
---|---|
The Space name from which polls are to be fetched. If this is supplied, then polls of that particular Space are shown. If this is not supplied, then it fetches polls from all Spaces. This parameter appears in the properties for the Polls Manager task flow. |
|
This parameter determines whether to display all polls or only those polls created by the user. The default (No) is to show all polls. Set to Yes to display only those polls created by the user. If the This parameter appears in the properties for the Polls Manager task flow. |
|
The poll to display. This parameter appears in the properties for the following task flows.
|
|
This parameter determines whether users can edit a quick poll. When a quick poll is in Edit mode, a Design Poll box for editing the poll appears. When a quick poll is not a Edit mode, the Design Poll box for editing is not visible. This parameter appears in the properties for the Quick Poll task flow. |
The Polls service does not require security. Administrators control access to Polls task flows through the Resource Catalog, where they define the users and groups privileged to see polls. Security is driven by the page security on which the task flow exists or by the task flow permissions on that page. Any user who can see the task flow can edit the poll.
ADF security is configured by default if you created your application using the WebCenter Portal Application template. For information about configuring ADF security, see Section 63.3, "Configuring ADF Security"
This section describes optional features available with this service. It includes the following subsections:
The Polls Manager task flow provides a complete view of polls and perform actions on them.
To add this to your WebCenter Portal application, follow the same instructions that you did for the Polls Manager task flow in Section 37.2.2, "Adding the Polls Service at Design Time," but drag and drop Polls Manager onto the page.
This task flow displays published polls for users to take. It displays the most recently-published available poll, unless it is set to display a specific poll with the pollId
parameter. After a user submits a response for that poll, it displays the next most recently-published poll.
To add this to your WebCenter Portal application, follow the same instructions that you did for the Polls Manager task flow in Section 37.2.2, "Adding the Polls Service at Design Time," but drag and drop Polls - Take Polls onto the page.
The View Poll Results task flow displays the results of a poll as a graph for the poll supplied with the required pollId
parameter.
To add this task flow to your WebCenter Portal application, follow the same instructions that you did for the Polls Manager task flow in Section 37.2.2, "Adding the Polls Service at Design Time," but drag and drop Polls - View Poll Results onto the page.
Use the Polls service data controls to build a customized user interface for polls with a WebCenter Portal application or a custom task flow.
The Polls service includes two data controls to customize the user interface:
The Take Poll data control contains the following methods:
This method lets users respond to a particular poll. Table 37-3 describes the required parameters for this method.
This method lets users respond to the most recently-published poll. It has no parameters.
Table 37-4 describes the required parameters for this method.
This method gets the poll results for a particular poll. Table 37-5 describes the required parameters for this method.
Table 37-6 describes the required parameters for this method.
The Polls Manager data control contains the following methods:
This method creates polls with multiple choice questions. Table 37-7 describes the required parameters for this method.
Table 37-7 addQuestion Input Parameters
Parameter | Type | Description |
---|---|---|
|
String |
The poll to display. |
|
String |
The text of the question; for example, What is your favorite color? |
|
String |
Corresponding list of options for the question. This should be line-separated list of options. |
|
Boolean |
True to allow multiple options to be selected; false to allow only a single option selection. |
This method creates complex polls with matrix-type questions. Table 37-8 describes the required parameters for this method.
Table 37-8 addQuestion Input Parameters
Parameter | Type | Description |
---|---|---|
|
String |
The poll to display. |
|
QuestionType |
Question type, either:
|
|
String |
The text of the question; for example, What is your favorite color? |
|
String |
Corresponding list of options for the question. This should be line-separated list of options. |
|
String |
Column options. |
|
Boolean |
True if the question is optional (that is, users can ignore answering it); false if question is mandatory. |
|
String |
Enables a comment field for users to provide feedback or enter personalized text with their answers. |
|
Integer |
Size for the comment field. To capture feedback, set this to 3; otherwise, set it to 1. This parameter value depends on the type of answer expected in the comment field. |
This method closes a particular poll. Table 37-9 describes the required parameters for this method.
This method closes a poll on a specific date. Table 37-10 describes the required parameters for this method.
This poll closes a poll at a set number of days after the poll is published. Table 37-11 describes the required parameters for this method.
This method closes as poll after a set number of responses have been collected. Table 37-12 describes the required parameters for this method.
This method creates a quick poll. Table 37-13 describes the required parameters for this method.
This method deletes a particular poll. Table 37-14 describes the required parameters for this method.
Table 37-15 describes the required parameters for this method.
This method edits a particular poll. Table 37-16 describes the required parameters for this method.
This method finds a particular poll. Table 37-17 describes the required parameters for this method.
This method displays all polls, as defined in its parameters. Table 37-18 describes the required parameters for this method.
This method displays polls created by a particular user. Table 37-19 describes the required parameters for this method.
Table 37-19 getPollsByUser Input Parameters
Parameter | Type | Description |
---|---|---|
|
String |
User name of the person who created the poll. |
|
Integer |
The index of the first matching result that should be included in the result set (0-n ... zero based). This is used for pagination. |
|
Integer |
The number or results to display. |
Table 37-20 describes the required parameters for this method.
This method publishes a particular poll. Table 37-21 describes the required parameters for this method.
This method publishes a poll on a specific date. Table 37-22 describes the required parameters for this method.