Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of Contents

This sample is a combination of a web app and Axis2 sample, and it depicts the behavior of a simple voting system. It has two perspectives: , which are namely a user perspective and an administration perspective.

...

  • Create new polls
  • Start polls (which have been stopped)
  • Stop polls (which are currently active)
  • Create accounts for new administrators

Only one vote per poll is allowed for a particular IP address and the poll results can be compared using the bar graphs and the relevant percentages of votes each choice has received. If you try voting again using the same IP, you will be directed to the poll results page which that includes the linemessage, "We have already received a vote for this poll from your IP address. Therefore, you are not eligible for voting" below the results graph.

...

Building the

...

To build the samples you need Apache Ant build tool.

1. Install the WSO2 Application Server. 

2. In a command prompt, switch to the Chad directory.

...

sample

The polling station sample is located in <AS_HOME>\samplesSamples\Chad

3. From there, type ant.

4. Run the WSO2 Application Server start script.

5. Chad directory.

  1. For more information, see Building Axis2 Samples.

    Anchor
    5-6
    5-6

  2. Check the WSO2 Application Server instance using this URL: https://localhost:9443/carbon

...

  1.  

...

  1. You now have the Chad service deployed on WSO2 Application Server.

...

  1. On the Main menu, under Services, click List.
    The Deployed Services page will appear with the Chad service listed as deployed.

Running the

...

web-based

...

client

...

  1. Start the WSO2 Application Server if it is not running and ensure that the Chad service is running as explained in

...

  1. steps 2 & 3 above.

...

  1. To run the chad client visit http://localhost:9763/Chad. This is the web-based UI of chad application.

    Info

...

  1. Using Mozilla Firefox is recommended when running this sample.

...

  1. The user view of the Chad system appears.

    Image Modified

If there are no Active polls, the page shows "No polls present". An active poll is a poll open for voting. A normal user can vote using the "Vote" action. He/she can also see poll results by clicking on the particular poll title.

Login to the Chad system as Administrator using the default username and password given. Admin has access to the following features:

  • Create a new poll.
  • Stop voting or remove a poll. If
    You can see the poll results, if you click on the name of a poll in the active polls - lists that are open for voting, you cansee the poll results.

Vote types available are "Single Choice" where only one choice can be voted and "Multiple Choice" where the user can vote for one or more choices. Once a poll is created, it is automatically open for voting. Voting is open until explicitly closed using stop option.

The menu item "All Polls" lists all created polls.

To see Poll results, click on the particular poll listed on any of the Polls lists pages. You will get a page as shown below.:

Using the "Stop" action, you can close voting. Once closed noone no one can vote for that particular poll. Once stopped, the Start link will appear under the 'Action' column replacing both the Stop and Vote action links. Start action reopens a poll for voting. While, the  Vote action takes you to a page as shown below, using which one where you can vote for his/her your preferred choice. This can happen for either a single type vote or a multiple type vote.

For single type voting:

For multiple type voting:

...

  • Stopped polls : List polls that are closed for voting (polls that one cannot vote for).
  • Administrators - Allow the user to add new administrators.

Using this option, you can add new administrators and check the list of current administrators.

...

The WSDL file of the sample can be found in <AS_HOME>\samples\Chad\wsdl directory.