[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EP-tech] RT1/Crosswalks - multiple dates
Morning all,
John and Christopher; thank you both for the help.
Apologies for the confusion; it was the Symplectic solution that I needed.
I was kicking myself when I received Christopher's response because it was
so close, but it was Johns' that fixed it, which I would never have got by
myself. I think I had better do some more reading about how the crosswalks
work...
Thanks,
James
On Thu, Dec 13, 2018 at 3:50 PM John Salter <J.Salter at leeds.ac.uk> wrote:
> Hi James,
>
> Chris' example would fix the rendering of the data within EPrints, but I _
> *think*_ you were wanting to be able to map a value coming from
> Symplectic (in an unexpected way), to the correct option in EPrints. Is
> that right?
>
>
>
> If so, something like (as the first test):
>
> <xsl:when test="$name='publication-date' and
> /atom:feed/atom:category[2]/@term ='
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.symplectic.co.uk%2Fpublications%2Fatom-terms%2F1.0%2Fpresentation_material&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=2FGKi%2F%2FQsv7x3K2nFb0CgZO8p0PZxagRcSQXaYgLCNo%3D&reserved=0
> '>presented</xsl:when>
>
> or
>
> <xsl:when test="$name='publication-date' and
> /atom:feed/atom:category[2]/@label
> ='presentation_material'>presented</xsl:when>
>
> should work.
>
>
>
>
>
> The XSLT James provided looks like the Symplectic-to-EPrints crosswalks
> toolkit (RT1) - e.g.
>
>
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fcrosswalks_sgul%2Fblob%2Fmaster%2Fsymplectic_xwalks_eprints_sgul.xsl%23L151-L166&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=yUUOx6aaOnEiFCvyixXL0EqAeuPcgBi6%2BkLd8n%2BCFK0%3D&reserved=0
> ).
>
>
>
> The mapping for Symplectic item types to EPrints item types uses this:
>
>
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fcrosswalks_sgul%2Fblob%2Fmaster%2Fsymplectic_xwalks_eprints_sgul.xsl%23L261-L266&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=dBG5eaYvUxPLkoLelEJmSmQqmD6nmYjAAlM3H%2FmT0p8%3D&reserved=0
>
> which in turn references this:
>
>
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fcrosswalks_sgul%2Fblob%2Fmaster%2Fsymplectic_xwalks_eprints_sgul.xsl%23L295-L312&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=vDSRHYfE7dO30my8BcBVOJ8nhGCrtgRkfr1hLq25zcw%3D&reserved=0
>
>
>
> My proposed solution above uses the same element in the incoming XML - so
> it should work OK. The '@term' might be slightly more future-proof than the
> '@label' variation.
>
>
>
> And you're right about things like 'type' being used all over the place -
> so much so that your question makes sense from both 'it's EPrints XSL' and
> 'it's Symplectic XSL' angles!
>
>
>
> Hope that helps!
>
> john
>
>
>
> *From:* eprints-tech-bounces at ecs.soton.ac.uk [mailto:
> eprints-tech-bounces at ecs.soton.ac.uk] *On Behalf Of *Christopher
> Gutteridge via Eprints-tech
> *Sent:* 13 December 2018 15:17
> *To:* eprints-tech at ecs.soton.ac.uk; James Kerwin <jkerwin2101 at gmail.com>
> *Subject:* Re: [EP-tech] RT1/Crosswalks - multiple dates
>
>
>
> All the "logic" should go within the test=""
>
> The scripting terms are documented at https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPScript&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=piZTmZ0qLIQ8o2a8qpWMOIDrZsMp5e%2F3tPk4rNrK7Fw%3D&reserved=0
> <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPScript&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=piZTmZ0qLIQ8o2a8qpWMOIDrZsMp5e%2F3tPk4rNrK7Fw%3D&reserved=0>
> and teh XML strucure at https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPrints_Control_Format&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=FpMEcx2jKOqthdly2AnU4zeqKJwtdBWURjW4MggaJe0%3D&reserved=0
> <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPrints_Control_Format&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=FpMEcx2jKOqthdly2AnU4zeqKJwtdBWURjW4MggaJe0%3D&reserved=0>
>
> here's the tweaks from your example to OK XML & EPScript:
>
>
>
> </xsl:when> test="$name='publication-date' and
> type='presentation_material'>presented</xsl:when>
> * *
> * *
>
> <xsl:when test="$name='publication-date' and
> $type='presentation_material'">presented</xsl:when>
>
> So you were close
>
> see also <xsl:otherwise>
>
>
>
> On 13/12/2018 06:05, James Kerwin via Eprints-tech wrote:
>
> Hello all,
>
>
>
> I recently noticed we had an item type in EPrints that hadn't been set up
> properly (Presentation Material). I have managed to add it to the
> crosswalks and phrases, but I have a problem that I cannot solve with the
> metadata.
>
>
>
> The "Presentation Date" is sent over from the Elements "publication-date"
> field and so has a field name in Eprints of "Published" when I want it to
> say "Presented".
>
>
>
> This is controlled via this bit of code in uol_xwalks_default.xml:
>
>
>
> <!-- ##################### MULTIPLE DATES ##################### -->
>
> <xsl:template match="pubs:date" mode="mapping">
>
> <xsl:param name="name"/>
>
> <xsl:param name="repo_field"/>
>
> <xsl:choose>
>
> <xsl:when test="$repo_field = 'dates'">
>
> <xsl:element name="date">
>
> <xsl:apply-templates select="."/>
>
> </xsl:element>
>
> <xsl:element name="date_type">
>
> * <xsl:choose>*
>
> *<xsl:when test="$name='publication-date'">published</xsl:when>*
>
> * <xsl:when
> test="$name='acceptance-date'">accepted</xsl:when>*
>
> * <xsl:when
> test="$name='filed-date'">filed</xsl:when>*
>
> * <xsl:when
> test="$name='online-publication-date'">published_online</xsl:when>*
>
> * </xsl:choose>*
>
> </xsl:element>
>
> </xsl:when>
>
> <xsl:otherwise>
>
> <xsl:apply-templates select="." />
>
> </xsl:otherwise>
>
> </xsl:choose>
>
> </xsl:template>
>
>
>
>
>
> It is the section in bold that I need to alter and add a condition to.
> Ideally I want to say something along the lines of:
>
>
>
> </xsl:when> test="$name='publication-date' and
> type='presentation_material'>presented</xsl:when>
>
>
>
> but I'm struggling to access the item type. I'm also uncertain as to
> whether the type should be the EPrint field name that was set in another
> crosswalks file, or if I should be using some other nomenclature.
> Complicated further by searching "type" and getting millions of results.
>
>
>
> This isn't particularly urgent or even essential, but if anybody has some
> advice I'd appreciate it.
>
>
>
> Thanks,
>
> James
>
>
>
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>
> *** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=Qm9qR89WldsGBll%2BEp7NNN0yzaqIl08%2F9ol%2BkZlG8mc%3D&reserved=0 <https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=Qm9qR89WldsGBll%2BEp7NNN0yzaqIl08%2F9ol%2BkZlG8mc%3D&reserved=0>
>
> *** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=VKX1R%2FNo0a8MPh8bWTX1jKbTxuwd%2BLjtjkT6%2Fmq5U2I%3D&reserved=0 <https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=VKX1R%2FNo0a8MPh8bWTX1jKbTxuwd%2BLjtjkT6%2Fmq5U2I%3D&reserved=0>
>
> *** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=T%2BYyRfnFK45v5NX2AFjP%2FNfkMiA7hQdwAMJlxzuh630%3D&reserved=0 <https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cf192f55825984f388f5d08d6619f0554%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=T%2BYyRfnFK45v5NX2AFjP%2FNfkMiA7hQdwAMJlxzuh630%3D&reserved=0>
>
>
>
> --
>
> Christopher Gutteridge <totl at soton.ac.uk> <totl at soton.ac.uk>
>
> You should read our team blog at http://blog.soton.ac.uk/webteam/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20181214/cdfb1436/attachment-0001.html