Difference between revisions of "API:EPrints/Const"

From EPrints Documentation
Jump to: navigation, search
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- 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' comments will be lost.
+
This page has been automatically generated from the EPrints 3.4 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Const.pm|package_name=EPrints::Const}}[[Category:API|CONST]][[Category:API:EPrints/Const|CONST]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Const.pm|package_name=EPrints::Const}}[[Category:API|CONST]]<div><!-- Edit below this comment -->
  
  
Line 55: Line 55:
 
<!-- Pod2Wiki=head_namespace -->
 
<!-- Pod2Wiki=head_namespace -->
 
===:namespace===
 
===:namespace===
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_ns_citation -->
 +
====EP_NS_CITATION====
 +
 +
http://eprints.org/ep3/citation
 +
 
<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%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 149: Line 161:
 
<!-- Pod2Wiki=item_xml_entity_reference_node -->
 
<!-- Pod2Wiki=item_xml_entity_reference_node -->
 
====XML_ENTITY_REFERENCE_NODE====
 
====XML_ENTITY_REFERENCE_NODE====
 +
 +
'''XML_ENTITY_REF_NODE''' shares the same constant value.
  
 
<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 229: Line 243:
 
<!-- Pod2Wiki=head_http -->
 
<!-- Pod2Wiki=head_http -->
 
===:http===
 
===:http===
 +
Also, all HTTP_* constants defined by {{API:PodLink|file=Apache2/Const|package_name=Apache2::Const|section=|text=Apache2::Const}}.
 +
 
<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%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 278: Line 294:
 
<!-- Pod2Wiki=head_trigger -->
 
<!-- Pod2Wiki=head_trigger -->
 
===:trigger===
 
===:trigger===
 +
