我正在嘗試使用Play進行網站製作!框架(Java中的v2.2.0 &)將作業保存在供學生瀏覽的存儲庫中。我想讓學生將.doc/.docx文件上傳到服務器,並在上傳時將文件自動轉換爲.html文件。將Play Framework中的文件(特別是.doc/.docx轉換爲.html)
這裏是我的HomeworkSnippet數據類型代碼,以供參考:
@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;
}
現在我想這樣做的方法是使用JODConverter tool,讓你轉換的.docx爲.html明確使用OpenOffice的.org或LibreOffice。但是,如果在播放時JODConverter SEEMS需要一個warfile,我該如何做到這一點!框架不使用warfiles。如果這沒有意義,請原諒我。