Difference between revisions of "API:EPrints/DataObj/EPM"

From EPrints Documentation
Jump to: navigation, search
Line 8: Line 8:
 
'''EPrints::DataObj::EPM''' - Class representing an EPrints Package
 
'''EPrints::DataObj::EPM''' - Class representing an EPrints Package
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_system_metadata -->
 
<!-- Pod2Wiki=head_system_metadata -->
 
==SYSTEM METADATA==
 
==SYSTEM METADATA==
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_methods -->
 
<!-- Pod2Wiki=head_methods -->
 
==METHODS==
 
==METHODS==
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<!-- Pod2Wiki=head_get_system_field_info -->
<span style='display:none'>User Comments</span>
+
===get_system_field_info===
<!-- Edit below this comment -->
 
 
 
  
<!-- Pod2Wiki= -->
+
<source lang="perl">$metadata = EPrints::DataObj::EPM->get_system_field_info
</div>
 
<!-- Pod2Wiki=item_get_system_field_info -->
 
===get_system_field_info===
 
  
$metadata = EPrints::DataObj::EPM-&gt;get_system_field_info
+
</source>
 
Return an array describing the system metadata of the EPrint dataset.
 
Return an array describing the system metadata of the EPrint dataset.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_map -->
<!-- Pod2Wiki=item_map -->
 
 
===map===
 
===map===
  
EPrints::DataObj::EPM-&gt;map( $repo, sub { ... }, $ctx )
+
<source lang="perl">EPrints::DataObj::EPM->map( $repo, sub { ... }, $ctx )
 +
 
 +
</source>
 
Apply a function over all installed EPMs.
 
Apply a function over all installed EPMs.
  
  sub {
+
<pre>  sub {
 
     my( $repo, $dataset, $epm [, $ctx ] ) = @_;
 
     my( $repo, $dataset, $epm [, $ctx ] ) = @_;
   }
+
   }</pre>
 
+
 
 
This loads the EPM index files only.
 
This loads the EPM index files only.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_new -->
<!-- Pod2Wiki=item_new -->
 
 
===new===
 
===new===
  
$epm = EPrints::DataObj::EPM-&gt;new( $repo, $id )
+
<source lang="perl">$epm = EPrints::DataObj::EPM->new( $repo, $id )
 +
 
 +
</source>
 
Returns a new object representing the installed package $id.
 
Returns a new object representing the installed package $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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_new_from_manifest -->
<!-- Pod2Wiki=item_new_from_manifest -->
 
 
===new_from_manifest===
 
===new_from_manifest===
  
$epm = EPrint::DataObj::EPM-&gt;new_from_manifest( $repo, $epdata [, @manifest ] )
+
<source lang="perl">$epm = EPrint::DataObj::EPM->new_from_manifest( $repo, $epdata [, @manifest ] )
 +
 
 +
</source>
 
Makes and returns a new EPM object based on a manifest of installable files.
 
Makes and returns a new EPM object based on a manifest of installable files.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_commit -->
<!-- Pod2Wiki=item_commit -->
 
 
===commit===
 
===commit===
  
$epm-&gt;commit
+
<source lang="perl">$epm->commit
 +
 
 +
</source>
 
Commit any changes to the installed .epm, .epmi files.
 
Commit any changes to the installed .epm, .epmi files.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_rebuild -->
<!-- Pod2Wiki=item_rebuild -->
 
 
===rebuild===
 
===rebuild===
  
$epm-&gt;rebuild
+
<source lang="perl">$epm->rebuild
 +
 
 +
</source>
 
Reload all of the installed files (regenerating hashes if necessary).
 
Reload all of the installed files (regenerating hashes if necessary).
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_version -->
<!-- Pod2Wiki=item_version -->
 
 
===version===
 
===version===
  
$v = $epm-&gt;version
+
<source lang="perl">$v = $epm->version
 +
 
 +
</source>
 
Returns a stringified version suitable for string gt/lt matching.
 
Returns a stringified version suitable for string gt/lt matching.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_is_enabled -->
<!-- Pod2Wiki=item_is_enabled -->
 
 
===is_enabled===
 
