Skip to content

Commit

Permalink
Revert "Merge dev branch"
Browse files Browse the repository at this point in the history
This reverts commit 325da60, reversing
changes made to b622ec8.
  • Loading branch information
Jan Ladleif committed Jun 20, 2019
1 parent 325da60 commit 5d411a7
Show file tree
Hide file tree
Showing 57 changed files with 87 additions and 2,429 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ epp.log
unicorn.properties

\.DS_Store

unicorn\.properties\.tpl

host\.env
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM tomcat:8.5.11-jre8
RUN apt-get update && apt-get install -y gettext-base && \
cp /usr/local/tomcat/conf/server.xml /usr/local/tomcat/conf/server-template.xml

COPY EapWebInterface/target/Unicorn.war /Unicorn.war
COPY unicorn.properties.tpl /usr/local/tomcat/conf/
COPY EapWebInterface/target/Unicorn.war /usr/local/tomcat/webapps/Unicorn.war
COPY unicorn.properties.tpl /usr/local/tomcat/conf/unicorn.properties.tpl
COPY scripts/docker-start.sh /usr/local/bin/docker-start.sh
RUN chmod +x /usr/local/bin/docker-start.sh

Expand Down
2 changes: 1 addition & 1 deletion EapCommons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.hpi.bpt</groupId>
<artifactId>unicorn-parent</artifactId>
<version>1.6</version>
<version>1.5</version>
</parent>
<artifactId>unicorn-commons</artifactId>
<name>Unicorn Common Components</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Scanner;
import java.util.regex.Pattern;

/**
* Enables access to unicorn.properties file
Expand All @@ -31,13 +34,6 @@ public class EapConfiguration {
public static String nokiaHereAppCode = "";
public static String tflAppId = "";
public static String tflAppCode = "";
public static String boschIotUsername = "";
public static String boschIotPassword = "";
public static String boschIotApiKey = "";
public static String goodsTagUri = "";
public static String goodstagUsername = "";
public static String goodsTagPassword = "";
public static String goodsTagDeviceIds = "";
public static String eMailUser = "";
public static String eMailPassword = "";
public static String triplestoreLocation = "";
Expand Down Expand Up @@ -67,13 +63,6 @@ public static void initialize() {
nokiaHereAppCode = props.getProperty("de.hpi.unicorn.adapter.nokiaHereAppCode", "");
tflAppId = props.getProperty("de.hpi.unicorn.adapter.tflAppId", "");
tflAppCode = props.getProperty("de.hpi.unicorn.adapter.tflAppCode", "");
boschIotUsername = props.getProperty("de.hpi.unicorn.adapter.boschIotUsername", "");
boschIotPassword = props.getProperty("de.hpi.unicorn.adapter.boschIotPassword", "");
boschIotApiKey = props.getProperty("de.hpi.unicorn.adapter.boschIotApiKey", "");
goodsTagUri = props.getProperty("de.hpi.unicorn.adapter.goodsTagUri", "");
goodstagUsername = props.getProperty("de.hpi.unicorn.adapter.goodsTagUsername", "");
goodsTagPassword = props.getProperty("de.hpi.unicorn.adapter.goodsTagPassword", "");
goodsTagDeviceIds = props.getProperty("de.hpi.unicorn.adapter.goodsTagDeviceIds", "");
eMailUser = props.getProperty("de.hpi.unicorn.email.user", "YOUR GMAIL ADDRESS HERE");
eMailPassword = props.getProperty("de.hpi.unicorn.email.password", "YOUR PASSWORD HERE");
triplestoreLocation = props.getProperty("de.hpi.unicorn.semantic.Triplestore.location", "./Triplestore");
Expand Down Expand Up @@ -121,4 +110,40 @@ public static Properties getProperties() {
}
}
}

/**
* The main method configures the persistence.xml of the database and the
* pom.xml of EapWebInterface.
*
* @param args
* @throws IOException void
*/
public static void main(String[] args) throws IOException {
Properties props = getProperties();
String content = null;
PrintWriter writer = null;
String folder = null;
Scanner template = null;

folder = props.getProperty("de.hpi.unicorn.projectFolder") + File.separator + "EapCommons" + File.separator + "src" + File.separator + "main" + File.separator + "resources" + File.separator + "META-INF";
template = new Scanner(new File(folder + File.separator + "persistence_template.xml"));
content = template.useDelimiter("\\Z").next();
template.close();
content = content.replace("${db.dev.url}", props.getProperty("javax.persistence.jdbc.devUrl")).replace("${db.test.url}", props.getProperty("javax.persistence.jdbc.testUrl")).replaceAll(Pattern.quote("${db.user}"), props.getProperty("javax.persistence.jdbc.user")).replaceAll(Pattern.quote("${db.passw}"), props.getProperty("javax.persistence.jdbc.password"));
// TODO: "eclipselink.ddl-generation" with drop-and-create-tables and create-tables;

writer = new PrintWriter(folder + File.separator + "persistence.xml");
writer.print(content);
writer.close();

folder = props.getProperty("de.hpi.unicorn.projectFolder") + File.separator + "EapWebInterface";
template = new Scanner(new File(folder + File.separator + "pom-default.xml"));
content = template.useDelimiter("\\Z").next();
template.close();
content = content.replace("${tomcat.server}", props.getProperty("org.apache.tomcat.maven.server")).replace("${tomcat.url}", props.getProperty("org.apache.tomcat.maven.url")).replace("${tomcat.path}", props.getProperty("org.apache.tomcat.maven.path"));

writer = new PrintWriter(folder + File.separator + "pom.xml");
writer.print(content);
writer.close();
}
}
13 changes: 1 addition & 12 deletions EapEventProcessing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.hpi.bpt</groupId>
<artifactId>unicorn-parent</artifactId>
<version>1.6</version>
<version>1.5</version>
</parent>
<artifactId>unicorn-events</artifactId>
<name>Unicorn Event Processing Component</name>
Expand Down Expand Up @@ -66,17 +66,6 @@
<artifactId>activemq-all</artifactId>
<version>5.9.0</version>
</dependency>
<dependency>
<groupId>com.flipkart.zjsonpatch</groupId>
<artifactId>zjsonpatch</artifactId>
<version>0.3.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.websocket/javax.websocket-client-api -->
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-client-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import java.util.List;
import java.util.Map;

