[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] RT1/Crosswalks - multiple dates



All the "logic" should go within the test=""

The scripting terms are documented at https://wiki.eprints.org/w/EPScript<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPScript&data=01%7C01%7C%7Cd6df61610aca4b04c4e008d6610e08f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=0BoHjAupnde35Nq6GYwNR%2BQIX9LSE7k4A64alB9EH18%3D&reserved=0> and teh XML strucure at https://wiki.eprints.org/w/EPrints_Control_Format<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPrints_Control_Format&data=01%7C01%7C%7Cd6df61610aca4b04c4e008d6610e08f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=FUx6w%2BNQJFfcPONyyaKxWATOr5fRcmlspqizvOQh%2BZU%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: http://www.eprints.org/tech.php/<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7Cd6df61610aca4b04c4e008d6610e08f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=lAPUqhRId2y69AQfCkEj7EN5ugDOxB44eAnEVLU7pCw%3D&reserved=0>
*** EPrints community wiki: http://wiki.eprints.org/<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7Cd6df61610aca4b04c4e008d6610e08f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=L%2FQGdPf87I2Jq%2BwakZZfYmhI9Tf85811%2B21TkcexcYQ%3D&reserved=0>
*** EPrints developers Forum: http://forum.eprints.org/<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7C%7Cd6df61610aca4b04c4e008d6610e08f6%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=mvokNxr9bJMhxWBqKzR44hSo6mH6JIBz2NwIGeEGbGA%3D&reserved=0>



--
Christopher Gutteridge <totl at soton.ac.uk><mailto: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/20181213/79435078/attachment-0001.html