[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Adding Buttons to Admin Screen



Hi Yuri,

Thank you so much for your advice. I realised my wrong assumption on what
"regen_abstracts" was doing, but was still confused as to how the abstracts
were being generated and how to call a script etc.

I spent all day trying to get it working yesterday and it did in the end. I
had to add my "config/aam_update" (In: return $self->allow(
"config/aam_update" );) to my core Users.pm because I couldn't get
user_roles.pl or a local Users.pm to work, but it's only on the Test server
for the time being.

Now to wrestle with the google docs API to finish!

Thanks,
James

On Mon, Jun 17, 2019 at 8:00 AM Yuri via Eprints-tech <
eprints-tech at ecs.soton.ac.uk> wrote:

> 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%7C4637a71334444662332108d6f3d1aef0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=MnrumGH3HCAed7W4o%2BTo9v2gyVv4XegivjzJlbdcV%2BU%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%7C4637a71334444662332108d6f3d1aef0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=ncidF1N%2FSNKZM0MHX3v%2FcFeudcA4gWahWnxpfDAx%2BUs%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%7C4637a71334444662332108d6f3d1aef0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=SVKNnoozP2SH9ff%2BdKVW%2F8lVWECnooc4JBTNuHQ3fIM%3D&amp;reserved=0
>
> *** 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%7C4637a71334444662332108d6f3d1aef0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=MnrumGH3HCAed7W4o%2BTo9v2gyVv4XegivjzJlbdcV%2BU%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%7C4637a71334444662332108d6f3d1aef0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=ncidF1N%2FSNKZM0MHX3v%2FcFeudcA4gWahWnxpfDAx%2BUs%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%7C4637a71334444662332108d6f3d1aef0%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=SVKNnoozP2SH9ff%2BdKVW%2F8lVWECnooc4JBTNuHQ3fIM%3D&amp;reserved=0
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20190618/b3f635ae/attachment.html