import de.hpi.unicorn.adapter.BoschIot.BoschIotAdapter;
import de.hpi.unicorn.adapter.GoodsTag.GoodsTagAdapter;
import de.hpi.unicorn.adapter.tfl.TflAdapter;
import org.quartz.SchedulerException;
import org.quartz.impl.StdSchedulerFactory;
Expand Down Expand Up @@ -58,14 +56,6 @@ public EventAdapter create(final String name, final AdapterType type) {
adapter = new TflAdapter(name);
this.adapters.put(name, adapter);
return adapter;
case BoschIot:
adapter = new BoschIotAdapter(name);
this.adapters.put(name, adapter);
return adapter;
case GoodsTag:
adapter = new GoodsTagAdapter(name);
this.adapters.put(name, adapter);
return adapter;
default:
return null;
}
Expand Down Expand Up @@ -165,34 +155,4 @@ public void stopAndRemoveTflAdapter() {
remove(adapterName);
}

public void startBoschIotAdapter() {
String adapterName = "BoschIot";
BoschIotAdapter adapter = (BoschIotAdapter) create(adapterName, AdapterType.BoschIot);

if (adapter != null) {
start(adapterName);
}
}

public void stopAndRemoveBoschIotAdapter() {
String adapterName = "BoschIot";
stop(adapterName);
remove(adapterName);
}

public void startGoodsTagAdapter() {
String adapterName = "GoodsTag";
GoodsTagAdapter adapter = (GoodsTagAdapter) create(adapterName, AdapterType.GoodsTag);

if (adapter != null) {
start(adapterName);
}
}

public void stopAndRemoveGoodsTagAdapter() {
String adapterName = "GoodsTag";
stop(adapterName);
remove(adapterName);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@

public enum AdapterType {
NokiaHere,
TransportForLondon,
BoschIot,
GoodsTag
TransportForLondon
}
Loading

0 comments on commit 5d411a7

Please sign in to comment.