Core API

From EPrints Documentation
Revision as of 17:33, 11 January 2007 by WikiSysop (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is the bits which you will need to get started...

A connection to the EPrints system is represented by an instance of EPrints::Session. The session object links to

  • the configuration of the repository (only one per session object, even if the system itself has multiple repositories).
  • the database for the repository.
  • the language to output in.

And if a CGI script then also

  • the EPrints::DataObj::User object of the current user, if any.
  • the apache request.

If you're writing your own script then you'll need to start by asking for a Session object.

command-line script

#!/usr/bin/perl -w -I/opt/eprints3/perl-lib/
use EPrints;
use strict;
my $archive_id = $ARGV[0];
my $session = new EPrints::Session( 1 );
exit( 1 ) unless( defined $session );

# do your stuff
$session->terminate;