Changeset 26426
- Timestamp:
- 2012-10-31T10:45:59+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
r26334 r26426 45 45 public class TransformingReceptionist extends Receptionist 46 46 { 47 protected static final int CONFIG_PASS = 1; 48 protected static final int TEXT_PASS = 2; 47 49 48 50 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.core.TransformingReceptionist.class.getName()); … … 923 925 924 926 GSXSLT.inlineImportAndIncludeFiles(skinAndLibraryDoc, null, (String) this.config_params.get(GSConstants.SITE_NAME), collection, (String) this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces); 925 skinAndLibraryDoc = (Document) perform TextFormatPass(collection, skinAndLibraryDoc, doc, new UserContext(request));926 skinAndLibraryDoc = (Document) perform ConfigFormatPass(collection, skinAndLibraryDoc, doc, new UserContext(request));927 skinAndLibraryDoc = (Document) performFormatPass(collection, skinAndLibraryDoc, doc, new UserContext(request), TEXT_PASS); 928 skinAndLibraryDoc = (Document) performFormatPass(collection, skinAndLibraryDoc, doc, new UserContext(request), CONFIG_PASS); 927 929 928 930 if (_debug) … … 950 952 } 951 953 952 protected Node performConfigFormatPass(String collection, Document skinAndLibraryDoc, Document doc, UserContext userContext) 953 { 954 String configStylesheet_file = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String) this.config_params.get(GSConstants.SITE_NAME), collection, (String) this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces, "config_format.xsl"); 955 Document configStylesheet_doc = this.converter.getDOM(new File(configStylesheet_file)); 956 957 if (configStylesheet_doc != null) 958 { 959 return this.transformer.transform(configStylesheet_doc, skinAndLibraryDoc, config_params); 960 } 961 return skinAndLibraryDoc; 962 } 963 964 protected Node performTextFormatPass(String collection, Document skinAndLibraryDoc, Document doc, UserContext userContext) 965 { 966 String configStylesheet_file = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String) this.config_params.get(GSConstants.SITE_NAME), collection, (String) this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces, "text_fragment_format.xsl"); 954 protected Node performFormatPass(String collection, Document skinAndLibraryDoc, Document doc, UserContext userContext, int pass) 955 { 956 String formatFile; 957 if (pass == CONFIG_PASS) 958 { 959 formatFile = "config_format.xsl"; 960 } 961 else 962 { 963 formatFile = "text_fragment_format.xsl"; 964 } 965 String configStylesheet_file = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String) this.config_params.get(GSConstants.SITE_NAME), collection, (String) this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces, formatFile); 967 966 Document configStylesheet_doc = this.converter.getDOM(new File(configStylesheet_file)); 968 967
Note:
See TracChangeset
for help on using the changeset viewer.