We provide a simple Java program that performs file uploads (via HTTPS POST) to Crossref. This program allows you to upload a single file, a list of files, or a whole directory of files.
To use, download crossref-upload-tool.jar and place it in /usr/local/lib
Usage
In the following examples:
- user is a system username and password
- file is the name of the file you are uploading or
- directory is the name of the directory containing files to upload
To upload a metadata file:
java -jar crossref-upload-tool.jar --user myusername mypassword --metadata (filename | directory)
for example (note: in these examples, we have used the fictional username/password combination of: mrcrossref/abc134):
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata crdeposit234.xml
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata crdeposits
To upload a resource file:
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --resources (file | directory)
for example:
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata cr_refs.xml
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata refdata
To upload conflict files:
Single file:
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --conflicts ticket1234.txt
Directory of files:
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --transfers ALIAS_123
To direct upload(s) to the test system:
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --host test.crossref.org --metadata crdeposit234.xml
Dry run
Note that if the --metadata option is given a directory name instead of a filename then all files within the directory are uploaded. To ensure that you are uploading what you want use the --dry-run option and review the listing of files, eg:
java -jar crossref-upload-tool.jar --user mrcrossref abc134 --metadata mydeposits/ --dry-run
Additional info
If your upload is successful you will see this message:
[...] INFO uploading to https://doi.crossref.org:443/
[...] INFO uploading submission: file=myfile.xml
[...] INFO uploaded submission: file=myfile.xml
[...] INFO done
If the login is wrong then you will see the message:
[...] INFO uploading to https://doi.crossref.org:443/
[...] INFO uploading submission: file=myfile.xml
[...] INFO unauthorized: file=myfile.xml; user=mrcrossref
[...] INFO done
Upload options
--user name password
--metadata ( file | directory )
--query ( file | directory )
--transfers ( file | directory )
--handles ( file | directory )
--resources ( file | directory )
--conflicts ( file | directory )
--address host port
--protocol ( http | https )
--dry-run
--help
Where:
- user: your Crossref system username and password
- metadata: use for metadata deposits
- query: use for query deposits
- transfers: admin use only
- handles: admin use only
- resources: resource deposits
- conflicts: conflict resolution files
- address: direct to a different address (such as test.crossref.org)
- protocol: http or https
- dry-run: test uploader without uploading
- help: displays the above list of upload options
Further examples
Entry into terminal
java -jar /usr/local/crossref-upload-tool.jar --user mrcrossref abc134 --metadata /Users/mistercrossref/Uploader/September/19/134/
Key for entry into terminal
Location of the upload program on your machine (usr/local/crossref-upload-tool.jar)
Crossref credentials I am using for upload (mrcrossref abc134)
Type of content being uploaded (metadata)
Location of XML files on my machine being uploaded (Users/mistercrossref/Uploader/September/19/134/)
Comments
0 comments
Please sign in to leave a comment.