[EP-tech] Re: Handles in EPrints
Jose Martin
J.Martin at ulcc.ac.uk
Tue Jan 8 18:10:45 GMT 2013
I think the following value for the HS_NAMESPACE entry would do the trick:
<namespace>
<template delimiter="/">
<foreach>
<if value="type" test="equals" expression="URL">
<if value="extension" test="matches" expression="repo_id1(/.*)?" parameter="x">
<value data= "http://your.repo1.url${x[1]}" />
</if>
<else>
<if value="extension" test="matches" expression="repo_id2(/.*)?" parameter="y">
<value data= "http://your.repo2.url${y[1]}" />
</if>
<else>
<notfound/>
</else>
</else>
</if>
<else>
<value />
</else>
</foreach>
</template>
</namespace>
doing:
http://hdl.handle.net/<your_prefix>/repo_id1/xyz -> http://your.repo1.url/xyz
http://hdl.handle.net/<your_prefix>/repo_id2/xyz -> http://your.repo2.url/xyz
http://hdl.handle.net/<your_prefix>/*not repo_id1 or repo_id2* -> not found
-----Original Message-----
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Ian Stuart
Sent: 08 January 2013 10:33
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Re: Handles in EPrints
The problem I had with handle servers was adding a new record: having created item 1234 in the repo, there was no way to inject that into the handle server.
Your, what I would call "proxy pass", solution looks good. Can it be extended so one could do:
http://hdl.handle.net/<your_prefix>/repo_id1/xyz -> http://your.repo1.url/xyz
-and-
http://hdl.handle.net/<your_prefix>/repo_id2/xyz -> http://your.repo2.url/xyz
?
('cos *that* would be really useful!)
On 08/01/13 09:53, Jose Martin wrote:
> In case someone is working with the Handle System (migrating from
> DSpace to EPrints, for instance), version 7 brings template handles
> which make it much easier to provide an EPrints repository with persistent URLs.
>
> While previous versions required a new record to be created in the
> local Handle server database for every persistent URL like
> http://hdl.handle.net/<prefix>/<item_id> to be resolved, we are now
> able to simply define a template that will map any
>
> http://hdl.handle.net/<your_prefix>/xyz
>
> to
>
> http://your.repo.url/xyz
>
> Assuming the following scenario:
>
> - 7.x Handle server set up and running
>
> - A prefix (institutional id registered in the Handle System) homed on
> that server. We'll use 123456 for this example
>
> - Your EPrints repository is located at http://your.repo.url
>
> Here is how:
>
> 1. For handle 123456: create a Simple URL with the value
> http://your.repo.url
>
> 2. For handle 0.NA/123456: add an HS_NAMESPACE entry with the
> following
> UTF8 Text value:
>
> <namespace>
>
> <template delimiter="/">
>
> <foreach>
>
> <if value="type" test="equals" expression="URL">
>
> <value data= "${data}/${extension}" />
>
> </if>
>
> <else>
>
> <value />
>
> </else>
>
> </foreach>
>
> </template>
>
> </namespace>
>
> And we're done! Any URL with the format http://hdl.handle.net/123456/*
> will be resolved as http://your.repo.url/*. Even non-valid handles,
> but you get a lightweight local handle server that does the job.
>
> Especially dedicated to Ian and John, after our handles conversation at
> OR2012 :)
>
> Cheers,
>
> Jose
--
Ian Stuart.
Developer: ORI, RJ-Broker, and OpenDepot.org Bibliographics and Multimedia Service Delivery team, EDINA, The University of Edinburgh.
http://edina.ac.uk/
This email was sent via the University of Edinburgh.
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
*** 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/
More information about the Eprints-tech
mailing list