Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

DSpace/orcid-jaxb-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORCID API (generated by JAXB)

This is an ORCID-Model Java API generated (using JAXB) from the official ORCID XSDs.

Resources:


⚠️ WARNING: GENERATED SOURCE CODE

All source code in src/main/java/ has been auto-generated (by JAXB) via the official ORCID.org XSDs. USE AT YOUR OWN RISK. This source code has only been tested with DSpace and may or may not work for other ORCID use cases.


How to (re)generate ORCID Java API

The below will regenerate/update the ORCID Java API stored in the src/main/java folder of this GitHub repo.

  1. Clone this orcid-jaxb-api repo locally
  2. Clone the ORCID-model repo (to a different location), and optionally checkout a specific tag:
    git clone https://github.com/ORCID/orcid-model.git
    
  3. Copy the necessary ORCID XSD folders into this repo's src/main/resources/xsd/ folder. Check the POM <schemaIncludes> list for the XSDs we need. Be sure not to overwrite the .gitignore already in the "empty" xsd folder, as we do NOT want to keep the XSDs in this repo!
    # Copy over common XSDs
    cp -r [ORCID-model]/src/main/resources/common_3.0 [orcid-jaxb-api]/src/main/resources/xsd/
    
    # Copy over record XSDs
    cp -r [ORCID-model]/src/main/resources/record_3.0 [orcid-jaxb-api]/src/main/resources/xsd/
    
  4. Build project (with profile generate-sources-from-jaxb enabled)
    cd [orcid-jaxb-api]
    
    # WARNING This next line overwrites Java source in ./src/main/java/
    mvn -U clean package -Pgenerate-sources-from-jaxb
    
  5. Double check the source code generated. If any class names or package names need to be updated, you may need to modify our custom orcid-3.0.xjb, as this is the JAXB Binding file used in the code generation process.
    1. Keep an eye out especially for any source code generated under an ns package path, as this means a specific XSD was not assigned a package name.
  6. If everything looks good, create a PR, noting which version of the ORCID XSDs you used to update the Java source code (e.g. either a specific release number or main branch of a given date)

Build Project

The project requires JAVA 6-8 to build. After regenerating the ORCID Java API (using JAXB and ORCID's XSDs -- see above), you can easily build this project by just running:

mvn -U clean package

The result will be a ./target/orcid-jaxb-api-[version].jar

License

The project retains the ORCID MIT-Style license, as all code within it is automatically generated from ORCID's XSDs.