Merge branch 'master' into sismics_prod

This commit is contained in:
Benjamin Gamard 2017-10-31 20:39:10 +01:00
commit bf89af0da9
9 changed files with 24 additions and 13 deletions

View File

@ -3,7 +3,7 @@ dist: trusty
language: java
before_install:
- sudo apt-get -qq update
- sudo apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-jpn
- sudo apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-ita tesseract-ocr-kor tesseract-ocr-rus tesseract-ocr-ukr tesseract-ocr-spa tesseract-ocr-ara tesseract-ocr-hin tesseract-ocr-deu tesseract-ocr-pol tesseract-ocr-jpn tesseract-ocr-por tesseract-ocr-tha tesseract-ocr-jpn tesseract-ocr-chi-sim tesseract-ocr-chi-tra
- sudo apt-get -y -q install haveged && sudo service haveged start
after_success:
- mvn -Pprod -DskipTests clean install

View File

@ -1,7 +1,7 @@
FROM sismics/jetty:9.2.20-jdk7
MAINTAINER benjamin.gam@gmail.com
RUN apt-get update && apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-jpn && \
RUN apt-get update && apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-ita tesseract-ocr-kor tesseract-ocr-rus tesseract-ocr-ukr tesseract-ocr-spa tesseract-ocr-ara tesseract-ocr-hin tesseract-ocr-deu tesseract-ocr-pol tesseract-ocr-jpn tesseract-ocr-por tesseract-ocr-tha tesseract-ocr-jpn tesseract-ocr-chi-sim tesseract-ocr-chi-tra && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ENV TESSDATA_PREFIX /usr/share/tesseract-ocr

View File

@ -1,9 +1,9 @@
package com.sismics.docs.core.constant;
import java.util.List;
import com.google.common.collect.Lists;
import java.util.List;
/**
* Application constants.
*
@ -43,5 +43,5 @@ public class Constants {
/**
* Supported document languages.
*/
public static final List<String> SUPPORTED_LANGUAGES = Lists.newArrayList("eng", "fra", "jpn");
public static final List<String> SUPPORTED_LANGUAGES = Lists.newArrayList("eng", "fra", "ita", "deu", "spa", "por", "pol", "rus", "ukr", "ara", "hin", "chi_sim", "chi_tra", "jpn", "tha", "kor");
}

View File

@ -13,7 +13,6 @@ import com.sismics.docs.core.event.DocumentCreatedAsyncEvent;
import com.sismics.docs.core.event.DocumentDeletedAsyncEvent;
import com.sismics.docs.core.event.DocumentUpdatedAsyncEvent;
import com.sismics.docs.core.event.FileDeletedAsyncEvent;
import com.sismics.docs.core.model.context.AppContext;
import com.sismics.docs.core.model.jpa.Acl;
import com.sismics.docs.core.model.jpa.Document;
import com.sismics.docs.core.model.jpa.File;
@ -67,7 +66,7 @@ public class DocumentResource extends BaseResource {
* @apiSuccess {String} title Title
* @apiSuccess {String} description Description
* @apiSuccess {Number} create_date Create date (timestamp)
* @apiSuccess {String="eng","fra","jpn"} language Language
* @apiSuccess {String} language Language
* @apiSuccess {Boolean} shared True if the document is shared
* @apiSuccess {Number} file_count Number of files in this document
* @apiSuccess {Object[]} tags List of tags
@ -313,7 +312,7 @@ public class DocumentResource extends BaseResource {
* @apiSuccess {String} documents.title Title
* @apiSuccess {String} documents.description Description
* @apiSuccess {Number} documents.create_date Create date (timestamp)
* @apiSuccess {String="eng","fra","jpn"} documents.language Language
* @apiSuccess {String} documents.language Language
* @apiSuccess {Boolean} documents.shared True if the document is shared
* @apiSuccess {Number} documents.file_count Number of files in this document
* @apiSuccess {Object[]} documents.tags List of tags
@ -529,7 +528,7 @@ public class DocumentResource extends BaseResource {
* @apiParam {String} [rights] Rights
* @apiParam {String[]} [tags] List of tags ID
* @apiParam {String[]} [relations] List of related documents ID
* @apiParam {String="eng","fra","jpn"} language Language
* @apiParam {String} language Language
* @apiParam {Number} [create_date] Create date (timestamp)
* @apiSuccess {String} id Document ID
* @apiError (client) ForbiddenError Access denied
@ -663,7 +662,7 @@ public class DocumentResource extends BaseResource {
* @apiParam {String} [rights] Rights
* @apiParam {String[]} [tags] List of tags ID
* @apiParam {String[]} [relations] List of related documents ID
* @apiParam {String="eng","fra","jpn"} language Language
* @apiParam {String} language Language
* @apiParam {Number} [create_date] Create date (timestamp)
* @apiSuccess {String} id Document ID
* @apiError (client) ForbiddenError Access denied or document not writable

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

View File

@ -31,9 +31,22 @@
<label class="col-sm-2 control-label" for="inputLanguage">Language</label>
<div class="col-sm-10">
<select class="form-control" id="inputLanguage" ng-model="document.language" ng-disabled="fileIsUploading">
<option value="fra">French</option>
<option value="eng">English</option>
<option value="jpn">Japanese</option>
<option value="fra">Français</option>
<option value="ita">Italiano</option>
<option value="deu">Deutsch</option>
<option value="spa">Español</option>
<option value="por">Português</option>
<option value="pol">Polski</option>
<option value="rus">русский</option>
<option value="ukr">українська</option>
<option value="ara">العربية</option>
<option value="hin">हिन्दी</option>
<option value="chi_sim">官话</option>
<option value="chi_tra">官話</option>
<option value="jpn">日本語</option>
<option value="tha">ภาษาไทย</option>
<option value="kor">한국어</option>
</select>
</div>
</div>

View File

@ -41,7 +41,6 @@
<div class="page-header">
<h1>
{{ document.title }}
<img ng-if="document" ng-src="img/flag/{{ document.language }}.png" title="Document language: {{ document.language }}" />
<small>{{ document.create_date | date: 'yyyy-MM-dd' }}
by <a href="#/user/{{ document.creator }}">{{ document.creator }}</a></small>
</h1>