Skip to content

ORCID Java API generated from the official ORCID XSDs (via JAXB)

License

Notifications You must be signed in to change notification settings

4Science/orcid-jaxb-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 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-Source repo (to a different location), and optionally checkout a specific tag:
    git clone https://github.com/ORCID/ORCID-Source.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_2.1 XSDs
    cp -r [ORCID-Source]/orcid-model/src/main/resources/common_2.1 [orcid-jaxb-api]/src/main/resources/xsd/
    
    # Copy over record_2.1 XSDs
    cp -r [ORCID-Source]/orcid-model/src/main/resources/record_2.1 [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-2.1.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 master of a given date)

Build Project

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.

About

ORCID Java API generated from the official ORCID XSDs (via JAXB)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%