Import Files

From EPrints Documentation
Revision as of 01:21, 12 September 2018 by Kgoetz (talk | contribs) (add categories, links)
Jump to: navigation, search


Here is a minimalist XML file to import local files into EPrints (provided by John Salter):

<?xml version='1.0' encoding='utf-8'?>
<eprints xmlns='http://eprints.org/ep2/data/2.0'>
  <eprint>
    <documents>
      <document>
        <files>
          <file>
            <datasetid>document</datasetid>
            <filename>thumb.jpg</filename>
            <url>file:///tmp/files/thumb.jpg</url>
          </file>
        </files>
        <format>image</format>
        <security>public</security>
        <main>thumb.jpg</main>
      </document>
    </documents>
    <eprint_status>archive</eprint_status>
    <userid>1</userid>
    <type>image</type>
    <creators>
      <item>
        <name>
          <family>test</family>
          <given>test</given>
        </name>
        <id>test@test.com</id>
      </item>
    </creators>
    <title>test</title>
  </eprint>
</eprints>

Note that this also set the title and the creators. You can override the "userid" when importing with the bin/import script (run it with "--help" to see how to do this).

This will put the eprint object straight into the live repository ("<eprint_status>archive</eprint_status>") - You may wish to place them into the user area ("<eprint_status>inbox</eprint_status>") or into the editorial review ("<eprint_status>buffer</eprint_status>") instead.

See also similar page Editing Import From URL and XML standardisation page EPData XML Representation.