EPrints Technical Mailing List Archive

Message: #07886


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Adding Buttons to Admin Screen


It is a default permission for the Admin role:

perl_lib/EPrints/DataObj/User.pm

        "admin" =>
        [
                [...]
                "config/regen_abstracts",

                [...]

        ]

You've to create a new one and grant it to a user.

Looking at the plugin, the important call is:

$session->expire_abstracts()

defined in:

perl_lib/EPrints/Repository.pm:

which just set a variable on expiring date. So, when viewed, the
abstract will be recreated.

If you need to run a script, just create an event when the button is
pressed and epindexer will run it. You can find an example in the same
Datacite plugin, on the MintDoi part.

Il 14/06/19 16:46, James Kerwin via Eprints-tech ha scritto:
Hi All,

I have a script that I run every two weeks for AAM updates. I'm away
when the next update is due so I've decided to create a new button on
the Admin screen that runs the script (inspired by the MintDOI button
in the DataCite plugin):

image.png
(I know it should say "an AAM").

I'm using RegenAbstracts.pm
(EPrints::Plugin::Screen::Admin::RegenAbstracts;) as a rough guide.

I had assumed that this would call "generate_abstracts" but it appears
to look at "config/regen_abstracts":

                sub allow_regen_abstracts

                {

                my( $self ) = @_;


                return $self->allow( "config/regen_abstracts" );

                }

Does anybody know how I can get it to point at my script? I must admit
that I'm not sure where "config/regen_abstracts" is pointing and I've
done so many greps to find it. If I could find how looking to that
causes the abstracts to be generated I could copy that approach.

Thanks,
James



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C59f5c952fb8a4ea5d3c808d6f2f17e69%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=TuKIovbKp7QuBhZnPwjMpf1CP5Cqh%2FmyedfYiCscJH8%3D&amp;reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C59f5c952fb8a4ea5d3c808d6f2f17e69%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=4wkPzi3hojLmpwldxb51FGOmd3ogvtl%2FSbzozgy5rTI%3D&amp;reserved=0
*** EPrints developers Forum: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C59f5c952fb8a4ea5d3c808d6f2f17e69%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=N4DLOzxw2kSHMrFihaiPX%2BBuBwq4dChEFZ7a1PLEPpE%3D&amp;reserved=0