Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test netbeans glassfish #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/web/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<title>Index Page</title>
</head>
<body>
<p> Hi </p>

<p>Pages: [Implement this better soon]</p>
<a href="register.jsp">Register</a>
<a href="login.jsp">Login</a>
<a href="welcome.jsp">Register</a>
<a href="welcome.jsp">Welcome</a>
</body>
</html>
50 changes: 50 additions & 0 deletions build/web/logout.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<%--
Document : logout
Created on : 05/05/2023, 2:14:45 PM
Author : peril
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!--will have to do something in backend that sets login to logged out-->

<!DOCTYPE html>
<html>
<head>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
.centre {
font-family: 'Inter', sans-serif;
vertical-align: center;
text-align: center;
}

h1 {
height: 80px;
color: #00498c;
}

button {
background-color: #00498c;
font-family: 'Inter', sans-serif;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}

</style>
<!-- <link rel="stylesheet" href="style.css"> -->
</head>
<body bgcolor= #cceeff>
<img src="Photos/IoTBayLogo.png" alt="Logo" style="width:200px;">
<div class="centre">
<h1>You have been logged out.</h1> <!--Add name from beans data?-->
<button onclick="window.location.href = 'index.html';">Proceed back to the home page</button> <!--when I say home page I mean index.html-->
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion build/web/welcome.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

<div class="top-bar">
<img src="Photos/IoTBayLogo.png" alt="Logo" style="width:200px;">
<button class="logout-button" align="right" onclick="window.location.href = 'logout.html';">Log Out</button>
<button class="logout-button" align="right" onclick="window.location.href = 'logout.jsp';">Log Out</button>
</div>
<div class="centre">
<div><h1>Welcome to IoT Bay, <%=firstName%>! </h1></div>
Expand Down
Binary file modified dist/IoTBay.war
Binary file not shown.
140 changes: 33 additions & 107 deletions nbproject/ant-deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,112 +20,38 @@

-->
<project default="-deploy-ant" basedir=".">
<target name="-init-cl-deployment-env" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}" />
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
<available file="${deploy.ant.resource.dir}" property="has.setup"/>
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
</target>

<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<sun-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.sun.web}" validate="false">
</xmlproperty>
<delete file="${temp.sun.web}"/>
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
</target>
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.gf.web}" validate="false">
</xmlproperty>
<delete file="${temp.gf.web}"/>
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
</target>
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
<property name="deploy.context.root.argument" value=""/>
</target>
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
<mkdir dir="${gfv3.resources.dir}"/>
<mkdir dir="${gfv3.resources.dir}/META-INF"/>
<copy todir="${gfv3.resources.dir}/META-INF">
<fileset dir="${deploy.ant.resource.dir}"/>
</copy>
<jar destfile="${deploy.ant.archive}" update="true">
<fileset dir="${gfv3.resources.dir}"/>
</jar>
<delete dir="${gfv3.resources.dir}"/>
</target>
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
<antcall target="-deploy-without-pw"/>
<antcall target="-deploy-with-pw"/>
</target>

<target name="-deploy-without-pw" unless="gfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-deploy-with-pw" if="gfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
<antcall target="-undeploy-without-pw"/>
<antcall target="-undeploy-with-pw"/>
</target>

