Changeset 25988

Show
Ignore:
Timestamp:
19.07.2012 15:39:33 (7 years ago)
Author:
kjdon
Message:

inlineImport... now calls mergedXSLTDocumentCascade to find all copies of a particular stylesheet and merge them, before inlining it. needs lots more arguments

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3
Files:
2 modified

Legend:

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

    r25987 r25988  
    739739        } 
    740740 
    741         GSXSLT.inlineImportAndIncludeFiles(skinAndLibraryDoc, null, (String) this.config_params.get(GSConstants.INTERFACE_NAME)); 
     741        GSXSLT.inlineImportAndIncludeFiles(skinAndLibraryDoc, null, (String) this.config_params.get(GSConstants.SITE_NAME), collection, (String) this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces); 
    742742        skinAndLibraryDoc = (Document) secondConfigFormatPass(collection, skinAndLibraryDoc, doc, new UserContext(request)); 
    743743 
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java

    r25987 r25988  
    220220    } 
    221221 
    222   public static void inlineImportAndIncludeFiles(Document doc, String pathExtra, String interface_name) 
    223     { 
    224       inlineImportAndIncludeFilesDebug(doc, pathExtra, false, null, interface_name); 
    225     } 
    226  
    227   public static void inlineImportAndIncludeFilesDebug(Document doc, String pathExtra, boolean debug, String docFileName, String interface_name) 
     222  public static void inlineImportAndIncludeFiles(Document doc, String pathExtra, String site, String collection, String interface_name, ArrayList<String> base_interfaces) 
     223    { 
     224      inlineImportAndIncludeFilesDebug(doc, pathExtra, false, null, site, collection, interface_name, base_interfaces); 
     225    } 
     226 
     227  public static void inlineImportAndIncludeFilesDebug(Document doc, String pathExtra, boolean debug, String docFileName, String site, String collection, String interface_name, ArrayList<String> base_interfaces) 
    228228    { 
    229229        XMLConverter converter = new XMLConverter(); 
     
    238238            Element current = (Element) ((i < importList.getLength()) ? importList.item(i) : includeList.item(i - importList.getLength())); 
    239239            String href = current.getAttribute("href"); 
    240             String filePath = GSFile.interfaceHome(GlobalProperties.getGSDL3Home(), interface_name) + File.separator + "transform" + File.separator + path.replace("/", File.separator) + href.replace("/", File.separator); 
     240            //String filePath = GSFile.interfaceHome(GlobalProperties.getGSDL3Home(), interface_name) + File.separator + "transform" + File.separator + path.replace("/", File.separator) + href.replace("/", File.separator); 
    241241            //String filePath = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), site_name, collection, interface_name, base_interfaces,  
    242242 
    243243            try 
    244244            { 
    245                 Document inlineDoc = converter.getDOM(new File(filePath), "UTF-8"); 
    246  
     245              //Document inlineDoc = converter.getDOM(new File(filePath), "UTF-8"); 
     246              Document inlineDoc = mergedXSLTDocumentCascade(path+href, site, collection, interface_name, base_interfaces, debug); 
    247247                String newPath = path; 
    248248                int lastSepIndex = href.lastIndexOf("/"); 
     
    253253 
    254254                //Do this recursively 
    255                 inlineImportAndIncludeFilesDebug(inlineDoc, newPath, debug, filePath, interface_name); 
    256  
    257                 GSXSLT.mergeStylesheetsDebug(doc, inlineDoc.getDocumentElement(), false, debug, docFileName, filePath); 
     255                inlineImportAndIncludeFilesDebug(inlineDoc, newPath, debug, "merged "+href/*filePath*/, site, collection, interface_name, base_interfaces); 
     256 
     257                GSXSLT.mergeStylesheetsDebug(doc, inlineDoc.getDocumentElement(), false, debug, docFileName, /*filePath*/"merged "+href); 
    258258            } 
    259259            catch (Exception ex)