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
StorageController
(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!
== Writing A Storage Plugin == Implement the methods above for your chosen storage medium. Note that the plug-in is resposible for any mapping from fileobj to a URI or path where the file exists. This leaves URI generation flexible however it must remain replicatable from the fileobj. Currently a local storage plug-in exists which replicates all legacy behaviour of the eprints storage system prior to containing a seporate storage layer. As a quick guide to writing a storage plug-in the following provides a template: Package EPrints::Plugin::Storage::NAME; use URI; use URI::Escape; use EPrints::Plugin::Storage; @ISA = ( "EPrints::Plugin::Storage" ); use strict; sub new { my( $class, %params ) = @_; my $self = $class->SUPER::new( %params ); $self->{name} = "NAME Storage Plugin"; return $self; } sub store { my( $self, $fileobj, $fh ) = @_; ... return $success; } sub retrieve { my( $self, $fileobj, $revision ) = @_; ... return $in_file_handle; } sub delete { my( $self, $fileobj, $revision ) = @_; ... return $success; } # Optional methods # get_local_copy() is provided by Storage::Plugin so does # not have to be implemented. If the file is stored # locally it may be more efficient to return it's filename # here rather than copying to a temporary file. sub get_local_copy { my( $self, $fileobj, $revision ) = @_; ... return $filename; } # get_remote_copy() allows the platform storing the file to directly # provide the file to the end user. sub get_remote_copy { my( $self, $fileobj, $uri ) = @_; ... return $uri; }
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)