Compare commits
No commits in common. "6116cbdaa4fcc9dda31b652f12ea08ba54ff7b4e" and "f269e24bb480fbab21c64d8a3dc4b3aafa155c4b" have entirely different histories.
6116cbdaa4
...
f269e24bb4
@ -28,9 +28,8 @@ public class ResearchDTO {
|
|||||||
private Access access;
|
private Access access;
|
||||||
private String domain;
|
private String domain;
|
||||||
private String summary;
|
private String summary;
|
||||||
private long views;
|
|
||||||
|
|
||||||
private ResearchDTO(String title, ResearcherDTO researcherDTO, Date releaseDate, PaperType paperType, String pdfLocation, String language, Access access, String domain, String summary, long id,long views) {
|
private ResearchDTO(String title, ResearcherDTO researcherDTO, Date releaseDate, PaperType paperType, String pdfLocation, String language, Access access, String domain, String summary, long id) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.researcher = researcherDTO;
|
this.researcher = researcherDTO;
|
||||||
this.releaseDate = releaseDate;
|
this.releaseDate = releaseDate;
|
||||||
@ -41,13 +40,12 @@ public class ResearchDTO {
|
|||||||
this.domain = domain;
|
this.domain = domain;
|
||||||
this.summary = summary;
|
this.summary = summary;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.views = views;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static ResearchDTO construct(Research research){
|
public static ResearchDTO construct(Research research){
|
||||||
return new ResearchDTO(research.getTitle(), ResearcherDTO.construct(research.getAuthor()), research.getReleaseDate(),
|
return new ResearchDTO(research.getTitle(), ResearcherDTO.construct(research.getAuthor()), research.getReleaseDate(),
|
||||||
research.getPaperType(),research.getPdfLocation(),research.getLanguage(),research.getAccess(),
|
research.getPaperType(),research.getPdfLocation(),research.getLanguage(),research.getAccess(),
|
||||||
research.getDomain(), research.getSummary(), research.getId(), research.getViews());
|
research.getDomain(), research.getSummary(), research.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ public class ApplicationsController {
|
|||||||
|
|
||||||
//if unAuthed
|
//if unAuthed
|
||||||
authorizedApps.add(Applications.Login);
|
authorizedApps.add(Applications.Login);
|
||||||
authorizedApps.add(Applications.ResearcherProfile);
|
|
||||||
|
|
||||||
User user = authServ.getUserFromToken(token);
|
User user = authServ.getUserFromToken(token);
|
||||||
if(user == null)
|
if(user == null)
|
||||||
|
@ -141,7 +141,7 @@ public class MockController {
|
|||||||
Researcher output = researchesService.saveResearcher(jojoResearcherAccount);
|
Researcher output = researchesService.saveResearcher(jojoResearcherAccount);
|
||||||
|
|
||||||
Research jojoResearch = new Research("Graphs : Advanced Search Algorithms", output, new Date(0),
|
Research jojoResearch = new Research("Graphs : Advanced Search Algorithms", output, new Date(0),
|
||||||
PaperType.Article, "test.pdf", null, "english",
|
PaperType.Article, "here.pdf", null, "english",
|
||||||
Access.OpenSource, "IT", "This Article's title speaks for itself \n We'll discuss about advanced Graph search Algorithms");
|
Access.OpenSource, "IT", "This Article's title speaks for itself \n We'll discuss about advanced Graph search Algorithms");
|
||||||
|
|
||||||
Research restrictedResearch = new Research("just another Name", output, new Date(1111111111),
|
Research restrictedResearch = new Research("just another Name", output, new Date(1111111111),
|
||||||
|
@ -229,7 +229,7 @@ public class ResearchController {
|
|||||||
|
|
||||||
///////
|
///////
|
||||||
//views part
|
//views part
|
||||||
@PostMapping("/addview/{url}")
|
@PostMapping("/addView/{url}")
|
||||||
public ResponseEntity<ResearchDTO> addView(@PathVariable String url){
|
public ResponseEntity<ResearchDTO> addView(@PathVariable String url){
|
||||||
Research research = researchesServ.getResearchByUrl(url);
|
Research research = researchesServ.getResearchByUrl(url);
|
||||||
if (research ==null) return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
if (research ==null) return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||||
|
@ -19,22 +19,22 @@ public interface StatsRepository extends CrudRepository<Research,Long> {
|
|||||||
Iterable<Map<String ,Integer>> viewsByTopics();
|
Iterable<Map<String ,Integer>> viewsByTopics();
|
||||||
|
|
||||||
|
|
||||||
@Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r group by r.domain")
|
@Query("select new map(r.domain as label, count(r.language) as y) from Research r group by r.domain")
|
||||||
Iterable<Map<String ,Integer>> languageByTopics();
|
Iterable<Map<String ,Integer>> languageByTopics();
|
||||||
|
|
||||||
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
|
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
|
||||||
Iterable<Map<String ,Integer>> languageByYears();
|
Iterable<Map<String ,Integer>> languageByYears();
|
||||||
|
|
||||||
@Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate, 'month')")
|
@Query("select new map(to_char(r.releaseDate, 'month') as label, count(r.language) as y) from Research r group by to_char(r.releaseDate, 'month')")
|
||||||
Iterable<Map<String ,Integer>> languageByMonths();
|
Iterable<Map<String ,Integer>> languageByMonths();
|
||||||
|
|
||||||
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
|
@Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(r) as y) from Research r group by to_char(r.releaseDate,'YYYY')")
|
||||||
Iterable<Map<String ,Integer>> researchesByYears();
|
Iterable<Map<String ,Integer>> researchesByYears();
|
||||||
|
|
||||||
@Query("select new map(r.domain as label, count(distinct r) as y) from Research r group by r.domain")
|
@Query("select new map(r.domain as label, count(r) as y) from Research r group by r.domain")
|
||||||
Iterable<Map<String ,Integer>> researchesByTopics();
|
Iterable<Map<String ,Integer>> researchesByTopics();
|
||||||
|
|
||||||
@Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate, 'month')")
|
@Query("select new map(to_char(r.releaseDate, 'month') as label, count(r) as y) from Research r group by to_char(r.releaseDate, 'month')")
|
||||||
Iterable<Map<String ,Integer>> researchesByMonth();
|
Iterable<Map<String ,Integer>> researchesByMonth();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,5 @@ public enum Applications {
|
|||||||
|
|
||||||
// InscriptionService authorization
|
// InscriptionService authorization
|
||||||
Requests,
|
Requests,
|
||||||
// profile of a researcher
|
|
||||||
ResearcherProfile,
|
|
||||||
StudentsList
|
StudentsList
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ function format(date){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const emit = defineEmits(["modal-close","downloadPdf","downloadBibTex"]);
|
const emit = defineEmits(["downloadPdf","downloadBibTex"]);
|
||||||
|
|
||||||
const target = ref(null)
|
const target = ref(null)
|
||||||
onClickOutside(target, ()=>emit('modal-close'))
|
onClickOutside(target, ()=>emit('modal-close'))
|
||||||
@ -42,7 +42,6 @@ onClickOutside(target, ()=>emit('modal-close'))
|
|||||||
<li>Language : {{article.language}}</li>
|
<li>Language : {{article.language}}</li>
|
||||||
<li>PaperType : {{article.paperType}}</li>
|
<li>PaperType : {{article.paperType}}</li>
|
||||||
<li>Domain : {{article.domain}}</li>
|
<li>Domain : {{article.domain}}</li>
|
||||||
<li>Views : {{article.views}}</li>
|
|
||||||
<li>Access : {{article.access}}</li>
|
<li>Access : {{article.access}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="downloads" v-if="article.pdfLocation !== null">
|
<div id="downloads" v-if="article.pdfLocation !== null">
|
||||||
|
@ -117,10 +117,10 @@ function update(){
|
|||||||
fontColor: "white",
|
fontColor: "white",
|
||||||
text: statsOf.value + " By "+ statsBy.value,
|
text: statsOf.value + " By "+ statsBy.value,
|
||||||
}
|
}
|
||||||
let index = (statsOf.value === "views"?0:(statsOf.value === "researches"?3:6)) + (statsBy.value ==="years"?0:(statsBy.value==="months"?1:2))
|
const index = (0 ?statsOf.value === "views": 3 ? statsOf.value === "researches":6) + (0?statsBy.value ==="years":1?statsBy.value==="months":2)
|
||||||
|
|
||||||
if (statsOf.value !== "" && statsBy.value !== "")
|
|
||||||
options.data[0].dataPoints = stats.value[index]
|
options.data[0].dataPoints = stats.value[index]
|
||||||
|
|
||||||
|
|
||||||
options.title.text = statsOf.value + " By "+ statsBy.value;
|
options.title.text = statsOf.value + " By "+ statsBy.value;
|
||||||
|
@ -12,10 +12,9 @@ export async function fetchStats(id){
|
|||||||
return restGet("/stats/" +id)
|
return restGet("/stats/" +id)
|
||||||
}
|
}
|
||||||
export async function addView(url){
|
export async function addView(url){
|
||||||
return restPost("/addview/" +url)
|
return restPost("/addView/" +url)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getFile(url){
|
export async function getFile(url){
|
||||||
const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api"
|
return restGet("/" + url)
|
||||||
await fetch(restURL + "/"+url, {method: "GET"})
|
|
||||||
}
|
}
|
@ -34,7 +34,6 @@ const appsList = {
|
|||||||
'ManageCourses': { path: '#/manage-courses', icon: 'fa-book', text: i18n("app.manage.courses") },
|
'ManageCourses': { path: '#/manage-courses', icon: 'fa-book', text: i18n("app.manage.courses") },
|
||||||
'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
|
'StudentsList':{ path: '#/students-list',icon: 'fa-users',text: i18n("app.studentList")},
|
||||||
'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
|
'UsersList':{ path: '#/users-list',icon: 'fa-users',text: i18n("app.users")},
|
||||||
'ResearcherProfile':{path:'#/researcher-profile',icon:'fa-book-bookmark',text:"hihi"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentPath = ref(window.location.hash)
|
const currentPath = ref(window.location.hash)
|
||||||
|
Loading…
Reference in New Issue
Block a user