Difference between revisions of "Import Files"
m (stray text) |
(updated to 3.4) |
||
| Line 1: | Line 1: | ||
[[Category: Howto]] | [[Category: Howto]] | ||
| − | |||
| + | Here is a minimalist XML file to import local files into EPrints: | ||
| − | + | <?xml version='1.0' encoding='utf-8'?> | |
| − | + | <eprints> | |
| − | + | <eprint> | |
| − | <?xml version='1.0' encoding='utf-8'?> | + | <documents> |
| − | <eprints | + | <document> |
| − | + | <files> | |
| − | + | <file> | |
| − | + | <filename>''/valid/local/path/2/thumb.jpg''</filename> | |
| − | + | </file> | |
| − | + | </files> | |
| − | + | <format>image</format> | |
| − | + | <security>public</security> | |
| − | + | </document> | |
| − | + | </documents> | |
| − | + | <eprint_status>archive</eprint_status> | |
| − | + | <userid>''numericID''</userid> | |
| − | + | <type>image</type> | |
| − | + | <creators> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<item> | <item> | ||
<name> | <name> | ||
| − | <family> | + | <family>''Surname''</family> |
| − | <given> | + | <given>''givenName''</given> |
</name> | </name> | ||
| − | |||
</item> | </item> | ||
| − | + | </creators> | |
| − | + | <title>''Importtest''</title> | |
| − | + | </eprint> | |
| − | </eprints> | + | </eprints> |
| − | </ | + | |
| + | Note that this also set the <code>title</code> and the <code>creators</code>. You can override the saved <code>userid</code> by <code>--user ''modID''</code> when importing with the <code>~/eprints/bin/import</code> script (run it with <code>--help</code> to see all options, <code>--parse-only</code> e.g.). | ||
| + | |||
| + | This will put the eprint object straight into the live repository by <code><eprint_status>archive</eprint_status></code>! You may wish to place it into the user area by <code><eprint_status>inbox</eprint_status></code> or into the editorial review by <code><eprint_status>buffer</eprint_status></code> instead. | ||
| − | |||
| − | + | For a proper overview of any input field, enter all relevant data into the form and export your entry by | |
| + | ~/eprints/bin/export ''repoID'' eprint XML ''entryID''. | ||
| − | See also | + | See also [[Import From URL]] and XML standardisation page [[EPData XML Representation]]. |
Latest revision as of 18:00, 24 February 2025
Here is a minimalist XML file to import local files into EPrints:
<?xml version='1.0' encoding='utf-8'?>
<eprints>
<eprint>
<documents>
<document>
<files>
<file>
<filename>/valid/local/path/2/thumb.jpg</filename>
</file>
</files>
<format>image</format>
<security>public</security>
</document>
</documents>
<eprint_status>archive</eprint_status>
<userid>numericID</userid>
<type>image</type>
<creators>
<item>
<name>
<family>Surname</family>
<given>givenName</given>
</name>
</item>
</creators>
<title>Importtest</title>
</eprint>
</eprints>
Note that this also set the title and the creators. You can override the saved userid by --user modID when importing with the ~/eprints/bin/import script (run it with --help to see all options, --parse-only e.g.).
This will put the eprint object straight into the live repository by <eprint_status>archive</eprint_status>! You may wish to place it into the user area by <eprint_status>inbox</eprint_status> or into the editorial review by <eprint_status>buffer</eprint_status> instead.
For a proper overview of any input field, enter all relevant data into the form and export your entry by
~/eprints/bin/export repoID eprint XML entryID.
See also Import From URL and XML standardisation page EPData XML Representation.