Difference between revisions of "API:EPrints"

From EPrints Documentation
Jump to: navigation, search
Line 10: Line 10:
 
'''EPrints''' - Institutional Repository software
 
'''EPrints''' - Institutional Repository software
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 71: Line 71:
 
   $handle-&gt;terminate;
 
   $handle-&gt;terminate;
 
    
 
    
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 82: Line 82:
 
See http://www.eprints.org/ for more information about EPrints. Much more documentation can be found at http://wiki.eprints.org/w/Documentation
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 89: Line 89:
 
<!-- Pod2Wiki=head_key_api_eprints_modules --></div>
 
<!-- Pod2Wiki=head_key_api_eprints_modules --></div>
 
===Key API EPrints Modules===
 
===Key API EPrints Modules===
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 99: Line 99:
 
This module! Used to load the other modules.
 
This module! Used to load the other modules.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 109: Line 109:
 
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>
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 119: Line 119:
 
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
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 129: Line 129:
 
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.  
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 139: Line 139:
 
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".
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 151: Line 151:
 
Handle has a large number of methods, which are documented in more than one file:
 
Handle has a large number of methods, which are documented in more than one file:
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 161: Line 161:
 
Handle methods for i18n.
 
Handle methods for i18n.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 171: Line 171:
 
Handle methods for generating XHTML as XML::DOM objects.
 
Handle methods for generating XHTML as XML::DOM objects.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 181: Line 181:
 
Handle methods for working with the mod_perl connection.
 
Handle methods for working with the mod_perl connection.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 191: Line 191:
 
Handle methods for generating and serving XHTML web pages.
 
Handle methods for generating and serving XHTML web pages.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 201: Line 201:
 
Handle methods for creating XML::DOM objects.
 
Handle methods for creating XML::DOM objects.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 211: Line 211:
 
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.
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 221: Line 221:
 
A single field in a dataset. It has many subclasses, one for each type of field.
 
A single field in a dataset. It has many subclasses, one for each type of field.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 231: Line 231:
 
Represents the configuration, datasets and dataobjects of a single repository. It is loaded from the configuration files and is essentially read-only.
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 241: Line 241:
 
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.
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 248: Line 248:
 
<!-- Pod2Wiki=head_other_api_eprints_modules --></div>
 
<!-- Pod2Wiki=head_other_api_eprints_modules --></div>
 
===Other API EPrints Modules===
 
===Other API EPrints Modules===
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 258: Line 258:
 
A utitility module to render HTML boxes with style and javascript roll-up animations.
 
A utitility module to render HTML boxes with style and javascript roll-up animations.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 268: Line 268:
 
An object representing a connection to the database for a repository. This is an abstraction over sub-objects which connect to MySQL or Oracle.
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 278: Line 278:
 
Represents a single file in a document with some basic metadata such as checksums.
 
Represents a single file in a document with some basic metadata such as checksums.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 288: Line 288:
 
Represents a single registered user of the repository. Used for keeping track of preferences, profile information and rights management.
 
Represents a single registered user of the repository. Used for keeping track of preferences, profile information and rights management.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 298: Line 298:
 
This dataset is used to store the structure of heierachichal(sp?) sets, used by the "Subject" metafield type.
 
This dataset is used to store the structure of heierachichal(sp?) sets, used by the "Subject" metafield type.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 308: Line 308:
 
Tool for sending email.
 
Tool for sending email.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 318: Line 318:
 
Tools for rendering an EPrint::List as paginated HTML.
 
Tools for rendering an EPrint::List as paginated HTML.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 328: Line 328:
 
An extension to EPrints::Paginate which shows the results in sortable columns, as seen in Items and Review screens.
 
An extension to EPrints::Paginate which shows the results in sortable columns, as seen in Items and Review screens.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 338: Line 338:
 
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.
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 348: Line 348:
 
Tools for creating and destorying temporary directories.
 
Tools for creating and destorying temporary directories.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 358: Line 358:
 
A set of methods for handling time and converting between time formats.
 
A set of methods for handling time and converting between time formats.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 368: Line 368:
 
Utility methods for generating and getting URLs, relative paths etc.
 
Utility methods for generating and getting URLs, relative paths etc.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 378: Line 378:
 
Misc. utility methods.
 
Misc. utility methods.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 388: Line 388:
 
Utility methods for working with XML and DOM. This papers over the cracks between the 3 different XML DOM libraries EPrints supports.
 
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: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 399: Line 399:
 
   use EPrints qw( no_check_user );
 
   use EPrints qw( no_check_user );
 
    
 
    
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 409: Line 409:
 
Do not check the current user/group is the same as the user/group in Systemsettings.
 
Do not check the current user/group is the same as the user/group in Systemsettings.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 424: Line 424:
 
A shell script will print the stack trace to the console.
 
A shell script will print the stack trace to the console.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 431: Line 431:
 
