Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow namedset to use vary using function #389

Closed
drn05r opened this issue Jun 17, 2024 · 2 comments
Closed

Allow namedset to use vary using function #389

drn05r opened this issue Jun 17, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@drn05r
Copy link
Contributor

drn05r commented Jun 17, 2024

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 for set_name

@drn05r drn05r added the enhancement New feature or request label Jun 17, 2024
@drn05r drn05r added this to the 3.4.6 milestone Jun 17, 2024
@drn05r drn05r self-assigned this Jun 17, 2024
@drn05r
Copy link
Contributor Author

drn05r commented Jun 19, 2024

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.

@drn05r
Copy link
Contributor Author

drn05r commented Jun 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant