Hi Elvi,

On 18/01/13 16:19, Nemiz, Elvi wrote:
>
> Thanks for your response. I would like to know if how can I make our
> repository as an authority file, specifically I want to use
> SampleAuthority plugin to lookup to existing names with authority. If
> it's not that complicated, where would I put your suggested sql query
> in SampleAuthority.java if ever I want to use it as the basis for my
> name authority plugin?

Like SampleAuthority, your plugin would need to implement the three
methods from ChoiceAuthority: getMatches, getBestMatch and getLabel.
There is quite a lot of documentation about the expected behaviour of
these methods in ChoiceAuthority.java:
https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthority.java

helix's query just gives you all metadata values where there already is
an authority key. This might be a candidate for getMatches, but of
course it wouldn't compare the name you're about to add to things in the
database. The getMatches method has access to the metadata field
(parameter "field") and to the value that is to be looked up (parameter
"text"), so you could use these to refine the SQL query, eg by looking
up metadata values only in that metadata field and/or only values that
are similar to the value that is to be looked up.

So you'll need to build your SQL query as needed and then invoke it
using one of the query methods in DatabaseManager. You'll then need to
iterate over the results and build a Choice instance for each so your
method can return a Choices instance.

For getBestMatch, you could mimic getBestMatch in SampleAuthority and
just return the first one for starters.

For getLabel, which is used when browsing publications for a given
author, you need to do a reverse lookup, which is a bit more
complicated. But if you use SolrBrowseDAO anyway then this method may
not even get used. For starters, you can always just return the key
parameter that was passed into the method.

> Would it still be possible if I'm using SolrBrowseDAO in my Browse
> Configuration instead of the default? I'm using dspace 3.0, xmlui with
> discovery enabled.  

The above should still work; however as far as I know, discovery and the
solr stats completely ignore all authority keys and use the text values
instead. So you won't get all the benefits of name authority.

cheers,
Andrea

-- 
Dr Andrea Schweer
IRR Technical Specialist, ITS Information Systems
The University of Waikato, Hamilton, New Zealand


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to