[EP-tech] Field description/validation based on eprint type
jpl at plosquare.com
Sat Oct 27 15:35:10 BST 2012
Is it possible to set the online help displayed for a field and the
field validation routine based on the eprint type?
My use case is a field "publication" which has the general meaning
"where the item was published". However, the more specific meaning,
validation and user instructions should depend on the actual item type.
For example, we only wish to allow selection from a predefined list of
journals, on the other hand the user is free to enter whatever they want
for conference items. As far as search is concerned, the entered value
is really a single field.
What I have found so far:
1. It's possible to control some field properties (e.g. "required") and
hide/show fields by modifying the workflow definition (default.xml).
2. NO reference to eprint is accessible anywhere in field_validate.pl
(it's a huge pain, as this is exactly the step where I need it -
validating in eprint_validate.pl seems too late for ergonomic reasons).
3. EPC expressions in phrases.xml don't seem to be useful at all (e.g.
$item evaluates to "FALSE" rather than the eprint).
4. It seems impossible to have a field that is to be displayed in form
only, but not stored in database. I know there is property is_virtual,
but it is attached to field type rather than to a field instance, as I
would desire; subclassing Text.pm or other field types just for this
purpose seems like an overkill.
All these remarks are based on EPrints 3.0.5; I would be also interested
if newer versions are any better.
So far I'm using artificial new fields (along with useless database
fields for each) to achieve what I want, but it seems like such a kludge...
More information about the Eprints-tech