Re: [EP-tech] DOI Minting

James Kerwin via Eprints-tech <[email protected]> Thu, 14 Nov 2019 10:38:08 +0000
Newsgroups gmane.comp.web.eprints.devel
Message-ID <EMEW3|6d002db0b1fa8ec1424409053ccdff8fvADAd214eprints-tech-bounces|ecs.soton.ac.uk|CAKkNZ9Ckj5QMigOno9o3vC2OFudFcMPkt4r72HMSO+tHe1REyw@mail.gmail.com>
--===============0822682083695233353==
Content-Type: multipart/alternative; boundary="0000000000007242fb05974c1490"

--0000000000007242fb05974c1490
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi All,

Since I asked publicly, I think it's only fair that I include my mistakes
for anybody who might be thinking of playing with EPrints triggers.

Using the commit trigger caused my Twtitter bot to send out tweets each
time an item was updated and caused the DataCite plugin to pile up a load
of failed tasks in the indexer.

For those who are as inexperienced as I am with this, I recommend using
sensible checks. For DataCite I just check the item is of type "thesis"
(for our needs we only want DOI's on theses) and that the DOI field isn't
already populated in z_datacitedoi.pl within this bit:

if($c->{datacitedoi}{auto_coin}){

    $c->add_dataset_trigger( "eprint", EP_TRIGGER_AFTER_COMMIT , sub {

        my ( %params ) =3D @_;


        my $repository =3D $params{repository};


        return undef if (!defined $repository);


        if (defined $params{dataobj}) {

            my $dataobj =3D $params{dataobj};

*            my $type =3D $dataobj->get_value( "type" );*

*            if ($type eq "thesis"){*

                my $eprint_id =3D $dataobj->id;

                $repository->dataset( "event_queue" )->create_dataobj({

                    pluginid =3D> "Event::DataCiteEvent",

                    action =3D> "datacite_doi",

                    params =3D> [$dataobj->internal_uri],

                });

          }}


       });

    }


(I've not included the check for the DOI field yet and I know the $type
variable isn't necessary, but I was being really careful).

For my Twitter bot I need to add a field to record if a tweet has been sent
previously or not and then check this in the twitter script. I suppose you
might want to add additional checks to ensure the item isn't a template/new
version of an existing item depending on your requirements and what you're
using the trigger for.

Otherwise, it's a really useful trigger for those weird cases where you
aren't depending on a status change to make things happen. Just be very
careful.

Thanks,
James

On Tue, Nov 12, 2019 at 4:48 PM James Kerwin via Eprints-tech <
[email protected]> wrote:

> Thanks everyone, It turns out I had more options than I thought!
>
> I went with Rory in the end. I've been putting off getting to grips with
> triggers for ages and so this was a good opportunity.
>
> The DataCite plugin works how I want and after a brief ban on my Twitter
> account, the twitter bot works as I want it to. For some reason, after
> changing the trigger on the Twitter script it sent LOADS of Tweets so I m=
ay
> need to take another look at it tomorrow.
>
> The important one was DataCite and that's spot on.
>
> As usual, thank you all for the advice.
>
> James
>
> On Tue, Nov 12, 2019 at 1:51 PM Yuri via Eprints-tech <
> [email protected]> wrote:
>
>> Maybe write the event directly in the mysql table used for the queue to
>> mint and tweet?
>>
>>
>> Il 12/11/19 13:56, Rory McNicholl via Eprints-tech ha scritto:
>> > Hi James,
>> >
>> > yes the trigger is the EP_TRIGGER_STATUS_CHANGE one, so from what you
>> > say that won't be happening.
>> >
>> > I guess options would be
>> >
>> > a)  to use a more general trigger like EP_TRIGGER_AFTER_COMMIT and
>> > then check the status of the item and whether there is already a DOI
>> > in place etc etc etc... though you may end up with a lot more logic to
>> do?
>> >
>> > b) you could enable the action_coin plugin in the z_datacitedoi.pl
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fz_da=
tacitedoi.pl&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5e41=
66af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=
=3DGoKlzZw8YyYvDXpR8%2FL29uMYZ%2Bb%2B5CGfzhYe4Hq7BFg%3D&amp;reserved=3D0>
>> and
>> > then go and press the "Coin DOI" button in the UI. I guess that would
>> > be a drag if you have more than a handful of Theses to process.
>> >
>> > Maybe there's a c) out there without any downsides?
>> >
>> > Cheers,
>> >
>> > Rory
>> >
>> > Rory McNicholl
>> > Team Lead - Research Technologies
>> > CoSector, University of London
>> > Senate House
>> > Malet Street
>> > London
>> > WC1E 7HU
>> >
>> > t: +44 (0)20 7863 1344
>> > e: [email protected]
>> > w:
>> https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fcose=
ctor.com%2Fdigital-research%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soto=
n.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9=
d8%7C0&amp;sdata=3DdD1jFlTMMNIMdC2LcYulnBvKO0fZPzZcneN%2B3nqMwcA%3D&amp;res=
erved=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fcos=
ector.com%2Fdigital-research%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.sot=
on.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada=
9d8%7C0&amp;sdata=3DdD1jFlTMMNIMdC2LcYulnBvKO0fZPzZcneN%2B3nqMwcA%3D&amp;re=
served=3D0>
>> >
>> > The University of London is an exempt charity in England and Wales.
>> > ----------------------------------------------------------------------=
--
>> > *From:* [email protected]
>> > <[email protected]> on behalf of James Kerwin via
>> > Eprints-tech <[email protected]>
>> > *Sent:* 12 November 2019 12:42
>> > *To:* [email protected] <[email protected]>
>> > *Subject:* [EP-tech] DOI Minting
>> > Hi All,
>> >
>> > I'm currently going through the process of uploading a load of
>> > digitised theses.
>> >
>> > I've managed to write scripts to create the EPrints friendly metadata
>> > and altered the bin/import script to slurp up a load of XML files and
>> > do the deposits for me.
>> >
>> > I'm having trouble getting the DOIs to mint on deposit (datacite) and
>> > to get my twitter bot to send tweets upon deposit (my own
>> > Frankenstein's monster of a script).
>> >
>> > Usually these scripts are triggered when an item moves from the review
>> > to the live archive. The digitised theses items are going straight
>> > into the live archive which I guess is why they aren't being triggered=
.
>> >
>> > Does anybody have any helpful advice on this?
>> >
>> > Thanks,
>> > James
>> >
>> > *** Options:
>> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>> > *** Archive:
>> https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwww.e=
prints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.u=
k%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0=
&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOgmIF0%3D&amp;reserved=
=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwww.=
eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.=
uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C=
0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOgmIF0%3D&amp;reserved=
=3D0>
>> > *** EPrints community wiki:
>> https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwiki.=
eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5e=
4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=
=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTiheYPs%2BJuTv8%3D&amp;reserved=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwiki=
.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5=
e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdat=
a=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTiheYPs%2BJuTv8%3D&amp;reserved=3D0>
>> > *** EPrints developers Forum:
>> https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fforum=
.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5=
e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdat=
a=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKXe%2F5HfcDtzg%3D&amp;reserved=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fforu=
m.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee=
5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sda=
ta=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKXe%2F5HfcDtzg%3D&amp;reserved=3D0>
>>
>> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tec=
h
>> *** Archive: https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%=
3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-tech%40e=
cs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669=
d03ada9d8%7C0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOgmIF0%3D&=
amp;reserved=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwww.=
eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.=
uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C=
0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOgmIF0%3D&amp;reserved=
=3D0>
>> *** EPrints community wiki: https://eur03.safelinks.protection.outlook.c=
om/?url=3Dhttp%3A%2F%2Fwiki.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tec=
h%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe=
89669d03ada9d8%7C0&amp;sdata=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTiheYPs%2BJu=
Tv8%3D&amp;reserved=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwiki=
.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5=
e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdat=
a=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTiheYPs%2BJuTv8%3D&amp;reserved=3D0>
>> *** EPrints developers Forum: https://eur03.safelinks.protection.outlook=
.com/?url=3Dhttp%3A%2F%2Fforum.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-=
tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3=
ebe89669d03ada9d8%7C0&amp;sdata=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKXe%2F5Hfc=
Dtzg%3D&amp;reserved=3D0
>> <https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fforu=
m.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee=
5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sda=
ta=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKXe%2F5HfcDtzg%3D&amp;reserved=3D0>
>>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3=
A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-tech%40ec=
s.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d=
03ada9d8%7C0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOgmIF0%3D&a=
mp;reserved=3D0
> *** EPrints community wiki: https://eur03.safelinks.protection.outlook.co=
m/?url=3Dhttp%3A%2F%2Fwiki.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-tech=
%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe8=
9669d03ada9d8%7C0&amp;sdata=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTiheYPs%2BJuT=
v8%3D&amp;reserved=3D0
> *** EPrints developers Forum: https://eur03.safelinks.protection.outlook.=
com/?url=3Dhttp%3A%2F%2Fforum.eprints.org%2F&amp;data=3D01%7C01%7Ceprints-t=
ech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3e=
be89669d03ada9d8%7C0&amp;sdata=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKXe%2F5HfcD=
tzg%3D&amp;reserved=3D0
>

--0000000000007242fb05974c1490
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi All,<br><div><br></div><div>Since I asked publicly, I t=
hink it&#39;s only fair that I include my mistakes for anybody who might be=
 thinking of playing with EPrints triggers.</div><div><br></div><div>Using =
the commit trigger caused my Twtitter bot to send out tweets each time an i=
tem was updated and caused the DataCite plugin to pile up a load of failed =
tasks in the indexer.</div><div><br></div><div>For those who are as inexper=
ienced as I am with this, I recommend using sensible checks. For DataCite I=
 just check the item is of type &quot;thesis&quot; (for our needs we only w=
ant DOI&#39;s on theses) and that the DOI field isn&#39;t already populated=
 in=C2=A0<a href=3D"https://eur03.safelinks.protection.outlook.com/?url=3Dh=
ttp%3A%2F%2Fz_datacitedoi.pl&amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.=
ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8=
%7C0&amp;sdata=3DGoKlzZw8YyYvDXpR8%2FL29uMYZ%2Bb%2B5CGfzhYe4Hq7BFg%3D&amp;r=
eserved=3D0" originalSrc=3D"http://z_datacitedoi.pl" shash=3D"ovhGy3obx0sFn=
Fd29hk5zM8PyMhg79GjxycVheoCJCZx+OhjqJhdxySiefgjvWhxZCigsAUxjhw1x7kd2LIV+rgJ=
dR/karCotCQgd5xe44kzoMV6wZbCHYRi6XytmBU8lYTxRY4H1zDJdhFXZdjVnQ8bxsMTwlIsQ/y=
wHUX5YWA=3D">z_datacitedoi.pl</a> within this bit:</div><div><br></div><blo=
ckquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote sty=
le=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margi=
n:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40p=
x;border:none;padding:0px"><div>if($c-&gt;{datacitedoi}{auto_coin}){</div><=
/blockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 0 40p=
x;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:no=
ne;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:=
0px"><div>=C2=A0 =C2=A0 $c-&gt;add_dataset_trigger( &quot;eprint&quot;, EP_=
TRIGGER_AFTER_COMMIT , sub {</div></blockquote></blockquote></blockquote><b=
lockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote s=
tyle=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"mar=
gin:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 my=
 ( %params ) =3D @_;</div></blockquote></blockquote></blockquote><blockquot=
e style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"=
margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 =
0 40px;border:none;padding:0px"><div><br></div></blockquote></blockquote></=
blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">=
<blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote=
 style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 my $repository =3D $params{repository};</div></blockquote></bloc=
kquote></blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;padd=
ing:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><b=
lockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div><br></di=
v></blockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 0 =
40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border=
:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;paddi=
ng:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return undef if (!defined $reposit=
ory);</div></blockquote></blockquote></blockquote><blockquote style=3D"marg=
in:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40=
px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:n=
one;padding:0px"><div><br></div></blockquote></blockquote></blockquote><blo=
ckquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote sty=
le=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margi=
n:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (=
defined $params{dataobj}) {</div></blockquote></blockquote></blockquote><bl=
ockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote st=
yle=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"marg=
in:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 my $dataobj =3D $params{dataobj};</div></blockquote></blockquote=
></blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0p=
x"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockqu=
ote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div><b>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 my $type =3D $dataobj-&gt;get_value( &quot;=
type&quot; );</b></div></blockquote></blockquote></blockquote><blockquote s=
tyle=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"mar=
gin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 4=
0px;border:none;padding:0px"><div><b>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 if ($type eq &quot;thesis&quot;){</b></div></blockquote></blockquote></=
blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">=
<blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote=
 style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 my $eprint_id =3D $dataobj-&gt;id;</=
div></blockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 =
0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;bord=
er:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;pad=
ding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $rep=
ository-&gt;dataset( &quot;event_queue&quot; )-&gt;create_dataobj({</div></=
blockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 0 40px=
;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:non=
e;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0=
px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 pluginid =3D&gt; &quot;Event::DataCiteEvent&quot;,</div></blockquote></=
blockquote></blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;=
padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px=
"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 action =
=3D&gt; &quot;datacite_doi&quot;,</div></blockquote></blockquote></blockquo=
te><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockqu=
ote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=
=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 params =3D&gt; [$dataobj-&=
gt;internal_uri],</div></blockquote></blockquote></blockquote><blockquote s=
tyle=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"mar=
gin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 4=
0px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 });</div></blockquote></blockquote></blockquote><blockquote =
style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"ma=
rgin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 =
40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }}</d=
iv></blockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 0=
 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;borde=
r:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padd=
ing:0px"><div><br></div></blockquote></blockquote></blockquote><blockquote =
style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"ma=
rgin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 =
40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0});</div></bl=
ockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 0 40px;b=
order:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;=
padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px=
"><div>=C2=A0 =C2=A0 }</div></blockquote></blockquote></blockquote></blockq=
uote><div><br></div><div>(I&#39;ve not included the check for the DOI field=
 yet and I know the $type variable isn&#39;t necessary, but I was being rea=
lly careful).</div><div><br></div><div>For my Twitter bot I need to add a f=
ield to record if a tweet has been sent previously or not and then check th=
is in the twitter script. I suppose you might want to add additional checks=
 to ensure the item isn&#39;t a template/new version of an existing item de=
