This is an automated email from the git hooks/post-receive script. New commit to branch feature/9206-upload-validation-zip-documents in repository coselmar. See https://gitlab.nuiton.org/codelutin/coselmar.git commit 01fdb54bbcfc700adc85cc848e96e174329bb656 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Jun 7 11:52:28 2017 +0200 refs-75 #9206 Add some details/infos in admin page about actions --- .../coselmar/beans/DocumentImportModel.java | 1 - .../coselmar/services/v1/DocumentsWebService.java | 3 +++ coselmar-rest/src/test/resources/documents.zip | Bin 151823 -> 151809 bytes .../src/test/resources/documents_errors.zip | Bin 87789 -> 87774 bytes coselmar-ui/src/main/webapp/i18n/en.js | 21 ++++++++++++++++++ coselmar-ui/src/main/webapp/i18n/fr.js | 22 +++++++++++++++++++ .../src/main/webapp/views/admin/admintools.html | 24 ++++++++++++++------- 7 files changed, 62 insertions(+), 9 deletions(-) diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentImportModel.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentImportModel.java index a5ff66a..d70af0b 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentImportModel.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/DocumentImportModel.java @@ -30,7 +30,6 @@ public class DocumentImportModel extends AbstractImportModel<DocumentBean> { newMandatoryColumn("name", "name"); newMandatoryColumn("type", "type"); - newMandatoryColumn("privacy", "privacy"); newMandatoryColumn("keywords", "keywords", LIST_STRING_PARSER); newOptionalColumn("authors", "authors"); newMandatoryColumn("summary", "summary"); diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java index d3b676a..7ab6011 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/DocumentsWebService.java @@ -1017,6 +1017,9 @@ public class DocumentsWebService extends CoselmarWebServiceSupport { for (DocumentBean documentBean : importer) { FileInfos fileInfos = new FileInfos(); String fileName = documentBean.getFileName(); + // cf https://forge.codelutin.com/issues/9205?issue_count=18&issue_position=4&next_issue_id=9198&prev_issue_id=9206#note-2 + documentBean.setPrivacy(Privacy.PUBLIC.name()); + ZipEntry zipFileEntry = zipFile.getEntry(fileName); if (zipFileEntry == null) { importResult.addMissingFile(fileName); diff --git a/coselmar-rest/src/test/resources/documents.zip b/coselmar-rest/src/test/resources/documents.zip index 6467307..ad0f982 100644 Binary files a/coselmar-rest/src/test/resources/documents.zip and b/coselmar-rest/src/test/resources/documents.zip differ diff --git a/coselmar-rest/src/test/resources/documents_errors.zip b/coselmar-rest/src/test/resources/documents_errors.zip index a6e53df..de38463 100644 Binary files a/coselmar-rest/src/test/resources/documents_errors.zip and b/coselmar-rest/src/test/resources/documents_errors.zip differ diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js index e6b38f5..e4f2c97 100644 --- a/coselmar-ui/src/main/webapp/i18n/en.js +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -328,6 +328,27 @@ var translateEN = { "admin.tools.message.massimport.csvReadFail" : "Unable to read 'description.csv' file, please verify file format.", "admin.tools.message.massimport.fileReadFail" : "Unable to read some files from zip.", "admin.tools.message.massimport.missingFiles" : "Files not found from zip : ", +"admin.tools.presentation.luceneRefresh" : "<p>Search Index makes search easier and faster.</p>\ + <p>Refresh it guaranties to be weel synch with information from database.</p>", +"admin.tools.presentation.documentsimport" : "<p>This allows to add several documents in one time in the application.</p>\ + <p>A Zip file is required, containing :\ + <ul>\ + <li>a CSV file named 'description.csv' with on each line metadata related to a file (in the zip) ;</li>\ + <li>all document files to import.</li>\ + </ul>\ + </p>\ + <p>CSV file should have following headers and columns: \ + <strong>name;type;keywords;authors;summary;license;copyright;publicationDate;comment;citation;fileName</strong>.<br/> \ + And some columns must have specific format : \ + <ul>\ + <li><strong>TYPE</strong> can only have one of values 'PERIODICAL_PUBLICATION', 'MEETING_PUBLICATION', 'THESIS',\ + 'REPORT', 'SCIENTIFIC_REPORT', 'SCIENTIFIC_WORK', 'CHAPTER_WORK', 'CONTRACT_REPORT', 'EXPERTISE',\ + 'POSTER', 'CONFERENCE_ARTICLE', 'CONFERENCE_SUMMARY', 'DATA', 'OTHER' ;</li>\ + <li><strong>keywords</strong> must be separated with coma (<strong>,</strong>) ;</li>\ + <li><strong>publicationDate</strong> format must be YYYY/MM/DD (2017/06/01) ;</li>\ + <li>If a text contains a semi-colon(<strong>;</strong>), it have to be borned with quotes (\"text ; rest\").\ + </ul>\ + </p>", //Common part diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js index 14f0d06..3783bc6 100644 --- a/coselmar-ui/src/main/webapp/i18n/fr.js +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -328,6 +328,28 @@ var translateFR = { "admin.tools.message.massimport.csvReadFail" : "Erreur dans le traitement du fichier 'description.csv'. Veuillez vérifier le format des données.", "admin.tools.message.massimport.fileReadFail" : "Erreur dans le traitement de fichiers contenus dans le zip.", "admin.tools.message.massimport.missingFiles" : "Fichiers non retrouvés dans le zip : ", +"admin.tools.presentation.luceneRefresh" : "<p>L'index de recherche permet d'accélérer la fonctionnalité de recherche.</p>\ + <p>Le rafraîchissement de cet index permet d'assurer la bonne synchronisation avec les informations\ + stockées en base de données.</p>", +"admin.tools.presentation.documentsimport" : "<p>Cette fonctionnalité permet d'ajouter plusieurs documents à la base de connaissance.</p>\ + <p>Un fichier Zip est attendu, contenant :\ + <ul>\ + <li>Un fichier CSV 'description.csv' contenant pour chaque lignes les metadata relatives à un fichier ;</li>\ + <li>L'ensemble des fichiers à importer.</li>\ + </ul>\ + </p>\ + <p>Le fichier CSV doit répondre aux colonnes suivantes : \ + <strong>name;type;keywords;authors;summary;license;copyright;publicationDate;comment;citation;fileName</strong>.<br/> \ + Certaines colonnes doivent répondre à un format spécifique : \ + <ul>\ + <li><strong>TYPE</strong> comprendra les valeurs 'PERIODICAL_PUBLICATION', 'MEETING_PUBLICATION', 'THESIS',\ + 'REPORT', 'SCIENTIFIC_REPORT', 'SCIENTIFIC_WORK', 'CHAPTER_WORK', 'CONTRACT_REPORT', 'EXPERTISE',\ + 'POSTER', 'CONFERENCE_ARTICLE', 'CONFERENCE_SUMMARY', 'DATA', 'OTHER' ;</li>\ + <li>les <strong>keywords</strong> doivent être séparés par des virgule (<strong>,</strong>) ;</li>\ + <li>le format de la <strong>publicationDate</strong> doit être YYYY/MM/DD (2017/06/01) ;</li>\ + <li>Si un texte comprend des points-virgule (<strong>;</strong>), il doit être écrit encadrés par des guillemets (\"texte ; continue\").\ + </ul>\ + </p>", //Common part diff --git a/coselmar-ui/src/main/webapp/views/admin/admintools.html b/coselmar-ui/src/main/webapp/views/admin/admintools.html index bdb9f25..625fa52 100644 --- a/coselmar-ui/src/main/webapp/views/admin/admintools.html +++ b/coselmar-ui/src/main/webapp/views/admin/admintools.html @@ -29,12 +29,15 @@ </h1> </div> - <div class="form-group"> + <div class="clear"> + <h2>{{ "admin.tools.label.luceneRefresh" | translate }}</h2> + + <div class="form-group"> <div class="form-group"> - <label class="col-md-5 control-label">{{ 'admin.tools.label.luceneRefresh' | translate }}</label> + <div class="col-md-8" translate="admin.tools.presentation.luceneRefresh"></div> - <div class="col-md-7 "> + <div class="col-md-4"> <a class="form-inline btn btn-primary" ng-click="refreshIndex()">{{ 'admin.tools.button.refresh' | translate }}</a> </div> </div> @@ -50,15 +53,19 @@ {{ 'admin.tools.message.refresh.error' | translate }} </div> </div> - <br/> + <br/> + </div> + </div> - <div class="form-group"> + <div class="clear"> + <h2>{{ "admin.tools.label.documentsImport" | translate }}</h2> + <div class="form-group"> <div class="form-group"> - <label class="col-md-5 control-label">{{ 'admin.tools.label.documentsImport' | translate }}</label> + <div class="col-md-8" translate="admin.tools.presentation.documentsimport"></div> - <div class="col-md-7 "> + <div class="col-md-4"> <input class="col-md-8" type="file" class="form-control" name="uploadFile" ng-file-model="uploadFile" accept=".zip"/> @@ -104,6 +111,7 @@ </div> - <br/> + <br/> + </div> </div> </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.