Difference between revisions of "API:EPrints"

From EPrints Documentation
Jump to: navigation, search
Line 17: Line 17:
 
<!-- Pod2Wiki=head_synopsis --></div>
 
<!-- Pod2Wiki=head_synopsis --></div>
 
==SYNOPSIS==
 
==SYNOPSIS==
   #!/usr/bin/perl -w -I/opt/eprints3/perl_lib
+
   use EPrints qw();
 
    
 
    
   use EPrints;
+
   my $session = EPrints::Session-&gt;new( 1, "demoprints" );
  use strict;
 
 
    
 
    
   # cgi script 
+
   ...
  my $handle = EPrints-&gt;get_handle();
 
  exit( 1 ) unless( defined $handle );
 
 
    
 
    
   # bin script
+
   $session-&gt;terminate;
  my $handle = EPrints-&gt;get_handle( repository =&gt; $repository_id, noise =&gt; $noise );
 
  exit( 1 ) unless( defined $handle );
 
 
 
  $eprint = $handle-&gt;get_eprint( $eprintid );
 
  my $title = $eprint-&gt;get_value( 'title' );
 
 
 
  $eprint-&gt;set_value( 'creators',
 
    [
 
      {
 
        name =&gt; { given=&gt;'John', family=&gt;'Smith' },
 
        id =&gt; 'js@example.com',
 
      },
 
      {
 
        name =&gt; { given=&gt;'Marvin', family=&gt;'Fenderson' },
 
        id =&gt; 'marvin@totl.net',
 
      },
 
    ]
 
  );
 
  $eprint-&gt;commit;
 
 
 
  my $eprint_ds = $handle-&gt;get_dataset( "eprint" );
 
  my $new_eprint = $eprint_ds-&gt;create_object(
 
    $handle, { title=&gt;"My new EPrint!" } );
 
 
 
  my $archive_ds = $handle-&gt;get_dataset( "archive" );
 
  my $search = new EPrints::Search(
 
    handle =&gt; $handle,
 
    dataset =&gt; $archive_ds );
 
  my $date_mf = $archive_ds-&gt;get_field( "date" );
 
  $search-&gt;add_field( $date_mf, "2000-2003" );
 
 
 
  my $list = $search-&gt;perform_search;
 
  $list-&gt;map(
 
    sub {
 
      my( $handle, $dataset, $eprint, $info ) = @_;
 
 
 
      printf( "%s: %s\n",
 
        $eprint-&gt;get_value( "date" ),
 
        $eprint-&gt;get_value( "title" ) );
 
    }
 
  );
 
  $list-&gt;dispose();
 
 
 
  $handle-&gt;log( "We did some stuff." );
 
 
 
  if( some_test() ) { EPrints::abort( "Something bad happened" ); }
 
 
 
  $handle-&gt;terminate;
 
 
    
 
    
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 83: Line 32:
 
<!-- Pod2Wiki=head_description --></div>
 
<!-- Pod2Wiki=head_description --></div>
 
==DESCRIPTION==
 
==DESCRIPTION==
Using this module will cause all the other EPrints modules to be used also.
+
See http://www.eprints.org/.
 
 
See http://www.eprints.org/ for more information about EPrints. Much more documentation can be found at http://wiki.eprints.org/w/Documentation
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=head_key_api_eprints_modules --></div>
 
===Key API EPrints Modules===
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints --></div>
 
====EPrints====
 
 
 
This module! Used to load the other modules.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataobj --></div>
 
====EPrints::DataObj====
 
 
 
Abstract object representing a single record in a DataSet. Has one subclass for each type of DataSet. The most important subclasses are listed below. This module documents generic functions which work on all (or most) data objects. Every DataObj has a unique ID within the dataset (an integer, with the exception of Subject). Every DataObj is given a URI of the form <em>repository_url</em>/id/<em>datasetid</em>/<em>dataobj_id</em>
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataobj_document --></div>
 
====EPrints::DataObj::Document====
 
 
 
Represents a single document. A document is a set of metadata plus files. It *may* have some repository configuraed metadata in addition to the default. The metadata describes the document and is mostly concerned with formats, and rights. Documents belong to exactly one EPrints::DataObj::EPrint are are destroyed if it is destroyed. A document has one or more file. If there's more than one file then they are related, like a .css file for a .html
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataobj_eprint --></div>
 
====EPrints::DataObj::EPrint====
 
 
 