<!-- Pod2Wiki=head_methods --></div>
 
<!-- Pod2Wiki=head_methods --></div>
 
==METHODS==
 
==METHODS==
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 443: Line 443:
 
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.
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 452: Line 452:
 
[[API:EPrints/Handle|EPrints::Handle]]
 
[[API:EPrints/Handle|EPrints::Handle]]
  
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
Line 464: Line 464:
  
 
__LICENSE__
 
__LICENSE__
<div style='background-color: #eef; 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%; '>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<h4><span style='display:none'>User Comments</span></h4>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->

Revision as of 14:03, 24 August 2009


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

 #!/usr/bin/perl -w -I/opt/eprints3/perl_lib
 
 use EPrints;
 use strict;
 
 my $handle = new EPrints::Handle( 1 , 'my_repository_id' );
 exit( 1 ) unless( defined $handle );
 
 $eprint = new EPrints::DataObj::EPrint( $handle, 23 );
 my $title = $eprint->get_value( 'title' );
 
 $eprint->set_value( 'creators', 
   [
     { 
       name => { given=>'John', family=>'Smith' },
       id => 'js@example.com',
     },
     { 
       name => { given=>'Marvin', family=>'Fenderson' },
       id => 'marvin@totl.net',
     },
   ]
 );
 $eprint->commit;
 
 my $eprint_ds = $handle->get_dataset( "eprint" );
 my $new_eprint = $eprint_ds->create_object( 
   $handle, { title=>"My new EPrint!" } );
 
 my $archive_ds = $handle->get_dataset( "archive" );
 my $search = new EPrints::Search( 
   handle => $handle, 
   dataset => $archive_ds );
 my $date_mf = $archive_ds->get_field( "date" );
 $search->add_field( $date_mf, "2000-2003" );
 
 my $list = $search->perform_search;
 $list->map(
   sub {
     my( $handle, $dataset, $eprint, $info ) = @_;
 
     printf( "%s: %s\n", 
        $eprint->get_value( "date" ),
        $eprint->get_value( "title" ) );
   }
 );
 $list->dispose();
 
 $handle->log( "We did some stuff." );
 
 if( some_test() ) { EPrints::abort( "Something bad happened" ); }
 
 $handle->terminate;
 

User Comments


DESCRIPTION

Using this module will cause all the other EPrints modules to be used also.

See http://www.eprints.org/ for more information about EPrints. Much more documentation can be found at http://wiki.eprints.org/w/Documentation

User Comments


Key API EPrints Modules

User Comments


EPrints

This module! Used to load the other modules.

User Comments


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 repository_url/id/datasetid/dataobj_id

User Comments


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

User Comments


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.

User Comments


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

User Comments


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:

User Comments


EPrints::Handle::Language

Handle methods for i18n.

User Comments


EPrints::Handle::Render

Handle methods for generating XHTML as XML::DOM objects.

User Comments


EPrints::Handle::CGI

Handle methods for working with the mod_perl connection.

User Comments


EPrints::Handle::Page

Handle methods for generating and serving XHTML web pages.

User Comments


EPrints::Handle::XML

Handle methods for creating XML::DOM objects.

User Comments


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.

User Comments


EPrints::MetaField

A single field in a dataset. It has many subclasses, one for each type of field.

User Comments


EPrints::Repository

Represents the configuration, datasets and dataobjects of a single repository. It is loaded from the configuration files and is essentially read-only.

User Comments


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.

User Comments


Other API EPrints Modules

User Comments


EPrints::Box

A utitility module to render HTML boxes with style and javascript roll-up animations.

User Comments


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.

User Comments


EPrints::DataObj::File

Represents a single file in a document with some basic metadata such as checksums.

User Comments


EPrints::DataObj::User

Represents a single registered user of the repository. Used for keeping track of preferences, profile information and rights management.

User Comments


EPrints::DataObj::Subject

This dataset is used to store the structure of heierachichal(sp?) sets, used by the "Subject" metafield type.

User Comments


EPrints::Email

Tool for sending email.

User Comments


EPrints::Paginate

Tools for rendering an EPrint::List as paginated HTML.

User Comments


EPrints::Paginate::Columns

An extension to EPrints::Paginate which shows the results in sortable columns, as seen in Items and Review screens.

User Comments


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.

User Comments


EPrints::TempDir

Tools for creating and destorying temporary directories.

User Comments


EPrints::Time

A set of methods for handling time and converting between time formats.

User Comments


EPrints::URL

Utility methods for generating and getting URLs, relative paths etc.

User Comments


EPrints::Utils

Misc. utility methods.

User Comments


EPrints::XML

Utility methods for working with XML and DOM. This papers over the cracks between the 3 different XML DOM libraries EPrints supports.

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( $msg )

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


SEE ALSO

EPrints::Handle

User Comments


COPYRIGHT

__COPYRIGHT__

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

__LICENSE__

User Comments