Hi Helix84,
        After looking at the various bits of code it would seem that Choice 
Authority is currently tied to the metadata fields and does a lot of the 
processing based on the config supplied ie. choices.plugin.* and uses this info 
in the submission process e.g. DescribeStep.java to hook in the linkage so that 
values for form fields can be supplied (in the renderChoiceSelectField method 
there is the code:

Choices cs = ChoiceAuthorityManager.getManager().getMatches(fieldKey, "", 
coll.getID(), 0, 0, null);
                if (dcValues.length == 0)
                {
                    select.addOption(true, "", "");
                }
                for (Choice c : cs.values)
                {
                    select.addOption(c.value, c.label);
                }

)

It would seem that it would not be a huge amount of work to generalise this to 
any form field if the metadata specific parts were removed.

Are there any people out there who have a really good understanding of this 
particular feature that would be prepared to help work on this (I will be able 
to devote resources to this in the near future)?

Regards,
        Ben
------------------------------------------------------------------
Dr Ben Ryan
Jorum Technical Coordinator (Services)

5.12 Roscoe Building
The University of Manchester
Oxford Road
Manchester
M13 9PL
Tel: 0160 275 6039
E-mail: [email protected]
------------------------------------------------------------------


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of helix84
Sent: 06 September 2012 14:42
To: Benjamin Ryan
Cc: [email protected]
Subject: Re: [Dspace-tech] Choice Authority

On Thu, Sep 6, 2012 at 3:36 PM, Benjamin Ryan <[email protected]> 
wrote:
>                I have used the ChoiceAuthority for metadata fields and 
> after working with the EditProfile code it would seem that it might be 
> possible to use this for any “field” in a form not just the metadata fields.
>
>                Does this sound possible?

Yes, it definitely is doable.

>                What I would like to do is to extend the Profile form 
> to capture the users institution and have the choice list supplied by 
> lookup (I have done this with metadata fields by writing a class to 
> query Solr to provide the values).

That's one way if you're a Java programmer and this is how it's currently 
implemented in DSpace. Can be also done more simply - Solr can return you 
response in XML and you can just parse it in XSL to get the list, then use the 
same Javascript to render the suggestions (IIRC we use jQuery with Autocomplete 
plugin).

Regards,
~~helix84
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to