Changeset 25999

Show
Ignore:
Timestamp:
23.07.2012 14:38:25 (7 years ago)
Author:
xiao
Message:

gslib file may be non-existent in some servlets (it's not there for flax and not necessary for it), therefore the code can't assume it exists and try to use it.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java

    r25988 r25999  
    582582        try 
    583583        { 
    584             libraryXsl = getDoc(this.getGSLibXSLFilename()); 
    585             String errMsg = ((XMLConverter.ParseErrorHandler) parser.getErrorHandler()).getErrorMessage(); 
    586             if (errMsg != null) 
    587             { 
    588                 return XMLTransformer.constructErrorXHTMLPage("Error loading xslt file: " + this.getGSLibXSLFilename() + "\n" + errMsg); 
     584            String gsLibFile = this.getGSLibXSLFilename(); 
     585            if(new File(gsLibFile).exists()) { 
     586                libraryXsl = getDoc(gsLibFile); 
     587                String errMsg = ((XMLConverter.ParseErrorHandler) parser.getErrorHandler()).getErrorMessage(); 
     588                if (errMsg != null) 
     589                { 
     590                    return XMLTransformer.constructErrorXHTMLPage("Error loading xslt file: " + this.getGSLibXSLFilename() + "\n" + errMsg); 
     591                } 
    589592            } 
    590593        } 
     
    619622 
    620623            Element l = skinAndLibraryXsl.createElement("libraryXsl"); 
    621             Element libraryXsl_el = libraryXsl.getDocumentElement(); 
    622             l.appendChild(skinAndLibraryXsl.importNode(libraryXsl_el, true)); 
     624            if(libraryXsl  != null) { 
     625                Element libraryXsl_el = libraryXsl.getDocumentElement(); 
     626                l.appendChild(skinAndLibraryXsl.importNode(libraryXsl_el, true)); 
     627            }    
    623628            root.appendChild(l); 
     629             
    624630            //System.out.println("Skin and Library XSL are now together") ; 
    625631