<target name="-undeploy-without-pw" unless="gfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-undeploy-with-pw" if="gfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
<target name="-init" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}"/>
<tempfile property="temp.module.folder" prefix="tomcat" destdir="${java.io.tmpdir}"/>
<unwar src="${deploy.ant.archive}" dest="${temp.module.folder}">
<patternset includes="META-INF/context.xml"/>
</unwar>
<xmlproperty file="${temp.module.folder}/META-INF/context.xml"/>
<delete dir="${temp.module.folder}"/>
</target>
<target name="-check-credentials" if="deploy.ant.enabled" depends="-init">
<fail message="Tomcat password has to be passed as tomcat.password property.">
<condition>
<not>
<isset property="tomcat.password"/>
</not>
</condition>
</fail>
</target>
<target name="-deploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials">
<echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
classpath="${tomcat.home}/server/lib/catalina-ant.jar"/>
<deploy url="${tomcat.url}/manager" username="${tomcat.username}"
password="${tomcat.password}" path="${Context(path)}"
war="${deploy.ant.archive}"/>
<property name="deploy.ant.client.url" value="${tomcat.url}${Context(path)}"/>
</target>
<target name="-undeploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials">
<echo message="Undeploying ${Context(path)}"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
classpath="${tomcat.home}/server/lib/catalina-ant.jar"/>
<undeploy url="${tomcat.url}/manager" username="${tomcat.username}"
password="${tomcat.password}" path="${Context(path)}"/>
</target>
</project>
8 changes: 4 additions & 4 deletions nbproject/private/private.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
deploy.ant.properties.file=C:\\Users\\james\\AppData\\Roaming\\NetBeans\\12.0\\config\\GlassFishEE6\\Properties\\gfv3161524139.properties
deploy.ant.properties.file=C:\\Users\\peril\\AppData\\Roaming\\NetBeans\\12.0\\tomcat90.properties
j2ee.platform.is.jsr109=true
j2ee.server.domain=C:/Users/james/GlassFish_Server/glassfish/domains/domain1
j2ee.server.home=C:/Users/james/GlassFish_Server/glassfish
j2ee.server.instance=[C:\\Users\\james\\GlassFish_Server\\glassfish;C:\\Users\\james\\GlassFish_Server\\glassfish\\domains\\domain1]deployer:gfv3ee6wc:localhost:4848
j2ee.server.home=C:/Users/peril/Downloads/apache-tomcat-10.1.7/apache-tomcat-10.1.7/apache-tomcat-10.0.27
j2ee.server.instance=tomcat90:home=C:\\Users\\peril\\Downloads\\apache-tomcat-10.1.7\\apache-tomcat-10.1.7\\apache-tomcat-10.0.27
j2ee.server.middleware=C:/Users/james/GlassFish_Server
user.properties.file=C:\\Users\\james\\AppData\\Roaming\\NetBeans\\12.0\\build.properties
user.properties.file=C:\\Users\\peril\\AppData\\Roaming\\NetBeans\\12.0\\build.properties
1 change: 1 addition & 0 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<group>
<file>file:/C:/Users/peril/OneDrive/Documents/NetBeansProjects/IoTBay/web/main.jsp</file>
<file>file:/C:/Users/peril/OneDrive/Documents/NetBeansProjects/IoTBay/web/register.jsp</file>
<file>file:/C:/Users/peril/OneDrive/Documents/NetBeansProjects/IoTBay/nbproject/build-impl.xml</file>
<file>file:/C:/Users/peril/OneDrive/Documents/NetBeansProjects/IoTBay/web/welcome.jsp</file>
<file>file:/C:/Users/peril/OneDrive/Documents/NetBeansProjects/IoTBay/web/index.jsp</file>
<file>file:/C:/Users/peril/OneDrive/Documents/NetBeansProjects/IoTBay/web/login.jsp</file>
Expand Down
9 changes: 2 additions & 7 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ j2ee.compile.on.save=true
j2ee.copy.static.files.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7-web
j2ee.platform.classpath=${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.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.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.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=gfv3ee6
j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-ssi.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.20.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jakartaee-migration-1.0.4-shaded.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jaspic-api.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-cs.jar:${j2ee.server.home}/lib/tomcat-i18n-de.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ko.jar:${j2ee.server.home}/lib/tomcat-i18n-pt-BR.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-i18n-zh-CN.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar
j2ee.server.type=Tomcat
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
Expand Down
4 changes: 2 additions & 2 deletions web/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<title>Index Page</title>
</head>
<body>
<p> Hi </p>

<p>Pages: [Implement this better soon]</p>
<a href="register.jsp">Register</a>
<a href="login.jsp">Login</a>
<a href="welcome.jsp">Register</a>
<a href="welcome.jsp">Welcome</a>
</body>
</html>
50 changes: 50 additions & 0 deletions web/logout.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<%--
Document : logout
Created on : 05/05/2023, 2:14:45 PM
Author : peril
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!--will have to do something in backend that sets login to logged out-->

<!DOCTYPE html>
<html>
<head>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
.centre {
font-family: 'Inter', sans-serif;
vertical-align: center;
text-align: center;
}

h1 {
height: 80px;
color: #00498c;
}

button {
background-color: #00498c;
font-family: 'Inter', sans-serif;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}

</style>
<!-- <link rel="stylesheet" href="style.css"> -->
</head>
<body bgcolor= #cceeff>
<img src="Photos/IoTBayLogo.png" alt="Logo" style="width:200px;">
<div class="centre">
<h1>You have been logged out.</h1> <!--Add name from beans data?-->
<button onclick="window.location.href = 'index.html';">Proceed back to the home page</button> <!--when I say home page I mean index.html-->
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion web/welcome.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

<div class="top-bar">
<img src="Photos/IoTBayLogo.png" alt="Logo" style="width:200px;">
<button class="logout-button" align="right" onclick="window.location.href = 'logout.html';">Log Out</button>
<button class="logout-button" align="right" onclick="window.location.href = 'logout.jsp';">Log Out</button>
</div>
<div class="centre">
<div><h1>Welcome to IoT Bay, <%=firstName%>! </h1></div>
Expand Down