Closed drn05r closed 4 months ago
There is a potential for this to break or at least make the output from /cgi/schema inaccurate. I would advise that if such a function is used the default return value should be one that encompasses all possible options.
This can be done by configuring the workflow as follows:
<epc:choose>
<epc:when test="type = 'article'">
<field ref="license" set_name="licenses_for_article"/>
</epc:when>
<epc:otherwise>
<field ref="license"/>
</epc:otherwise>
</epc:choose>
It does mean you need to define a separate set of phrases for licenses_for_article. You should probably do something like the following to make sure license typename phrases are consistent:
<epp:phrase id="licenses_for_article_typename_cc_by_nd_4" ref="licenses_typename_cc_by_nd_4"/>
You need not for the licence description phrases (e.g. licenses_for_article_description_cc_by_nd_4
) as it will not know what namedset was used it will just assume the one in the field configuration, so it is important that those license description phrases are present.
It may be the case that you want to present a different set of options for a field based on the values already set for an existing field (e.g. an eprint's
type
). At the moment this cannot be done. However, as subject fields can set set their top to a function (#249) it should be possible to do something similar forset_name