diff --git a/Online Survey System Java Project/Project Abstract/Synopsis.doc b/Online Survey System Java Project/Project Abstract/Synopsis.doc new file mode 100644 index 0000000..a9ac95a Binary files /dev/null and b/Online Survey System Java Project/Project Abstract/Synopsis.doc differ diff --git a/Online Survey System Java Project/survey/build.xml b/Online Survey System Java Project/survey/build.xml new file mode 100644 index 0000000..0c6ec27 --- /dev/null +++ b/Online Survey System Java Project/survey/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project survey. + + + diff --git a/Online Survey System Java Project/survey/build/web/META-INF/MANIFEST.MF b/Online Survey System Java Project/survey/build/web/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Online Survey System Java Project/survey/build/web/WEB-INF/classes/beans/Question.class b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/beans/Question.class new file mode 100644 index 0000000..d8f4110 Binary files /dev/null and b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/beans/Question.class differ diff --git a/Online Survey System Java Project/survey/build/web/WEB-INF/classes/beans/Topic.class b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/beans/Topic.class new file mode 100644 index 0000000..f806cf1 Binary files /dev/null and b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/beans/Topic.class differ diff --git a/Online Survey System Java Project/survey/build/web/WEB-INF/classes/dao/Database.class b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/dao/Database.class new file mode 100644 index 0000000..a50cea5 Binary files /dev/null and b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/dao/Database.class differ diff --git a/Online Survey System Java Project/survey/build/web/WEB-INF/classes/dao/TopicDAO.class b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/dao/TopicDAO.class new file mode 100644 index 0000000..86c7bfc Binary files /dev/null and b/Online Survey System Java Project/survey/build/web/WEB-INF/classes/dao/TopicDAO.class differ diff --git a/Online Survey System Java Project/survey/build/web/WEB-INF/sun-web.xml b/Online Survey System Java Project/survey/build/web/WEB-INF/sun-web.xml new file mode 100644 index 0000000..011787b --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/WEB-INF/sun-web.xml @@ -0,0 +1,11 @@ + + + + /survey + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Online Survey System Java Project/survey/build/web/WEB-INF/web.xml b/Online Survey System Java Project/survey/build/web/WEB-INF/web.xml new file mode 100644 index 0000000..03b8123 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + *.xhtml + + + + 30 + + + + faces/index.xhtml + + diff --git a/Online Survey System Java Project/survey/build/web/error.xhtml b/Online Survey System Java Project/survey/build/web/error.xhtml new file mode 100644 index 0000000..c6bbed8 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/error.xhtml @@ -0,0 +1,18 @@ + + + + + Error Page + + + +
+
Survey
+

Sorry! There was an error due to which your survey results cannot be processed.

+

+ Click here to select your topic of survey and try again! +

+
+ + diff --git a/Online Survey System Java Project/survey/build/web/finish.xhtml b/Online Survey System Java Project/survey/build/web/finish.xhtml new file mode 100644 index 0000000..6c84880 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/finish.xhtml @@ -0,0 +1,19 @@ + + + + + Thank You + + + +
+
Survey
+

Thank You for participating in the survey.

+

+ Click here to select your topic of survey. +

+
+ + diff --git a/Online Survey System Java Project/survey/build/web/index.xhtml b/Online Survey System Java Project/survey/build/web/index.xhtml new file mode 100644 index 0000000..5fa2e62 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/index.xhtml @@ -0,0 +1,33 @@ + + + + + Select Topic + + + +
+ +
Survey
+

Select Topic

+ Available Topics : + + + + +

+ + +

+

Click on Submit button to start participating in the survey.

+

+

