[EP-tech] Link from Abstract/Summary creator to /views/creators/{creator encoded}.html

Brian D. Gregg bdgregg at pitt.edu
Fri Jan 26 14:09:59 GMT 2018


Alan, Matt,

Thank you so much.  That helps us a lot.

Cheers to you both.
-Brian.


-----Original Message-----
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: Friday, January 26, 2018 5:51 AM
To: eprints-tech at ecs.soton.ac.uk
Subject: Re: [EP-tech] Link from Abstract/Summary creator to /views/creators/{creator encoded}.html

Thanks Matt,
That looks like a better option for avoiding the issues with feeds / exporters.  Another item on my list of things to sort, later!
Cheers,
Alan

-----Original Message-----
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Matthew Kerwin
Sent: 26 January 2018 10:12
To: eprints-tech at ecs.soton.ac.uk
Subject: Re: [EP-tech] Link from Abstract/Summary creator to /views/creators/{creator encoded}.html

Ah, that's how ours is different.  We *didn't* put a special renderer in the sub-field, instead we explicitly invoke renderers in the various citations.  For example, in citations/eprint/default.xml we do something like this:

~~~xml
<choose>
  <when test="is_set(creators)">
    <print expr="$item.render_value_special( 'QUT::EPrints::Utils::render_names_with_person_link', 'creators' )" />
  </when>
  <when test="type.one_of('book') and is_set(editors)">
    <print expr="$item.render_value_special( 'QUT::EPrints::Utils::render_names_with_person_link', 'editors' )" /> (Ed<if test="length(editors_name) gt 1">s</if>.)
  </when>
</choose>
~~~

... where the custom render_names_with_person_link subroutine does the <A> and URL generation.  Then we also have a second citation, .../abbrev.xml, which just does the usual:

