Skip to content

Commit

Permalink
Merge pull request #21 from arc12012/BrisBranch
Browse files Browse the repository at this point in the history
Project Setup for Pivotal Deployment
  • Loading branch information
beb13005 committed Feb 10, 2017
2 parents cc4447e + 208b072 commit 8dec9bb
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 44 deletions.
13 changes: 6 additions & 7 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0">
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry exported="true" kind="con" path="org.eclipse.jst.server.core.container/org.cloudfoundry.appcloudserver.classPathProvider/Cloud Foundry">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
3 changes: 2 additions & 1 deletion .settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="2017-CSE-Senior-Project-Team-2">
<wb-module deploy-name="2017-CSE-Senior-Project-Team-2-0.0.1-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="context-root" value="2017-CSE-Senior-Project-Team-2"/>
Expand Down
5 changes: 3 additions & 2 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v9.0"/>
<runtime name="Cloud Foundry"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="cloudfoundry.standalone.app" version="1.0"/>
<installed facet="jst.web" version="3.1"/>
</faceted-project>
2 changes: 1 addition & 1 deletion WebContent/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Class-Path:
Main-Class: com.main.Main

22 changes: 12 additions & 10 deletions WebContent/html/javascript/listing.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@
</head>
<body>
<%
MySQLAccess myaccess = new MySQLAccess();
/*MySQLAccess myaccess = new MySQLAccess();
myaccess.connectDB();
String name = myaccess.getResult()[0][0];
String description = myaccess.getResult()[0][1];
String hardware = myaccess.getResult()[0][2];
String hardware = myaccess.getResult()[0][2];*/
//out.println(name);
//out.println(description);
//out.println(hardware);
%>

<script type=text/javascript>
//gets variables for database data
(function(){
window.myname = "<%=name%>";
window.mydesc = "<%=description%>";
window.myhard = "<%=hardware%>";
})();
<%
/*(function(){
window.myname = "<=name>" ; --> add percents to make them work in the name box things
window.mydesc = "<=description>" ;
window.myhard = "<=hardware>" ;
})(); */
%>
//get all the option buttons
var options = document.getElementsByClassName('option');
var dev7 = {
/*var dev7 = {
name: window.myname,
description: window.mydesc,
hardware: window.myhard,
software:"intel"
};
};*/
var dev1 = {
name:"George",
Expand Down Expand Up @@ -79,7 +81,7 @@ var dev6 = {
software:"intel"
};
var devices = [dev1, dev2, dev3, dev4, dev5, dev6, dev7];
var devices = [dev1, dev2, dev3, dev4, dev5, dev6];
options[0].addEventListener('click', showAll);
for(var a = 1; a < options.length; a++){
options[a].addEventListener('click', show);
Expand Down
18 changes: 1 addition & 17 deletions WebContent/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@
<title>Insert title here</title>
</head>
<body>
<%
MySQLAccess myaccess = new MySQLAccess();
myaccess.connectDB();
String name = myaccess.getResult()[0][0];
String description = myaccess.getResult()[0][1];
String hardware = myaccess.getResult()[0][2];
out.println(name);
out.println(description);
out.println(hardware);
%>
<script type=text/javascript>
(function(){
window.myname = "<%=name%>";
window.mydesc = "<%=description%>";
window.myhard = "<%=hardware%>";
})();
</script>
Welcome to Senior Design Request System!
</body>
</html>
34 changes: 34 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>2017-CSE-Senior-Project-Team-2</groupId>
<artifactId>2017-CSE-Senior-Project-Team-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
</dependency>
</dependencies>
<packaging>war</packaging>
</project>
3 changes: 2 additions & 1 deletion src/database/MySQLAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ public class MySQLAccess {
String[][] result = new String[20][3];

public void connectDB() throws SQLException, ClassNotFoundException {
System.getenv("VCAP_SERVICES");
Class.forName("com.mysql.jdbc.Driver");
Connection connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/seniordesign", "root", "password");
Connection connect = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/seniordesign", "root", "password");
Statement statement = connect.createStatement();
//PreparedStatement preparedStatement = null;
ResultSet resultSet = statement.executeQuery("SELECT * FROM devices");
Expand Down
5 changes: 0 additions & 5 deletions src/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
public class Main {

public static void main(String[] args) {
ClientManager cm = new ClientManager();
Scanner STDIN = new Scanner(System.in);
SystemManager sm = new SystemManager();
sm.loginProcess(STDIN);
sm.runMenu(STDIN, cm);
}

}

0 comments on commit 8dec9bb

Please sign in to comment.