FreemarkerPresentationManager now falls back to PageTransformer if no theme manifest is found

or if XSL_FALLBACK.XSL is configured as template


git-svn-id: https://svn.libreccm.org/ccm/trunk@5829 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-02-15 18:31:06 +00:00
parent 1cc7a9a80d
commit 7a814be765
2 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package org.libreccm.theming; package org.libreccm.theming;
import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.Bebop;
import com.arsdigita.bebop.page.PageTransformer;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.subsite.Site; import com.arsdigita.subsite.Site;
@ -132,6 +133,11 @@ public class FreeMarkerPresentationManager implements PresentationManager {
// } // }
final InputStream manifestInputStream = servletContext final InputStream manifestInputStream = servletContext
.getResourceAsStream(themeManifestPath); .getResourceAsStream(themeManifestPath);
if (manifestInputStream == null) {
final PageTransformer pageTransformer = new PageTransformer();
pageTransformer.servePage(document, request, response);
return;
}
final ThemeManifestUtil manifestUtil = ThemeManifestUtil.getInstance(); final ThemeManifestUtil manifestUtil = ThemeManifestUtil.getInstance();
final ThemeManifest manifest = manifestUtil final ThemeManifest manifest = manifestUtil
@ -169,6 +175,12 @@ public class FreeMarkerPresentationManager implements PresentationManager {
applicationTemplatePath = templates.getDefaultApplicationTemplate(); applicationTemplatePath = templates.getDefaultApplicationTemplate();
} }
if ("XSL_FALLBACK.XSL".equals(applicationTemplatePath)) {
final PageTransformer pageTransformer = new PageTransformer();
pageTransformer.servePage(document, request, response);
return;
}
final Configuration configuration = new Configuration( final Configuration configuration = new Configuration(
Configuration.VERSION_2_3_28); Configuration.VERSION_2_3_28);
final WebappTemplateLoader themeTemplateLoader final WebappTemplateLoader themeTemplateLoader

View File

@ -5,6 +5,7 @@
"ui": "http://www.arsdigita.com/ui/1.0"} "ui": "http://www.arsdigita.com/ui/1.0"}
> >
<#-- Move to Navigation tags? -->
<#macro pageTitle> <#macro pageTitle>
${model["//nav:categoryMenu/nav:category/@title"]} ${model["//nav:categoryMenu/nav:category/@title"]}
</#macro> </#macro>