Difference between revisions of "Import Files"

From EPrints Documentation
Jump to: navigation, search
m (stray text)
(updated to 3.4)
 
Line 1: Line 1:
 
[[Category: Howto]]
 
[[Category: Howto]]
[[Category: Out of Date]]
 
  
 +
Here is a minimalist XML file to import local files into EPrints:
  
Here is a minimalist XML file to import local files into EPrints (provided by John Salter):
+
<?xml version='1.0' encoding='utf-8'?>
 
+
<eprints>
<pre>
+
  <eprint>
<?xml version='1.0' encoding='utf-8'?>
+
    <documents>
<eprints xmlns='http://eprints.org/ep2/data/2.0'>
+
      <document>
  <eprint>
+
        <files>
    <documents>
+
          <file>
      <document>
+
            <filename>''/valid/local/path/2/thumb.jpg''</filename>
        <files>
+
          </file>
          <file>
+
        </files>
            <datasetid>document</datasetid>
+
        <format>image</format>
            <filename>thumb.jpg</filename>
+
        <security>public</security>
            <url>file:///tmp/files/thumb.jpg</url>
+
      </document>
          </file>
+
    </documents>
        </files>
+
    <eprint_status>archive</eprint_status>
        <format>image</format>
+
    <userid>''numericID''</userid>
        <security>public</security>
+
    <type>image</type>
        <main>thumb.jpg</main>
+
    <creators>
      </document>
 
    </documents>
 
    <eprint_status>archive</eprint_status>
 
    <userid>1</userid>
 
    <type>image</type>
 
    <creators>
 
 
       <item>
 
       <item>
 
         <name>
 
         <name>
           <family>test</family>
+
           <family>''Surname''</family>
           <given>test</given>
+
           <given>''givenName''</given>
 
         </name>
 
         </name>
        <id>test@test.com</id>
 
 
       </item>
 
       </item>
    </creators>
+
    </creators>
    <title>test</title>
+
    <title>''Importtest''</title>
  </eprint>
+
  </eprint>
</eprints>
+
</eprints>
</pre>
+
 
 +
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.
  
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.
+
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 similar page [[Import From URL]] and XML standardisation page [[EPData XML Representation]].
+
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.