Represents a single submission to the repository. May have 0+ documents as sub-objects. Has both system defined metafields plus many defined in the repository configuration.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataset --></div>
 
====EPrints::DataSet====
 
 
 
This object represents a set of objects of the same time, and has associated MetaFields and database tables. A dataset may represent a subset of another dataset. For example, "eprint" represents all EPrints::DataObj::EPrint objects, but the "buffer" dataset only represents those which are "under review".
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_handle --></div>
 
====EPrints::Handle====
 
 
 
the core of the EPrints API. This object represents a connection between the configuration for a repository, the database connection and either the CGI (web) or CLI (command line) interface.
 
 
 
Handle has a large number of methods, which are documented in more than one file:
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_handle_language --></div>
 
====EPrints::Handle::Language====
 
 
 
Handle methods for i18n.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_handle_render --></div>
 
====EPrints::Handle::Render====
 
 
 
Handle methods for generating XHTML as XML::DOM objects.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_handle_cgi --></div>
 
====EPrints::Handle::CGI====
 
 
 
Handle methods for working with the mod_perl connection.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_handle_page --></div>
 
====EPrints::Handle::Page====
 
 
 
Handle methods for generating and serving XHTML web pages.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_handle_xml --></div>
 
====EPrints::Handle::XML====
 
 
 
Handle methods for creating XML::DOM objects.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_list --></div>
 
====EPrints::List====
 
 
 
A list of zero or more data-objects in a single dataset. It can be constructed from a list of ID's or returned as the result of a search.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_metafield --></div>
 
====EPrints::MetaField====
 
 
 
A single field in a dataset. It has many subclasses, one for each type of field.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_repository --></div>
 
====EPrints::Repository====
 
 
 
Represents the configuration, datasets and dataobjects of a single repository. It is loaded from the configuration files and is essentially read-only.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_search --></div>
 
====EPrints::Search====
 
 
 
The search object takes parameters and returns a List object of matching dataobjs from a given dataset. It can also be used it reverse to test if a dataobj matches it's parameters.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=head_other_api_eprints_modules --></div>
 
===Other API EPrints Modules===
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_box --></div>
 
====EPrints::Box====
 
 
 
A utitility module to render HTML boxes with style and javascript roll-up animations.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_database --></div>
 
====EPrints::Database====
 
 
 
An object representing a connection to the database for a repository. This is an abstraction over sub-objects which connect to MySQL or Oracle.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataobj_file --></div>
 
====EPrints::DataObj::File====
 
 
 
Represents a single file in a document with some basic metadata such as checksums.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataobj_user --></div>
 
====EPrints::DataObj::User====
 
 
 
Represents a single registered user of the repository. Used for keeping track of preferences, profile information and rights management.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_dataobj_subject --></div>
 
====EPrints::DataObj::Subject====
 
 
 
This dataset is used to store the structure of heierachichal(sp?) sets, used by the "Subject" metafield type.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_email --></div>
 
====EPrints::Email====
 
 
 
Tool for sending email.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_paginate --></div>
 
====EPrints::Paginate====
 
 
 
Tools for rendering an EPrint::List as paginated HTML.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_paginate_columns --></div>
 
====EPrints::Paginate::Columns====
 
 
 
An extension to EPrints::Paginate which shows the results in sortable columns, as seen in Items and Review screens.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_storage --></div>
 
====EPrints::Storage====
 
 
 
Methods to abstract the process of reading and writing files. EPrints 3.2 introduced the possibility of storing files in the cloud, or in other storage devices, and this module is the interface to that.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_tempdir --></div>
 
====EPrints::TempDir====
 
 
 
Tools for creating and destorying temporary directories.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_time --></div>
 
====EPrints::Time====
 
 
 
A set of methods for handling time and converting between time formats.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_url --></div>
 
====EPrints::URL====
 
 
 
Utility methods for generating and getting URLs, relative paths etc.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_utils --></div>
 
====EPrints::Utils====
 
 
 
Misc. utility methods.
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki=item_eprints_xml --></div>
 
====EPrints::XML====
 
 
 
Utility methods for working with XML and DOM. This papers over the cracks between the 3 different XML DOM libraries EPrints supports.
 
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 442: Line 83:
  
 
<!-- Pod2Wiki=item_abort --></div>
 
