document_admin_default_xsl.html

 1   <?xml version="1.0"?>
 2   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 3   
 4       <xsl:output method="html" indent="yes"/>
 5   
 6   
 7       <xsl:template match="${document_type.code}"> 
 8           <p>
 9               <strong>#i18n{document.document_admin_default_xsl.labelTitle} :  </strong>
 10               <xsl:value-of select="document-title" />
 11           </p>
 12           <p>
 13               <strong>#i18n{document.document_admin_default_xsl.labelSummary} :  </strong>
 14               <xsl:value-of select="document-summary" />
 15           </p>
 16           <#list document_type.attributes as attribute>
 17           <p>
 18                <xsl:apply-templates select="document" />            
 19           </p>
 20           <p>
 21               <strong>${attribute.name} : </strong>
 22   			<#if attribute.codeAttributeType = "richtext" || attribute.codeAttributeType = "internallink">
 23   				<xsl:if test="${document_type.code}-${attribute.code}/text() != ''">
 24   					<div>
 25   						<xsl:value-of disable-output-escaping="yes" select="${document_type.code}-${attribute.code}" />
 26   					</div>
 27   				</xsl:if>
 28   			<#else> 
 29   	            <xsl:choose>
 30   	                <xsl:when test="${document_type.code}-${attribute.code}/file-resource!=''">
 31   	                    <xsl:apply-templates select="${document_type.code}-${attribute.code}/file-resource" />
 32   	                </xsl:when>
 33   	                <xsl:otherwise>
 34   	                    <xsl:value-of select="${document_type.code}-${attribute.code}" />
 35   	                </xsl:otherwise>        
 36   	            </xsl:choose>
 37   			</#if>
 38            </p>
 39           </#list>
 40       </xsl:template>
 41       <xsl:template match="document">
 42           <p>            
 43               <strong><xsl:value-of select="document-title" /></strong>
 44           </p>
 45           <p>
 46               <xsl:value-of select="document-summary" /> 
 47           </p>
 48       </xsl:template>
 49       <xsl:template match="file-resource">
 50           <xsl:choose>
 51               <xsl:when test="(resource-content-type='image/jpeg' or resource-content-type='image/jpg' or  resource-content-type='image/pjpeg' or resource-content-type='image/gif' or resource-content-type='image/png')">
 52                   <img src="servlet/plugins/document/resource?id={resource-document-id}&amp;id_attribute={resource-attribute-id}&amp;working_content=true" align="right" />
 53               </xsl:when>
 54               <xsl:when test="(resource-content-type='application/pdf')">
 55                   <a href="servlet/plugins/document/resource?id={resource-document-id}&amp;id_attribute={resource-attribute-id}&amp;working_content=true"> 
 56                       <img src="images/local/skin/plugins/document/filetypes/pdf.png" />
 57                   </a>
 58               </xsl:when>
 59               <xsl:when test="(resource-content-type='application/binary')">
 60                   <a href="servlet/plugins/document/resource?id={resource-document-id}&amp;id_attribute={resource-attribute-id}&amp;working_content=true"> 
 61                       <img src="images/local/skin/plugins/document/filetypes/compressed.png" />
 62                   </a>
 63               </xsl:when>
 64               <xsl:when test="(resource-content-type='video/mpeg')">
 65                   <a href="servlet/plugins/document/resource?id={resource-document-id}&amp;id_attribute={resource-attribute-id}&amp;working_content=true"> 
 66                       <img src="images/local/skin/plugins/document/filetypes/video.png" />
 67                   </a>
 68               </xsl:when>
 69               <xsl:when test="(resource-content-type='audio/mpeg')">
 70                   <a href="servlet/plugins/document/resource?id={resource-document-id}&amp;id_attribute={resource-attribute-id}&amp;working_content=true"> 
 71                       <img src="images/local/skin/plugins/document/filetypes/audio.png" />
 72                   </a>
 73               </xsl:when>
 74               <xsl:otherwise>
 75                   <a href="servlet/plugins/document/resource?id={resource-document-id}&amp;id_attribute={resource-attribute-id}&amp;working_content=true"> 
 76                       <img src="images/local/skin/plugins/document/filetypes/file.png" />
 77                   </a>
 78               </xsl:otherwise>        
 79           </xsl:choose>
 80       </xsl:template>
 81   
 82   </xsl:stylesheet>
 83