[EP-tech] Search form

Adam Field Adam.Field at jisc.ac.uk
Wed Apr 27 09:48:38 BST 2016

Hi Matt / Lessard

I don't think virtual fields will work for searching (if I've understood the problem correctly).  Virtual fields don't store values in the database, and in general, searching is operating on the database.

When I have issues like this, I tend to use automatic fields to solve it.  How about this:

1) Create a new multiple volatile field called all_contributors_unite_ids
2) in eprint_fields_automatic, add code that will pull all the unite_ids of all the creators, editors and contributors and store them in the new field
3) use the that field as the target of your search.

There's a training video on automatic fields here: https://wiki.eprints.org/w/Training_Video:Automatic_Fields

Note that there's one issue with this: if your user records change, you will need to recommit the publications associated with that user record.  You can do with user_fields_automatic -- on commit do a search for eprints with this userid in any of the 'person' fields, and recommit them.


Adam Field
SHERPA services analyst developer

From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of Matthew Brady <Matthew.Brady at usq.edu.au<mailto:Matthew.Brady at usq.edu.au>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Wednesday, 27 April 2016 01:21
To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] Search form

Hi Lessard,

We implemented our system a little differently that Gilles did with Cirad.

We re-used the original creator_id field, and update its contents as the author records get manipulated.  We also wrote custom view render logic for the double hop we make, from creator->author_instance_id->author_id, so our browse by author view (http://eprints.usq.edu.au/view/uniqueauthor/)  is listing the Unique Authors by name, then any cited name used.  Virtual Fields would likely streamline this process a bit more…

There are Training Video’s on the eprints wiki, https://wiki.eprints.org/w/Category:Training_Video

The one I think would suit this application is the Virtual Fields video (https://wiki.eprints.org/w/Training_Video:Virtual_Fields).
From the description…

“Virtual Meta Fields are fields that are not stored in the database, instead
their input and output is programmed. They can be used whenever a default
display-value is not suitable. Since their value is calculated their uses are
limited by one's imagination.”

So you could create a virtual field, that handles all the linkages between datasets, and provides a single point of data for your search screen.

I think I have the process correct in my head, but I am happy for anyone (John, Ian, Adam) to point out any problems with understanding ☺



This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )

Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160427/0102f40e/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6B9928AE-9C97-4E75-8330-7E24168F02D7[1].png
Type: image/png
Size: 1264 bytes
Desc: 6B9928AE-9C97-4E75-8330-7E24168F02D7[1].png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160427/0102f40e/attachment-0001.png 

More information about the Eprints-tech mailing list