===is_enabled===
  
$bool = $epm-&gt;is_enabled
+
<source lang="perl">$bool = $epm->is_enabled
 +
 
 +
</source>
 
Returns true if the $epm is enabled for the current repository.
 
Returns true if the $epm is enabled for the current repository.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_repositories -->
<!-- Pod2Wiki=item_repositories -->
 
 
===repositories===
 
===repositories===
  
@repoids = $epm-&gt;repositories
+
<source lang="perl">@repoids = $epm->repositories
 +
 
 +
</source>
 
Returns a list of repository ids this $epm is enabled in.
 
Returns a list of repository ids this $epm is enabled in.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_package_filename -->
<!-- Pod2Wiki=item_package_filename -->
 
 
===package_filename===
 
===package_filename===
  
$filename = $epm-&gt;package_filename()
+
<source lang="perl">$filename = $epm->package_filename()
 +
 
 +
</source>
 
Returns the complete package filename.
 
Returns the complete package filename.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_epm_dir -->
<!-- Pod2Wiki=item_epm_dir -->
 
 
===epm_dir===
 
===epm_dir===
  
$dir = $epm-&gt;epm_dir
+
<source lang="perl">$dir = $epm->epm_dir
 +
 
 +
</source>
 
Path to the epm directory for this $epm.
 
Path to the epm directory for this $epm.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_installed_files -->
<!-- Pod2Wiki=item_installed_files -->
 
 
===installed_files===
 
===installed_files===
  
@files = $epm-&gt;installed_files()
+
<source lang="perl">@files = $epm->installed_files()
 +
 
 +
</source>
 
Returns a list of installed files as [[API:EPrints/DataObj/File|EPrints::DataObj::File]].
 
Returns a list of installed files as [[API:EPrints/DataObj/File|EPrints::DataObj::File]].
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_repository_files -->
<!-- Pod2Wiki=item_repository_files -->
 
 
===repository_files===
 
===repository_files===
  
@files = $epm-&gt;repository_files()
+
<source lang="perl">@files = $epm->repository_files()
 +
 
 +
</source>
 
Returns the list of configuration files used to enable/configure an $epm.
 
Returns the list of configuration files used to enable/configure an $epm.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_control_screen -->
<!-- Pod2Wiki=item_control_screen -->
 
 
===control_screen===
 
===control_screen===
  
$screen = $epm-&gt;control_screen( %params )
+
<source lang="perl">$screen = $epm->control_screen( %params )
 +
 
 +
</source>
 
Returns the control screen for this $epm. %params are passed to the plugin constructor.
 
Returns the control screen for this $epm. %params are passed to the plugin constructor.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_serialise -->
<!-- Pod2Wiki=item_serialise -->
 
 
===serialise===
 
===serialise===
  
$epm-&gt;serialise( $fh, [ FILES ] )
+
<source lang="perl">$epm->serialise( $fh, [ FILES ] )
 +
 
 +
</source>
 
Serialises this EPM to the open file handle $fh. If FILES is true file contents are included.
 
Serialises this EPM to the open file handle $fh. If FILES is true file contents are included.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_install -->
<!-- Pod2Wiki=item_install -->
 
 
===install===
 
===install===
  
$ok = $epm-&gt;install( HANDLER [, FORCE ] )
+
<source lang="perl">$ok = $epm->install( HANDLER [, FORCE ] )
 +
 
 +
</source>
 
Install the EPM into the system. HANDLER is a [[API:EPrints/CLIProcessor|EPrints::CLIProcessor]] or [[API:EPrints/ScreenProcessor|EPrints::ScreenProcessor]], used for reporting errors.
 
Install the EPM into the system. HANDLER is a [[API:EPrints/CLIProcessor|EPrints::CLIProcessor]] or [[API:EPrints/ScreenProcessor|EPrints::ScreenProcessor]], used for reporting errors.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_uninstall -->
<!-- Pod2Wiki=item_uninstall -->
 
 
===uninstall===
 
===uninstall===
  
$ok = $epm-&gt;uninstall( HANDLER [, FORCE ] )
+
<source lang="perl">$ok = $epm->uninstall( HANDLER [, FORCE ] )
 +
 
 +
