Changeset 23968
- Timestamp:
- 2011-04-29T13:19:47+12:00 (13 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
r23790 r23968 633 633 if (href.indexOf("?")!=-1) { 634 634 String[] parts = StringUtils.split(href, "\\?", -1); 635 parts[1] = StringUtils.replace(parts[1], ":", "%3A"); 636 href = parts[0]+"?"+parts[1]; 635 if (parts.length == 1) 636 { 637 parts[0] = StringUtils.replace(parts[0], ":", "%3A"); 638 href = "?"+parts[0]; 639 } 640 else 641 { 642 parts[1] = StringUtils.replace(parts[1], ":", "%3A"); 643 href = parts[0]+"?"+parts[1]; 644 } 645 637 646 } 638 647 a.setAttribute("href", response.encodeURL(href)); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r23938 r23968 223 223 addPlugins(plugin_list); 224 224 if (plugin_list != null){ 225 Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlug ");225 Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlugin"); 226 226 if (plugin_elem != null) { 227 227 //get the option 228 Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "- tidy_html");228 Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-use_realistic_book"); 229 229 if (option_elem != null) { 230 230 useBook = true; -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java
r23815 r23968 52 52 53 53 if (coll_name.equals("")) { 54 coll_name = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, "p.c").getAttribute(GSXML.VALUE_ATT); 54 Element pc_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, "p.c"); 55 if(pc_param != null) 56 { 57 coll_name = pc_param.getAttribute(GSXML.VALUE_ATT); 58 } 55 59 } 56 60 -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
r23839 r23968 205 205 else if(excerptTag != null) 206 206 { 207 /* 207 208 // define a list 208 209 209 210 Node selectedElement = modifyNodesByTagRecursive(transformed_page, excerptTag); 211 */ 212 213 Node selectedElement = getNodeByTagRecursive(transformed_page, excerptTag); 210 214 return selectedElement; 215 211 216 } 212 217 return transformed_page; … … 285 290 protected Node transformPage(Element page) { 286 291 287 boolean allowsClientXSLT = (Boolean)config_params.get(GSConstants.ALLOW_CLIENT_SIDE_XSLT); 288 //System.out.println("Client side transforms allowed? " + allowsClientXSLT); 289 290 // Force it back to traditional 291 if(!allowsClientXSLT) 292 config_params.put(GSConstants.INTERFACE_NAME, "traditional"); 293 294 Element request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM); 295 String output = request.getAttribute(GSXML.OUTPUT_ATT); 296 297 String currentInterface = (String)config_params.get(GSConstants.INTERFACE_NAME); 298 //System.out.println("Current output mode is: " + output + ", current interface name is: " + currentInterface); 299 300 if(allowsClientXSLT) { 301 if((currentInterface.equals("default") && output.equals("html")) || output.equals("server")) 302 // Switch the interface 303 config_params.put(GSConstants.INTERFACE_NAME, "traditional"); 304 else if(currentInterface.equals("traditional") && !output.equals("html")) 305 // The reverse needs to happen too 306 config_params.put(GSConstants.INTERFACE_NAME, "default"); 292 boolean allowsClientXSLT = (Boolean)config_params.get(GSConstants.ALLOW_CLIENT_SIDE_XSLT); 293 //System.out.println("Client side transforms allowed? " + allowsClientXSLT); 294 295 String currentInterface = (String)config_params.get(GSConstants.INTERFACE_NAME); 296 297 Element request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM); 298 String output = request.getAttribute(GSXML.OUTPUT_ATT); 299 300 //System.out.println("Current output mode is: " + output + ", current interface name is: " + currentInterface); 301 302 if(allowsClientXSLT) { 303 if(!currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX) && output.equals("html")) 304 { 305 System.out.println("output is html and we are not currently using a client side version, switching"); 306 // Switch the interface 307 config_params.put(GSConstants.INTERFACE_NAME, currentInterface.concat(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX)); 308 } 309 else if((currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX) && !output.equals("html")) || output.equals("server")) 310 { 311 // The reverse needs to happen too 312 config_params.put(GSConstants.INTERFACE_NAME, currentInterface.substring(0, currentInterface.length() - GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX.length())); 313 } 314 } 315 else if (currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX)) 316 { 317 config_params.put(GSConstants.INTERFACE_NAME, currentInterface.substring(0, currentInterface.length() - GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX.length())); 307 318 } 308 319 … … 773 784 String stylesheet = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.SITE_NAME), collection, (String)this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces, name); 774 785 if (stylesheet==null) { 775 logger.info(" cant find stylesheet for "+name);776 } 777 logger. error("stylesheet:"+stylesheet);786 logger.info(" Can't find stylesheet for "+name); 787 } 788 logger.debug("Stylesheet: "+stylesheet); 778 789 return stylesheet; 779 790 } -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java
r23791 r23968 28 28 public static final String DEFAULT_LANG = "default_lang"; 29 29 public static final String ALLOW_CLIENT_SIDE_XSLT = "allow_client_side_xslt"; 30 public static final String CLIENT_SIDE_XSLT_INTERFACE_SUFFIX = "-client-xslt"; 30 31 31 32 public static final String META_RELATION_SEP = "_"; -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java
r23269 r23968 50 50 public static final String EXPAND_DOCUMENT = "ed"; 51 51 public static final String EXPAND_CONTENTS = "ec"; 52 public static final String REALISTIC_BOOK = "book"; 52 53 53 54 // used for filtering out a piece of the final page … … 80 81 addParameter(EXPAND_DOCUMENT, false); 81 82 addParameter(EXPAND_CONTENTS, false); 83 addParameter(REALISTIC_BOOK, false); 84 82 85 //addParameter(); 83 86 // ugly hack so we don't save the extlink param -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r23791 r23968 687 687 public static void addParametersToList(Document owner, Element param_list, 688 688 HashMap params) { 689 if (params == null) 690 { 691 return; 692 } 693 689 694 Set items = params.entrySet(); 690 695 Iterator i = items.iterator(); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
r23791 r23968 277 277 } 278 278 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 } 279 311 } 280 312
Note:
See TracChangeset
for help on using the changeset viewer.