I'm trying to make a website using the Play! Framework (v2.2.0 & in Java) that keeps homework in a repository for students to browse. I want to allow students to upload .doc/.docx files to the server and have the files get automatically converted to .html upon upload.
Here's my code for the HomeworkSnippet data type, for reference:
@SuppressWarnings("serial")
@Entity
public class HomeworkSnippet extends Model {
public HomeworkSnippet (String filepath) {
this.filepath = filepath;
this.snippetRender = snippet.render(/*code for html version of file at filepath here*/);
}
public static Finder<Long,HomeworkSnippet> find = new Finder<Long,HomeworkSnippet>(
Long.class, HomeworkSnippet.class
);
@Id
public Long id;
public String filepath;
public Html snippetRender;
}
Now the way I would like to do this is by using the JODConverter tool that allows you to convert .docx to .html explicitly using OpenOffice.org or LibreOffice. However, how should I do this when JODConverter SEEMS to need a warfile when Play! Framework doesn't use warfiles. I'm a little out of my depth, please forgive me if this makes no sense.
You can download the jar file also. If you go to a download page for the project, such as this:
http://sourceforge.net/projects/jodconverter/files/JODConverter/2.2.2/
You'll be given the opportunity to download a tomcat zip, a webapp zip, or the .. other zip, that is just the name of the library: jodconverter-2.2.2.zip
. Download that one, and include it as a Play library. Fun project! Enjoy!