Skip to content

Commit e1678d3

Browse files
luis100claude
andcommitted
fix(emailarchive): use composite title in ingest XSLT
Format: "Custodian <email> (dateStart / dateEnd)" Date range is omitted when both dates are absent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4ecea44 commit e1678d3

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

roda-core/roda-core/src/main/resources/config/crosswalks/ingest/emailarchive.xslt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
<xsl:template match="*:emailArchive">
1616
<!-- Mailbox-level fields (parent AIP) -->
1717

18-
<!-- title: custodian name used as primary display title; emailAddress as fallback -->
19-
<xsl:choose>
20-
<xsl:when test="normalize-space(*:custodian/text()) != ''">
21-
<field name="title"><xsl:value-of select="normalize-space(*:custodian/text())"/></field>
22-
<field name="title_txt"><xsl:value-of select="normalize-space(*:custodian/text())"/></field>
23-
</xsl:when>
24-
<xsl:when test="normalize-space(*:emailAddress/text()) != ''">
25-
<field name="title"><xsl:value-of select="normalize-space(*:emailAddress/text())"/></field>
26-
<field name="title_txt"><xsl:value-of select="normalize-space(*:emailAddress/text())"/></field>
27-
</xsl:when>
28-
</xsl:choose>
18+
<!-- title: "Custodian <email> (dateStart / dateEnd)" -->
19+
<xsl:variable name="titleDateRange">
20+
<xsl:if test="normalize-space(*:dateStart/text()) != '' or normalize-space(*:dateEnd/text()) != ''">
21+
<xsl:value-of select="concat(' (', normalize-space(*:dateStart/text()), ' / ', normalize-space(*:dateEnd/text()), ')')"/>
22+
</xsl:if>
23+
</xsl:variable>
24+
<xsl:variable name="titleValue">
25+
<xsl:value-of select="concat(normalize-space(*:custodian/text()), ' &lt;', normalize-space(*:emailAddress/text()), '&gt;', $titleDateRange)"/>
26+
</xsl:variable>
27+
<xsl:if test="normalize-space($titleValue) != ''">
28+
<field name="title"><xsl:value-of select="$titleValue"/></field>
29+
<field name="title_txt"><xsl:value-of select="$titleValue"/></field>
30+
</xsl:if>
2931

3032
<!-- level is always "item" for an email mailbox archive -->
3133
<field name="level">item</field>

0 commit comments

Comments
 (0)