From 219165aacf8812f59fbe5c6327a49d951c17e557 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Sun, 21 Apr 2024 01:37:30 +0200 Subject: [PATCH] final translation and documentation --- .../StatController.java | 7 +++ .../ResearchRepository.java | 7 +++ .../ResearcherRepository.java | 7 +++ .../StatsRepository.java | 7 +++ .../ResearchesService.java | 49 +++------------ .../StatisticsService.java | 9 ++- .../ScientificPublications/Research.java | 1 - .../ScientificPublications/Researcher.java | 1 - frontend/public/i18n/EN.txt | 61 +++++++++++++++++++ frontend/public/i18n/FR.txt | 61 +++++++++++++++++++ .../FilterComponent.vue | 46 +++----------- .../ScientificPublications/ListResearches.vue | 24 +++++--- .../ManageResearcherProfile.vue | 23 ++++--- .../ResearchComponent.vue | 51 ++++++++-------- .../ResearchPostComponent.vue | 51 ++++++++-------- .../ResearcherProfile.vue | 27 ++++---- 16 files changed, 269 insertions(+), 163 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScientificPublications/StatController.java b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScientificPublications/StatController.java index 3809d29..ef363ae 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScientificPublications/StatController.java +++ b/backend/src/main/java/ovh/herisson/Clyde/EndPoints/ScientificPublications/StatController.java @@ -1,5 +1,12 @@ package ovh.herisson.Clyde.EndPoints.ScientificPublications; +/****************************************************** + * @file StatController.java + * @author Bartha Maxime + * @scope Publications Scientifiques + * + * Api class for handling statistics + ******************************************************/ import lombok.AllArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearchRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearchRepository.java index f2d1cf2..1aa7b51 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearchRepository.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearchRepository.java @@ -1,5 +1,12 @@ package ovh.herisson.Clyde.Repositories.ScientificPublications; +/****************************************************** + * @file ResearchRepository.java + * @author Bartha Maxime + * @scope Publications Scientifiques + * + * Repository handling communication with Reseach table + ******************************************************/ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import ovh.herisson.Clyde.Tables.ScientificPublications.Research; diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearcherRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearcherRepository.java index 5863bc4..ba1e6e8 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearcherRepository.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/ResearcherRepository.java @@ -1,5 +1,12 @@ package ovh.herisson.Clyde.Repositories.ScientificPublications; +/****************************************************** + * @file ResearcherRepository.java + * @author Bartha Maxime + * @scope Publications Scientifiques + * + * Repository handling communication with Reseacher table + ******************************************************/ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import ovh.herisson.Clyde.Tables.ScientificPublications.Research; diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java index 0dfabfe..6dc1726 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java @@ -1,5 +1,12 @@ package ovh.herisson.Clyde.Repositories.ScientificPublications; +/****************************************************** + * @file StatsRepository.java + * @author Bartha Maxime + * @scope Publications Scientifiques + * + * Repository handling communication with Reseach table for making statistics + ******************************************************/ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import ovh.herisson.Clyde.Tables.ScientificPublications.Research; diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/ResearchesService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/ResearchesService.java index 9916bd8..e7bea68 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/ResearchesService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/ResearchesService.java @@ -1,5 +1,12 @@ package ovh.herisson.Clyde.Services.ScientificPublications; +/****************************************************** + * @file ResearchesService.java + * @author Bartha Maxime + * @scope Publications Scientifiques + * + * Service for managing researcher and researches + ******************************************************/ import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository; @@ -130,39 +137,6 @@ public class ResearchesService { } researcherRepo.save(researcher); } - - - //Co Author part - public boolean saveCoAuthors(Iterable researchersId, Research research) { - - if (researchersId == null) return false; - - ArrayList toAdd = new ArrayList<>(); - for (long researcherId : researchersId){ - Researcher researcher= researcherRepo.findById(researcherId); - if (researcher== null){ - return false; - } - if (!toAdd.contains(researcher)) - { - toAdd.add(researcher); - } - } - research.getCoAuthors().addAll(toAdd); - articleRepo.save(research); - return true; - } - - public boolean deleteCoAuthor(Research research,Researcher coAuthor) { - - if (!research.getCoAuthors().contains(coAuthor)) - return false; - - research.getCoAuthors().remove(coAuthor); - articleRepo.save(research); - return true; - } - // Other stuff public Research addView(Research research) { @@ -188,12 +162,9 @@ public class ResearchesService { } } - if (research.getAccess() == Access.Restricted && ( - user.getRole() == Role.Secretary || - user.getRole() == Role.Teacher || user.getRole() == Role.InscriptionService)) - return false; // if the access is restricted only the staff member (above) can access the research + return research.getAccess() != Access.Restricted || (user.getRole() != Role.Secretary && + user.getRole() != Role.Teacher && user.getRole() != Role.InscriptionService); + // if the access is restricted only the staff member (above) can access the research - return true; - // if the researcher is the author or one of the co-authors of the research will return false } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java index 90a60d2..350feca 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java @@ -1,14 +1,19 @@ package ovh.herisson.Clyde.Services.ScientificPublications; +/****************************************************** + * @file StatisticsService + * @author Bartha Maxime + * @scope Publications Scientifiques + * + * Service for managing statistics + ******************************************************/ import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository; -import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearcherRepository; import ovh.herisson.Clyde.Repositories.ScientificPublications.StatsRepository; import ovh.herisson.Clyde.Tables.ScientificPublications.Research; import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher; -import java.security.Key; import java.util.*; @Service diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Research.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Research.java index da0d714..4c41d15 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Research.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Research.java @@ -6,7 +6,6 @@ package ovh.herisson.Clyde.Tables.ScientificPublications; * @scope Extension Publications scientifiques * * Research entity - * ******************************************************/ import jakarta.persistence.*; import lombok.Getter; diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Researcher.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Researcher.java index 4fe8a9d..60f8328 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Researcher.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/ScientificPublications/Researcher.java @@ -6,7 +6,6 @@ package ovh.herisson.Clyde.Tables.ScientificPublications; * @scope Extension Publications scientifiques * * Researcher entity - * ******************************************************/ import jakarta.persistence.*; import lombok.AllArgsConstructor; diff --git a/frontend/public/i18n/EN.txt b/frontend/public/i18n/EN.txt index c316597..030c814 100644 --- a/frontend/public/i18n/EN.txt +++ b/frontend/public/i18n/EN.txt @@ -54,3 +54,64 @@ Curriculum=curriculum Credits=Credits InscriptionService=I.S. faculty=Faculty +Year=Year +Access=Access +Access.Restricted=Restricted +Access.OpenSource=OpenSource +Access.Private=Private +Language=Language +Month=Month +Month.01=january +Month.02=february +Month.03=march +Month.04=april +Month.05=may +Month.06=june +Month.07=july +Month.08=august +Month.09=september +Month.10=october +Month.11=november +Month.12=december +Domain=Domain +PaperType=PaperType +Submit=Submit +Search.Researches=Search For Researches +Search.Researchers=Search For Researchers +Filters=Filters +Toggle.Researcher=Toggle Researcher Search +Untoggle.Researcher=Toggle Research Search +MoreInfo=More Info +Modify.Research=Modify Research +To.Change.In.Options=To change in regular account options +Modify.Data=Modify Data +Confirm.Changes=Confirm Changes +Cancel.Changes=Cancel Changes +Post.Research=Post a new Research +Summary=Summary +Title=Title +Views=Number of Views +See.Research=See Research +SeeBibTex=See BibTex +Author=Author +CoAuthors=Co-Authors +ReleaseDate=ReleaseDate +Article.Id=Article Id +Delete.Research=Delete Research +Here=Here +Stat.Type=Stat Type +Researches=Researches +Please.Select.Option=Please Select an Option +Class.By=Class By +PaperType.Article=Article +PaperType.Book=Book +PaperType.Book.Chapter=Book Chapter +PaperType.Paper=Paper +Research.Pdf=Research Pdf +BibTex.Pdf=BibTex Pdf +CoAuthors.List=Co-Author List +Confirm.Publish=Confirm Publishing +Cancel.Publish=Cancel Publishing +Years=Years +Months=Months +By=By \ No newline at end of file diff --git a/frontend/public/i18n/FR.txt b/frontend/public/i18n/FR.txt index e86b19b..72404ce 100644 --- a/frontend/public/i18n/FR.txt +++ b/frontend/public/i18n/FR.txt @@ -54,3 +54,64 @@ Curriculum=Cursus Credits=Credits InscriptionService=S.I. faculty=Faculté +Year=Année +Access=Accès +Access.Restricted=Restreint +Access.OpenSource=Libre +Access.Private=Privé +Language=Langue +Month=Mois +Month.01=janvier +Month.02=fevrier +Month.03=mars +Month.04=avril +Month.05=mai +Month.06=juin +Month.07=juillet +Month.08=août +Month.09=septembre +Month.10=octobre +Month.11=novembre +Month.12=decembre +Domain=Domaine +PaperType=Type de recherche +Submit=Envoyer +Search.Researches=Chercher Par Recherche +Search.Researchers=Chercher Par Chercheur +Filters=Filtres +Toggle.Researcher=Activer la recherche par chercheur +Untoggle.Researcher=Désactiver la recherche par chercheur +MoreInfo=Plus d'info +Modify.Research=Modifer l'article +To.Change.In.Options=À changer dans les options +Modify.Data=Modifier +Confirm.Changes=Confirmer les Changements +Cancel.Changes=Abandonner les Changements +Post.Research=Poster un nouvel article +Summary=Résumé +Title=Titre +Views=Nombre de Vues +See.Research=Ouvrir l'article +SeeBibTex=Ouvrir le BibTex +Author=Autheur +CoAuthors=Co-Autheurs +ReleaseDate=Date de Parution +Article.Id=Id de l'article +Delete.Research=Supprimer l'article +Here=Ici +Stat.Type=Type de Stat +Researches=Recherches +Please.Select.Option=Selectionnez des Options +Class.By=Classifer Par +PaperType.Article=Article +PaperType.Book=Livre +PaperType.Book.Chapter=Chapitre de Livre +PaperType.Paper=Papier +Research.Pdf=Pdf de la Recherche +BibTex.Pdf=BibTex de la Recherche +CoAuthors.List=Liste des Co-Autheurs +Confirm.Publish=Confirmer la Publication +Cancel.Publish=Annuler la Publication +Years=Années +Months=Mois +By=par diff --git a/frontend/src/Apps/ScientificPublications/FilterComponent.vue b/frontend/src/Apps/ScientificPublications/FilterComponent.vue index 3916001..27405b4 100644 --- a/frontend/src/Apps/ScientificPublications/FilterComponent.vue +++ b/frontend/src/Apps/ScientificPublications/FilterComponent.vue @@ -7,6 +7,7 @@ @@ -79,26 +80,26 @@ function update(){
Orcid : {{researcher.orcidId}}
Email : {{researcher.user.email}}
-
Domain : {{researcher.domain}}
-
Co-authors list : here
+
{{i18n("Domain")}} : {{researcher.domain}}
+
Co-authors list : {{i18n("Here")}}
- Stat type : + {{i18n("Stat.Type")}} :
- Class by: + {{i18n("Class.By")}} :