Chad Sample Guide

INTRODUCTION

Chad is a simple voting service. It has two perspectives; a user perspective & an administration perspective. The user perspective is the default one, which allows a user to vote for a particular poll, as well as view the results of a poll. In addition, in the administration perspective, an authorized administrator can;

  • 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, also including the line, "We have already received a vote for this poll from your IP address. Hence you are not eligible for voting" below the results graph.

DEFINITIONS

  • CARBON_HOME : Directory to which you installed WSO2 AppServer.
  • MGT_CONSOLE_URL : This is the URL that will be used to access the management console. This will be https://localhost:9443/carbon. This can vary depending on your installation type and the configuration.
  • CHAD_URL : This URL is used to open the CHAD GUI Application. This will be http://localhost:9763/Chad.

DEPLOYING THE CHAD SERVICE

To build the samples you need the Apache Ant build tool.

  • First install WSO2 AppServer (See Installation Guide for details).
  • In the command prompt go to CARBON_HOME/samples/Chad
  • Type ant at the command prompt.
  • Execute the WSO2 AppServer starting script.
  • Check your WSO2 AppServer instance using this URL https://localhost:9443/carbon

Now you will have the Chad service deployed on WSO2 AppServer. You can check this by going to the Management Console and clicking on the "Manage -> Service -> List" link on the left menu. If you see the Chad service listed here, then you know for sure that Chad is active/deployed.

RUNNING THE WEB BASED CHAD CLIENT

You can run the client using a Web browser interface.

  • Run the WSO2 AppServer Server (See Installation Guide for instructions on installation)
  • You can get to the WSO2 AppServer Management Console, sign in, then click on "Manage -> Service -> List" link on the left menu. As Chad service is already deployed you will see the service listed on the page. To run the chad client visit http://localhost:9763/Chad this url will take you to the web based UI of chad application (See User Guide for details for details)
  • Now you will see the user view of the Chad system as shown below. If there are no Active polls, then the page will read as "No polls present". An active poll is a poll open for voting. A normal user can vote using the "Vote" action. He can also see poll results by clicking on the particular poll title.

    Figure 1: User View-before logging in

  • Do an Administrator Login with the given default username and password to have access to administrator privileges to the Chad system. Once logged in as Admin you will have access to the following features
    • Active polls- lists polls that are open for voting. Here you have the option of either stopping the poll or voting. If you click on the name of the poll it will list the poll results
    • Create a poll

      Figure 1: Create Poll



      Vote types available are 'Single Choice' where one can only vote for a single choice and 'Multiple Choice' where one can vote for one or more choices.


      Note: Once a poll is created it is automatically open for voting. Voting is open until explicitly closed using stop option

    • All Polls - lists all polls created

      Figure 2: All 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.



       Figure 3: Poll Results



      Using the Stop action you can close voting after which one cannot vote for that particular poll. Once stopped, the Start link will appear under 'Action' column replacing both Stop and Vote action links.

      Start action reopens a poll for voting.

      Vote action will take you to a page as shown below from which one can vote for his/her preferred choice. This can happen for either a single type vote or a multiple type vote .

      For single type vote:



      Figure 4: Single Vote



      For multiple type vote:



      Figure 5: Multiple Vote

    • Stopped polls- lists polls that have been closed for voting (polls that one cannot vote for).
    • Administrators - allows the user to add new administrators

      Figure 6: Administrators



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

Note: Using mozilla firefox is recommended when running this sample.

APPENDIX