org.zkoss.zkplus.liferay
Class NonRootContextJQueryRenderPatch

java.lang.Object
  extended by org.zkoss.zkplus.liferay.JQueryRenderPatch
      extended by 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
NonRootContextJQueryRenderPatch()
           
 
Method Summary
 java.io.Writer beforeRender(RequestInfo reqInfo)
          It returns an instance of StringWriter if JQueryRenderPatch.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonRootContextJQueryRenderPatch

public NonRootContextJQueryRenderPatch()
Method Detail

beforeRender

public java.io.Writer beforeRender(RequestInfo reqInfo)
Description copied from class: JQueryRenderPatch
It returns an instance of StringWriter if JQueryRenderPatch.getDelay() is non-negative, or null if negative (means no patch).

Specified by:
beforeRender in interface PageRenderPatch
Overrides:
beforeRender in class JQueryRenderPatch
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. If PageRenderPatch.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 interface PageRenderPatch
Overrides:
patchRender in class JQueryRenderPatch
Parameters:
reqInfo - the request information
result - the result returned by PageRenderPatch.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


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo