Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
Upgrading EPM Packages
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Example= The starting point for this is our Screen plug-in where the POSTINST and PRERM methods are defined (see [[XML manipulation of the EPrints Workflow using a Bazaar Package]]). To enable upgrades we simply add an upgrade sub alongside these methods: sub allow_action_upgrade { my ( $self ) = @_; return 1; } # The upgrade method, this will call all upgrade subs individually between the old version number and the new version number. sub action_upgrade { my ( $self, $old_version_number, $new_version_number ) = @_; my @versions = qw( 0.0.1 0.0.2 ); for(my $i = 0; $i < $#versions; ++$i) { if( $old_version_number eq $versions[$i] ) { no strict 'refs'; my $f = "upgrade_".$versions[$i]."_to_".$versions[$i+1]; $f =~ s/\./_/g; &$f( $self ); $old_version_number = $versions[$i+1]; } } } sub upgrade_0_0_1_to_0_0_2 { my ( $self ) = @_; print STDERR "IN THE UPGRADE ROUTINE FOR 0.0.1 to 0.0.2 \n\n"; # Add your API calls POSTINST like stuff here to upgrade versions. } So all you need to do is define potentially lots of upgrade_X_X_X_to_X_X_Z routines to handle all the upgrades and add this version number (which needs an upgrade routine). If people are upgrading from 0.0.1 to 0.0.5 then potentially 4 of these upgrade methods will be called. [[Category:EPrints_Bazaar]]
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)