pending on your requirements and what you&#39;re using the trigger for.</di=
v><div><br></div><div>Otherwise, it&#39;s a really useful trigger for those=
 weird cases where you aren&#39;t depending on a status change to make thin=
gs happen. Just be very careful.</div><div><br></div><div>Thanks,</div><div=
>James</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"=
gmail_attr">On Tue, Nov 12, 2019 at 4:48 PM James Kerwin via Eprints-tech &=
lt;<a href=3D"mailto:[email protected]">[email protected]=
c.uk</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"ltr">Thanks everyone, It turns out I had more options than =
I thought!<div><br></div><div>I went with Rory in the end. I&#39;ve been pu=
tting off getting to grips with triggers for ages and so this was a good op=
portunity.</div><div><br></div><div>The DataCite plugin works how I want an=
d after a brief ban on my Twitter account, the twitter bot works as I want =
it to. For some reason, after changing the trigger on the Twitter script it=
 sent LOADS of Tweets so I may need to take another look at it tomorrow.</d=
iv><div><br></div><div>The important one was DataCite and that&#39;s spot o=
n.</div><div><br></div><div>As usual, thank you all for the advice.</div><d=
iv><br></div><div>James</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Tue, Nov 12, 2019 at 1:51 PM Yuri via Epri=
nts-tech &lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">Maybe write the event directly in the mysq=
l table used for the queue to<br>
mint and tweet?<br>
<br>
<br>
Il 12/11/19 13:56, Rory McNicholl via Eprints-tech ha scritto:<br>
&gt; Hi James,<br>
&gt;<br>
&gt; yes the trigger is the=C2=A0EP_TRIGGER_STATUS_CHANGE one, so from what=
 you<br>
&gt; say that won&#39;t be happening.<br>
&gt;<br>
&gt; I guess options would be<br>
&gt;<br>
&gt; a)=C2=A0 to use a more general trigger like EP_TRIGGER_AFTER_COMMIT an=
d<br>
&gt; then check the status of the item and whether there is already a DOI<b=
r>
&gt; in place etc etc etc... though you may end up with a lot more logic to=
 do?<br>
&gt;<br>
&gt; b) you could enable the action_coin plugin in the <a href=3D"https://e=
ur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fz_datacitedoi.pl&=
amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba0830=
8d768eec531%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=3DGoKlzZw8YyYv=
DXpR8%2FL29uMYZ%2Bb%2B5CGfzhYe4Hq7BFg%3D&amp;reserved=3D0" originalSrc=3D"h=
ttp://z_datacitedoi.pl" shash=3D"ovhGy3obx0sFnFd29hk5zM8PyMhg79GjxycVheoCJC=
Zx+OhjqJhdxySiefgjvWhxZCigsAUxjhw1x7kd2LIV+rgJdR/karCotCQgd5xe44kzoMV6wZbCH=
YRi6XytmBU8lYTxRY4H1zDJdhFXZdjVnQ8bxsMTwlIsQ/ywHUX5YWA=3D" rel=3D"noreferre=
r" target=3D"_blank">z_datacitedoi.pl</a> and<br>
&gt; then go and press the &quot;Coin DOI&quot; button in the UI. I guess t=
hat would<br>
&gt; be a drag if you have more than a handful of Theses to process.<br>
&gt;<br>
&gt; Maybe there&#39;s a c) out there without any downsides?<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Rory<br>
&gt;<br>
&gt; Rory McNicholl<br>
&gt; Team Lead - Research Technologies<br>
&gt; CoSector,=C2=A0University of London<br>
&gt; Senate House<br>
&gt; Malet Street<br>
&gt; London<br>
&gt; WC1E 7HU<br>
&gt;<br>
&gt; t: +44 (0)20 7863 1344<br>
&gt; e: <a href=3D"mailto:[email protected]" target=3D"_blank">ro=
[email protected]</a><br>
&gt; w: <a href=3D"https://eur03.safelinks.protection.outlook.com/?url=3Dht=
tps%3A%2F%2Fcosector.com%2Fdigital-research%2F&amp;data=3D01%7C01%7Ceprints=
-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d=
3ebe89669d03ada9d8%7C0&amp;sdata=3DdD1jFlTMMNIMdC2LcYulnBvKO0fZPzZcneN%2B3n=
qMwcA%3D&amp;reserved=3D0" originalSrc=3D"https://cosector.com/digital-rese=
arch/" shash=3D"lz7rcGnmbXWJ1Bve+KSgNtmTtCeB7r1ksWIPli0c7SJ7tqVhttN+gDeBSbm=
nTQ7Mrnfy12f5aregRw3xUpzO5TiTyVPXIf8v7E1gVfTL+oqfb+G0NeoIsI4cKyzp2deqm2oVA/=
20CIrX2ecTVN+iq81X9SHG3h7TYssAgt/+Q/w=3D" rel=3D"noreferrer" target=3D"_bla=
nk">https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fcos=
ector.com%2Fdigital-research%2F&amp;amp;data=3D01%7C01%7Ceprints-tech%40ecs=
.soton.ac.uk%7Cb676e764c24d4ccd716308d767776ddd%7C4a5378f929f44d3ebe89669d0=
3ada9d8%7C0&amp;amp;sdata=3D4l3BrUFniZstrmo5GhtGqq6FmvHiEAlWDFat9uy0RPY%3D&=
amp;amp;reserved=3D0</a><br>
&gt;<br>
&gt; The University of London is an exempt charity in England and Wales.<br=
>
&gt; ----------------------------------------------------------------------=
--<br>
&gt; *From:* <a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a><br>
&gt; &lt;<a href=3D"mailto:[email protected]" target=3D"=
_blank">[email protected]</a>&gt; on behalf of James Ker=
win via<br>
&gt; Eprints-tech &lt;<a href=3D"mailto:[email protected]" targe=
t=3D"_blank">[email protected]</a>&gt;<br>
&gt; *Sent:* 12 November 2019 12:42<br>
&gt; *To:* <a href=3D"mailto:[email protected]" target=3D"_blank=
">[email protected]</a> &lt;<a href=3D"mailto:[email protected]=
oton.ac.uk" target=3D"_blank">[email protected]</a>&gt;<br>
&gt; *Subject:* [EP-tech] DOI Minting<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I&#39;m currently going through the process of uploading a load of<br>
&gt; digitised theses.<br>
&gt;<br>
&gt; I&#39;ve managed to write scripts to create the EPrints friendly metad=
ata<br>
&gt; and altered the bin/import script to slurp up a load of XML files and<=
br>
&gt; do the deposits for me.<br>
&gt;<br>
&gt; I&#39;m having trouble getting the DOIs to mint on deposit (datacite) =
and<br>
&gt; to get my twitter bot to send tweets upon deposit (my own<br>
&gt; Frankenstein&#39;s monster of a script).<br>
&gt;<br>
&gt; Usually these scripts are triggered when an item moves from the review=
<br>
&gt; to the live archive. The digitised theses items are going straight<br>
&gt; into the live archive which I guess is why they aren&#39;t being trigg=
ered.<br>
&gt;<br>
&gt; Does anybody have any helpful advice on this?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; James<br>
&gt;<br>
&gt; *** Options: <a href=3D"http://mailman.ecs.soton.ac.uk/mailman/listinf=
o/eprints-tech" rel=3D"noreferrer" target=3D"_blank">http://mailman.ecs.sot=
on.ac.uk/mailman/listinfo/eprints-tech</a><br>
&gt; *** Archive: <a href=3D"https://eur03.safelinks.protection.outlook.com=
/?url=3Dhttp%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Cepr=
ints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929=
f44d3ebe89669d03ada9d8%7C0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%=
2BKOgmIF0%3D&amp;reserved=3D0" originalSrc=3D"http://www.eprints.org/tech.p=
hp/" shash=3D"lpeSVKqvI/e3qCCZMyHuvBzYoy4r6t4hkr6mAVQJJQ/FcWilVvaFStbxAbAi5=
yLKa66olgrMpQ0u1F/oWGGsTHZ86lu8cnR2BdU9ohux5rxghQ+rIh+me4nNL2hUe5iTXGQtn0Z9=
R+Ffdx9CsAtWgZWqAJMZNH1no57tWtjPJDU=3D" rel=3D"noreferrer" target=3D"_blank=
">https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwww.ep=
rints.org%2Ftech.php%2F&amp;amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.a=
c.uk%7Cb676e764c24d4ccd716308d767776ddd%7C4a5378f929f44d3ebe89669d03ada9d8%=
7C0&amp;amp;sdata=3D6XVKDqBZ%2BFP1XYSlUpoz%2BvxhDX9JqwU3hKn2mRFwBQw%3D&amp;=
amp;reserved=3D0</a><br>
&gt; *** EPrints community wiki: <a href=3D"https://eur03.safelinks.protect=
ion.outlook.com/?url=3Dhttp%3A%2F%2Fwiki.eprints.org%2F&amp;data=3D01%7C01%=
7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a537=
8f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2B=
lTiheYPs%2BJuTv8%3D&amp;reserved=3D0" originalSrc=3D"http://wiki.eprints.or=
g/" shash=3D"qUzQjdkAwjfApPeeC8F2LdM9tAazPKamUiAx5r+gW5edQ/t3DdRzdIq9nHfw8L=
pdPzV9zzkFPM98mZLmBk/AntRDtKPa9i81U2qwO+QqEi/9+vnflgX76ixXt1yH1ltCDBpXZd3TT=
NxOqVOuuV4nXmI7PYK815pr/AD1ytOuMDc=3D" rel=3D"noreferrer" target=3D"_blank"=
>https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwiki.ep=
rints.org%2F&amp;amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb676=
e764c24d4ccd716308d767776ddd%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;amp=
;sdata=3DJ3sUddBMvMLJ9Geo%2BjDTbZeUYnjrl5VtB%2FRNKsQYOT0%3D&amp;amp;reserve=
d=3D0</a><br>
&gt; *** EPrints developers Forum: <a href=3D"https://eur03.safelinks.prote=
ction.outlook.com/?url=3Dhttp%3A%2F%2Fforum.eprints.org%2F&amp;data=3D01%7C=
01%7Ceprints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a=
5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=3DCTUJrew1s5XZauegPf5zkAmM2vie=
gYaKXe%2F5HfcDtzg%3D&amp;reserved=3D0" originalSrc=3D"http://forum.eprints.=
org/" shash=3D"a8IJOGK7c/vgKKRt3AAFhMX9o/YEncO7y3I0ctuk3vjkVg5ibgep7wDhN1CD=
OCb6MRKhADX7D+b/3bz5VPuu+OHlpNGZJ8FBGdNactJt/NBOqYxk6A1rvzU+Y3iO6mPWphxgIzy=
lHryvobuG6ZdhUvr8d2w+4RrjpwWmW23qS/0=3D" rel=3D"noreferrer" target=3D"_blan=
k">https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fforum=
.eprints.org%2F&amp;amp;data=3D01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb=
676e764c24d4ccd716308d767776ddd%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;=
amp;sdata=3D4NS4UFJPeWQvZUHCpfjzkBBbxSizfGiFpqkitZ2VWAY%3D&amp;amp;reserved=
=3D0</a><br>
<br>
*** Options: <a href=3D"http://mailman.ecs.soton.ac.uk/mailman/listinfo/epr=
ints-tech" rel=3D"noreferrer" target=3D"_blank">http://mailman.ecs.soton.ac=
.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href=3D"https://eur03.safelinks.protection.outlook.com/?url=
=3Dhttp%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-=
tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3=
ebe89669d03ada9d8%7C0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOg=
mIF0%3D&amp;reserved=3D0" originalSrc=3D"http://www.eprints.org/tech.php/" =
shash=3D"lpeSVKqvI/e3qCCZMyHuvBzYoy4r6t4hkr6mAVQJJQ/FcWilVvaFStbxAbAi5yLKa6=
6olgrMpQ0u1F/oWGGsTHZ86lu8cnR2BdU9ohux5rxghQ+rIh+me4nNL2hUe5iTXGQtn0Z9R+Ffd=
x9CsAtWgZWqAJMZNH1no57tWtjPJDU=3D" rel=3D"noreferrer" target=3D"_blank">htt=
p://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href=3D"https://eur03.safelinks.protection.o=
utlook.com/?url=3Dhttp%3A%2F%2Fwiki.eprints.org%2F&amp;data=3D01%7C01%7Cepr=
ints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929=
f44d3ebe89669d03ada9d8%7C0&amp;sdata=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTihe=
YPs%2BJuTv8%3D&amp;reserved=3D0" originalSrc=3D"http://wiki.eprints.org/" s=
hash=3D"qUzQjdkAwjfApPeeC8F2LdM9tAazPKamUiAx5r+gW5edQ/t3DdRzdIq9nHfw8LpdPzV=
9zzkFPM98mZLmBk/AntRDtKPa9i81U2qwO+QqEi/9+vnflgX76ixXt1yH1ltCDBpXZd3TTNxOqV=
OuuV4nXmI7PYK815pr/AD1ytOuMDc=3D" rel=3D"noreferrer" target=3D"_blank">http=
://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href=3D"https://eur03.safelinks.protection=
.outlook.com/?url=3Dhttp%3A%2F%2Fforum.eprints.org%2F&amp;data=3D01%7C01%7C=
eprints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f=
929f44d3ebe89669d03ada9d8%7C0&amp;sdata=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKX=
e%2F5HfcDtzg%3D&amp;reserved=3D0" originalSrc=3D"http://forum.eprints.org/"=
 shash=3D"a8IJOGK7c/vgKKRt3AAFhMX9o/YEncO7y3I0ctuk3vjkVg5ibgep7wDhN1CDOCb6M=
RKhADX7D+b/3bz5VPuu+OHlpNGZJ8FBGdNactJt/NBOqYxk6A1rvzU+Y3iO6mPWphxgIzylHryv=
obuG6ZdhUvr8d2w+4RrjpwWmW23qS/0=3D" rel=3D"noreferrer" target=3D"_blank">ht=
tp://forum.eprints.org/</a><br>
</blockquote></div>
*** Options: <a href=3D"http://mailman.ecs.soton.ac.uk/mailman/listinfo/epr=
ints-tech" rel=3D"noreferrer" target=3D"_blank">http://mailman.ecs.soton.ac=
.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href=3D"https://eur03.safelinks.protection.outlook.com/?url=
=3Dhttp%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=3D01%7C01%7Ceprints-=
tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929f44d3=
ebe89669d03ada9d8%7C0&amp;sdata=3DUTmWg1ob5CAeWrVt499LoqCPqeB3OGEa1hu%2BKOg=
mIF0%3D&amp;reserved=3D0" originalSrc=3D"http://www.eprints.org/tech.php/" =
shash=3D"lpeSVKqvI/e3qCCZMyHuvBzYoy4r6t4hkr6mAVQJJQ/FcWilVvaFStbxAbAi5yLKa6=
6olgrMpQ0u1F/oWGGsTHZ86lu8cnR2BdU9ohux5rxghQ+rIh+me4nNL2hUe5iTXGQtn0Z9R+Ffd=
x9CsAtWgZWqAJMZNH1no57tWtjPJDU=3D" rel=3D"noreferrer" target=3D"_blank">htt=
p://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href=3D"https://eur03.safelinks.protection.o=
utlook.com/?url=3Dhttp%3A%2F%2Fwiki.eprints.org%2F&amp;data=3D01%7C01%7Cepr=
ints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f929=
f44d3ebe89669d03ada9d8%7C0&amp;sdata=3D12Jg2aP6vyYrV8abwaxhMVVVq0hr%2BlTihe=
YPs%2BJuTv8%3D&amp;reserved=3D0" originalSrc=3D"http://wiki.eprints.org/" s=
hash=3D"qUzQjdkAwjfApPeeC8F2LdM9tAazPKamUiAx5r+gW5edQ/t3DdRzdIq9nHfw8LpdPzV=
9zzkFPM98mZLmBk/AntRDtKPa9i81U2qwO+QqEi/9+vnflgX76ixXt1yH1ltCDBpXZd3TTNxOqV=
OuuV4nXmI7PYK815pr/AD1ytOuMDc=3D" rel=3D"noreferrer" target=3D"_blank">http=
://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href=3D"https://eur03.safelinks.protection=
.outlook.com/?url=3Dhttp%3A%2F%2Fforum.eprints.org%2F&amp;data=3D01%7C01%7C=
eprints-tech%40ecs.soton.ac.uk%7C83ee5e4166af4eeba08308d768eec531%7C4a5378f=
929f44d3ebe89669d03ada9d8%7C0&amp;sdata=3DCTUJrew1s5XZauegPf5zkAmM2viegYaKX=
e%2F5HfcDtzg%3D&amp;reserved=3D0" originalSrc=3D"http://forum.eprints.org/"=
 shash=3D"a8IJOGK7c/vgKKRt3AAFhMX9o/YEncO7y3I0ctuk3vjkVg5ibgep7wDhN1CDOCb6M=
RKhADX7D+b/3bz5VPuu+OHlpNGZJ8FBGdNactJt/NBOqYxk6A1rvzU+Y3iO6mPWphxgIzylHryv=
obuG6ZdhUvr8d2w+4RrjpwWmW23qS/0=3D" rel=3D"noreferrer" target=3D"_blank">ht=
tp://forum.eprints.org/</a><br>
</blockquote></div>

--0000000000007242fb05974c1490--

--===============0822682083695233353==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/

--===============0822682083695233353==--