Difference between revisions of "API:EPrints/Plugin/Import"

From EPrints Documentation
Jump to: navigation, search
(Created page with '<!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' com…')
 
Line 12: Line 12:
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
$plugin = EPrints::Plugin::Import-&gt;new( %opts )
+
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<!-- Pod2Wiki=head_new -->
 +
===new===
 +
 
 +
<source lang="perl">$plugin = EPrints::Plugin::Import->new( %opts )
 +
 
 +
</source>
 
Create a new Import plugin. Available options:
 
Create a new Import plugin. Available options:
  
Line 39: Line 46:
 
*: "staff" (staff only) or "all" (anyone).
 
*: "staff" (staff only) or "all" (anyone).
  
$plugin-&gt;input_fh( fh =&gt; FILEHANDLE [, %opts] )
+
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_input_fh -->
 +
===input_fh===
 +
 
 +
<source lang="perl">$plugin->input_fh( fh => FILEHANDLE [, %opts] )
 +
 
 +
</source>
 
Import one or more objects from filehandle FILEHANDLE. FILEHANDLE should be set to binary semantics.
 
Import one or more objects from filehandle FILEHANDLE. FILEHANDLE should be set to binary semantics.
  
 
This method should by subclassed.
 
This method should by subclassed.
  
$plugin-&gt;input_file( filename =&gt; FILENAME [, %opts] )
+
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_input_file -->
 +
===input_file===
 +
 
 +
<source lang="perl">$plugin->input_file( filename => FILENAME [, %opts] )
 +
 
 +
</source>
 
Opens FILENAME for reading, sets binary semantics and calls input_fh to actually read the file.
 
Opens FILENAME for reading, sets binary semantics and calls input_fh to actually read the file.
  
 
This method may be subclassed (e.g. see [[API:EPrints/Plugin/Import/TextFile|EPrints::Plugin::Import::TextFile]]).
 
This method may be subclassed (e.g. see [[API:EPrints/Plugin/Import/TextFile|EPrints::Plugin::Import::TextFile]]).
  
$dataobj = $plugin-&gt;epdata_to_dataobj( $epdata, %opts )
+
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_epdata_to_dataobj -->
 +
===epdata_to_dataobj===
 +
 
 +
<source lang="perl">$dataobj = $plugin->epdata_to_dataobj( $epdata, %opts )
 +
 
 +
</source>
 
Turn $epdata into a [[API:EPrints/DataObj|EPrints::DataObj]] with the dataset passed in %opts.
 
Turn $epdata into a [[API:EPrints/DataObj|EPrints::DataObj]] with the dataset passed in %opts.
  
 
Calls handler to perform the actual creation.
 
Calls handler to perform the actual creation.
  
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki=head_copyright -->
 
<!-- Pod2Wiki=head_copyright -->
 
==COPYRIGHT==
 
==COPYRIGHT==
Copyright 2000-2011 University of Southampton.
+
: Copyright 2000-2011 University of Southampton.
  
This file is part of EPrints http://www.eprints.org/.
+
: This file is part of EPrints http://www.eprints.org/.
  
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
: EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+
: EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
+
: You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
  
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->

Revision as of 08:48, 2 April 2012

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Plugin::Import


METHODS

new

$plugin = EPrints::Plugin::Import->new( %opts )

Create a new Import plugin. Available options:

  • accept
    Array reference of acceptable MIME types.
  • actions
    Array reference of named actions.
  • advertise
    Boolean for whether to advertise this plugin to users.
  • arguments
    Hash reference of supported arguments/default values.
  • produce
    Array reference of eprint types this plugin can produce.
  • screen
    The screen id this plugin uses to provide its import UI.
  • visible
    "staff" (staff only) or "all" (anyone).


input_fh

$plugin->input_fh( fh => FILEHANDLE [, %opts] )

Import one or more objects from filehandle FILEHANDLE. FILEHANDLE should be set to binary semantics.

This method should by subclassed.


input_file

$plugin->input_file( filename => FILENAME [, %opts] )

Opens FILENAME for reading, sets binary semantics and calls input_fh to actually read the file.

This method may be subclassed (e.g. see EPrints::Plugin::Import::TextFile).


epdata_to_dataobj

$dataobj = $plugin->epdata_to_dataobj( $epdata, %opts )

Turn $epdata into a EPrints::DataObj with the dataset passed in %opts.

Calls handler to perform the actual creation.


COPYRIGHT

Copyright 2000-2011 University of Southampton.
This file is part of EPrints http://www.eprints.org/.
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.