Readme.md 2.61 KB
Newer Older
Maxime Chaillet's avatar
Maxime Chaillet committed
1 2
# DOI landing page
## Introduction
Maxime Chaillet's avatar
Maxime Chaillet committed
3
This project handles the management of the doi landing page at ESRF.
Maxime Chaillet's avatar
Maxime Chaillet committed
4
A person is searching for information from a given DOI code. He/she can go to datacite [search page](https://search.datacite.org/) and will enter the doi code he/she is looking at. In response, from his own database, the datacite server will redirect the search to the doi landing page which is located on esrf server.
Maxime Chaillet's avatar
Maxime Chaillet committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

### Usage
In production, the doi landing page is part of a docker container containing an apache2 server. 
To perform a request use the following address (provided the page is accessible from doi.esrf.fr)
   http://doi.esrf.fr/DOIprefix/DOIsuffix



## Technicalities for developers

The grunFile.js has 2 tasks.
* the default task will check and prepare the project for production. js files will be minified and concatanated. Consequently debugging of the js files is not easy using this task. 
* the dev task which is meant for debugging purpose. In this case the js files are not minified.

### How to develop

21 22
* Fork this project to your github space.
* Change the code to implement a new functionnality or fix issues. 
Maxime Chaillet's avatar
Maxime Chaillet committed
23

24 25
To test the changes locally on your computer:
* Prepare the project ( check js files, create the dev.html file from the dev.tpl.html template )
Maxime Chaillet's avatar
Maxime Chaillet committed
26
```
Maxime Chaillet's avatar
Maxime Chaillet committed
27
grunt dev
Maxime Chaillet's avatar
Maxime Chaillet committed
28
```
29
* Copy the www folder  (not all files are needed but it is easy) to apache folder
Maxime Chaillet's avatar
Maxime Chaillet committed
30
```
Maxime Chaillet's avatar
Maxime Chaillet committed
31
sudo rm -fr /var/www/html &&  sudo cp -r www/. /var/www/html/
Maxime Chaillet's avatar
Maxime Chaillet committed
32
```
33 34 35 36 37 38 39
* Open your browser and hit the starting page at the following address http://localhost/dev.html?DOI=prefix/suffix
Replace prefix and suffix with real values. Note that the stating page is dev.html. In production , the starting page will be index.html.
* Once you are satisfied with your work, prepare the project for production
```
grunt
```
* Submit a merge request on icat repository at https://gitlab.esrf.fr/icat/doi-landing-page
Maxime Chaillet's avatar
Maxime Chaillet committed
40 41 42

### How to prepare the docker container
* check js files, concatene them, minify them, handle other js dependancies
Maxime Chaillet's avatar
Maxime Chaillet committed
43
```
Maxime Chaillet's avatar
Maxime Chaillet committed
44
grunt
Maxime Chaillet's avatar
Maxime Chaillet committed
45
```
Maxime Chaillet's avatar
Maxime Chaillet committed
46
* prepare the docker container
Maxime Chaillet's avatar
Maxime Chaillet committed
47
```
Maxime Chaillet's avatar
Maxime Chaillet committed
48 49
cd rootOfTheProject
sudo ./build.sh
Maxime Chaillet's avatar
Maxime Chaillet committed
50
```
Maxime Chaillet's avatar
Maxime Chaillet committed
51 52 53 54

### How to test the page in production setting (ie using the docker container)
you can install the container locally to your docker instance
* start docker daemon
Maxime Chaillet's avatar
Maxime Chaillet committed
55
```
Maxime Chaillet's avatar
Maxime Chaillet committed
56
sudo /etc/init.d/docker start
Maxime Chaillet's avatar
Maxime Chaillet committed
57
```
Maxime Chaillet's avatar
Maxime Chaillet committed
58
* install the docker container created before.
Maxime Chaillet's avatar
Maxime Chaillet committed
59
```
Maxime Chaillet's avatar
Maxime Chaillet committed
60 61
cd rootOfTheProject
sudo ./run.sh
Maxime Chaillet's avatar
Maxime Chaillet committed
62
```
Maxime Chaillet's avatar
Maxime Chaillet committed
63

Maxime Chaillet's avatar
Maxime Chaillet committed
64
* retrieve the name of the container which has been installed locally listing all none running containers
Maxime Chaillet's avatar
Maxime Chaillet committed
65
```
Maxime Chaillet's avatar
Maxime Chaillet committed
66
sudo docker ps -a
Maxime Chaillet's avatar
Maxime Chaillet committed
67
```
Maxime Chaillet's avatar
Maxime Chaillet committed
68 69

* start the given container
Maxime Chaillet's avatar
Maxime Chaillet committed
70
```
Maxime Chaillet's avatar
Maxime Chaillet committed
71
sudo docker start nameOfTheContainer
Maxime Chaillet's avatar
Maxime Chaillet committed
72
```
Maxime Chaillet's avatar
Maxime Chaillet committed
73 74 75

* access the doi landing page http://localhost:8092/DOIprefix/DOIsuffix