This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.forge.codelutin.com/coselmar.git commit bb5b6dab5b4d083a7185540ced75194e8d12d7f1 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Feb 10 17:34:45 2016 +0100 fixes #7975 Add new page to display bibliography from document search result --- .../fr/ifremer/coselmar/persistence/DaoUtils.java | 5 + .../persistence/entity/DocumentTopiaDao.java | 183 +++++++++++++++++++++ .../coselmar/services/v1/DocumentsWebService.java | 86 +++++++++- coselmar-rest/src/main/resources/mapping | 1 + coselmar-ui/src/main/webapp/i18n/en.js | 2 + coselmar-ui/src/main/webapp/i18n/fr.js | 2 + .../src/main/webapp/js/coselmar-controllers.js | 38 +++++ .../src/main/webapp/js/coselmar-services.js | 6 + coselmar-ui/src/main/webapp/js/coselmar.js | 4 + .../main/webapp/views/documents/bibliography.html | 38 +++++ .../src/main/webapp/views/documents/documents.html | 7 +- .../main/webapp/views/documents/editDocument.html | 16 +- .../main/webapp/views/documents/newdocument.html | 16 +- 13 files changed, 386 insertions(+), 18 deletions(-) diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/DaoUtils.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/DaoUtils.java index 0c61205..932799f 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/DaoUtils.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/DaoUtils.java @@ -199,6 +199,11 @@ public class DaoUtils { return result; } + public static String orAttributeIn(String entityAlias, String entityAttributeName, Map<String, Object> args, Object value) { + String result = getQueryForAttributeIn(entityAlias, entityAttributeName, args, value, "OR"); + return result; + } + public static String orAttributeContains(String entityAlias, String entityAttributeName, Map<String, Object> args, Object value) { String result = getQueryForAttributeContains(entityAlias, entityAttributeName, args, value, "OR"); return result; diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java index fcd7b0e..3cdb00e 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/DocumentTopiaDao.java @@ -255,6 +255,189 @@ public class DocumentTopiaDao extends AbstractDocumentTopiaDao<Document> { return paginatedDocuments; } + public List<String> findCitationsByDocumentExample(CoselmarUser userFilter, DocumentSearchExample searchExample) { + + StringBuilder hqlBuilder = new StringBuilder("SELECT DISTINCT(D." + Document.PROPERTY_CITATION + ") FROM " + Document.class.getName() + " D" + + " LEFT OUTER JOIN D." + Document.PROPERTY_RESTRICTED_LIST + " CUG " + + " LEFT OUTER JOIN D." + Document.PROPERTY_OWNER + " DO "); + hqlBuilder.append(" WHERE 1=1 "); // Just because next clause will begin with operator + + Map<String, Object> args = new HashMap<>(); + + // If there is a filter on User : list public, owned and ones he is on restricted list. + if (userFilter != null) { + // can list all public document + String privacyPublicCondition = DaoUtils.getQueryForAttributeEquals("D", Document.PROPERTY_PRIVACY, args, Privacy.PUBLIC, ""); + hqlBuilder.append(" AND ( " + privacyPublicCondition); + + // Can list his own document + String ownerCondition = DaoUtils.orAttributeEquals("D", Document.PROPERTY_OWNER, args, userFilter); + hqlBuilder.append(ownerCondition); + + // For limited access, check if user is in a restricted list + String participantCondition = DaoUtils.orAttributeContains("CUG", CoselmarUserGroup.PROPERTY_MEMBERS, args, userFilter); + hqlBuilder.append(participantCondition + ")"); + } + + + // Manage example + Document example = searchExample.getExample(); + if (example != null) { + hqlBuilder.append(" AND ( 1 = 1 "); + + if (StringUtils.isNotBlank(example.getName())) { + String nameCondition = DaoUtils.andAttributeLike("D", Document.PROPERTY_NAME, args, example.getName()); + hqlBuilder.append(nameCondition); + } + + if (StringUtils.isNotBlank(example.getAuthors())) { + String authorsCondition = DaoUtils.andAttributeLike("D", Document.PROPERTY_AUTHORS, args, example.getAuthors()); + hqlBuilder.append(authorsCondition); + } + + if (StringUtils.isNotBlank(example.getLicense())) { + String licenseCondition = DaoUtils.andAttributeLike("D", Document.PROPERTY_LICENSE, args, example.getLicense()); + hqlBuilder.append(licenseCondition); + } + + if (StringUtils.isNotBlank(example.getType())) { + String typeCondition = DaoUtils.andAttributeLike("D", Document.PROPERTY_TYPE, args, example.getType()); + hqlBuilder.append(typeCondition); + } + + if (example.getPrivacy() != null ) { + String privacyCondition = DaoUtils.andAttributeEquals("D", Document.PROPERTY_PRIVACY, args, example.getPrivacy()); + hqlBuilder.append(privacyCondition); + } + + if (example.getKeywords() != null && !example.getKeywords().isEmpty()) { + for (String keyword : example.getKeywords()) { + String keywordCondition = DaoUtils.andAttributeContains("D", Document.PROPERTY_KEYWORDS, args, keyword); + hqlBuilder.append(keywordCondition); + } + } + + if (example.getOwner() != null) { + String ownerCondition = DaoUtils.andAttributeEquals("D", Document.PROPERTY_OWNER, args, example.getOwner()); + hqlBuilder.append(ownerCondition); + } + + + // Now try to find user with given name + if (StringUtils.isNotBlank(searchExample.getOwnerName())) { + + String activeCondition = DaoUtils.andAttributeEquals("DO", CoselmarUser.PROPERTY_ACTIVE, args, true); + hqlBuilder.append(activeCondition); + + // try to find name in user#firstName or user#name! + hqlBuilder.append(" AND ( 1=0 "); // Same as previously : need to have an insignificant clause to add all OR after + String orFirstname = DaoUtils.orAttributeLike("DO", CoselmarUser.PROPERTY_FIRSTNAME, args, searchExample.getOwnerName()); + hqlBuilder.append(orFirstname); + + // Name + String orName = DaoUtils.orAttributeLike("DO", CoselmarUser.PROPERTY_NAME, args, searchExample.getOwnerName()); + hqlBuilder.append(orName); + + hqlBuilder.append(" ) "); // Close this keywords clause + } + + // Manage date range + if (searchExample.getPublicationBeforeDate() != null) { + String publicationDateConditionBefore = DaoUtils.andAttributeLesserOrEquals("D", Document.PROPERTY_PUBLICATION_DATE, args, searchExample.getPublicationBeforeDate()); + hqlBuilder.append(publicationDateConditionBefore); + } + + if (searchExample.getPublicationAfterDate() != null) { + String publicationDateConditionAfter = DaoUtils.andAttributeGreaterOrEquals("D", Document.PROPERTY_PUBLICATION_DATE, args, searchExample.getPublicationAfterDate()); + hqlBuilder.append(publicationDateConditionAfter); + } + + if (searchExample.getDepositBeforeDate() != null) { + String depositDateConditionBefore = DaoUtils.andAttributeLesserOrEquals("D", Document.PROPERTY_DEPOSIT_DATE, args, searchExample.getDepositBeforeDate()); + hqlBuilder.append(depositDateConditionBefore); + } + + if (searchExample.getDepositAfterDate() != null) { + String depositDateConditionAfter = DaoUtils.andAttributeGreaterOrEquals("D", Document.PROPERTY_DEPOSIT_DATE, args, searchExample.getDepositAfterDate()); + hqlBuilder.append(depositDateConditionAfter); + } + + hqlBuilder.append(" ) "); + } + + + // Manage keywords search in : title, summary, authors and keywords + if (searchExample.getFullTextSearch() != null && !searchExample.getFullTextSearch().isEmpty()) { + hqlBuilder.append(" AND ( 1 = 0 "); + for (String keyword : searchExample.getFullTextSearch()) { + String nameClause = DaoUtils.orAttributeLike("D", Document.PROPERTY_NAME, args, keyword); + String summaryClause = DaoUtils.orAttributeLike("D", Document.PROPERTY_SUMMARY, args, keyword); + String authorsClause = DaoUtils.orAttributeLike("D", Document.PROPERTY_AUTHORS, args, keyword); + String containsKeyword = DaoUtils.orAttributeContains("D", Document.PROPERTY_KEYWORDS, args, keyword); + + hqlBuilder.append(nameClause); + hqlBuilder.append(summaryClause); + hqlBuilder.append(authorsClause); + hqlBuilder.append(containsKeyword); + } + hqlBuilder.append(" )"); + } + + // Add the prefix for order clause + searchExample.setOrderClause("D." + Document.PROPERTY_CITATION); + + PaginationParameter paginationParameter = searchExample.getPaginationParameter(); + + List<String> citations = find(hqlBuilder.toString(), args, paginationParameter); + + return citations; + } + + public List<String> findCitationsByDocumentFromKeywords(List<String> keywords) { + + StringBuilder hqlBuilder = new StringBuilder("SELECT DISTINCT(D." + Document.PROPERTY_CITATION + ") FROM " + Document.class.getName() + " D"); + Map<String, Object> args = new HashMap<>(); + + if (keywords != null) { + hqlBuilder.append(" WHERE ( 1 = 0 "); + for (String keyword : keywords) { + String nameClause = DaoUtils.orAttributeLike("D", Document.PROPERTY_NAME, args, keyword); + String summaryClause = DaoUtils.orAttributeLike("D", Document.PROPERTY_SUMMARY, args, keyword); + String authorsClause = DaoUtils.orAttributeLike("D", Document.PROPERTY_AUTHORS, args, keyword); + String containsKeyword = DaoUtils.orAttributeContains("D", Document.PROPERTY_KEYWORDS, args, keyword); + + hqlBuilder.append(nameClause); + hqlBuilder.append(summaryClause); + hqlBuilder.append(authorsClause); + hqlBuilder.append(containsKeyword); + } + hqlBuilder.append(" )"); + } + + String hql = hqlBuilder.toString(); + List<String> citations = findAll(hql, args); + + return citations; + } + + public List<String> findCitationsByDocumentIds(List<String> documentIds) { + + StringBuilder hqlBuilder = new StringBuilder("SELECT DISTINCT(D." + Document.PROPERTY_CITATION + ") FROM " + Document.class.getName() + " D"); + Map<String, Object> args = new HashMap<>(); + + if (documentIds != null && !documentIds.isEmpty()) { + hqlBuilder.append(" WHERE ( 1 = 0 "); + String documentIdsClause = DaoUtils.orAttributeIn("D", Document.PROPERTY_TOPIA_ID, args, documentIds); + hqlBuilder.append(documentIdsClause); + hqlBuilder.append(" )"); + } + + String hql = hqlBuilder.toString(); + List<String> citations = findAll(hql, args); + + return citations; + } + public List<String> findAllKeywords() { StringBuilder hqlBuilder = 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 7f4c58a..53377e2 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 @@ -26,7 +26,9 @@ package fr.ifremer.coselmar.services.v1; import com.google.common.base.Function; import com.google.common.base.Preconditions; +import com.google.common.base.Predicate; import com.google.common.collect.Collections2; +import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import fr.ifremer.coselmar.beans.DocumentBean; import fr.ifremer.coselmar.beans.DocumentSearchBean; @@ -56,9 +58,9 @@ import org.debux.webmotion.server.call.UploadFile; import org.debux.webmotion.server.render.Render; import org.nuiton.topia.persistence.TopiaNoResultException; import org.nuiton.util.DateUtil; -import org.nuiton.util.pagination.PaginationParameter; import org.nuiton.util.pagination.PaginationResult; +import javax.annotation.Nullable; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -256,6 +258,88 @@ public class DocumentsWebService extends CoselmarWebServiceSupport { return result; } + public List<String> getSearchBibliography(DocumentSearchBean searchBean) throws InvalidCredentialException { + + // Check authentication + String authorization = getContext().getHeader("Authorization"); + CoselmarUser currentUser = checkUserAuthentication(authorization); + + CoselmarUserRole currentUserRole = currentUser.getRole(); + + DocumentSearchExample searchExample = DocumentSearchExample.newDefaultSearchExample(); + if (searchBean != null) { + // For this search result, no pagination + searchExample.setPage(searchExample.DEFAULT_PAGE); + searchExample.setLimit(searchExample.DEFAULT_PAGE_SIZE); + + searchExample.setFullTextSearch(searchBean.getFullTextSearch()); + + Document example = BeanEntityConverter.fromBean(searchBean); + searchExample.setExample(example); + + searchExample.setOwnerName(searchBean.getOwnerName()); + + if (searchBean.getDepositAfterDate() != null) { + Date depositAfterDate = DateUtil.getEndOfDay(DateUtil.getYesterday(searchBean.getDepositAfterDate())); + searchExample.setDepositAfterDate(depositAfterDate); + } + + if (searchBean.getDepositBeforeDate() != null) { + Date depositBeforeDate = DateUtil.getEndOfDay((searchBean.getDepositBeforeDate())); + searchExample.setDepositBeforeDate(depositBeforeDate); + } + + if (searchBean.getPublicationAfterDate() != null) { + Date publicationAfterDate = DateUtil.getEndOfDay(DateUtil.getYesterday(searchBean.getPublicationAfterDate())); + searchExample.setPublicationAfterDate(publicationAfterDate); + } + + if (searchBean.getPublicationBeforeDate() != null) { + Date publicationBeforeDate = DateUtil.getEndOfDay((searchBean.getPublicationBeforeDate())); + searchExample.setPublicationBeforeDate(publicationBeforeDate); + } + } + + + List<String> citations; + // Admin and Supervisor can see all documents (public, private and restricted) + if (Lists.newArrayList(CoselmarUserRole.ADMIN, CoselmarUserRole.SUPERVISOR).contains(currentUserRole)) { + List<String> searchKeywords = searchBean.getFullTextSearch(); + if (searchKeywords != null && !searchKeywords.isEmpty()) { + DocumentsIndexationService documentsIndexationService = getServicesContext().newService(DocumentsIndexationService.class); + + try { + List<String> documentIds = documentsIndexationService.searchDocuments(searchKeywords); + List<String> documentFullIds = getDocumentsFullId(documentIds); + + citations = getDocumentDao().findCitationsByDocumentIds(documentFullIds); + + } catch (IOException | ParseException e) { + if (log.isErrorEnabled()) { + log.error("Unable to search by lucene, make search directly in database", e); + } + citations = getDocumentDao().findCitationsByDocumentFromKeywords(searchKeywords); + + } + } else { + citations = getDocumentDao().findCitationsByDocumentExample(null, searchExample); + } + + } else { + //Other can only see public, his own private and restricted for which he is allowed + citations = getDocumentDao().findCitationsByDocumentExample(currentUser, searchExample); + } + + Iterables.removeIf(citations, new Predicate<String>() { + @Override + public boolean apply(@Nullable String input) { + return StringUtils.isBlank(input); + } + }); + + return citations; + } + public DocumentBean addDocument(DocumentBean document, UploadFile uploadFile) throws InvalidCredentialException, UnauthorizedException { // Check authentication diff --git a/coselmar-rest/src/main/resources/mapping b/coselmar-rest/src/main/resources/mapping index 156ce9b..7c9ac1b 100644 --- a/coselmar-rest/src/main/resources/mapping +++ b/coselmar-rest/src/main/resources/mapping @@ -33,6 +33,7 @@ GET /v1/doc DocApi.showMapping GET /v1/documents DocumentsWebService.getDocuments GET /v2/documents DocumentsWebService.getPaginatedDocuments +GET /v2/documents/citations DocumentsWebService.getSearchBibliography GET /v1/documents/keywords DocumentsWebService.getKeywords GET /v1/documents/types DocumentsWebService.getTypes GET /v1/documents/{documentId} DocumentsWebService.getDocument diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js index ccea16d..be7b136 100644 --- a/coselmar-ui/src/main/webapp/i18n/en.js +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -64,6 +64,7 @@ var translateEN = { <li>Private : only you can see the document</li>\ <li>Restricted : you can specify who can see the document specifically</li>\ </ul>", +"document.bibliography.title" : "Bibliography", "document.metadata.name" : "Title", "document.metadata.authors" : "Authors", @@ -132,6 +133,7 @@ var translateEN = { "document.button.download" : "Download", "document.button.openLink" : "Open link", "document.button.removeFile" : "Remove file", +"document.button.generateBibliography" : "Generate bibliography", //Questions part diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js index baac462..de2076b 100644 --- a/coselmar-ui/src/main/webapp/i18n/fr.js +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -64,6 +64,7 @@ var translateFR = { <li>Privé : vous seul pouvez accéder au document</li>\ <li>Restreint : le document ne sera accessible qu'aux participants d'un projet ou est attaché le document</li>\ </ul>", +"document.bibliography.title" : "Bibliographie", "document.metadata.name" : "Titre", "document.metadata.authors" : "Auteurs", @@ -132,6 +133,7 @@ var translateFR = { "document.button.download" : "Télécharger", "document.button.openLink" : "Ouvrir le lien", "document.button.removeFile" : "Supprimer le fichier", +"document.button.generateBibliography" : "Générer la bibliographie", //Questions part diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index db0f90c..8bd7ba3 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -210,6 +210,7 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara if (limit) { $scope.example.limit = limit; } + $scope.searchId = btoa(JSON.stringify($scope.example)); documentService.getPaginatedDocuments($scope.example, function(paginatedDocuments) { $scope.paginationData = paginatedDocuments; @@ -258,6 +259,7 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara $scope.example.publicationBeforeDate = $scope.example.publicationBeforeDate.getTime(); } + $scope.searchId = btoa(JSON.stringify($scope.example)); $scope.$emit('dataLoading'); documentService.getPaginatedDocuments($scope.example, function(paginatedDocuments) { $scope.paginationData = paginatedDocuments; @@ -408,6 +410,42 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif }]); +// Controller for bibliography View +coselmarControllers.controller("DocumentsBibliographyCtrl", ['$scope', '$routeParams', 'documentService', 'errorService', + function($scope, $routeParams, documentService, errorService){ + + $scope.searchId = $routeParams.searchId; + + $scope.example = JSON.parse(atob($scope.searchId)); + + { + if (angular.isDate($scope.example.depositAfterDate)) { + $scope.example.depositAfterDate = $scope.example.depositAfterDate.getTime(); + } + + if (angular.isDate($scope.example.depositBeforeDate)) { + $scope.example.depositBeforeDate = $scope.example.depositBeforeDate.getTime(); + } + + if (angular.isDate($scope.example.publicationAfterDate)) { + $scope.example.publicationAfterDate = $scope.example.publicationAfterDate.getTime(); + } + + if (angular.isDate($scope.example.publicationBeforeDate)) { + $scope.example.publicationBeforeDate = $scope.example.publicationBeforeDate.getTime(); + } + + $scope.$emit('dataLoading'); + documentService.getSearchBibliography($scope.example, function(citations) { + console.log(citations); + $scope.citations = citations; + }, errorService.defaultFailOnCall, function() { + $scope.$emit('dataLoaded'); + }); + }; + +}]); + // Controller for single document View coselmarControllers.controller("DocumentViewCtrl", ['$scope', '$route', '$location', '$routeParams', 'coselmarConfig', 'notify', 'documentService', 'errorService', diff --git a/coselmar-ui/src/main/webapp/js/coselmar-services.js b/coselmar-ui/src/main/webapp/js/coselmar-services.js index 64f4706..0115a3e 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-services.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-services.js @@ -148,4 +148,10 @@ function Document(resource, config){ docResource.get(successFunction, failFunction).$promise.finally(finallyFunction); }; + this.getSearchBibliography = function(searchExample, successFunction, failFunction, finallyFunction){ + // Load documents with search example + var docResource = resource(baseV2URL + "/citations", {'searchBean' : searchExample}); + docResource.query(successFunction, failFunction).$promise.finally(finallyFunction); + }; + }; \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/js/coselmar.js b/coselmar-ui/src/main/webapp/js/coselmar.js index 8904db3..ca5840e 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar.js +++ b/coselmar-ui/src/main/webapp/js/coselmar.js @@ -36,6 +36,10 @@ coselmarApp.config(['$routeProvider', function($routeProvider) { controller : 'NewDocumentCtrl', templateUrl : 'views/documents/newdocument.html' + }).when('/documents/bibliography/:searchId', { + controller : 'DocumentsBibliographyCtrl', + templateUrl : 'views/documents/bibliography.html' + }).when('/documents/:documentId', { controller : 'DocumentViewCtrl', templateUrl : 'views/documents/document.html' diff --git a/coselmar-ui/src/main/webapp/views/documents/bibliography.html b/coselmar-ui/src/main/webapp/views/documents/bibliography.html new file mode 100644 index 0000000..0b1b6e7 --- /dev/null +++ b/coselmar-ui/src/main/webapp/views/documents/bibliography.html @@ -0,0 +1,38 @@ +<!-- + #%L + Coselmar :: UI + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2014 Ifremer, Code Lutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<div> + <div class="page-header"> + <h1> + <!-- Heading goes here --> + {{ 'document.bibliography.title' | translate }} + </h1> + </div> + + <div> + <ul> + <li ng-repeat="citation in citations">{{citation}}</li> + </ul> + </div> +</div> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/documents/documents.html b/coselmar-ui/src/main/webapp/views/documents/documents.html index 61b3c1b..cb8bb40 100644 --- a/coselmar-ui/src/main/webapp/views/documents/documents.html +++ b/coselmar-ui/src/main/webapp/views/documents/documents.html @@ -62,6 +62,11 @@ </tbody> </table> <pagination-tool></pagination-tool> - <p ng-if="documents && documents.length == 0" translate="common.search.noResult" class="info"/> + <p ng-if="!paginationData || !paginationData.elements || paginationData.elements.length == 0" translate="common.search.noResult" class="info"/> + <div ng-if="paginationData && paginationData.elements && paginationData.elements.length > 0" > + <a href="#/documents/bibliography/{{searchId}}" target="_blank" class="btn btn-primary"> + <span class="fa fa-book" aria-hidden="true"></span>{{ 'document.button.generateBibliography' | translate }}</button> + </a> + </div> </div> </div> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/documents/editDocument.html b/coselmar-ui/src/main/webapp/views/documents/editDocument.html index e8d7152..fb60c4d 100644 --- a/coselmar-ui/src/main/webapp/views/documents/editDocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/editDocument.html @@ -281,24 +281,24 @@ </div> </div> - <!-- Comment --> + <!-- Citation --> <div class="form-group" > - <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> + <label class="col-md-2 control-label">{{ 'document.metadata.citation' | translate }}</label> <div class="col-md-10"> - <textarea type="text" class="form-control" name="comment" rows="5" - ng-model="document.comment" /> + <textarea type="text" class="form-control" name="citation" rows="2" + ng-model="document.citation" /> </div> </div> - <!-- Citation --> + <!-- Comment --> <div class="form-group" > - <label class="col-md-2 control-label">{{ 'document.metadata.citation' | translate }}</label> + <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> <div class="col-md-10"> - <textarea type="text" class="form-control" name="citation" rows="2" - ng-model="document.citation" /> + <textarea type="text" class="form-control" name="comment" rows="5" + ng-model="document.comment" /> </div> </div> diff --git a/coselmar-ui/src/main/webapp/views/documents/newdocument.html b/coselmar-ui/src/main/webapp/views/documents/newdocument.html index c373536..086bed2 100644 --- a/coselmar-ui/src/main/webapp/views/documents/newdocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/newdocument.html @@ -274,24 +274,24 @@ </div> </div> - <!-- Comment --> + <!-- Citation --> <div class="form-group" > - <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> + <label class="col-md-2 control-label">{{ 'document.metadata.citation' | translate }}</label> <div class="col-md-10"> - <textarea type="text" class="form-control" name="comment" rows="5" - ng-model="document.comment" /> + <textarea type="text" class="form-control" name="citation" rows="2" + ng-model="document.citation" /> </div> </div> - <!-- Citation --> + <!-- Comment --> <div class="form-group" > - <label class="col-md-2 control-label">{{ 'document.metadata.citation' | translate }}</label> + <label class="col-md-2 control-label">{{ 'document.metadata.comment' | translate }}</label> <div class="col-md-10"> - <textarea type="text" class="form-control" name="citation" rows="2" - ng-model="document.citation" /> + <textarea type="text" class="form-control" name="comment" rows="5" + ng-model="document.comment" /> </div> </div> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.