Foundry suppor for ccm-cms-types-contact and ccm-cms-types-person (and all other types which inherit from com.arsdigita.cms.contenttypes.GenericPerson)

git-svn-id: https://svn.libreccm.org/ccm/trunk@3325 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2015-04-09 09:10:31 +00:00
parent ed9c82cc45
commit 0dae87841d
2 changed files with 89 additions and 17 deletions

View File

@ -87,18 +87,16 @@
<xsl:template match="content-item-layout//contact-entries">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:message>
<xsl:value-of select="concat('count contactentries = ', count($contentitem-tree/contactentries))"/>
</xsl:message>
<xsl:if test="$contentitem-tree/contactentries">
<xsl:apply-templates>
<xsl:with-param name="contact-entries"
tunnel="yes"
select="$contentitem-tree/contactentries"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="content-item-layout//contact-entries//contact-entry">
<xsl:template match="content-item-layout//*[ends-with(name(), 'contact-entries')]//contact-entry">
<xsl:param name="contact-entries" tunnel="yes"/>
<xsl:variable name="keyId" select="./@key"/>
@ -115,13 +113,13 @@
</xsl:if>
</xsl:template>
<xsl:template match="content-item-layout//contact-entries//contact-entry//contact-entry-label">
<xsl:template match="content-item-layout//*[ends-with(name(), 'contact-entries')]//contact-entry//contact-entry-label">
<xsl:param name="label" tunnel="yes"/>
<xsl:value-of select="$label"/>
</xsl:template>
<xsl:template match="content-item-layout//contact-entries//contact-entry//contact-entry-value">
<xsl:template match="content-item-layout//*[ends-with(name(), 'contact-entries')]//contact-entry//contact-entry-value">
<xsl:param name="value" tunnel="yes"/>
<xsl:choose>
@ -145,12 +143,52 @@
</xsl:choose>
</xsl:template>
<xsl:template match="content-item-layout//if-contact-entry">
<xsl:param name="contact-entries" tunnel="yes"/>
<xsl:template match="content-item-layout//contact-address">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:if test="$contact-entries[./keyId = ./@key]">
<xsl:apply-templates/>
<xsl:if test="$contentitem-tree/address">
<xsl:apply-templates>
<xsl:with-param name="address"
tunnel="yes"
select="$contentitem-tree/address"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="content-item-layout//*[ends-with(name(),'-address')]//address-text">
<xsl:param name="address" tunnel="yes"/>
<xsl:value-of select="$address/address"/>
</xsl:template>
<xsl:template match="content-item-layout//*[ends-with(name(),'-address')]//postal-code">
<xsl:param name="address" tunnel="yes"/>
<xsl:value-of select="$address/postalCode"/>
</xsl:template>
<xsl:template match="content-item-layout//*[ends-with(name(),'-address')]//city">
<xsl:param name="address" tunnel="yes"/>
<xsl:value-of select="$address/city"/>
</xsl:template>
<xsl:template match="content-item-layout//*[ends-with(name(),'-address')]//state">
<xsl:param name="address" tunnel="yes"/>
<xsl:value-of select="$address/state"/>
</xsl:template>
<xsl:template match="content-item-layout//*[ends-with(name(),'-address')]//country">
<xsl:param name="address" tunnel="yes"/>
<xsl:value-of select="$address/country"/>
</xsl:template>
<xsl:template match="content-item-layout//*[ends-with(name(),'-address')]//iso-country-code">
<xsl:param name="address" tunnel="yes"/>
<xsl:value-of select="$address/isoCountryCode"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -104,7 +104,41 @@
</xsl:template>
<xsl:template match="/content-item-layout//contact">
<xsl:template match="content-item-layout//person-contact-entries">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="contact-type"
select="if(./@contact-type)
then ./@contact-type
else 'commonContact'"/>
<xsl:if test="$contentitem-tree/contacts/contact[@contactType=$contact-type]/contactentries">
<xsl:apply-templates>
<xsl:with-param name="contact-entries"
tunnel="yes"
select="$contentitem-tree/contacts/contact[@contactType=$contact-type]/contactentries"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="content-item-layout//person-address">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="contact-type"
select="if(./@contact-type)
then ./@contact-type
else 'commonContact'"/>
<xsl:if test="$contentitem-tree/contacts/contact[@contactType=$contact-type]/address">
<xsl:apply-templates>
<xsl:with-param name="address"
tunnel="yes"
select="$contentitem-tree/contacts/contact[@contactType=$contact-type]/address"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<!--<xsl:template match="/content-item-layout//contact">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="contact-type"
@ -148,6 +182,6 @@
<xsl:param name="contact-entry-value" tunnel="yes"/>
<xsl:value-of select="$contact-entry-value"/>
</xsl:template>
</xsl:template>-->
</xsl:stylesheet>