Skip to content

Commit

Permalink
Merge pull request #57 from bd2kccd/v1.3.x
Browse files Browse the repository at this point in the history
V1.3.x
  • Loading branch information
kvb2univpitt authored May 17, 2017
2 parents bb948ac + bfded6c commit f272b7e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 19 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ If you want to host the application with your own hardware, follow the instructi
#### Dependencies
Download and uncompress the source code for each of following dependencies:

* [ccd-job-queue-0.1.6](https://github.com/bd2kccd/ccd-job-queue/releases/tag/v0.1.6)
* [ccd-mail-0.2.2](https://github.com/bd2kccd/ccd-mail/releases/tag/v0.2.2)
* [ccd-db-0.6.3](https://github.com/bd2kccd/ccd-db/releases/tag/v0.6.3)
* [ccd-job-queue-0.1.7](https://github.com/bd2kccd/ccd-job-queue/releases/tag/v0.1.7)
* [ccd-mail-0.2.3](https://github.com/bd2kccd/ccd-mail/releases/tag/v0.2.3)
* [ccd-db-0.6.4](https://github.com/bd2kccd/ccd-db/releases/tag/v0.6.4)
* [ccd-commons-0.3.1](https://github.com/bd2kccd/ccd-commons/releases/tag/v0.3.1)
To install the dependencies, go to the top directory of each project and do a maven install by typing **mvn install**.

#### Application
Download and uncompress the application source code [causal-web-1.3.1](https://github.com/bd2kccd/causal-web/releases/tag/v1.3.1). To compile and build the application, go to the directory **causal-web-1.3.1** and type **mvn package**.
Download and uncompress the application source code [causal-web-1.3.4](https://github.com/bd2kccd/causal-web/releases/tag/v1.3.4). To compile and build the application, go to the directory **causal-web-1.3.4** and type **mvn package**.

#### External Dependencies
* [causal-cmd-6.0.1-SNAPSHOT-jar-with-dependencies.jar](https://github.com/cmu-phil/tetrad/releases/tag/v6.0.1-20161122)
* [causal-cmd-0.1.2-jar-with-dependencies.jar](https://github.com/bd2kccd/causal-cmd/releases/tag/v0.1.2)

## Configure the software

### Setup the directory structure and copy libraries
First, you need to create a workspace for the application to work in. Create a directory called **workspace**, for an example ***/home/tuser/workspace***.
Inside the workspace directory, create another folder called **lib**, for example ***/home/tuser/workspace/lib***.

Copy the **causal-cmd-6.0.1.jar** to the **workspace/lib** folder.
Copy the **causal-cmd-0.1.2-jar-with-dependencies.jar** to the **workspace/lib** folder.

### Configure
There are 4 configuration files to configure located in causal-web-1.3.1/src/main/resources folder:
There are 4 configuration files to configure located in causal-web-1.3.4/src/main/resources folder:
1. **application-hsqldb.properties**: HSQLDB database configurations (for testing only).
2. **application-mysql.properties**: MySQL database configurations
3. **application.properties**: Spring Boot configurations
Expand Down Expand Up @@ -74,15 +74,15 @@ spring.profiles.active=scheduler,mysql
Make sure you set **ccd.server.workspace=/home/tuser/workspace** and **ccd.folder.lib=lib** in the **ccd.properties** file.

## Compile the Program
Go to the **causal-web** directory and run the command **mvn clean package**. This will create a jar file called **causal-web-1.3.1.jar** in the **/target** folder.
Go to the **causal-web** directory and run the command **mvn clean package**. This will create a jar file called **causal-web-1.3.4.jar** in the **/target** folder.

### Launch the Program
```java
java -jar causal-web-1.3.1.jar
java -jar causal-web-1.3.4.jar
```
To give the program 4GB of memory to run on, type the follow, using the jvm options:
```java
java -Xmx4G -jar causal-web-1.3.1.jar
java -Xmx4G -jar causal-web-1.3.4.jar
```

To launch app in the browser
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>edu.pitt.dbmi</groupId>
<artifactId>causal-web</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
<packaging>jar</packaging>

<name>causal-web</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public String showPlot(
String username = appUser.getUsername();
List<String> categoryNames = Arrays.asList("Runtime Parameters", "Dataset", "Filters", "FGS Parameters", "Run Options", "Algorithm Parameters", "Data Validations");
model.addAttribute("categories", algorithmResultService.extractDataCategories(fileName, username, categoryNames));
model.addAttribute("isPag", algorithmResultService.isPagResult(fileName, username));

return PLOT_VIEW;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -172,6 +173,23 @@ public List<ResultFileInfo> listResultFileInfo(final String username) {
return Arrays.asList(array);
}

public boolean isPagResult(final String fileName, final String username) {
boolean isPag = false;

Path file = Paths.get(workspace, username, resultFolder, algorithmResultFolder, fileName);
try (Scanner scanner = new Scanner(Files.newBufferedReader(file))) {
scanner.nextLine(); // skip the first line
String line = scanner.nextLine();
if (line != null) {
isPag = line.trim().contains("GFCI");
}
} catch (IOException exception) {
LOGGER.error(String.format("Unable to read file '%s'.", fileName), exception);
}

return isPag;
}

public Map<String, Map<String, String>> extractDataCategories(final String fileName, final String username, final List<String> categoryNames) {
Map<String, Map<String, String>> info = new LinkedHashMap<>();
categoryNames.forEach(key -> {
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

██████╗ █████╗ ██╗ ██╗███████╗ █████╗ ██╗ ██╗ ██╗███████╗██████╗ ██╗ ██████╗ ██████╗
██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗██║ ██║ ██║██╔════╝██╔══██╗ ███║ ╚════██╗ ╚════██╗
██║ ███████║██║ ██║███████╗███████║██║ ██║ █╗ ██║█████╗ ██████╔╝ ╚██║ █████╔╝ █████╔╝
██║ ██╔══██║██║ ██║╚════██║██╔══██║██║ ██║███╗██║██╔══╝ ██╔══██╗ ██║ ╚═══██╗ ██╔═══
╚██████╗██║ ██║╚██████╔╝███████║██║ ██║███████╗ ╚███╔███╔╝███████╗██████╔╝ ██║██╗██████╔╝██╗███████╗
╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═╝╚═╝╚═════╝ ╚═╝╚══════╝
██████╗ █████╗ ██╗ ██╗███████╗ █████╗ ██╗ ██╗ ██╗███████╗██████╗ ██╗ ██████╗ ██╗ ██╗
██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗██║ ██║ ██║██╔════╝██╔══██╗ ███║ ╚════██╗██║ ██║
██║ ███████║██║ ██║███████╗███████║██║ ██║ █╗ ██║█████╗ ██████╔╝ ╚██║ █████╔╝███████║
██║ ██╔══██║██║ ██║╚════██║██╔══██║██║ ██║███╗██║██╔══╝ ██╔══██╗ ██║ ╚═══██╗════██║
╚██████╗██║ ██║╚██████╔╝███████║██║ ██║███████╗ ╚███╔███╔╝███████╗██████╔╝ ██║██╗██████╔╝██╗ ██║
╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═╝╚═╝╚═════╝ ╚═╝═╝
2 changes: 1 addition & 1 deletion src/main/resources/ccd.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ccd.email.admin.sendto=${spring.mail.username}
ccd.acct.reg.activ.required=false

# LABELS
ccd.app.title=Causal Web v1.3.3
ccd.app.title=Causal Web v1.3.4
ccd.app.copyright=University of Pittsburgh and Carnegie Mellon University

ccd.app.agreement=TERMS AND CONDITIONS&#10;&#10;\
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/algorithm/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3 class="page-header">Causal Graph of <span class="label label-primary" th:tex
</ul>
</div>
</div>
<div class="row">
<div class="row" th:if="${isPag}">
<div class="col-lg-12">
<div class="panel panel-primary">
<div class="panel-body">
Expand Down

0 comments on commit f272b7e

Please sign in to comment.