<!-- Pod2Wiki=item_abort --></div>
===EPrints::abort( $msg )===
+
===EPrints-&gt;abort( $errmsg )===
  
 
Print an error message and exit. If running under mod_perl then print the error as a webpage and exit.
 
Print an error message and exit. If running under mod_perl then print the error as a webpage and exit.
Line 453: Line 94:
  
  
<!-- Pod2Wiki=item_get_handle --></div>
+
<!-- Pod2Wiki=item_new --></div>
===$handle = EPrints-&gt;get_handle( %options )===
+
===$ep = EPrints-&gt;new();===
 +
 
 +
Construct a new EPrints system object.
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki=item_repository --></div>
 +
===$repo = $ep-&gt;repository( $repository_id, %options );===
  
Return an EPrints::Handle object joining a web request or script to a database connection, and the configuration and data for a single  repository.
+
Return the repository with the given ID, or undef. Options are... optional.
  
The main options are:
+
Options noise=&gt;1, etc.
  
repository =&gt; $repository_id: This is required for command line scripts. CGI scripts will obtain the repository ID from the context of the request.
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
  
noise =&gt; [0..4]: The level of debug info. 0 - silent, 1 - quietish (default), 2 - noisy, 3 - debug all SQL statements, 4 - debug database connection.
 
  
The following advanced options are also available but are less likely to be useful:
+
<!-- Pod2Wiki=item_current_repository --></div>
 +
===$repo = $ep-&gt;current_repository( %options );===
  
consume_post_data =&gt; [0,1]: Default 1. Only meaningful when running as a web-request. Setting this to "0" will stop the session parsing the POST data which comes in via STDIN. This may be useful if writing apache handlers which make decisions before the main $handle is created. If you don't set it they consume the POST data, and the main handle doesn't get to see it.
+
Return the repository based on the current web request, or undef.
  
check_database =&gt; [0,1]: Default 1. By default a session checks the database structure is compatible with the EPrints database module version. Setting this to "0" will supress this check.
+
%options as for $ep-&gt;repository(..)
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 475: Line 128:
  
  
<!-- Pod2Wiki=item_get_repository --></div>
+
<!-- Pod2Wiki=item_repository_ids --></div>
===$repository = EPrints-&gt;get_repository( $repository_id )===
+
===@ids = $eprints-&gt;repository_ids===
  
Return an EPrints::Repository object representing the configuration of the named repository.
+
Returns a list of the active repository ids.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 487: Line 140:
 
<!-- Pod2Wiki=head_see_also --></div>
 
<!-- Pod2Wiki=head_see_also --></div>
 
==SEE ALSO==
 
==SEE ALSO==
[[API:EPrints/Handle|EPrints::Handle]]
+
[[API:EPrints/Session|EPrints::Session]]
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>

Revision as of 16:29, 12 February 2010


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.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints - Institutional Repository software

User Comments


SYNOPSIS

 use EPrints qw();
 
 my $session = EPrints::Session->new( 1, "demoprints" );
 
 ...
 
 $session->terminate;
 

User Comments


DESCRIPTION

See http://www.eprints.org/.

User Comments


Available Symbols

You can pass options to the EPrints package that effect the EPrints initialisation e.g.

 use EPrints qw( no_check_user );
 

User Comments


no_check_user

Do not check the current user/group is the same as the user/group in Systemsettings.

User Comments


Debugging Slow Processes

This module installs a signal handler that will print a stack trace if given a USR2 signal (if your system supports this signal). To print a stack trace to the error log execute:

$ kill -USR2 PID
 

Where PID is the id number of the stalled process.

A shell script will print the stack trace to the console.

User Comments


METHODS

User Comments


EPrints->abort( $errmsg )

Print an error message and exit. If running under mod_perl then print the error as a webpage and exit.

This subroutine is loaded before other modules so that it may be used to report errors when initialising modules.

User Comments


$ep = EPrints->new();

Construct a new EPrints system object.

User Comments


$repo = $ep->repository( $repository_id, %options );

Return the repository with the given ID, or undef. Options are... optional.

Options noise=>1, etc.

User Comments


$repo = $ep->current_repository( %options );

Return the repository based on the current web request, or undef.

%options as for $ep->repository(..)

User Comments


@ids = $eprints->repository_ids

Returns a list of the active repository ids.

User Comments


SEE ALSO

EPrints::Session

User Comments


COPYRIGHT

__COPYRIGHT__

Copyright 2000-2008 University of Southampton. All Rights Reserved.

__LICENSE__

User Comments