~~~xml
<choose>
  <when test="is_set(creators_name)">
    <print expr="creators_name" />
  </when>
  <when test="type.one_of('book') and is_set(editors_name)">
    <print expr="editors_name" /> (Ed<if test="length(editors_name) gt
1">s</if>.)
  </when>
</choose>
~~~

...so we can choose between linked or non-linked citations.

~~~xml
<epc:print expr="$item.citation('abbrev')" /> ~~~

It's worth noting that, deep down, our render_names_with_person_link subroutine uses `EPrints::Utils::escape_filename` to convert the id field to a usable URL.

Cheers


On 26 January 2018 at 18:37, Alan.Stiles <alan.stiles at open.ac.uk> wrote:
> Hi Brian,
>
> We also have a similar thing, e.g. 
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Foro.op
> en.ac.uk%2F35731%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb46
> 2d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=S4bwIb
> E%2FgGNBFcVaGBRwvfeQUZry0%2FoEp%2BJ4Lw%2BbVKY%3D&reserved=0
> (currently
> v3.3.15 plus local customisations)
>
> It is a custom local_author_render function defined in 
> cfg.d/eprints_render.pl which checks each author entry for a value in 
> author_id (as per Matthew’s system) and, if that exists, uses it to 
> render the name as a link to the author view based on that id, 
> otherwise just renders the author name.
>
> It is defined as a render_value in eprint_fields.pl
>
>
>
> $c->{fields}->{eprint} = [
>
>
>
>           {
>
>             'name' => 'creators',
>
>             'type' => 'compound',
>
>             'multiple' => 1,
>
>             'fields' => [
>
>                           {
>
>                             'sub_name' => 'name',
>
>                             'type' => 'name',
>
>                             'hide_honourific' => 1,
>
>                             'hide_lineage' => 1,
>
>                             'family_first' => 1,
>
>                             'render_value' => \&local_author_render,
>
>
>
>                           },
>
>                           {
>
>                             'sub_name' => 'id',
>
>                             'type' => 'authorid',
>
>                             'input_cols' => 20,
>
>                             'allow_null' => 1,
>
>                           },
>
>>
>                 ]}];
>
>
>
> NOTE: It will probably have knock on effects in how the author name is 
> rendered elsewhere though – like in exports and coversheet renderers!
>
>
>
> Regards,
>
> Alan
>
>
>
> From: eprints-tech-bounces at ecs.soton.ac.uk
> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Matthew 
> Kerwin
> Sent: 26 January 2018 01:17
> To: eprints-tech at ecs.soton.ac.uk
> Subject: Re: [EP-tech] Link from Abstract/Summary creator to 
> /views/creators/{creator encoded}.html
>
>
>
>
>
>
>
> On 26 Jan. 2018 03:50, "Brian D. Gregg" <bdgregg at pitt.edu> wrote:
>
> All,
>
>
>
> Has anyone looked into linking creators from an Abstract/Summary page 
> to the /views/creators/{creator encoded}.html page?  If so, can you 
> explain how you did so?  We have a request to provide that link and 
> I've not come up with what I feel is a good solution yet so I'm asking the group here.
>
>
>
> I suspect that this would be a custom render function to alter the 
> displayed list of the creators.  But in addition, is there an existing 
> function that takes the creators name and translates it to the 
> /views/creators/{creator encoded}.html value that we can just use just to create the link?
>
>
>
> Thanks,
>
> -Brian
>
>
>
> We have those sorts of links in the citation (eg.
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Feprin
> ts.qut.edu.au%2F115171%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464
> c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=
> 4yPWWsbhARmca%2B1se%2BuCJYifUTtyfgJ51qIdcXHEOfc%3D&reserved=0 )
>
>
>
> It's a public holiday here today so I'll have to get back to you on 
> exactly how it's set up, but from memory it's a custom renderer inside 
> the eprint_creators field. I can't remember for sure how it's invoked 
> from the citation.
>
>
>
> Since the 'creators' view is not vanilla, it's necessarily one you 
> built yourself, so no one else can tell you how the mapping from 
> creator to encoded view key works. In our case eprint_creators has an 
> 'id' subfield, alongside name and all that.
>
>
>
> Cheers
>
> --
>
> Matthew Kerwin
>
> -- The Open University is incorporated by Royal Charter (RC 000391), 
> an exempt charity in England & Wales and a charity registered in 
> Scotland (SC 038302). The Open University is authorised and regulated 
> by the Financial Conduct Authority in relation to its secondary activity of credit broking.
>
> *** Options:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailma
> n.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&data=01%7C01%7Cb
> dgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04ee
> b87cc3a526112fd0d%7C1&sdata=%2FGtmGGzxXfbJsFWtywglsW5JnJTcejUvYEtayKZA
> 9s4%3D&reserved=0
> *** Archive: 
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ep
> rints.org%2Ftech.php%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8
> cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=bg
> fippYO3J9r%2BArv4UU8C6j8nkfZ8hzDJ%2BkzJCJOZuA%3D&reserved=0
> *** EPrints community wiki: 
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.e
> prints.org%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d8405
> 08d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=Z3YzSF3BquQY
> C5HmzEOcZP5pVY3g2rrWNkqRknubo60%3D&reserved=0
> *** EPrints developers Forum: 
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.
> eprints.org%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840
> 508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=JKlhlU77hmr
> 3%2F1Vt%2FkexoPvDNTxWS5XjHNXjCUitaDI%3D&reserved=0
>



--
  Matthew Kerwin
  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmatthew.kerwin.net.au%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=qDIt%2B1zAJxIn1snTbd0Mk7X0NqFm4OWC3ML7mdMAZkw%3D&reserved=0

*** Options: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=%2FGtmGGzxXfbJsFWtywglsW5JnJTcejUvYEtayKZA9s4%3D&reserved=0
*** Archive: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=bgfippYO3J9r%2BArv4UU8C6j8nkfZ8hzDJ%2BkzJCJOZuA%3D&reserved=0
*** EPrints community wiki: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=Z3YzSF3BquQYC5HmzEOcZP5pVY3g2rrWNkqRknubo60%3D&reserved=0
*** EPrints developers Forum: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=JKlhlU77hmr3%2F1Vt%2FkexoPvDNTxWS5XjHNXjCUitaDI%3D&reserved=0
-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority in relation to its secondary activity of credit broking.

*** Options: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=%2FGtmGGzxXfbJsFWtywglsW5JnJTcejUvYEtayKZA9s4%3D&reserved=0
*** Archive: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=bgfippYO3J9r%2BArv4UU8C6j8nkfZ8hzDJ%2BkzJCJOZuA%3D&reserved=0
*** EPrints community wiki: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=Z3YzSF3BquQYC5HmzEOcZP5pVY3g2rrWNkqRknubo60%3D&reserved=0
*** EPrints developers Forum: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7Cbdgregg%40pitt.edu%7C57391464c8cb462d840508d564ab5160%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1&sdata=JKlhlU77hmr3%2F1Vt%2FkexoPvDNTxWS5XjHNXjCUitaDI%3D&reserved=0



More information about the Eprints-tech mailing list