Changeset 24087

Show
Ignore:
Timestamp:
25.05.2011 20:10:55 (8 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed Papitha's problem with GS3 not embedding thumbnails of image collections in links that take one to the source document. Katherine explained that we will need to modify the config_format.xsl in interfaces to have process a gsf:link for type=source. Dr Bainbridge found that we needed to make use of the httpPath variable to help us construct the URL path for the link and that we additionally needed to request the assocfilepath metadata in order to get all the meta needed to complete the URL, so now the GS3 java code requests assocfilemeta as well.

Location:
main/trunk/greenstone3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java

    r22134 r24087  
    7777    } 
    7878 
    79     protected void extractMetadataNames(Element format, HashSet meta_names) { 
     79    protected void extractMetadataNames(Element format, HashSet meta_names) { 
    8080    //NodeList nodes = format.getElementsByTagNameNS("metadata", "http://www.greenstone.org/configformat"); 
    81     NodeList nodes = format.getElementsByTagName("gsf:metadata"); 
    82         for (int i=0; i<nodes.getLength(); i++) { 
    83             Element elem = (Element)nodes.item(i); 
     81    NodeList metadata_nodes = format.getElementsByTagName("gsf:metadata"); 
     82        for (int i=0; i<metadata_nodes.getLength(); i++) { 
     83            Element elem = (Element)metadata_nodes.item(i); 
    8484            StringBuffer metadata = new StringBuffer(); 
    8585            String all = elem.getAttribute("multiple"); 
     
    105105            meta_names.add(metadata.toString()); 
    106106        } 
     107 
     108        // The XSL tranform for 
     109        //   gsf:link type="source"  
     110        // makes use of 'assocfilepath' so need to make sure it's asked for 
     111 
     112        NodeList link_nodes = format.getElementsByTagName("gsf:link"); 
     113            for (int i=0; i<link_nodes.getLength(); i++) { 
     114                Element elem = (Element)link_nodes.item(i); 
     115                String type = elem.getAttribute("type"); 
     116            if (type.equals("source")) { 
     117            meta_names.add("assocfilepath"); 
     118            } 
     119        } 
     120 
    107121    } 
    108122 
  • main/trunk/greenstone3/web/interfaces/default/transform/config_format.xsl

    r23972 r24087  
    3636    </a> 
    3737      </xsl:when> 
     38      <xsl:when test="@type='source'"> 
     39    <a><xslt:attribute name='href'><xslt:value-of  
     40       disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']" />/index/assoc/<xslt:value-of  
     41       disable-output-escaping="yes" select="metadataList/metadata[@name='assocfilepath']" />/<xslt:value-of  
     42       disable-output-escaping="yes" select="metadataList/metadata[@name='Source']" /></xslt:attribute> 
     43      <xsl:apply-templates/> 
     44    </a> 
     45      </xsl:when> 
     46       
    3847      <xsl:otherwise> <!-- a document link --> 
    3948    <xslt:variable name="bookswitch"><xslt:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xslt:variable>