Project

General

Profile

1
@author: Alessia Bardi
2
@date: 28/9/2018
3
@description: read me file to update schemas and schema documentation for OpenAIRE
4

    
5
This folder contains the files that are publicly available.
6
There is one folder per schema version, plus one folder for sygma schema.
7
Each schema folder contains:
8
- doc: folder with html documentation. The documentation must be automatically generated via Oxygen. Please find instructions below.
9
- a set of xsd files
10

    
11
The latest schema version must be available in 'latest', which is a symbolic link.
12
Currently for example: 
13
lrwxr-xr-x   1 alessia  staff    3 Sep 28 10:47 latest -> 1.0
14

    
15
A schema that has already been published must never be updated. A new version must instead be released, i.e. you must create a new folder under 'schema' whose name is the new version.
16

    
17
Current published version is 1.0.
18

    
19
Next schema version should be:
20
- 1.2 if there are no major, breaking changes (i.e. only additions or vocabulary changes)
21
- 2.0 if there are major breaking changes (i.e. deletion of fields, breaking type changes)
22

    
23
---- DEPLOYMENT INFO ----
24
Never ever change the files directly in the folder of the OpenAIRE server! Changes there CANNOT be committed. 
25
Work on your local machine, follow the instructions https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaire-schema/trunk and then type the following on the OpenAIRE server:
26

    
27
> sudo su - www-data -s /bin/bash
28
> cd /var/www/schema
29
> svn up
30

    
31
Current deployment info:
32
- machine: new.openaire.eu
33
- location: /var/www/schema
34
- user: www-data
35

    
36
---- HOW TO GENERATE THE DOC FOLDER WITH OXYGEN ---
37
Let's suppose we want to publish version X.Y. This means that we have a folder `schema/X.Y`. 
38
1. Commit `schema/X.Y` on svn.
39
2. Go to the OpenAIRE server via ssh (new.openaire.eu) and update the schema folder:
40
    > sudo su - www-data -s /bin/bash
41
    > cd /var/www/schema
42
    > svn up
43
    Now you should see folder `/var/www/schema/X.Y` and https://www.openaire.eu/schema/X.Y/oaf-X.Y.xsd should be accessible. Check it.
44
3. Now we can generate the documentation via Oxygen.
45
3.1 Open Oxygen in your local machine and select: Tools --> Generate Documentation --> XML Schema Documentation 
46
3.2 Click on Import Settings and select the file `schema/docGenerationSettings.xml`. Settings are:
47
    - output format: splitted by location
48
    - all settings option checked
49
    - images in jpeg
50
3.3 Set the schema URL to https://www.openaire.eu/schema/X.Y/oaf-X.Y.xsd (if we select the file on the local file system, then the documentation will contain references to the local file system, while we want documentation to refer to www.openaire.eu)
51
3.4 Modify the output file by changing X.Y to the actual version you are working with
52
3.5 Click on `Generate`.
53
3.6 Check the documentation is currently stored under `schema/X.Y/doc` and images under `schema/X.Y/doc/img`
54
3.7 Create a symlink for `doc/oaf-X.Y.html` with a name with no version (needed to have a clean URL for the entry point to the latest documentation)
55
    > cd schema/X.Y/doc
56
    > ln -s oaf-X.Y.html oaf.html
57
4. Commit the `schema/X.Y/doc` folder
58
5. Go to the OpenAIRE server via ssh (new.openaire.eu) and update the schema folder:
59
    > sudo su - www-data -s /bin/bash
60
    > cd /var/www/schema
61
    > svn up
62
    Now https://www.openaire.eu/schema/X.Y/oaf-X.Y.html should be accessible. Check it.
63
6. Update the `latest` folder   
64
6.1 Update the `latest` on your local copy of https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-openaire-schema/trunk
65
    > cd schema/latest
66
    > rm -rf *
67
    > ln -s ../X.Y/oaf-X.Y.xsd oaf.xsd
68
    > ln -s ../X.Y/oaf-common-X.Y.xsd oaf-common-X.Y.xsd
69
    > ln -s ../X.Y/oaf-datasource-X.Y.xsd oaf-datasource-X.Y.xsd
70
    > ln -s ../X.Y/oaf-org-X.Y.xsd  oaf-org-X.Y.xsd
71
    > ln -s ../X.Y/oaf-person-X.Y.xsd oaf-person-X.Y.xsd
72
    > ln -s ../X.Y/oaf-project-X.Y.xsd oaf-project-X.Y.xsd
73
    > ln -s ../X.Y/oaf-result-X.Y.xsd  oaf-result-X.Y.xsd
74
    > ln -s ../1.0/doc doc 
75
    > svn commit latest -m "updated latest links to version X.Y"
76
6.2 Update again on the OpenAIRE server folder
77
    > sudo su - www-data -s /bin/bash
78
    > cd /var/www/schema
79
    > svn up
80
6.3 Check the latest links refer to the new schema:
81
    * https://www.openaire.eu/schema/latest/oaf.xsd
82
    * https://www.openaire.eu/schema/latest/doc/oaf.html
83
7. Update the API documentation following instructions on https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-api-http-doc/
84

    
(1-1/2)