See [[API:EPrints/RepositoryConfig#add_trigger|EPrints::RepositoryConfig/add_trigger]] and [[API:EPrints/RepositoryConfig#add_dataset_trigger|EPrints::RepositoryConfig/add_dataset_trigger]].
 +
 
<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%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 301: Line 319:
  
 
Continue normal processing.
 
Continue normal processing.
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_ep_trigger_guess_doc_type -->
 
====EP_TRIGGER_GUESS_DOC_TYPE====
 
  
 
<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 361: Line 369:
 
<!-- Pod2Wiki=item_ep_trigger_begin_request -->
 
<!-- Pod2Wiki=item_ep_trigger_begin_request -->
 
====EP_TRIGGER_BEGIN_REQUEST====
 
====EP_TRIGGER_BEGIN_REQUEST====
 +
 +
Called after [[API:EPrints/Repository#init_from_request|EPrints::Repository/init_from_request]].
  
 
<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 371: Line 381:
 
<!-- Pod2Wiki=item_ep_trigger_end_request -->
 
<!-- Pod2Wiki=item_ep_trigger_end_request -->
 
====EP_TRIGGER_END_REQUEST====
 
====EP_TRIGGER_END_REQUEST====
 +
 +
Called just before [[API:EPrints/Repository#cleanup|EPrints::Repository/cleanup]] in response to a mod_perl request.
  
 
<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 392: Line 404:
 
====EP_TRIGGER_URL_REWRITE====
 
====EP_TRIGGER_URL_REWRITE====
  
 +
Called for every request that is within the repository's path. Use this to redirect the user to a different location. <tt>return_code</tt> is a scalar reference, therefore you must deference when assigning a new value <tt>${$rc} = CODE</tt>.
 +
 +
  request - mod_perl request object
 +
  lang - current language id
 +
  args - request arguments "?..."
 +
  urlpath - EPrint's HTTP root
 +
  cgipath - EPrints's HTTP cgi root
 +
  uri - request uri "/eprints/12/"
 +
  secure - whether under HTTPS
 +
  return_code - reference to return code
 +
 
 
<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%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 412: Line 435:
 
====EP_TRIGGER_CREATED====
 
====EP_TRIGGER_CREATED====
  
 +
Called after $dataset-&gt;create_dataobj( { ... } ).
 +
 +
  dataobj - the newly created dataobj
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_trigger_removed -->
 +
====EP_TRIGGER_REMOVED====
 +
 +
Called just before the object is removed from the database.
 +
 +
  dataobj - the object being removed
 +
 
 
<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%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 524: Line 565:
 
   filename
 
   filename
 
   filepath
 
   filepath
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_trigger_thumbnail_types -->
 +
====EP_TRIGGER_THUMBNAIL_TYPES====
 +
 +
Manipulate the list of thumbnail types that will be generated for a given user-uploaded document.
 +
 +
  types - array reference of types (strings)
 +
  dataobj - document object
 
    
 
    
 
<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 554: Line 610:
 
   dataset = EPrints::DataSet
 
   dataset = EPrints::DataSet
 
   id = object id
 
   id = object id
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_trigger_dynamic_template -->
 +
====EP_TRIGGER_DYNAMIC_TEMPLATE====
 +
 +
Manipulate parts included in the template. These will be called for every page impression, so don't do anything heavyweight in here.
 +
 +
  pins - hash ref of template pins
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_trigger_local_sitemap_urls -->
 +
====EP_TRIGGER_LOCAL_SITEMAP_URLS====
 +
 +
Manipulate the URLs added to the local sitemaps.
 +
 +
  urlset - the set of all URLs to include in the sitemap.
 
    
 
    
 
<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 635: Line 719:
  
 
This field property defaults to false.
 
This field property defaults to false.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_crypt -->
 +
===:crypt===
 +
One-way encryption methods for passwords, see [[API:EPrints/Utils#crypt|EPrints::Utils/crypt]].
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_crypt_crypt -->
 +
====EP_CRYPT_CRYPT====
 +
 +
{{API:PodLink|file=perlfunc|package_name=perlfunc|section=crypt|text=perlfunc/crypt}}.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_ep_crypt_sha512 -->
 +
====EP_CRYPT_SHA512====
 +
 +
{{API:PodLink|file=Digest/SHA|package_name=Digest::SHA|section=|text=Digest::SHA}} sha512 with 2-byte salt and 10000 rounds.
  
 
<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 645: Line 764:
 
<!-- Pod2Wiki=head_copyright -->
 
<!-- Pod2Wiki=head_copyright -->
 
==COPYRIGHT==
 
==COPYRIGHT==
 +
{{API:Copyright}}
 
<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%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>

Revision as of 10:39, 20 December 2021

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


Contents

NAME

EPrints::Const - constants and enumerations

User Comments


SYNOPSIS

 # don't import any constants
 use EPrints::Const qw();
 
 # import trigger and http constants
 use EPrints::Const qw( :trigger :http );
 
 # import only the OK DONE DECLINED constants
 use EPrints::Const qw( OK DONE DECLINED );
 

User Comments


DESCRIPTION

This module contains EPrints constants and enumerations.

User Comments


CONSTANTS

User Comments


:namespace

User Comments


EP_NS_CITATION

http://eprints.org/ep3/citation

User Comments


EP_NS_DATA

http://eprints.org/ep2/data/2.0

User Comments


EP_NS_XSLT

http://eprints.org/ep2/xslt/1.0

User Comments


EP_NS_OPENSEARCH

http://a9.com/-/spec/opensearch/1.1/

User Comments


:xml

User Comments


XML_ELEMENT_NODE

User Comments


XML_ATTRIBUTE_NODE

User Comments


XML_TEXT_NODE

User Comments


XML_CDATA_SECTION_NODE

User Comments


XML_ENTITY_REFERENCE_NODE

XML_ENTITY_REF_NODE shares the same constant value.

User Comments


XML_ENTITY_NODE

User Comments


XML_PROCESSING_INSTRUCTION_NODE

User Comments


XML_COMMENT_NODE

User Comments


XML_DOCUMENT_NODE

User Comments


XML_DOCUMENT_TYPE_NODE

User Comments


XML_DOCUMENT_FRAGMENT_NODE

User Comments


XML_NOTATION_NODE

User Comments


:http

Also, all HTTP_* constants defined by Apache2::Const.

User Comments


DONE

User Comments


DECLINED

User Comments


NOT_FOUND

User Comments


OK

User Comments


:trigger

See EPrints::RepositoryConfig/add_trigger and EPrints::RepositoryConfig/add_dataset_trigger.

User Comments


EP_TRIGGER_DONE

Stop processing triggers immediately and return.

User Comments


EP_TRIGGER_OK

Continue normal processing.

User Comments


EP_TRIGGER_LOG

User Comments


EP_TRIGGER_BOILERPLATE_RDF

User Comments


EP_TRIGGER_REPOSITORY_RDF

User Comments


EP_TRIGGER_BEGIN

User Comments


EP_TRIGGER_BEGIN_REQUEST

Called after EPrints::Repository/init_from_request.

User Comments


EP_TRIGGER_END_REQUEST

Called just before EPrints::Repository/cleanup in response to a mod_perl request.

User Comments


EP_TRIGGER_END

User Comments


EP_TRIGGER_URL_REWRITE

Called for every request that is within the repository's path. Use this to redirect the user to a different location. return_code is a scalar reference, therefore you must deference when assigning a new value ${$rc} = CODE.

 request - mod_perl request object
 lang - current language id
 args - request arguments "?..."
 urlpath - EPrint's HTTP root
 cgipath - EPrints's HTTP cgi root
 uri - request uri "/eprints/12/"
 secure - whether under HTTPS
 return_code - reference to return code
 

User Comments


EP_TRIGGER_DOC_URL_REWRITE

User Comments


EP_TRIGGER_CREATED

Called after $dataset->create_dataobj( { ... } ).

 dataobj - the newly created dataobj
 

User Comments


EP_TRIGGER_REMOVED

Called just before the object is removed from the database.

 dataobj - the object being removed
 

User Comments


EP_TRIGGER_RDF

User Comments


EP_TRIGGER_DEFAULTS

User Comments


EP_TRIGGER_STATUS_CHANGE

User Comments


EP_TRIGGER_BEFORE_COMMIT

User Comments


EP_TRIGGER_AFTER_COMMIT

User Comments


EP_TRIGGER_VALIDATE

User Comments


EP_TRIGGER_VALIDATE_FIELD

Validate a field's value.

 field - field to validate
 value - value to validate
 dataobj - parent dataobj (if available)
 problems - ARRAYREF of DOM problems encountered
 

User Comments


EP_TRIGGER_WARNINGS

User Comments


EP_TRIGGER_FILES_MODIFIED

User Comments


EP_TRIGGER_MEDIA_INFO

Populate a Document epdata structure with information about a file.

 epdata
 filename
 filepath
 

User Comments


EP_TRIGGER_THUMBNAIL_TYPES

Manipulate the list of thumbnail types that will be generated for a given user-uploaded document.

 types - array reference of types (strings)
 dataobj - document object
 

User Comments


EP_TRIGGER_INDEX_FIELDS

Add the changed fields for the given data object to the index engine(s).

 dataobj = EPrints::DataObj
 fields = ARRAYREF of field objects
 

User Comments


EP_TRIGGER_INDEX_REMOVED

An object was removed and should now be removed from the index engine(s).

 dataset = EPrints::DataSet
 id = object id
 

User Comments


EP_TRIGGER_DYNAMIC_TEMPLATE

Manipulate parts included in the template. These will be called for every page impression, so don't do anything heavyweight in here.

 pins - hash ref of template pins
 

User Comments


EP_TRIGGER_LOCAL_SITEMAP_URLS

Manipulate the URLs added to the local sitemaps.

 urlset - the set of all URLs to include in the sitemap.
 

User Comments


:metafield

User Comments


EP_PROPERTY_FROM_CONFIG

Get the default value from field defaults in the config.

User Comments


EP_PROPERTY_NO_CHANGE

Don't use a default, the code may have already set this value. setting it to undef has no effect rather than setting it to default value.

User Comments


EP_PROPERTY_REQUIRED

This field property must be explicitly set.

User Comments


EP_PROPERTY_UNDEF

This field property defaults to undef.

User Comments


EP_PROPERTY_TRUE

This field property defaults to true.

User Comments


EP_PROPERTY_FALSE

This field property defaults to false.

User Comments


:crypt

One-way encryption methods for passwords, see EPrints::Utils/crypt.

User Comments


EP_CRYPT_CRYPT

perlfunc/crypt.

User Comments


EP_CRYPT_SHA512

Digest::SHA sha512 with 2-byte salt and 10000 rounds.

User Comments


COPYRIGHT

© Copyright 2022 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 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 3.4. If not, see http://www.gnu.org/licenses/.

User Comments