API:EPrints/DataObj/EPM
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
- 1 NAME
- 2 DESCRIPTION
- 3 SYSTEM METADATA
- 4 METHODS
- 4.1 get_system_field_info
- 4.2 map
- 4.3 new
- 4.4 new_from_manifest
- 4.5 commit
- 4.6 rebuild
- 4.7 version
- 4.8 is_enabled
- 4.9 repositories
- 4.10 package_filename
- 4.11 epm_dir
- 4.12 installed_files
- 4.13 repository_files
- 4.14 control_screen
- 4.15 serialise
- 4.16 install
- 4.17 uninstall
- 4.18 enable
- 4.19 Utility Methods
- 5 COPYRIGHT
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.
enable
$ok = $epm->enable( $handler )
Enables the $epm for the current repository.
Utility Methods
current_counters
$conf = $epm->current_counters()
current_datasets
$conf = $epm->current_datasets()
update_counters
$ok = $epm->update_counters( $conf )
update_datasets
$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.
publish
$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
COPYRIGHT