Difference between revisions of "API:EPrints"

From EPrints Documentation
Jump to: navigation, search
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- Pod2Wiki=_preamble_  
This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost.
+
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
  -->{{Pod2Wiki}}{{API:Source|file=EPrints.pm|package_name=EPrints}}[[Category:API|EPrints]]<!-- End of Pod2Wiki -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints|package_name=EPrints}}[[Category:API|EPRINTS]]<div><!-- Edit below this comment -->
<!-- Pod2Wiki=head_name -->=NAME=
 
'''EPrints''' - EPrints Software
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_synopsis -->=SYNOPSIS=
 
  use EPrints;
 
 
 
  my $session = EPrints::Session-&gt;new( 1, "xxx" );
 
 
 
  $session-&gt;terminate;
 
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
 
EPrints is generic repository building software developed by the University of Southampton. It is intended to create a highly configurable web-based repository.
 
  
For more information on EPrints see http://www.eprints.org/software/.
+
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 +
==NAME==
 +
EPrints - Institutional Repository software
  
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=head_methods -->=METHODS=
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_abort -->==abort==
 
  
  EPrints::abort( $msg )
 
  
Print an error message and exit. If running under mod_perl then print the error as a webpage and exit.
+
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_synopsis -->
 +
==SYNOPSIS==
 +
<source lang="perl">use EPrints qw();
  
 +
# don't check current user (CLI only)
 +
use EPrints qw( no_check_user );
 +
 +
$eprints = EPrints->new;
 +
 +
# CLI
 +
$repo = $eprints->repository( "demoprints" );
 +
 +
# CGI
 +
$repo = $eprints->current_repository;
 +
 +
if( EPrints->VERSION() gt v3.2.0 )
 +
{
 +
...
 +
}</source>
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_description -->
 +
==DESCRIPTION==
 +
See http://www.eprints.org/.
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_available_symbols -->
 +
===Available Symbols===
 +
You can pass options to the EPrints package that effect the EPrints initialisation e.g.
 +
 +
<pre>  use EPrints qw( no_check_user );</pre>
 +
 +
* no_check_user
 +
: Do not check the current user/group is the same as the user/group in SystemSettings.
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_debugging -->
 +
===Debugging===
 +
To get a full stack trace on errors and warnings use {{API:PodLink|file=Carp|package_name=Carp|section=|text=Carp}}'s verbose mode. E.g. in ''perl_lib/EPrints/SystemSettings.pm'' add:
 +
 +
<pre>  use Carp 'verbose';</pre>
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<!-- Pod2Wiki=head_VERSION -->
 +
===VERSION===
 +
 +
<source lang="perl">$version = EPrints->VERSION()
 +
 +
</source>
 +
Returns the version of EPrints in 'v' format (this is the UNIVERSAL method).
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_human_version -->
 +
===human_version===
 +
 +
<source lang="perl">EPrints->human_version()
 +
 +
</source>
 +
Returns the EPrints version in a human-readable form.
 +
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_abort -->
 +
===abort===
 +
 +
<source lang="perl">EPrints->abort( $errmsg )
 +
 +
</source>
 
This subroutine is loaded before other modules so that it may be used to report errors when initialising modules.
 
This subroutine is loaded before other modules so that it may be used to report errors when initialising modules.
  
<!-- End of Pod2Wiki -->
+
When running under Mod_Perl this method is replaced.
<!-- Pod2Wiki=item_deprecated -->==deprecated==
+
 
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_dump -->
 +
===dump===
 +
 
 +
<source lang="perl">EPrints->dump( $VAR1 [, $VAR2 ... ] )
 +
 
 +
</source>
 +
Use {{API:PodLink|file=Data/Dumper|package_name=Data::Dumper|section=|text=Data::Dumper}} to dump the passed variables to STDERR.
 +
 
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_new -->
 +
===new===
 +
 
 +
<source lang="perl">$ep = EPrints->new();
 +
 
 +
</source>
 +
Construct a new EPrints system object.
 +
 
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_repository -->
 +
===repository===
 +
 
 +
<source lang="perl">$repo = $ep->repository( $repository_id, [%options] );
 +
 
 +
</source>
 +
Return the [[API:EPrints/Repository|EPrints::Repository]] with the given ID, or undef. Options are... optional.
 +
 
 +
Options noise=&gt;1, etc.
 +
 
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_current_repository -->
 +
===current_repository===
 +
 
 +
<source lang="perl">$repo = $ep->current_repository();
 +
 
 +
</source>
 +
Returns the current [[API:EPrints/Repository|EPrints::Repository]]. The current  repository is determined by the apache request.
 +
 
 +
Returns undef if there is no current repository active.
 +
 
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_see_also -->
 +
==SEE ALSO==
 +
[[API:EPrints/Repository|EPrints::Repository]]
 +
 
 +
<!-- Edit below this comment -->
 +
 
  
  EPrints::deprecated()
+
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_copyright -->
 +
==COPYRIGHT==
 +
Copyright 2000-2011 University of Southampton.
  
Prints a deprecated warning for the calling sub.
+
This file is part of EPrints &lt;http://www.eprints.org/&gt;.
  
<!-- End of Pod2Wiki -->
+
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.
<!-- Pod2Wiki=item_try -->==try==
 
  
  EPrints::try( CODE_REF )
+
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.
  
Attempts to call CODE_REF and if an error occurs calls [[#abort|/abort]] with the error message.
+
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
  
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=head_see_also -->=SEE ALSO=
 
[[API:EPrints/Session|EPrints::Session]], [[API:EPrints/Repository|EPrints::Repository]].
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_author -->=AUTHOR=
 
Copyright 2000-2009 University of Southampton, UK.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=_postamble_ -->
 +
<!-- Edit below this comment -->

Latest revision as of 09:56, 22 January 2013

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


SYNOPSIS

use EPrints qw();

# don't check current user (CLI only)
use EPrints qw( no_check_user );

$eprints = EPrints->new;

# CLI
$repo = $eprints->repository( "demoprints" );

# CGI
$repo = $eprints->current_repository;

if( EPrints->VERSION() gt v3.2.0 )
{
	...
}


DESCRIPTION

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


Available Symbols

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

  use EPrints qw( no_check_user );
  • no_check_user
Do not check the current user/group is the same as the user/group in SystemSettings.


Debugging

To get a full stack trace on errors and warnings use Carp's verbose mode. E.g. in perl_lib/EPrints/SystemSettings.pm add:

  use Carp 'verbose';


METHODS

VERSION

$version = EPrints->VERSION()

Returns the version of EPrints in 'v' format (this is the UNIVERSAL method).


human_version

EPrints->human_version()

Returns the EPrints version in a human-readable form.


abort

EPrints->abort( $errmsg )

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

When running under Mod_Perl this method is replaced.


dump

EPrints->dump( $VAR1 [, $VAR2 ... ] )

Use Data::Dumper to dump the passed variables to STDERR.


new

$ep = EPrints->new();

Construct a new EPrints system object.


repository

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

Return the EPrints::Repository with the given ID, or undef. Options are... optional.

Options noise=>1, etc.


current_repository

$repo = $ep->current_repository();

Returns the current EPrints::Repository. The current repository is determined by the apache request.

Returns undef if there is no current repository active.



SEE ALSO

EPrints::Repository


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/>.