Difference between revisions of "API:EPrints/CLIProcessor"
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name --> | <!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name --> | ||
==NAME== | ==NAME== | ||
− | '''EPrints::CLIProcessor''' - utility module supporting command-line scripts | + | '''EPrints::CLIProcessor''' - utility module supporting command-line scripts. |
<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 17: | Line 17: | ||
<!-- Pod2Wiki=head_description --> | <!-- Pod2Wiki=head_description --> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
− | Currently this module is just a 'handler' for import scripts. In future it may do more things to support the CLI (Command-Line Interface) to EPrints. | + | Currently this module is just a 'handler' for import scripts. In future it may do more things to support the CLI (Command-Line Interface) to EPrints. |
<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 39: | Line 39: | ||
EPrints::CLIProcessor::color( $type ) | EPrints::CLIProcessor::color( $type ) | ||
− | Returns boolean depending on whether $type is a permitted setting for the | + | Returns boolean depending on whether $type is a permitted setting for the [[API:EPrints/CLIProcessor|EPrints/CLIProcessor]]. |
<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 69: | Line 69: | ||
$processor->add_message( $type, $msg ) | $processor->add_message( $type, $msg ) | ||
− | Add a message for the user. $type is | + | Add a message for the user. <tt>$type</tt> is <tt>error</tt>, <tt>warning</tt> or <tt>message</tt>. <tt>$msg</tt> is an XHTML fragment. |
<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 82: | Line 82: | ||
$dataobj = $processor->epdata_to_dataobj( $epdata, %opts ) | $dataobj = $processor->epdata_to_dataobj( $epdata, %opts ) | ||
− | Requests the handler create the new object from $epdata. | + | Requests the handler create the new object from <tt>$epdata</tt>. |
<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 95: | Line 95: | ||
$processor->parsed( [ $epdata ] ) | $processor->parsed( [ $epdata ] ) | ||
− | Register a parsed event, optionally with $epdata. | + | Register a parsed event, optionally with <tt>$epdata</tt>. |
<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 107: | Line 107: | ||
===object=== | ===object=== | ||
− | $processor->object( | + | $processor->object( $dataset, $dataobj ) |
− | Register a new object event in | + | Register a new object event in <tt>$dataset</tt> with new object <tt>$dataobj</tt>. |
<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%; '> |
Latest revision as of 12:16, 4 March 2022
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::CLIProcessor - utility module supporting command-line scripts.
DESCRIPTION
Currently this module is just a 'handler' for import scripts. In future it may do more things to support the CLI (Command-Line Interface) to EPrints.
METHODS
color
EPrints::CLIProcessor::color( $type )
Returns boolean depending on whether $type is a permitted setting for the EPrints/CLIProcessor.
new
$processor = EPrints::CLIProcessor->new( session => $session, %opts )
Create a new processor object. Supported options:
scripted - backwards compatibility for import scripted interface epdata_to_dataobj - replace epdata_to_dataobj message - replace message
add_message
$processor->add_message( $type, $msg )
Add a message for the user. $type is error, warning or message. $msg is an XHTML fragment.
epdata_to_dataobj
$dataobj = $processor->epdata_to_dataobj( $epdata, %opts )
Requests the handler create the new object from $epdata.
parsed
$processor->parsed( [ $epdata ] )
Register a parsed event, optionally with $epdata.
object
$processor->object( $dataset, $dataobj )
Register a new object event in $dataset with new object $dataobj.
COPYRIGHT
© Copyright 2000-2024 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/.