EPrints Technical Mailing List Archive

Message: #07604


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] RT1/Crosswalks - multiple dates


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 ='http://www.symplectic.co.uk/publications/atom-terms/1.0/presentation_material'>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://github.com/eprintsug/crosswalks_sgul/blob/master/symplectic_xwalks_eprints_sgul.xsl#L151-L166 ).

 

The mapping for Symplectic item types to EPrints item types uses this:

https://github.com/eprintsug/crosswalks_sgul/blob/master/symplectic_xwalks_eprints_sgul.xsl#L261-L266

which in turn references this:

https://github.com/eprintsug/crosswalks_sgul/blob/master/symplectic_xwalks_eprints_sgul.xsl#L295-L312

 

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@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Christopher Gutteridge via Eprints-tech
Sent: 13 December 2018 15:17
To: eprints-tech@ecs.soton.ac.uk; James Kerwin <jkerwin2101@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://wiki.eprints.org/w/EPScript and teh XML strucure at https://wiki.eprints.org/w/EPrints_Control_Format

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/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/



-- 
Christopher Gutteridge <totl@soton.ac.uk> 
You should read our team blog at http://blog.soton.ac.uk/webteam/