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

merge cloud computing changes to v09 code #37

Open
wants to merge 10 commits into
base: v0.9dev
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ node
node_modules
built
npm-debug.log
*.iml
25 changes: 25 additions & 0 deletions discoursedb-io-spirit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# discoursedb-io-spirit

## Data Source

* [Spirit](https://github.com/CloudComputingCourse/Spirit) is a Django application that is installed as part of TPZ.
* The `tpz.spirit_*` tables contain the forum data

## Importing Forum Data

* Configuring TPZ and DiscourseDB access
* Chris Bogart can proivde access to the `discoursedb_ext_cloud_computing_s18` database in DiscourseDB. These credentials can be configured in [custom.properties](https://github.com/CloudComputingCourse/discoursedb-core/blob/master/discoursedb-io-spirit/src/main/resources/custom.properties#L10).
* `spirit.jdbc.*` in [custom.properties](https://github.com/CloudComputingCourse/discoursedb-core/blob/master/discoursedb-io-spirit/src/main/resources/custom.properties#L36) should be configured with a MySQL user that has access to `tpz.spirit_*`

### Import

* `Usage: SpiritConverterApplication <DataSetName> <DiscourseName>`
* [SpiritConverter](https://github.com/CloudComputingCourse/discoursedb-core/blob/master/discoursedb-io-spirit/src/main/java/edu/cmu/cs/lti/discoursedb/io/spirit/converter/SpiritConverter.java#L33) is the entrypoint for the command line application.
* DataSetName - This is unique per semester (e.g. `f18-cloud-computing-spirit`)
* DiscourseName - This is same per semester, but should be different for new discourse data sets (e.g. `scs-cloud-computing`)

* Importing the forum data via the CLI

```
mvn spring-boot:run -Drun.arguments="f18-cloud-computing-spirit,scs-cloud-computing" -Djdbc.database=discoursedb_ext_cloud_computing_f18
```
51 changes: 51 additions & 0 deletions discoursedb-io-spirit/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<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>
<parent>
<groupId>edu.cmu.cs.lti</groupId>
<artifactId>discoursedb-core</artifactId>
<version>0.9-SNAPSHOT</version>
</parent>
<artifactId>discoursedb-io-spirit</artifactId>
<name>DiscourseDB Spirit Forum converters</name>
<description>DiscourseDB converters for Spirit Forum data</description>
<dependencies>
<dependency>
<groupId>edu.cmu.cs.lti</groupId>
<artifactId>discoursedb-model</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*******************************************************************************
* Copyright (C) 2015 - 2017 Carnegie Mellon University
* Author:
*
* This file is part of DiscourseDB.
*
* DiscourseDB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* DiscourseDB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DiscourseDB. If not, see <http://www.gnu.org/licenses/>
* or write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA
*******************************************************************************/
package edu.cmu.cs.lti.discoursedb.io.spirit.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import lombok.extern.log4j.Log4j;

@Log4j
@Component
public class SpiritConverter implements CommandLineRunner {
private String dataSetName;
private String discourseName;

@Autowired
private SpiritConverterService converterService;

@Override
public void run(String... args) throws Exception {
Assert.isTrue(args.length == 2,
"Usage: SpiritConverterApplication <DataSetName> <DiscourseName>");

dataSetName = args[0];
discourseName = args[1];

log.info("Starting Spirit conversion");

converterService.map(dataSetName, discourseName);

log.info("Spirit conversion completed");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************************************************************
* Copyright (C) 2015 - 2017 Carnegie Mellon University
* Author:
*
* This file is part of DiscourseDB.
*
* DiscourseDB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* DiscourseDB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DiscourseDB. If not, see <http://www.gnu.org/licenses/>
* or write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA
*******************************************************************************/
package edu.cmu.cs.lti.discoursedb.io.spirit.converter;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.util.Assert;

/**
* This starter class launches the components necessary for importing Spirit
* forum data from a designated Spirit database into DiscourseDB.
*
* This starter class requires two parameters: DataSetName, DiscourseName
*
* @author
*/
@SpringBootApplication
@ComponentScan(basePackages = { "edu.cmu.cs.lti.discoursedb", "edu.cmu.cs.lti.discoursedb.configuration", "edu.cmu.cs.lti.discoursedb.io.spirit" })
public class SpiritConverterApplication {

/**
* @param args
* DataSetName, DiscourseName
*/
public static void main(String[] args) {
Assert.isTrue(args.length == 2, "Usage: SpiritConverterApplication <DataSetName> <DiscourseName>");

SpringApplication.run(SpiritConverterApplication.class, args);
}
}
Loading