Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier Lézoray
Hal
Commits
be1e0bfb
Commit
be1e0bfb
authored
Oct 21, 2018
by
Olivier Lézoray
Browse files
Options
Downloads
Patches
Plain Diff
Modification Hal.js
parent
d572cf9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/Hal.js
+64
-18
64 additions, 18 deletions
js/Hal.js
with
64 additions
and
18 deletions
js/Hal.js
+
64
−
18
View file @
be1e0bfb
//search a structure : https://api.archives-ouvertes.fr/ref/structure/?q=GREYC
//search an author : https://api.archives-ouvertes.fr/ref/author/?q=lézoray
/**
@file Hal.js
@date October 21, 2018
@author Olivier Lézoray
@version 1.0
@description
This Javascript file contains functions useful to make queries to the HAL webservice.
The HAL API is https://api.archives-ouvertes.fr
For instance to search a structure :
https://api.archives-ouvertes.fr/ref/structure/?q=GREYC
To search an author :
https://api.archives-ouvertes.fr/ref/author/?q=lézoray
//fields for search : https://api.archives-ouvertes.fr/docs/search/schema/fields/#fields
//https://www.ccsd.cnrs.fr/2015/04/produire-la-liste-des-publications-pour-un-laboratoire-une-collection-un-portail/
The fields for searching are :
https://api.archives-ouvertes.fr/docs/search/schema/fields/#fields
**/
/**
* Description.
* Generates a set of <option> year tags to be included in a <select>.
* Each <option> corresponds to a year that can be chosen in the list.
* @param {int} deb the starting year.
* @param {int} fin the ending year.
* @param {int} theid the id of the select to add the generated <option> tags.
**/
function
generateYears
(
deb
,
fin
,
theid
){
var
i
;
var
actualYear
=
new
Date
();
...
...
@@ -18,6 +37,13 @@
$
(
"
#
"
+
theid
).
append
(
option
);
}
}
/**
* Description.
* Generates a set of <option> HAL doc types tags to be included in a <select>.
* Each <option> corresponds to a type of document that can be chosen in the list.
* @param int theid the id of the select to add the generated <option> tags.
**/
function
generateDocTypes
(
theid
){
var
res
=
""
;
var
typesCODES
=
new
Array
(
"
None
"
,
"
ART
"
,
"
COMM
"
,
"
COUV
"
,
"
OTHER
"
,
"
OUV
"
,
"
DOUV
"
,
"
PATENT
"
,
"
POSTER
"
,
"
UNDEFINED
"
,
"
REPORT
"
,
"
THESE
"
,
"
HDR
"
,
"
LECTURE
"
);
...
...
@@ -33,6 +59,18 @@
$
(
"
#
"
+
theid
).
append
(
option
);
}
}
/**
* Description.
* Generates in a given element, a text containing the list of documents for an author.
* This makes a query to the HAL API webservice.
* @param {int} displayid the id of the element ot contain the generated text.
* @param {String} idHal the id of the author.
* @param {String} firstName the first name of the author.
* @param {String} lastName the last name of the author.
* @param {int} lab the id of the lab of the author.
* @param {String} selectedDocType the type of required documents.
* @param {int} selectedYear the year of the required documents.
**/
function
getDocuments
(
displayid
,
idHal
,
firstName
,
lastName
,
lab
,
selectedDocType
,
selectedYear
){
var
criteria
=
"
authFullName_t:
"
+
firstName
+
"
+
"
+
lastName
+
"
and labStructId_i:
"
+
lab
+
"
and docType_s:
"
+
selectedDocType
;
//var criteria="authIdHal_s:"+idHal+" and labStructId_i:"+lab+" and docType_s:"+selectedDocType;
...
...
@@ -108,6 +146,10 @@
"
json
"
);
}
/**
* Description.
* Makes an update of the document on a change of year.
**/
function
yearChange
(){
var
selectedYear
=
$
(
"
#yearSelect
"
).
val
();
var
selectedDocType
=
$
(
"
#documentTypeSelect
"
).
val
();
...
...
@@ -118,6 +160,10 @@
getDocuments
(
"
publications
"
,
idHal
,
firstName
,
lastName
,
lab
,
selectedDocType
,
selectedYear
);
}
}
/**
* Description.
* Makes an update of the document on a change of document type.
**/
function
typeChange
(){
lastName
=
$
(
"
#lastName
"
).
val
();
firstName
=
$
(
"
#firstName
"
).
val
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment