[EP-tech] Re: adding link to eprint in phrase

Sebastien Francois sf2 at ecs.soton.ac.uk
Thu Nov 14 14:51:32 GMT 2013


On 14/11/13 14:45, stof999 at cmdt.ch wrote:
> hello
>
> we add a duplication check whenimporting DOI publications.
> would be nice for the user, when in the message window a link to the
> existing eprint is showed.
>
> the phrase with absolute path to the already existing eprint works fine:
>
> <epp:phrase id="Plugin/Import/DOI:doiDuplicate">doi:<epc:pin
> name="doi"/> is already stored in Eprint
> 	<a href='boris.stof003-vb-ub124/id/eprint/19'>19</a>
> 	<br/><br/>
> 	The following authors from the University of Bern are connected with
> this publication:<br/><epc:pin name="contrib"/><br/><br/>
> 	If an author is missing, please contact <a
> href="mailto:{$config{adminemail}}"><epc:print
> expr="$config{adminemail}" /></a>
> </epp:phrase>
>
>
> does someone know how to add the link as pin?
>
> assembling the link in the plugin code:
>
> my $eprintlink = "<a href='" .
> $plugin->{session}->get_repository->get_conf("host") . "/id/eprint/" .
> 						$values[0] . "'>" .
> 						$values[0] . "</a>";
>
> and use the string as pin gives an error:
> ###Unhandled warning in Import::DOI: parameter "eprintlink" is not an
> XML node when making phrase "Plugin/Import/DOI:doiDuplicate"

It's complaining that $eprintlink is a string rather than a DOM object

my $eprintlink = $session->make_element( 'a', href => $eprint->get_url );
$eprintlink->appendChild( $session->make_text( _your_label_ ) );

Seb.



More information about the Eprints-tech mailing list