1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 17:56:20 +00:00

Ability to upload files without document (no OCR, no Lucene)

+ New resource to attach a document to a file and OCR/Lucene it
This commit is contained in:
jendib
2015-03-03 00:23:30 +01:00
parent 5cf0532db7
commit c36014b46f
12 changed files with 774 additions and 35 deletions

View File

@@ -93,12 +93,32 @@ public class FileDao {
q.setParameter("id", file.getId());
File fileFromDb = (File) q.getSingleResult();
// Update the user
// Update the file
fileFromDb.setContent(file.getContent());
return file;
}
/**
* Update the document of a file.
*
* @param file File to update
* @return Updated file
*/
public File updateDocument(File file) {
EntityManager em = ThreadLocalContext.get().getEntityManager();
// Get the file
Query q = em.createQuery("select f from File f where f.id = :id and f.deleteDate is null");
q.setParameter("id", file.getId());
File fileFromDb = (File) q.getSingleResult();
// Update the file
fileFromDb.setDocumentId(file.getDocumentId());
return file;
}
/**
* Gets a file by its ID.
*

View File

@@ -1 +1 @@
db.version=6
db.version=7