</source>
 
Remove the EPM from the system. HANDLER is a [[API:EPrints/CLIProcessor|EPrints::CLIProcessor]] or [[API:EPrints/ScreenProcessor|EPrints::ScreenProcessor]], used for reporting errors.
 
Remove the EPM from the system. HANDLER is a [[API:EPrints/CLIProcessor|EPrints::CLIProcessor]] or [[API:EPrints/ScreenProcessor|EPrints::ScreenProcessor]], used for reporting errors.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_disable_unchanged -->
<!-- Pod2Wiki=item_disable_unchanged -->
 
 
===disable_unchanged===
 
===disable_unchanged===
  
$ok = $epm-&gt;disable_unchanged()
+
<source lang="perl">$ok = $epm->disable_unchanged()
 +
 
 +
</source>
 
Remove unchanged files from the repository directory. This allows a new version of the EPM to be installed/enabled.
 
Remove unchanged files from the repository directory. This allows a new version of the EPM to be installed/enabled.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_enable -->
<!-- Pod2Wiki=item_enable -->
 
 
===enable===
 
===enable===
  
$ok = $epm-&gt;enable( $handler )
+
<source lang="perl">$ok = $epm->enable( $handler )
 +
 
 +
</source>
 
Enables the $epm for the current repository.
 
Enables the $epm for the current repository.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_utility_methods -->
 
<!-- Pod2Wiki=head_utility_methods -->
 
===Utility Methods===
 
===Utility Methods===
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #ccepadding: 0em 1em 0em 1em; font-size: 80%; '>
+
$conf = $epm-&gt;current_counters()
<span style='display:none'>User Comments</span>
+
$conf = $epm-&gt;current_datasets()
<!-- Edit below this comment -->
+
$ok = $epm-&gt;update_counters( $conf )
 +
  $ok = $epm-&gt;update_datasets( $conf )
 +
