Package org.zkoss.zkplus.liferay
Class NonRootContextJQueryRenderPatch
- java.lang.Object
-
- org.zkoss.zkplus.liferay.JQueryRenderPatch
-
- org.zkoss.zkplus.liferay.NonRootContextJQueryRenderPatch
-
- All Implemented Interfaces:
PageRenderPatch
public class NonRootContextJQueryRenderPatch extends JQueryRenderPatch
Used to patch the rendering result of a ZK portlet for Liferay. When using ZK portlets with Liferay under non root context, we have to add a JSESSIONID under root(/) path.To use it, you have to specify a library property called ""org.zkoss.zk.portlet.PageRenderPatch.class" with this class's name ("org.zkoss.zkplus.liferay.NonRootContextJQueryRenderPatch").
- Since:
- 5.0.11
- Author:
- jimmy
-
-
Field Summary
-
Fields inherited from class org.zkoss.zkplus.liferay.JQueryRenderPatch
JQUERY_PATCH
-
-
Constructor Summary
Constructors Constructor Description NonRootContextJQueryRenderPatch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Writer
beforeRender(RequestInfo reqInfo)
It returns an instance of StringWriter ifJQueryRenderPatch.getDelay()
is non-negative, or null if negative (means no patch).void
patchRender(RequestInfo reqInfo, Page page, java.io.Writer result, java.io.Writer out)
Called after rendering to patch the result.-
Methods inherited from class org.zkoss.zkplus.liferay.JQueryRenderPatch
getBrowserDelay, getDelay, processHtml, setDelay
-
-
-
-
Method Detail
-
beforeRender
public java.io.Writer beforeRender(RequestInfo reqInfo)
Description copied from class:JQueryRenderPatch
It returns an instance of StringWriter ifJQueryRenderPatch.getDelay()
is non-negative, or null if negative (means no patch).- Specified by:
beforeRender
in interfacePageRenderPatch
- Overrides:
beforeRender
in classJQueryRenderPatch
- Parameters:
reqInfo
- the request information- Returns:
- null if no need of patch, or a writer if the patch is required.
The writer will be used to hold the rendering result of the portlet.
Thus, you can process it later in
PageRenderPatch.patchRender(org.zkoss.zk.ui.sys.RequestInfo, org.zkoss.zk.ui.Page, java.io.Writer, java.io.Writer)
(so the writer is usually an instance of StringWriter).
-
patchRender
public void patchRender(RequestInfo reqInfo, Page page, java.io.Writer result, java.io.Writer out) throws java.io.IOException
Description copied from interface:PageRenderPatch
Called after rendering to patch the result. IfPageRenderPatch.beforeRender(org.zkoss.zk.ui.sys.RequestInfo)
returns null, this method won't be called since nothing to patch.If
PageRenderPatch.beforeRender(org.zkoss.zk.ui.sys.RequestInfo)
returns a writer, the writer will become the result argument.- Specified by:
patchRender
in interfacePageRenderPatch
- Overrides:
patchRender
in classJQueryRenderPatch
- Parameters:
reqInfo
- the request informationresult
- the result returned byPageRenderPatch.beforeRender(org.zkoss.zk.ui.sys.RequestInfo)
, and the rendering result of a page will be written to it.out
- the real output sent to the client. It is the writer to write the patched result to.- Throws:
java.io.IOException
-
-