Ignore:
Timestamp:
2011-07-01T21:05:19+12:00 (13 years ago)
Author:
ak19
Message:

Thanks to Sam, Veronica and Dr Bainbridge, can finally commit the changes necessary for ticket 449.

File:
1 edited

Legend:

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

    r24198 r24219  
    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") || type.equals("sourcelinkfile")) {
    117             meta_names.add("assocfilepath");
    118             }
    119         }
    120 
     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        } else if (type.equals("sourcelinkfile")) {
     119        meta_names.add("assocfilepath");
     120        //meta_names.add("srclinkFile");
     121        }
     122    }
     123
     124
     125    // get all the metadata necessary for when the user has used "gsf:equivlink"
     126    // so that we can build up the equivlink from the metadata components it needs
     127    link_nodes = format.getElementsByTagName("gsf:equivlinkgs3");
     128    if(link_nodes != null) {     
     129
     130        String[] equivlink_metanames = {"equivDocIcon", "equivDocLink", "/equivDocLink"};
     131
     132        for(int i = 0; i < equivlink_metanames.length; i++) {
     133        StringBuffer metadata = new StringBuffer();
     134        metadata.append("all"); // this means the attr multiple = true;
     135        metadata.append(GSConstants.META_RELATION_SEP);
     136       
     137        metadata.append(GSConstants.META_SEPARATOR_SEP);
     138        metadata.append(','); // attr separator = ","
     139        metadata.append(GSConstants.META_SEPARATOR_SEP);
     140        metadata.append(GSConstants.META_RELATION_SEP);
     141       
     142        // the name of the metadata we're retrieving
     143        metadata.append(equivlink_metanames[i]);
     144        meta_names.add(metadata.toString());
     145        }
     146    }
    121147    }
    122148
Note: See TracChangeset for help on using the changeset viewer.