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/util/XSLTUtil.java

    r24117 r24219  
    9797    }
    9898
     99    /** Generates links to equivalent documents for a document with a default document icon/type.
     100     * Links are generated from the parameters: a list of document icons which are each in turn embedded
     101     * in the matching starting link tag in the list of docStartLinks (these starting links link to the
     102     * equivalent documents in another format). Each link's start tag is closed with the corresponding
     103     * closing tag in the docEndLinks list. Parameter token is the list separator. Parameter divider is
     104     * the string that should separate each final link generated from the next.
     105     * Returns a string that represents a sequence of links to equivalent documents, where the anchor is
     106     * a document icon. */
     107    public static String getEquivDocLinks(String token, String docIconsString, String docStartLinksString,
     108                      String docEndLinksString, String divider)
     109    {
     110    String [] docIcons = StringUtils.split(docIconsString, token, -1);
     111    String [] startLinks = StringUtils.split(docStartLinksString, token, -1);
     112    String [] endLinks = StringUtils.split(docEndLinksString, token, -1);
     113
     114    StringBuffer buffer = new StringBuffer();
     115    for(int i = 0; i < docIcons.length; i++) {
     116        if(i > 0) {
     117        buffer.append(divider);
     118        }
     119        buffer.append(startLinks[i]+docIcons[i]+endLinks[i]);
     120    }
     121   
     122    return buffer.toString();
     123    }
     124
    99125   
    100126    public static String tidyWhitespace(String original) {
Note: See TracChangeset for help on using the changeset viewer.