Re: [EP-tech] Getting Data from the EPrints Database - not urgent

James Kerwin via Eprints-tech <[email protected]>
Newsgroups gmane.comp.web.eprints.devel
Message-ID <EMEW3|407f8974c929f51fc6f97c3c7fdebd83v7SEdZ14eprints-tech-bounces|ecs.soton.ac.uk|CAKkNZ9BgB1ZyBKAOLuSk0b6MRgXWkeGyRZkfozvR_rOmpVh_JQ@mail.gmail.com>
Hi Alan,

Thank you; that was it! I have no idea why I struggled so much with it when
I was first doing it because that seems quite straight forward and I've
used"get_value" to get at other fields elsewhere since then.

My only defence is that it was almost seven months ago and I hadn't been in
the job for long. I'm currently going through past things that I've done
that appear to work and checking them for stupidity and making sure they've
been done the "correct" way.

Thanks for your help!

James



On Thu, Aug 29, 2019 at 12:04 PM Alan.Stiles <[email protected]> wrote:

> Hi James,
>
> Once you have the eprint object, I’d have expected something like
>
>
>
> my $elements_id = $eprint->get_value(“elemid”);
>
>
>
> Though I’m just back from holiday and that’s come from my partially
> functional brain.
>
>
>
> Alan
>
>
>
>
>
> *From:* [email protected] <
> [email protected]> *On Behalf Of *James Kerwin via
> Eprints-tech
> *Sent:* 29 August 2019 11:39
> *To:* [email protected]
> *Subject:* [EP-tech] Getting Data from the EPrints Database - not urgent
>
>
>
> Hello everyone,
>
>
>
> I altered the staff/admin view of our EPrints installation at the start of
> February this year so that it displays both a link to the EPrints record
> and a link to the corresponding Elements record:
>
>
>
> [image: image.png]
>
>
>
> I managed to successfully grab the Elements ID from the Crosswalks and add
> it as a new field in the EPrints database ("eprint" table) under a field
> name of "elemid". The link only shows if an item has an elements ID and so
> far I've not had any problems with it.
>
>
>
> I'm just not sure the way I'm grabbing the elements ID from the eprints
> database is correct. When I get the eprint ID I do the following in my
> local copy of View.pm:
>
>
>
> my $eprint = $self->{processor}->{eprint};
>
> $eprint->id;
>
>
>
> I know there's other STUFF elsewhere in this module that handles getting
> the eprint  and ID. No matter what I do I can't get the Elements ID in this
> way and I have to use a small function to perform a SQL query to get
> "elemid". Is there a way I could more easily/cleanly get the elemid without
> writing a SQL query? I'm assuming there is and I'm totally misunderstanding
> what's happening.
>
>
>
> Thanks,
>
> James
> -- The Open University is incorporated by Royal Charter (RC 000391), an
> exempt charity in England & Wales and a charity registered in Scotland (SC
> 038302). The Open University is authorised and regulated by the Financial
> Conduct Authority in relation to its secondary activity of credit broking.
>

*** 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/
image001.png (image/png, 47.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.