|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.sys.HtmlPageRenders
public class HtmlPageRenders
Utilities for implementing HTML-based PageRenderer
.
Nested Class Summary | |
---|---|
static class |
HtmlPageRenders.RenderContext
The render context which consists of two writers ( HtmlPageRenders.RenderContext.temp and
HtmlPageRenders.RenderContext.perm . |
Constructor Summary | |
---|---|
HtmlPageRenders()
|
Method Summary | |
---|---|
static HtmlPageRenders.RenderContext |
getRenderContext(Execution exec)
Returns the render context, or null if not available. |
static java.util.List<StyleSheet> |
getStyleSheets(Execution exec,
WebApp wapp,
java.lang.String deviceType)
Returns a list of StyleSheet that shall be generated
to the client for the specified execution. |
static boolean |
isDirectContent(Execution exec)
Returns whether a component can directly generate HTML tags to the output. |
static boolean |
isZkTagsGenerated(Execution exec)
Returns if the ZK specific HTML tags are generated. |
static java.lang.String |
outDocType(Execution exec,
Page page)
Returns the doc type, or null if not available. |
static java.lang.String |
outFirstLine(Execution exec,
Page page)
Returns the first line to be generated to the output, or null if no special first line. |
static java.lang.String |
outHeaders(Execution exec,
Page page,
boolean before)
Returns the content of the specified condition that will be placed inside the header element of the specified page, or null if it was generated before. |
static java.lang.String |
outHeaderZkTags(Execution exec,
Page page)
Generates and returns the ZK specific HTML tags including the headers defined in the specified page, or null if it was generated before. |
static java.lang.String |
outLangJavaScripts(Execution exec,
WebApp wapp,
java.lang.String deviceType)
Returns HTML tags to include all JavaScript files and codes that are required when loading a ZUML page (never null). |
static java.lang.String |
outLangStyleSheets(Execution exec,
WebApp wapp,
java.lang.String deviceType)
Returns HTML tags to include all style sheets that are defined in all languages of the specified device (never null). |
static void |
outPageContent(Execution exec,
Page page,
java.io.Writer out,
boolean au)
Returns the HTML content representing a page. |
static java.lang.String |
outResponseJavaScripts(Execution exec)
Generates the AU responses that are part of a page rendering. |
static java.lang.String |
outResponseJavaScripts(Execution exec,
boolean directJS)
Generates the AU responses that are part of a page rendering. |
static void |
outSEOContent(Page page,
java.io.Writer out)
Generates the SEO content for the given page. |
static java.lang.String |
outSpecialJS(Desktop desktop)
Generates the special JavaScript code, such as the application's name. |
static void |
outStandalone(Execution exec,
Component comp,
java.io.Writer out)
Generates the content of a standalone component that the peer widget is not a child of the page widget at the client. |
static java.lang.String |
outUnavailable(Execution exec)
Generates the unavailable message in HTML tags, if any. |
static java.lang.String |
outZkTags(Execution exec,
WebApp wapp,
java.lang.String deviceType)
Generates and returns the ZK specific HTML tags such as stylesheet and JavaScript. |
static void |
setContentType(Execution exec,
Page page)
Sets the content type to the specified execution for the given page. |
static boolean |
setDirectContent(Execution exec,
boolean direct)
Sets whether a component can directly generate HTML tags to the output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlPageRenders()
Method Detail |
---|
public static final void setContentType(Execution exec, Page page)
exec
- the execution (never null)public static final java.lang.String outDocType(Execution exec, Page page)
public static java.lang.String outUnavailable(Execution exec)
exec
- the execution (never null)public static final java.lang.String outFirstLine(Execution exec, Page page)
public static final java.lang.String outResponseJavaScripts(Execution exec)
outPageContent(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer, boolean)
will invoke this method automatically.
It is the same as outResponseJavaScripts(exec, false)
.
public static final java.lang.String outResponseJavaScripts(Execution exec, boolean directJS)
outPageContent(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer, boolean)
will invoke this method automatically.
directJS
- whether to generate JS directly.
If true, it generates "x,y"
where x and y are assumed to the responses.
If false, it generates <script>zkac(x,y);</script>
public static final java.lang.String outLangJavaScripts(Execution exec, WebApp wapp, java.lang.String deviceType)
FUTURE CONSIDERATION: we might generate the inclusion on demand instead of all at once.
exec
- the execution (never null)wapp
- the Web application.
If null, exec.getDesktop().getWebApp() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution, such as JSP/DSP).deviceType
- the device type, such as ajax.
If null, exec.getDesktop().getDeviceType() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution).public static final java.lang.String outLangStyleSheets(Execution exec, WebApp wapp, java.lang.String deviceType)
In addition to style sheets defined in lang.xml and lang-addon.xml, it also include:
FUTURE CONSIDERATION: we might generate the inclusion on demand instead of all at once.
exec
- the execution (never null)wapp
- the Web application.
If null, exec.getDesktop().getWebApp() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution, such as JSP/DSP).deviceType
- the device type, such as ajax.
If null, exec.getDesktop().getDeviceType() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution).public static final java.util.List<StyleSheet> getStyleSheets(Execution exec, WebApp wapp, java.lang.String deviceType)
StyleSheet
that shall be generated
to the client for the specified execution.
exec
- the execution (never null)wapp
- the Web application.
If null, exec.getDesktop().getWebApp() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution, such as JSP/DSP).deviceType
- the device type, such as ajax.
If null, exec.getDesktop().getDeviceType() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution).public static final HtmlPageRenders.RenderContext getRenderContext(Execution exec)
ContentRenderer
, such as crawlable content.
exec
- the execution. If null, Executions.getCurrent()
is assumed.public static final void outPageContent(Execution exec, Page page, java.io.Writer out, boolean au) throws java.io.IOException
au
- whether it is caused by asynchronous updateexec
- the execution (never null)
java.io.IOException
public static void outSEOContent(Page page, java.io.Writer out) throws java.io.IOException
The SEO content shall be placed inside <div class="z-temp">
.
If a page renderer generates <div class="z-temp">
by itself,
it must invoke this method.
java.io.IOException
public static final java.lang.String outSpecialJS(Desktop desktop)
public static final void outStandalone(Execution exec, Component comp, java.io.Writer out) throws java.io.IOException
comp
- the component to render. It is null if no child component
at all.
java.io.IOException
public static final java.lang.String outHeaders(Execution exec, Page page, boolean before)
Notice that this method ignores the following invocations against the same page in the same execution. In other words, it is safe to invoke this method multiple times.
before
- whether to return the headers that shall be shown
before ZK's CSS/JS headers.
If true, only the headers that shall be shown before (such as meta)
are returned.
If true, only the headers that shall be shown after (such as link)
are returned.public static java.lang.String outHeaderZkTags(Execution exec, Page page)
It is shortcut of
outZkHeader(exec, page, true)+outZkTags(exec, null, null)+outZkHeader(exec, page, false)
Unlike outZkTags(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.WebApp, java.lang.String)
, this method cannot be called
in JSP/DSP (since desktop is not available).
outZkTags(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.WebApp, java.lang.String)
public static java.lang.String outZkTags(Execution exec, WebApp wapp, java.lang.String deviceType)
For each desktop, we have to generate a set of HTML tags to load ZK Client engine, style sheets and so on. For ZUL pages, it is generated automatically by page.dsp. However, for ZHTML pages, we have to generate these tags with special component such as org.zkoss.zhtml.Head, such that the result HTML page is legal.
exec
- the execution (never null)wapp
- the Web application.
If null, exec.getDesktop().getWebApp() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution, such as JSP/DSP).deviceType
- the device type, such as ajax.
If null, exec.getDesktop().getDeviceType() is used.
So you have to specify it if the execution is not associated
with desktop (a fake execution).
outHeaderZkTags(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page)
public static boolean isZkTagsGenerated(Execution exec)
public static boolean setDirectContent(Execution exec, boolean direct)
isDirectContent(org.zkoss.zk.ui.Execution)
public static boolean isDirectContent(Execution exec)
HtmlNativeComponent
setDirectContent(org.zkoss.zk.ui.Execution, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |