Ignore:
Timestamp:
2011-05-09T14:37:04+12:00 (13 years ago)
Author:
sjm84
Message:

Updating this branch to match the latest Greenstone3 changes

Location:
main/branches/64_bit_Greenstone/greenstone3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/branches/64_bit_Greenstone/greenstone3

  • main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r18308 r24007  
    2828import org.w3c.dom.Node;
    2929
     30import org.apache.commons.lang3.StringUtils;
     31
    3032/** a class to contain various static methods that are used by the xslt
    3133 * stylesheets
     
    8890
    8991    public static String getNumberedItem(String list, int number) {
    90     String [] items = list.split(",", -1); 
     92    String [] items = StringUtils.split(list, ",", -1);
    9193    if (items.length > number) {
    9294        return items[number];
     
    112114    String [] args = null;
    113115    if (args_str!=null && !args_str.equals("")) {
    114         args = args_str.split(";");
     116        args = StringUtils.split(args_str, ";");
    115117    }
    116118    Dictionary dict = new Dictionary("interface_"+interface_name, lang);
     
    275277    }
    276278   
     279    public static String hashToSectionId(String hashString)
     280    {
     281        if(hashString == null || hashString.length() == 0 || !hashString.startsWith("HASH")) {return "";}
     282       
     283        int firstDotIndex = hashString.indexOf(".");
     284        if(firstDotIndex == -1)
     285        {   
     286            return "";
     287        }
     288       
     289        String sectionString = hashString.substring(firstDotIndex + 1);
     290       
     291        return sectionString;
     292    }
     293   
     294    public static String hashToDepthClass(String hashString)
     295    {
     296        if(hashString == null || hashString.length() == 0 || !hashString.startsWith("HASH")) {return "";}
     297       
     298        String sectionString = hashToSectionId(hashString);
     299       
     300        int count = sectionString.split("\\.").length;
     301       
     302        if (sectionString.equals(""))
     303        {
     304            return "sectionHeaderDepthTitle";
     305        }
     306        else
     307        {
     308            return "sectionHeaderDepth" + count;
     309        }
     310    }
    277311}
    278312
Note: See TracChangeset for help on using the changeset viewer.