Import From URL

From EPrints Documentation
Jump to: navigation, search

The Eprints3 XML Format

Note: to import local files, see Import Files.

Note: for using --enable-web-imports, in file ~/archives/archiv/cfg/cfg.d/plugins.pl $c->{enable_web_imports}=1; must be set.

The file and metadata you wish to import should be placed in an one of the formats supported by the import script. The example used in this page is the Eprints XML Format. Note: This format can be retrieved by exporting an eprint from your repository. The following is an example of the Eprints 3 XML Format:

<?xml version="1.0" encoding="utf-8" ?>
<eprints>
  <eprint>
    <eprintid></eprintid>
    <rev_number></rev_number>
    <eprint_status></eprint_status>
    <userid></userid>
    <dir></dir>
    <lastmod></lastmod>
    <status_changed></status_changed>
    <type>other</type>
    <metadata_visibility></metadata_visibility>
    <item_issues_count></item_issues_count>
    <creators>
      <item>
        <name>
          <family></family>
          <given></given>
        </name>
        <id></id>
      </item>
    </creators>
    <title></title>
    <ispublished></ispublished>
    <subjects>
      <item>SubjectID</item>
    </subjects>
    <full_text_status></full_text_status>
    <publisher></publisher>
    <documents>
      <document xmlns="http://eprints.org/ep2/data/2.0">
        <docid></docid>
        <rev_number></rev_number>
        <eprintid></eprintid>
        <pos></pos>
        <format></format>
        <language></language>
        <security></security>
        <main></main>
        <files>
          <file>
            <filename></filename>
            <filesize></filesize>
            <url></url>
          </file> 
        <files>
      </document>
    </documents>
  </eprint>
</eprints>

Importing the File into Eprints

After putting the metadata and file URL into Eprints 3XML Format, you are ready to import the file. The example shown uses the import tool in the eprints folder (/opt/eprints3/ is assumed).

./import ''repository_id'' --enable-web-imports dataset plugin filename

--enable-web-imports : this is used to enable Eprints to download the file from a URL Allow the imported data to import files from the Web. This can obviously be seen as a security hole if you don't trust the data you are importing. This sets the "enable_web_imports" configuration option for this session only.

dataset : The name of the dataset to import into, such as "eprint", "archive", "subject" or "user".

plugin : The id of the input plugin to use. This should not include the leading "Import::". Examples: BibTeX, XML.