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
Boxes on Abstract Pages
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!
[[Category:EPrints_Bazaar]] This tutorial looks at ways to add items to eprint abstract pages without the need to manipulate any XML code. This can be done by adding a box to either the top,bottom,left or right of the abstract page. These can be useful but don't always turn out in the correct place, hence manipulating XML can be more preferable in the long run. =An EPrints Box= These are very simple and live under the Screen plug-ins Box directory: * lib/plugins/EPrints/Plugin/Screen/EPrint/Box/package_name.pm All they require is a render method as shown in the basic shell below: package EPrints::Plugin::Screen::EPrint::Box::package_name; @ISA = ( 'EPrints::Plugin::Screen::EPrint::Box' ); use strict; sub render { my( $self ) = @_; my $repository = $self->{repository}; my $eprint = $self->{processor}->{eprint}; my $frag = $repository->make_doc_fragment; $frag->appendChild($repository->make_text("HELLO")); return $frag; } =Configuring your box= For this you need a config file in cfg/cfg.d/package_name.pl which contains the following: $c->{plugins}->{"Screen::EPrint::Box::package_name"}->{appears}->{summary_top} = undef; $c->{plugins}->{"Screen::EPrint::Box::package_name"}->{appears}->{summary_right} = undef; $c->{plugins}->{"Screen::EPrint::Box::package_name"}->{appears}->{summary_bottom} = 800; $c->{plugins}->{"Screen::EPrint::Box::package_name"}->{appears}->{summary_left} = undef; So this box will appear below the summary_page citation with a priority of 800 (anything less will appear below and anything more above). =Installing as a package= To see your box you will need to invalidate the abstract pages which can be done via the "Regenerate Abstracts" button under the "System Tools" tab of the admin interface. If you specify you config file properly in the spec file you should be able to click the "Configure Add-on" button to change these values. =Extension Exercise= It is recommended that this exercise is done after [[XML manipulation of the Abstract page using a Bazaar Module]] Make a screen plug-in which has a '''postinst''' and '''prerm''' which invalidate the abstract pages. The render method of this screen should still re-direct the user to the config file however! For the invalidate abstract code see [[XML manipulation of the Abstract page using a Bazaar Module]] Clue to the redirecting: my $config_file = "cfg.d/package_name.pl"; my $screen_id = "Admin::Config::View::Perl"; my $redirect_url = $session->current_url() . "?screen=" . $screen_id . "&configfile=" . $config_file; $session->redirect( $redirect_url ); exit();
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)