+ +
+
+
+
+ + diff --git a/Online Survey System Java Project/survey/build/web/resources/css/cssLayout.css b/Online Survey System Java Project/survey/build/web/resources/css/cssLayout.css new file mode 100644 index 0000000..234e260 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/Online Survey System Java Project/survey/build/web/resources/css/default.css b/Online Survey System Java Project/survey/build/web/resources/css/default.css new file mode 100644 index 0000000..beb5892 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/Online Survey System Java Project/survey/build/web/styles.css b/Online Survey System Java Project/survey/build/web/styles.css new file mode 100644 index 0000000..916764c --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/styles.css @@ -0,0 +1,58 @@ +body { + font-family:verdana; + font-size:12pt; + background-color: black; +} +.header { + background-color: #ff0000; + font-weight: bold; + color: #ffffff; + font-size: 30px; + letter-spacing: 5pt; + font-family: Arial; +} + +.qno { + font-weight: bold; + font-size: 12px; + font-family: Verdana; +} +.question { + background-color: #cccccc; + font-weight: bold; + font-size: 14px; + font-family: Verdana; + margin-top: 5pt; + margin-bottom: 5pt; + text-align:left; +} + +.options { + text-align:left; + font-weight: bold; + font-size: 12px; + font-family: Verdana; +} + +h3 { + font-family: Arial; + font-size: 14px; + font-weight: 700; +} + +h2 { + font-family: Arial; + font-size: 22px; + color:blue; + font-weight: 700; + +} + +.content { + background-color: white; + width: 600px; + height:800px; + overflow: visible; + margin-left: auto ; + margin-right: auto ; +} \ No newline at end of file diff --git a/Online Survey System Java Project/survey/build/web/survey.jpg b/Online Survey System Java Project/survey/build/web/survey.jpg new file mode 100644 index 0000000..f14d8ea Binary files /dev/null and b/Online Survey System Java Project/survey/build/web/survey.jpg differ diff --git a/Online Survey System Java Project/survey/build/web/survey.xhtml b/Online Survey System Java Project/survey/build/web/survey.xhtml new file mode 100644 index 0000000..13b7475 --- /dev/null +++ b/Online Survey System Java Project/survey/build/web/survey.xhtml @@ -0,0 +1,67 @@ + + + + + + + Survey + + + +
+ +
Survey
+

+

+ Question : / +
+

+

+

+ +

+

+

+

+ + + +
+

+

+ + + +   + + + +   + + +   + + +

+ +

+
+

+
    +
  • Click on NEXT button for next question
  • +
  • Click on PREVIOUS button for previous question
  • +
  • Click on FINISH to finish your survey
  • +
  • Click on CANCEL button to cancel this survey and go to selection of topic
  • +
+

+
+ +
+
+
+
+ + diff --git a/Online Survey System Java Project/survey/build/web/topic.jpg b/Online Survey System Java Project/survey/build/web/topic.jpg new file mode 100644 index 0000000..6864508 Binary files /dev/null and b/Online Survey System Java Project/survey/build/web/topic.jpg differ diff --git a/Online Survey System Java Project/survey/nbproject/ant-deploy.xml b/Online Survey System Java Project/survey/nbproject/ant-deploy.xml new file mode 100644 index 0000000..b03100d --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/ant-deploy.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Online Survey System Java Project/survey/nbproject/build-impl.xml b/Online Survey System Java Project/survey/nbproject/build-impl.xml new file mode 100644 index 0000000..fa1314d --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/build-impl.xml @@ -0,0 +1,976 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Online Survey System Java Project/survey/nbproject/genfiles.properties b/Online Survey System Java Project/survey/nbproject/genfiles.properties new file mode 100644 index 0000000..c307e55 --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=6bbe641e +build.xml.script.CRC32=81731ee8 +build.xml.stylesheet.CRC32=651128d4@1.24.2.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=6bbe641e +nbproject/build-impl.xml.script.CRC32=51ff7143 +nbproject/build-impl.xml.stylesheet.CRC32=8419264d@1.24.2.1 diff --git a/Online Survey System Java Project/survey/nbproject/private/private.properties b/Online Survey System Java Project/survey/nbproject/private/private.properties new file mode 100644 index 0000000..9c8d706 --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/private/private.properties @@ -0,0 +1,7 @@ +deploy.ant.properties.file=G:\\Documents and Settings\\Srikanth Pragada\\.netbeans\\6.9\\gfv31188857282.properties +j2ee.platform.is.jsr109=true +j2ee.server.home=G:\\netbeans6.9\\glassfish-3.0.1\\glassfish +j2ee.server.instance=[G:\\netbeans6.9\\glassfish-3.0.1\\glassfish]deployer:gfv3ee6:localhost:4848 +javac.debug=true +javadoc.preview=true +user.properties.file=G:\\Documents and Settings\\Srikanth Pragada\\.netbeans\\6.9\\build.properties diff --git a/Online Survey System Java Project/survey/nbproject/private/private.xml b/Online Survey System Java Project/survey/nbproject/private/private.xml new file mode 100644 index 0000000..cc2c0e5 --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/Online Survey System Java Project/survey/nbproject/project.properties b/Online Survey System Java Project/survey/nbproject/project.properties new file mode 100644 index 0000000..570dae8 --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/project.properties @@ -0,0 +1,90 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-6.0.classpath} +excludes= +file.reference.ojdbc14.jar=C:\\oraclexe\\app\\oracle\\product\\10.2.0\\server\\jdbc\\lib\\ojdbc14.jar +includes=** +j2ee.deploy.on.save=true +j2ee.platform=1.6-web +j2ee.platform.classpath=${j2ee.server.home}\\modules\\javax.servlet.jsp.jar:${j2ee.server.home}\\modules\\javax.jms.jar:${j2ee.server.home}\\modules\\jstl-impl.jar:${j2ee.server.home}\\modules\\endorsed\\jaxb-api-osgi.jar:${j2ee.server.home}\\modules\\javax.security.jacc.jar:${j2ee.server.home}\\modules\\javax.persistence.jar:${j2ee.server.home}\\modules\\weld-osgi-bundle.jar:${j2ee.server.home}\\modules\\javax.servlet.jsp.jstl.jar:${j2ee.server.home}\\modules\\javax.transaction.jar:${j2ee.server.home}\\modules\\endorsed\\webservices-api-osgi.jar:${j2ee.server.home}\\modules\\javax.ejb.jar:${j2ee.server.home}\\modules\\javax.security.auth.message.jar:${j2ee.server.home}\\modules\\javax.management.j2ee.jar:${j2ee.server.home}\\modules\\jsr311-api.jar:${j2ee.server.home}\\modules\\javax.resource.jar:${j2ee.server.home}\\modules\\javax.servlet.jar:${j2ee.server.home}\\modules\\bean-validator.jar:${j2ee.server.home}\\modules\\jsf-api.jar:${j2ee.server.home}\\modules\\endorsed\\javax.annotation.jar:${j2ee.server.home}\\modules\\javax.enterprise.deploy.jar:${j2ee.server.home}\\modules\\jsf-impl.jar:${j2ee.server.home}\\modules\\mail.jar +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}\\lib\\embedded\\glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}\\modules\\webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}\\modules\\webservices-osgi.jar:${j2ee.server.home}\\modules\\endorsed\\webservices-api-osgi.jar:${j2ee.server.home}\\modules\\jaxb-osgi.jar:${j2ee.server.home}\\modules\\endorsed\\jaxb-api-osgi.jar:${j2ee.server.home}\\modules\\javax.ejb.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}\\modules\\webservices-osgi.jar:${j2ee.server.home}\\modules\\endorsed\\webservices-api-osgi.jar:${j2ee.server.home}\\modules\\jaxb-osgi.jar:${j2ee.server.home}\\modules\\endorsed\\jaxb-api-osgi.jar:${j2ee.server.home}\\modules\\javax.ejb.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv3ee6 +jar.compress=false +javac.classpath=\ + ${libs.jsf20.classpath}:\ + ${libs.jstl11.classpath}:\ + ${file.reference.ojdbc14.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=survey.war +war.name=survey.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/Online Survey System Java Project/survey/nbproject/project.xml b/Online Survey System Java Project/survey/nbproject/project.xml new file mode 100644 index 0000000..5c527b8 --- /dev/null +++ b/Online Survey System Java Project/survey/nbproject/project.xml @@ -0,0 +1,31 @@ + + + org.netbeans.modules.web.project + + + survey + 1.6.5 + + + ${libs.jsf20.classpath} + WEB-INF/lib + + + ${libs.jstl11.classpath} + WEB-INF/lib + + + ${file.reference.ojdbc14.jar} + WEB-INF/lib + + + + + + + + + + + + diff --git a/Online Survey System Java Project/survey/src/conf/MANIFEST.MF b/Online Survey System Java Project/survey/src/conf/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/Online Survey System Java Project/survey/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Online Survey System Java Project/survey/src/java/beans/Question.java b/Online Survey System Java Project/survey/src/java/beans/Question.java new file mode 100644 index 0000000..2900cc3 --- /dev/null +++ b/Online Survey System Java Project/survey/src/java/beans/Question.java @@ -0,0 +1,50 @@ +package beans; + +import javax.faces.bean.ManagedBean; +import javax.faces.model.SelectItem; + +@ManagedBean +public class Question { + private String id, text, answer; + + public String getAnswer() { + return answer; + } + + public void setAnswer(String answer) { + this.answer = answer; + } + + public SelectItem[] getOptions() { + return options; + } + + public void setOptions(SelectItem[] options) { + this.options = options; + } + private SelectItem options[] = new SelectItem[3]; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + public Question() { + } + public Question(String id, String text, String opt1, String opt2, String opt3) { + this.id = id; + this.text = text; + this.options[0] = new SelectItem(1,opt1); + this.options[1] = new SelectItem(2,opt2); + this.options[2] = new SelectItem(3,opt3); + } +} diff --git a/Online Survey System Java Project/survey/src/java/beans/Topic.java b/Online Survey System Java Project/survey/src/java/beans/Topic.java new file mode 100644 index 0000000..d637322 --- /dev/null +++ b/Online Survey System Java Project/survey/src/java/beans/Topic.java @@ -0,0 +1,93 @@ +package beans; + +import dao.TopicDAO; +import java.util.ArrayList; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.event.ActionEvent; +import javax.faces.model.SelectItem; + +@ManagedBean +@SessionScoped +public class Topic { + private String title, id; + private ArrayList questions = null; + private int position = 0; + + public int getPosition() { + return position; + } + public Topic() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + + public Topic(String id, String title) { + this.title = title; + this.id = id; + } + + public String process() { + // get questions for the selected topic + position = 0; + questions = TopicDAO.getQuestions(id); + return "survey"; + } + + public ArrayList getTopics() { + ArrayList lst = TopicDAO.getTopics(); + ArrayList items = new ArrayList(); + + for ( Topic t : lst) + items.add( new SelectItem( t.getId(), t.getTitle())); + + return items; + } + + public Question getQuestion() { + return questions.get(position); + } + + public int getQuestionCount() { + return questions.size(); + } + + public void next(ActionEvent evt) { + position ++; + } + + public void previous(ActionEvent evt) { + position --; + } + + public String cancel() { + return "index"; + } + + public String finish() { + // process the results + boolean done = TopicDAO.storeSurveyResults(id, questions); + if ( done ) + return "finish"; + else + return "error"; + } + + + +} diff --git a/Online Survey System Java Project/survey/src/java/dao/Database.java b/Online Survey System Java Project/survey/src/java/dao/Database.java new file mode 100644 index 0000000..66e7c5b --- /dev/null +++ b/Online Survey System Java Project/survey/src/java/dao/Database.java @@ -0,0 +1,27 @@ +package dao; +import java.sql.Connection; +import java.sql.DriverManager; +public class Database { + + public static Connection getConnection() { + try { + Class.forName("oracle.jdbc.driver.OracleDriver"); + Connection con = DriverManager.getConnection + ("jdbc:oracle:thin:@localhost:1521:xe", + "survey","survey"); + return con; + } + catch(Exception ex) { + System.out.println("Database.getConnection() Error -->" + ex.getMessage()); + return null; + } + } + + public static void close(Connection con) { + try { + con.close(); + } + catch(Exception ex) { + } + } +} diff --git a/Online Survey System Java Project/survey/src/java/dao/TopicDAO.java b/Online Survey System Java Project/survey/src/java/dao/TopicDAO.java new file mode 100644 index 0000000..2c5ae9c --- /dev/null +++ b/Online Survey System Java Project/survey/src/java/dao/TopicDAO.java @@ -0,0 +1,77 @@ +package dao; +import beans.Question; +import beans.Topic; +import java.sql.Statement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; + +public class TopicDAO { + public static ArrayList getTopics() { + try { + Connection con = Database.getConnection(); + Statement statement = con.createStatement(); + ResultSet rs = statement.executeQuery("select * from topics order by topictitle"); + ArrayList al = new ArrayList(); + while (rs.next()) { + al.add( new Topic(rs.getString("topicid"), rs.getString("topictitle"))); + } + rs.close(); + return al; + } catch (Exception e) { + System.out.println("Error In TopicDAO.getTopics() -->" + e.getMessage()); + return (null); + } + } + + public static ArrayList getQuestions(String topicid) { + try { + Connection con = Database.getConnection(); + PreparedStatement ps = con.prepareStatement("select * from questions where topicid = ? order by questionid"); + ps.setString(1, topicid); + ResultSet rs = ps.executeQuery(); + + ArrayList al = new ArrayList(); + while (rs.next()) { + al.add(new Question(rs.getString("questionid"), rs.getString("questiontext"), rs.getString("opt1"), rs.getString("opt2"), rs.getString("opt3"))); + } + rs.close(); + return al; + } catch (Exception e) { + System.out.println("Error In TopicDAO.getQuestions() -->" + e.getMessage()); + return (null); + } + } + + public static boolean storeSurveyResults(String topicid, ArrayList questions) { + Connection con = null; + PreparedStatement ps = null; + try { + con = Database.getConnection(); + con.setAutoCommit(false); + ps = con.prepareStatement("insert into answers_master values( surveyid_sequence.nextval,?,sysdate)"); + ps.setString(1, topicid); + ps.executeUpdate(); + + ps = con.prepareStatement("insert into answers_details values( surveyid_sequence.currval, ?,?)"); + + for( Question q : questions) { + ps.setString(1, q.getId()); + ps.setString(2, q.getAnswer()); + ps.executeUpdate(); + } + con.commit(); + return true; + } catch (Exception ex) { + System.out.println("Error in TopicDAO.storeSurveyResults() -->" + ex.getMessage()); + try { + con.rollback(); + } catch (Exception nex) { + } + return false; + } finally { + Database.close(con); + } + } +} diff --git a/Online Survey System Java Project/survey/web/WEB-INF/sun-web.xml b/Online Survey System Java Project/survey/web/WEB-INF/sun-web.xml new file mode 100644 index 0000000..011787b --- /dev/null +++ b/Online Survey System Java Project/survey/web/WEB-INF/sun-web.xml @@ -0,0 +1,11 @@ + + + + /survey + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Online Survey System Java Project/survey/web/WEB-INF/web.xml b/Online Survey System Java Project/survey/web/WEB-INF/web.xml new file mode 100644 index 0000000..03b8123 --- /dev/null +++ b/Online Survey System Java Project/survey/web/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + *.xhtml + + + + 30 + + + + faces/index.xhtml + + diff --git a/Online Survey System Java Project/survey/web/error.xhtml b/Online Survey System Java Project/survey/web/error.xhtml new file mode 100644 index 0000000..c6bbed8 --- /dev/null +++ b/Online Survey System Java Project/survey/web/error.xhtml @@ -0,0 +1,18 @@ + + + + + Error Page + + + +
+
Survey
+

Sorry! There was an error due to which your survey results cannot be processed.

+

+ Click here to select your topic of survey and try again! +

+
+ + diff --git a/Online Survey System Java Project/survey/web/finish.xhtml b/Online Survey System Java Project/survey/web/finish.xhtml new file mode 100644 index 0000000..6c84880 --- /dev/null +++ b/Online Survey System Java Project/survey/web/finish.xhtml @@ -0,0 +1,19 @@ + + + + + Thank You + + + +
+
Survey
+

Thank You for participating in the survey.

+

+ Click here to select your topic of survey. +

+
+ + diff --git a/Online Survey System Java Project/survey/web/index.xhtml b/Online Survey System Java Project/survey/web/index.xhtml new file mode 100644 index 0000000..5fa2e62 --- /dev/null +++ b/Online Survey System Java Project/survey/web/index.xhtml @@ -0,0 +1,33 @@ + + + + + Select Topic + + + +
+ +
Survey
+

Select Topic

+ Available Topics : + + + + +

+ + +

+

Click on Submit button to start participating in the survey.

+

+

+ +
+
+
+
+ + diff --git a/Online Survey System Java Project/survey/web/resources/css/cssLayout.css b/Online Survey System Java Project/survey/web/resources/css/cssLayout.css new file mode 100644 index 0000000..234e260 --- /dev/null +++ b/Online Survey System Java Project/survey/web/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/Online Survey System Java Project/survey/web/resources/css/default.css b/Online Survey System Java Project/survey/web/resources/css/default.css new file mode 100644 index 0000000..beb5892 --- /dev/null +++ b/Online Survey System Java Project/survey/web/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/Online Survey System Java Project/survey/web/styles.css b/Online Survey System Java Project/survey/web/styles.css new file mode 100644 index 0000000..916764c --- /dev/null +++ b/Online Survey System Java Project/survey/web/styles.css @@ -0,0 +1,58 @@ +body { + font-family:verdana; + font-size:12pt; + background-color: black; +} +.header { + background-color: #ff0000; + font-weight: bold; + color: #ffffff; + font-size: 30px; + letter-spacing: 5pt; + font-family: Arial; +} + +.qno { + font-weight: bold; + font-size: 12px; + font-family: Verdana; +} +.question { + background-color: #cccccc; + font-weight: bold; + font-size: 14px; + font-family: Verdana; + margin-top: 5pt; + margin-bottom: 5pt; + text-align:left; +} + +.options { + text-align:left; + font-weight: bold; + font-size: 12px; + font-family: Verdana; +} + +h3 { + font-family: Arial; + font-size: 14px; + font-weight: 700; +} + +h2 { + font-family: Arial; + font-size: 22px; + color:blue; + font-weight: 700; + +} + +.content { + background-color: white; + width: 600px; + height:800px; + overflow: visible; + margin-left: auto ; + margin-right: auto ; +} \ No newline at end of file diff --git a/Online Survey System Java Project/survey/web/survey.jpg b/Online Survey System Java Project/survey/web/survey.jpg new file mode 100644 index 0000000..f14d8ea Binary files /dev/null and b/Online Survey System Java Project/survey/web/survey.jpg differ diff --git a/Online Survey System Java Project/survey/web/survey.xhtml b/Online Survey System Java Project/survey/web/survey.xhtml new file mode 100644 index 0000000..13b7475 --- /dev/null +++ b/Online Survey System Java Project/survey/web/survey.xhtml @@ -0,0 +1,67 @@ + + + + + + + Survey + + + +
+ +
Survey
+

+

+ Question : / +
+

+

+

+ +

+

+

+

+ + + +
+

+

+ + + +   + + + +   + + +   + + +

+ +

+
+

+
    +
  • Click on NEXT button for next question
  • +
  • Click on PREVIOUS button for previous question
  • +
  • Click on FINISH to finish your survey
  • +
  • Click on CANCEL button to cancel this survey and go to selection of topic
  • +
+

+
+ +
+
+
+
+ + diff --git a/Online Survey System Java Project/survey/web/topic.jpg b/Online Survey System Java Project/survey/web/topic.jpg new file mode 100644 index 0000000..6864508 Binary files /dev/null and b/Online Survey System Java Project/survey/web/topic.jpg differ diff --git a/Online Survey System Java Project/surveyadmin/build/web/META-INF/MANIFEST.MF b/Online Survey System Java Project/surveyadmin/build/web/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Online Survey System Java Project/surveyadmin/build/web/META-INF/context.xml b/Online Survey System Java Project/surveyadmin/build/web/META-INF/context.xml new file mode 100644 index 0000000..cf7f457 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/Online Survey System Java Project/surveyadmin/build/web/addquestion.jsp b/Online Survey System Java Project/surveyadmin/build/web/addquestion.jsp new file mode 100644 index 0000000..71031f7 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/addquestion.jsp @@ -0,0 +1,75 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + + + + Add Topic + + + + + <%@include file="header.html"%> + + + + + +
+

Add Question

+ + + + + + + + + + + + + + + + + + + + + +
Question Text : + + +
Option 1 : + + +
Option 2 : + + +
Option 3 : + + +
+

+ +

+

+
+
+ + <% + if ( request.getParameter("topicid") != null) + session.setAttribute("topicid", request.getParameter("topicid")); + %> + + +
\ No newline at end of file diff --git a/Online Survey System Java Project/surveyadmin/build/web/addtopic.jsp b/Online Survey System Java Project/surveyadmin/build/web/addtopic.jsp new file mode 100644 index 0000000..fc55fd8 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/addtopic.jsp @@ -0,0 +1,37 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + + + + Add Topic + + + + + <%@include file="header.html"%> + + + + + +
+

Add Topic

+ Topic Title : +

+ +

+

+
+
+ + +
diff --git a/Online Survey System Java Project/surveyadmin/build/web/deletequestion.jsp b/Online Survey System Java Project/surveyadmin/build/web/deletequestion.jsp new file mode 100644 index 0000000..00680e7 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/deletequestion.jsp @@ -0,0 +1,35 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + Delete Question + + + + <%@include file="header.html"%> + + + + + +
+ <% + boolean done = dao.TopicDAO.deleteQuestion( request.getParameter("questionid")); + if ( done ) + out.println("

Deleted Question Successfully!

"); + else + out.println("

Could Not Delete Question!

"); + + %> + Click here to go back to questions in the topic. +
+

+ + + + diff --git a/Online Survey System Java Project/surveyadmin/build/web/deletetopic.jsp b/Online Survey System Java Project/surveyadmin/build/web/deletetopic.jsp new file mode 100644 index 0000000..c840907 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/deletetopic.jsp @@ -0,0 +1,34 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + JSP Page + + + <%@include file="header.html"%> + + + + + +
+ <% + boolean done = dao.TopicDAO.delete( request.getParameter("topicid")); + if ( done ) + out.println("

Deleted Topic Successfully!

"); + + else + out.println("

Could not delete topic!

"); + + %> + +
+ + + + + diff --git a/Online Survey System Java Project/surveyadmin/build/web/header.html b/Online Survey System Java Project/surveyadmin/build/web/header.html new file mode 100644 index 0000000..d6a6a80 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/header.html @@ -0,0 +1 @@ +

Survey Admin
\ No newline at end of file diff --git a/Online Survey System Java Project/surveyadmin/build/web/home.jsp b/Online Survey System Java Project/surveyadmin/build/web/home.jsp new file mode 100644 index 0000000..174caa7 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/home.jsp @@ -0,0 +1,69 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + + + Add Topic + + + + <%@include file="header.html"%> + + + + + +
+

Topics

+ + + Title + + + + Added On + + + + Added By + + + + +   + + + + +
+ + + + +
+ + + + +
+ + + + +
+
+
+
+ + +
+ + diff --git a/Online Survey System Java Project/surveyadmin/build/web/listtopics.jsp b/Online Survey System Java Project/surveyadmin/build/web/listtopics.jsp new file mode 100644 index 0000000..60b1eda --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/listtopics.jsp @@ -0,0 +1,65 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + + + Add Topic + + + + <%@include file="header.html"%> + + + + + +
+ <%@include file="menu.html"%> + +

Topics

+ + + Title + + + + Added On + + + + Added By + + + + +   + + + + +   + + + + +   + + + + + + +
+
+ + +
+ + diff --git a/Online Survey System Java Project/surveyadmin/build/web/login.jsp b/Online Survey System Java Project/surveyadmin/build/web/login.jsp new file mode 100644 index 0000000..44b2f7a --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/login.jsp @@ -0,0 +1,42 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + Login Page + + + + + + <%@include file="header.html"%> + +
+

Login

+ + + + + + + +
Username: + +
Password : + +
+

+ +

+

+
+
+
+ + diff --git a/Online Survey System Java Project/surveyadmin/build/web/logout.jsp b/Online Survey System Java Project/surveyadmin/build/web/logout.jsp new file mode 100644 index 0000000..1b8655f --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/logout.jsp @@ -0,0 +1,4 @@ +<% + session.invalidate(); + response.sendRedirect("login.jsp"); +%> \ No newline at end of file diff --git a/Online Survey System Java Project/surveyadmin/build/web/menu.jsp b/Online Survey System Java Project/surveyadmin/build/web/menu.jsp new file mode 100644 index 0000000..9ad02df --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/menu.jsp @@ -0,0 +1,14 @@ +

User : ${sessionScope.uname}

+Logout +

+  +

+Home +

+List Topics +

+Add New Topic + + + + diff --git a/Online Survey System Java Project/surveyadmin/build/web/styles.css b/Online Survey System Java Project/surveyadmin/build/web/styles.css new file mode 100644 index 0000000..3f0bb66 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/styles.css @@ -0,0 +1,27 @@ +body { + font-family:verdana; + font-size:10pt; +} +.header { + + font-family: Arial; + font-weight: bold; + font-size: 24pt; + color: #ffffff; + background-color: #003333; + letter-spacing: 4pt; + text-align: center; +} + +th { + background-color: maroon ; + color:white; + font-weight: 700; +} + +.menu { + font-weight:700; + vertical-align: top; + width:15%; + background-color: #cccccc; +} diff --git a/Online Survey System Java Project/surveyadmin/build/web/surveyresults.jsp b/Online Survey System Java Project/surveyadmin/build/web/surveyresults.jsp new file mode 100644 index 0000000..408ad12 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/surveyresults.jsp @@ -0,0 +1,59 @@ + <%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + + + + Survey Results + + + + <%@include file="header.html"%> + + + + + +
+

Survey Results

+ + + Question + + + + Option1 + + : + % + + + Option2 + + + : + % + + + Option3 + + + : + % + + +
+
+ + +
+ + diff --git a/Online Survey System Java Project/surveyadmin/build/web/topicquestions.jsp b/Online Survey System Java Project/surveyadmin/build/web/topicquestions.jsp new file mode 100644 index 0000000..b21aa70 --- /dev/null +++ b/Online Survey System Java Project/surveyadmin/build/web/topicquestions.jsp @@ -0,0 +1,60 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> + + + + + + + + + Add Topic + + + + <%@include file="header.html"%> + + + + + +
+

Topics

+ + + Question + + + + Option1 + + + + Option2 + + + + + Option3 + + + + +   + + + + + + +
+
+ + +
+ +