Having users create Polls in your (and their) ADF/WebCenter application – at run time

The Patch Set 3 release of Oracle Fusion Middleware hit the streets a few days back. For many of the FMW components, this release is one that fixes bugs, stabilizes, provides better integration and perhaps adds a feature or two. Nothing major really. However, for WebCenter this Patch Set 3 is pretty substantial, in terms of new functionality! Especially when it comes to ‘design time @ run time’ and the availability of services around social networking and collaboration as well as content integration, PS3 is quite impressive. In a recent article I demonstrated one of the PS3 Design Time at Run Time features: ‘create data controls at run time’: https://technology.amis.nl/blog/10555/webcenter-11gr1-ps3-design-time-at-run-time-with-a-vengeance-introducing-run-time-data-controls-and-data-visualizations.

This article discusses another interesting piece of functionality that hands over control to run time administrators, content editors and perhaps even end users: the Polls Service. Through the Polls Service, surveys or polls can be created at run time. Questions can be defined, the results can be analyzed and administration facilities are provided – such as when the poll opens and closes and making sure that a user cannot take the poll multiple times. To use the Polls Service, a Data Source connecting to the WebCenter database schema needs to be set up (same as for many of the WC Services).

An example of a poll, created at run time, is shown below:


This article demonstrates how a default Portal Framework Application – with absolutely no design time coding applied – is enhanced at run time through the creation of a poll. This poll surveys the interests and opinions of employees of the company about the yearly company outing – always a hotly debated topic.

Assuming that JDeveloper 11gR1 PS3 with the WebCenter extensions is up and running and assuming that a default (WebCenter) Portal Framework application was created and the index.html file in that application is started on the Integrated WLS and finally assuming that a user with administration privileges is logged in (say weblogic/weblogic1) and has entered the administration page, here it goes:

On the Services tab, click the Polls Service. Then click the Create Poll icon.


The Create Poll popup appears. Provide name and description for the poll.


Then click Create to create the poll.


The overview of the poll appears. Open the Add dropdown menu and select the option to add a question. Note that with Add Section we can structure a more extensive poll and with Apply Template we can populate the poll with an existing template (poll).


Select the type of the new question. Note that only questions with predefined answers are supported: a question type with a free format answer is not available. However, it is possible to include a free format comment field with each question, so with a little trickery it is more or less possible to have free format answer-type questions.

For the question type Multiple Choice (Only One Answer) – a radio button style question – we need to provide the question and all the answer options:


We can allow poll-takers to type a comment – and specify the label for that comment field – and indicate whether a poll can be completed without an answer to this question (Require Answer to Question). Click OK to create the question.


We will add a second question, of the Matrix type:


Press OK to complete the creation of the question.


Click on the Schedule tab to configure when the poll will be available for completion.


We can also indicate the introduction message for the poll and the text that is shown to the user when she or he completes the survey.

Click on the Settings tab:


Rather than showing the exit message, it might be more interesting for users to see the results of the poll so far, including their own responses. The results are shown graphically.


Click on Save to close the Poll-editor and commit all changes.


The overview page with all polls appears. Click on the Services tab. We will now add the new Poll to one of the pages in the Portal. Since we have only a single page at this point – Home – we will add the poll to that page.


Select the Home page and select Edit Page from the Actions menu. Home appears in Edit mode.


Press the Add Content button. This will bring up the Resource Catalog Browser.


Open the Polls and Surveys folder. Click on the Add icon for Take Polls. Since there is only one Poll available, we do not need to explicitly select it. This Company Outing poll is automatically added to the Home page.


Close the page editor. This returns the user to the page in view mode. Now we can actually participate in the survey, as is shown below.


Click on the Vote button to submit the answers to the poll’s questions.

The results of the poll so far appear. Since our user is the only one to have participated, these results are fairly unsurprising:


Each question has its own graphical overview:


When the users leaves the poll results and returns to the Home page, the Take Polls area is empty, as their are no more polls for the user to participate in. Note: when there are multiple open polls in the application that the user has not yet participated in, the most recent is displayed in this area. When the user has participated in the most recent poll, the next in line will be displayed. Alternatively, the administrator can make this area display only one specifically selected poll, instead of the most recent one not yet participated in.


After multiple users have participated in the poll, the analysis of the results becomes a little more interesting and we can start planning the company event:


although there seems to be little common ground between all respondents…



It is extremely simple to have application administrators or content editors or other qualified staff create polls in the portal application (note: any ADF application enriched with WebCenter Services can be called a portal application, there is nothing really special about it). Creating a poll is very simple – no technical skills required. The polls look pretty okay – and will assume the same style used by the application at large. The graphical visualization of the poll results is slick – and I have not even shown the 3D view. Well, here it comes:


Quickly gathering information to impromptu questions is dead easy.

I feel it is a little unfortunate that only questions with predefined choices are available. I can see how these questions are easier to process and the comment field provides some sort of work around. I guess the Polls Service is not meant to a real “form-editor at run time” (that facility exists through the “data control and data visualization at run time ” feature.

Note that it is not just at run time that we can add Polls Service components to the application, we can do the same at design time. Below is the Resource Palette with the Data Controls and Task Flows available around Polls.


However, the definition of the Polls is a runtime activity.

Note: at this point I have not yet figured out how to take a look at the values entered in the comments fields that can be defined for each of the poll questions. They do not seem to be included in the standard View Poll Results facilities and may have to be added using the Take Poll Data Control’s getResults operation or perhaps through a customized version of the View Poll Results task flow. More on that in a later article.

Note2: the results from all polls are stored in the WebCenter database schema. The table WC_SURVEY_RESPONSE contains the answers to the polls.


On closer inspection, it seems like the values from the comment fields are not even stored in the database right now. Could this be a bug?


WebCenter 11gR1 PS3 Developer Guide on Polls Service: http://download.oracle.com/docs/cd/E17904_01/webcenter.1111/e10148/jpsdg_polls.htm

WebCenter 11g R1 PS 3 User Guide – Working with the Polss Service: http://download.oracle.com/docs/cd/E17904_01/webcenter.1111/e10149/polls.htm#WCSUG6961

One Response

  1. Pramod August 4, 2011