@@ -647,21 +647,21 @@ public class ApplicationServlet extends HttpServlet implements | |||
throw new ServletException("Theme (named '" | |||
+ themeName + "') can not be found"); | |||
// If UIDL rendering mode is preferred, a page for it is | |||
// If ajax rendering mode is preferred, a page for it is | |||
// rendered | |||
String renderingMode = theme.getPreferredMode(terminalType, | |||
themeSource); | |||
if (unhandledParameters.get("renderingMode") != null) | |||
renderingMode = (String) ((Object[]) unhandledParameters | |||
.get("renderingMode"))[0]; | |||
if (Theme.MODE_UIDL.equals(renderingMode) | |||
if (Theme.MODE_AJAX.equals(renderingMode) | |||
&& !(window instanceof DebugWindow)) { | |||
writeAjaxPage(request, response, out, unhandledParameters, window, terminalType, theme); | |||
return; | |||
} | |||
// If other than XSLT or UIDL mode is requested | |||
if (!Theme.MODE_XSLT.equals(renderingMode) | |||
// If other than html or ajax mode is requested | |||
if (!Theme.MODE_HTML.equals(renderingMode) | |||
&& !(window instanceof DebugWindow)) { | |||
// TODO More informal message should be given is browser | |||
// is not supported | |||
@@ -820,7 +820,7 @@ public class ApplicationServlet extends HttpServlet implements | |||
for (int k = themes.size() - 1; k >= 0; k--) { | |||
t = (Theme) themes.get(k); | |||
Collection files = t.getFileNames(terminalType, | |||
Theme.MODE_UIDL); | |||
Theme.MODE_AJAX); | |||
for (Iterator i = files.iterator(); i.hasNext();) { | |||
String file = (String) i.next(); | |||
if (file.endsWith(".css")) |
@@ -134,7 +134,7 @@ public class DirectoryThemeSource implements ThemeSource { | |||
} | |||
} | |||
Collection fileNames = theme.getFileNames(type, Theme.MODE_XSLT); | |||
Collection fileNames = theme.getFileNames(type, Theme.MODE_HTML); | |||
// Add all XSL file streams | |||
for (Iterator i = fileNames.iterator(); i.hasNext();) { |
@@ -168,7 +168,7 @@ public class JarThemeSource implements ThemeSource { | |||
} | |||
} | |||
Collection fileNames = theme.getFileNames(type, Theme.MODE_XSLT); | |||
Collection fileNames = theme.getFileNames(type, Theme.MODE_HTML); | |||
// Add all XSL file streams | |||
for (Iterator i = fileNames.iterator(); i.hasNext();) { | |||
entry = jar.getJarEntry(this.path + (String) i.next()); |
@@ -159,7 +159,7 @@ public class ServletThemeSource implements ThemeSource { | |||
} | |||
} | |||
Collection fileNames = theme.getFileNames(type, Theme.MODE_XSLT); | |||
Collection fileNames = theme.getFileNames(type, Theme.MODE_HTML); | |||
// Add all XSL file streams | |||
for (Iterator i = fileNames.iterator(); i.hasNext();) { | |||
String entryName = (String) i.next(); |
@@ -130,11 +130,11 @@ public class Theme extends DefaultHandler { | |||
private static final String ATTR_MARKUP = "markup"; | |||
public static final String MODE_UIDL = "uidl"; | |||
public static final String MODE_AJAX = "ajax"; | |||
public static final String MODE_XSLT = "xslt"; | |||
public static final String MODE_HTML = "html"; | |||
public static final String MODE_FALLBACK = MODE_XSLT; | |||
public static final String MODE_FALLBACK = MODE_HTML; | |||
/** Name of the theme. */ | |||
private String name; | |||
@@ -321,11 +321,11 @@ public class Theme extends DefaultHandler { | |||
String mode = atts.getValue(ATTR_MODE); | |||
if (mode != null && mode.length() == 0) | |||
mode = null; | |||
if (mode != null && !mode.equals(MODE_UIDL) | |||
&& !mode.equals(MODE_XSLT)) | |||
if (mode != null && !mode.equals(MODE_AJAX) | |||
&& !mode.equals(MODE_HTML)) | |||
throw new IllegalStateException("Given mode '" + mode | |||
+ "' is not supported. (This version only supports '" | |||
+ MODE_XSLT + "' and '" + MODE_UIDL + "')"); | |||
+ MODE_HTML + "' and '" + MODE_AJAX + "')"); | |||
fs = new Fileset(mode); | |||
// Use the first fileset as root fileset |
@@ -440,7 +440,7 @@ public class ThemeFunctionLibrary { | |||
static public String getCssLinksForHead() { | |||
ApplicationServlet as = (ApplicationServlet) ((Object[]) state.get())[WEBADAPTERSERVLET]; | |||
Theme t = as.getThemeSource().getThemeByName(theme()); | |||
Collection allFiles = t.getFileNames(browser(), Theme.MODE_XSLT); | |||
Collection allFiles = t.getFileNames(browser(), Theme.MODE_HTML); | |||
StringBuffer links = new StringBuffer(); | |||
for (Iterator i = allFiles.iterator(); i.hasNext();) { | |||
String file = (String) i.next(); | |||
@@ -457,7 +457,7 @@ public class ThemeFunctionLibrary { | |||
static public String getJavaScriptLinksForHead() { | |||
ApplicationServlet as = (ApplicationServlet) ((Object[]) state.get())[WEBADAPTERSERVLET]; | |||
Theme t = as.getThemeSource().getThemeByName(theme()); | |||
Collection allFiles = t.getFileNames(browser(), Theme.MODE_XSLT); | |||
Collection allFiles = t.getFileNames(browser(), Theme.MODE_HTML); | |||
StringBuffer links = new StringBuffer(); | |||
for (Iterator i = allFiles.iterator(); i.hasNext();) { | |||
String file = (String) i.next(); |