SurveyAdmin

SurveyAdmin is the web application used by employees in the company that surveys users on various topics.

It allows user to do the following:

This is one of the modules related to survey application. The other module, called as user module, is given to students as assignment. It allows users to select a topic and take survey.

Architecture Of the Project

This project uses JSF to build the interface. Managed Beans talk to DAO (Data Access Objects), which talk to database using JDBC.

So overall architecure is - JSF Components -> Managed Beans -> DAO -> JDBC -> Oracle Database.

It also uses a filter (Intercepting Filter design pattern) to ensure only authenticated users access secured pages.

Products used in this project

Steps to download and deploy this project

  1. Download surveyadmin.rar. The .rar file contains the entire source code for the project. Unzip the file into C:\ so that c:\surveyadmin folder is create with all the components of the project.
  2. Go to properties of the project using popup menu. Select libraries node and delete existing libraries using  Remove button. Then add - Oracle - ojdbc14.jar. You have to add these .jar files to the project using Add Jar/Folder button.
  3. Add JSF 1.2 libraries using Add Library button
  4. Create suryvey account with password survey in Oracle10g Express Edition. This must be done after you log in as SYSTEM user. Then create tables listed below.
    create table users
    ( uname varchar2(10) primary key,
      password varchar2(10) 
    );
    
    insert into users values('abc','abc');
    insert into users values('def','d');
    
    
    create table topics
    ( topicid number(5) primary key,
      topictitle varchar2(50),
      addedon  date default sysdate,
      uname    varchar2(10) references users(uname)
    );
    
    
    insert into topics values(1001,'Programming Languages',sysdate,'abc');
    insert into topics values(1002,'Web Frameworks',sysdate,'abc');
    
    create sequence topicid_sequence start with 1010 nocache;
    
    create table questions
    (questionid number(5) primary key,
     questiontext varchar2(200) not null,
     opt1  varchar2(50) not null,
     opt2 varchar2(50) not null,
     opt3 varchar2(50) not null,
     topicid number(5) references topics(topicid)
    );
    
    insert into questions values(2000,'What is your fav. dynamic Language','Javascript','Ruby','Python',1001);
    insert into questions values(2001,'What is your primary tool for writing code?','IDE','Text Editor','Both',1001);
    
    
    insert into questions values(2002,'Which MVC framework do you use?','JSF','Struts','Spring',1002);
    insert into questions values(2003,'Which Javascript library do you use?','JQuery','GWT','Others',1002);
    
    create sequence questionid_sequence start with 2010 nocache;  
    
    create table answers_master
    (  surveyid number(5) primary key,
       topicid  number(5) references topics(topicid) on delete cascade,
       takenon  date
    );
    
    insert into answers_master values (1,1001,sysdate);
    insert into answers_master values(2,1001,sysdate);
    insert into answers_master values(3,1002,sysdate);
    insert into answers_master values(4,1002,sysdate);
    
    
    create table answers_details
    (  surveyid number(5) references answers_master(surveyid)  on delete cascade,
       questionid number(5) references questions(questionid),
       answer   char(1),
       primary key(surveyid,questionid)
    );
    
    insert into answers_details values(1,2000,1);
    insert into answers_details values(1,2001,1);
    
    
    insert into answers_details values(2,2000,1);
    insert into answers_details values(2,2001,2);
    
    insert into answers_details values(3,2002,2);
    insert into answers_details values(3,2003,1);
    
    
    insert into answers_details values(4,2002,1);
    insert into answers_details values(4,2003,3);
    
    
    
    
  5. Start NetBeans 6.8. Open the project from c:\surveyadmin folder.
  6. Run login.jsp, login and try the remaing pages.