Update the datasets following any configuration changes made by the extension on being enabled. $conf should be retrieved before enabling by using [[API:EPrints/DataObj/EPM#current_datasets|current_datasets]].
  
 +
$ok = $epm-&gt;publish( $handler, $base_url, %opts )
 +
Publish this EPM to a remote system using SWORD.
  
<!-- Pod2Wiki= -->
+
$base_url is the URL of the SWORD endpoint or a page containing a SWORD &lt;link&gt;.
</div>
 
<!-- Pod2Wiki=item_current_counters -->
 
====current_counters====
 
  
$conf = $epm-&gt;current_counters()
+
Options:
<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 -->
 
  
 +
<pre>  username - username for Basic auth
 +
  password - password for Basic auth</pre>
  
<!-- Pod2Wiki= -->
+
$epm-&gt;add_to_xml( $dest, $src )
</div>
+
Add this package's XML $src to $dest XML. Useful for workflows and citations.
<!-- Pod2Wiki=item_current_datasets -->
 
====current_datasets====
 
  
$conf = $epm-&gt;current_datasets()
+
$src may have these additional attributes on elements:
<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 -->
 
  
 +
* operation = "replace" | "disable" | *"merge"
 +
: Where replace will replace the default element, disable will disable it and merge will merge the new branch with the old.
  
<!-- Pod2Wiki= -->
+
$epm-&gt;remove_from_xml( $dest )
</div>
+
Remove this package's extensions from $dest XML.
<!-- Pod2Wiki=item_update_counters -->
 
====update_counters====
 
  
$ok = $epm-&gt;update_counters( $conf )
 
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_copyright -->
<!-- Pod2Wiki=item_update_datasets -->
+
==COPYRIGHT==
====update_datasets====
+
Copyright 2000-2011 University of Southampton.
 
 
$ok = $epm-&gt;update_datasets( $conf )
 
Update the datasets following any configuration changes made by the extension on being enabled. $conf should be retrieved before enabling by using [[API:EPrints/DataObj/EPM#current_datasets|current_datasets]].
 
 
 
<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 -->
 
  
 +
This file is part of EPrints http://www.eprints.org/.
  
<!-- 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.
</div>
 
<!-- Pod2Wiki=item_publish -->
 
====publish====
 
  
  $ok = $epm-&gt;publish( $handler, $base_url, %opts )
+
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.
Publish this EPM to a remote system using SWORD.
 
  
$base_url is the URL of the SWORD endpoint or a page containing a SWORD &lt;link&gt;.
+
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
  
Options:
 
 
  username - username for Basic auth
 
  password - password for Basic auth
 
 
 
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=_postamble_ -->
<!-- Pod2Wiki=head_copyright -->
 
==COPYRIGHT==
 
<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 -->
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->
 

Revision as of 09:57, 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::DataObj::EPM - Class representing an EPrints Package


DESCRIPTION

SYSTEM METADATA

METHODS

get_system_field_info

$metadata = EPrints::DataObj::EPM->get_system_field_info

Return an array describing the system metadata of the EPrint dataset.


map

EPrints::DataObj::EPM->map( $repo, sub { ... }, $ctx )

Apply a function over all installed EPMs.

  sub {
    my( $repo, $dataset, $epm [, $ctx ] ) = @_;
  }

This loads the EPM index files only.


new

$epm = EPrints::DataObj::EPM->new( $repo, $id )

Returns a new object representing the installed package $id.


new_from_manifest

$epm = EPrint::DataObj::EPM->new_from_manifest( $repo, $epdata [, @manifest ] )

Makes and returns a new EPM object based on a manifest of installable files.


commit

$epm->commit

Commit any changes to the installed .epm, .epmi files.


rebuild

$epm->rebuild

Reload all of the installed files (regenerating hashes if necessary).


version

$v = $epm->version

Returns a stringified version suitable for string gt/lt matching.


is_enabled

$bool = $epm->is_enabled

Returns true if the $epm is enabled for the current repository.


repositories

@repoids = $epm->repositories

Returns a list of repository ids this $epm is enabled in.


package_filename

$filename = $epm->package_filename()

Returns the complete package filename.


epm_dir

$dir = $epm->epm_dir

Path to the epm directory for this $epm.


installed_files

@files = $epm->installed_files()

Returns a list of installed files as EPrints::DataObj::File.


repository_files

@files = $epm->repository_files()

Returns the list of configuration files used to enable/configure an $epm.


control_screen

$screen = $epm->control_screen( %params )

Returns the control screen for this $epm. %params are passed to the plugin constructor.


serialise

$epm->serialise( $fh, [ FILES ] )

Serialises this EPM to the open file handle $fh. If FILES is true file contents are included.


install

$ok = $epm->install( HANDLER [, FORCE ] )

Install the EPM into the system. HANDLER is a EPrints::CLIProcessor or EPrints::ScreenProcessor, used for reporting errors.


uninstall

$ok = $epm->uninstall( HANDLER [, FORCE ] )

Remove the EPM from the system. HANDLER is a EPrints::CLIProcessor or EPrints::ScreenProcessor, used for reporting errors.


disable_unchanged

$ok = $epm->disable_unchanged()

Remove unchanged files from the repository directory. This allows a new version of the EPM to be installed/enabled.


enable

$ok = $epm->enable( $handler )

Enables the $epm for the current repository.


Utility Methods

$conf = $epm->current_counters()
$conf = $epm->current_datasets()
$ok = $epm->update_counters( $conf )
$ok = $epm->update_datasets( $conf )

Update the datasets following any configuration changes made by the extension on being enabled. $conf should be retrieved before enabling by using current_datasets.

$ok = $epm->publish( $handler, $base_url, %opts )

Publish this EPM to a remote system using SWORD.

$base_url is the URL of the SWORD endpoint or a page containing a SWORD <link>.

Options:

  username - username for Basic auth
  password - password for Basic auth
$epm->add_to_xml( $dest, $src )

Add this package's XML $src to $dest XML. Useful for workflows and citations.

$src may have these additional attributes on elements:

  • operation = "replace" | "disable" | *"merge"
Where replace will replace the default element, disable will disable it and merge will merge the new branch with the old.
$epm->remove_from_xml( $dest )

Remove this package's extensions from $dest XML.


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