diff --git a/zkdoc/release-note b/zkdoc/release-note index 8bf6f1c2db4..0ed390db9a8 100644 --- a/zkdoc/release-note +++ b/zkdoc/release-note @@ -5,6 +5,7 @@ ZK 10.0.1 ZK-5679: RichletMapping with "/" on Class does not work on StatelessRichlet class * Upgrade Notes + + Remove zkplus/liferay because it is designed for ie6 & ie7 which are not supported by ZK10. -------- ZK 10.0.0 diff --git a/zkplus/src/main/java/org/zkoss/zkplus/liferay/JQueryRenderCachedPatch.java b/zkplus/src/main/java/org/zkoss/zkplus/liferay/JQueryRenderCachedPatch.java deleted file mode 100644 index 8bb40445d20..00000000000 --- a/zkplus/src/main/java/org/zkoss/zkplus/liferay/JQueryRenderCachedPatch.java +++ /dev/null @@ -1,105 +0,0 @@ -/* JQueryRenderPatch.java - - Purpose: - - Description: - - History: - Sun Jan 17 11:48:04 TST 2010, Created by tomyeh - -Copyright (C) 2010 Potix Corporation. All Rights Reserved. - -*/ -package org.zkoss.zkplus.liferay; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Used to patch the rendering result of a ZK portlet for Liferay. - * When using ZK portlets with Liferay under Internet Explorer, we have - * to delay the processing at the client a bit. This patch assume - * "/zkau/web/js/zk.wpd" has loaded by Liferay, please refer to - * www.liferay.com document for configuration - * - *

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.JQueryRenderCachedPatch"). - * - * @author tomyeh, sam - * @since 5.0.1 - */ -public class JQueryRenderCachedPatch extends JQueryRenderPatch { - private static final Logger log = LoggerFactory.getLogger(JQueryRenderCachedPatch.class); - - protected String getBrowserDelay() { - return "zk.ie6_ || zk.ie7_ ? 1300 : 100"; - } - - /** - * Append CSS link to head, and remove zk.wpd script - */ - protected String[] processHtml(String html) { - boolean isAppendCSS = false; - StringBuffer script = new StringBuffer( - ")"); - - StringBuffer buffer = new StringBuffer(); - int parseStart = 0, scriptStart = 0, scriptEnd = 0; - for (scriptStart = html.indexOf("", scriptStart); - if (scriptEnd == -1) - break; - scriptEnd += "".length(); - - removeScript(html, scriptStart, scriptEnd, scriptPattern, script, buffer); - if ((scriptStart = html.indexOf(""); - ret[0] = script.toString(); - ret[1] = buffer.toString(); - } - return ret; - } - - private static boolean extractCSS(String html, int start, int end, Pattern cssPattern, StringBuffer scriptBuffer, - StringBuffer htmlBuffer) { - if (!(start < end)) - return false; - - boolean isAppendCSS = false; - Matcher m = cssPattern.matcher(html.substring(start, end)); - while (m.find()) { - isAppendCSS = true; - scriptBuffer.append("_zkCSS('" + m.group(1) + "');"); - m.appendReplacement(htmlBuffer, ""); - } - m.appendTail(htmlBuffer); - return isAppendCSS; - } - - private static void removeScript(String html, int start, int end, Pattern scriptPattern, StringBuffer scriptBuffer, - StringBuffer htmlBuffer) { - String scriptBlock = html.substring(start, end); - Matcher m = scriptPattern.matcher(scriptBlock); - if (m.find()) - m.appendReplacement(scriptBuffer, ""); - else - htmlBuffer.append(scriptBlock); - } -} \ No newline at end of file diff --git a/zkplus/src/main/java/org/zkoss/zkplus/liferay/JQueryRenderPatch.java b/zkplus/src/main/java/org/zkoss/zkplus/liferay/JQueryRenderPatch.java deleted file mode 100644 index 9dd811bb17e..00000000000 --- a/zkplus/src/main/java/org/zkoss/zkplus/liferay/JQueryRenderPatch.java +++ /dev/null @@ -1,157 +0,0 @@ -/* JQueryRenderPatch.java - - Purpose: - - Description: - - History: - Sun Jan 17 11:48:04 TST 2010, Created by tomyeh - -Copyright (C) 2010 Potix Corporation. All Rights Reserved. - -*/ -package org.zkoss.zkplus.liferay; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.zkoss.lang.Library; -import org.zkoss.lang.Strings; -import org.zkoss.zk.ui.Page; -import org.zkoss.zk.ui.sys.PageRenderPatch; -import org.zkoss.zk.ui.sys.RequestInfo; - -/** - * Used to patch the rendering result of a ZK portlet for Liferay. - * When using ZK portlets with Liferay under Internet Explorer, we have - * to delay the processing at the client a bit. - * - *

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.JQueryRenderPatch"). - * - *

You can further control the behavior of this patch by use of - * a library property called "org.zkoss.zkplus.liferary.jQueryPatch" - * (refer to {@link #JQUERY_PATCH} for details). - * - * @author tomyeh, sam - * @since 5.0.0 - */ -public class JQueryRenderPatch implements PageRenderPatch { - private static final Logger log = LoggerFactory.getLogger(JQueryRenderPatch.class); - - /** A library property to indicate how to apply the so-called jQuery patch. - *

Default: "500" (it means 500 milliseconds) - * - *

You can specify a number to indicate how many milliseconds to wait - * before replacing with the correct content. - * If negative, the patch is ignored. - */ - public static final String JQUERY_PATCH = "org.zkoss.zkplus.liferary.jQueryPatch"; - - private int _delay = -1; - - public JQueryRenderPatch() { - final String val = Library.getProperty(JQUERY_PATCH); - try { - _delay = Integer.parseInt(val); - } catch (Throwable ex) { - log.warn("Ignored delay time specified in " + JQUERY_PATCH + ": " + val); - } - } - - /** Returns the number of milliseconds to wait before replacing with - * the correct content. - *

Default: depends on the value defined in the {@link #JQUERY_PATCH} - * library property. - */ - public int getDelay() { - return _delay; - } - - /** Sets the number of milliseconds to wait before replacing with - * the correct content. - * @see #JQUERY_PATCH - */ - public void setDelay(int delay) { - _delay = delay; - } - - /** It returns an instance of StringWriter if {@link #getDelay} is non-negative, - * or null if negative (means no patch). - */ - public Writer beforeRender(RequestInfo reqInfo) { - return _delay >= 0 ? new StringWriter() : null; - //we cannot retrieve HTTP request's header so no need to - //apply the patch for particular browsers, such as ie - } - - public void patchRender(RequestInfo reqInfo, Page page, Writer result, Writer out) throws IOException { - final String extid = page.getUuid() + "-ext"; - String[] html = processHtml(((StringWriter) result).toString()); - //we have to process CSS and append it to HEAD - out.write(html[0]); - out.write("

"); - } - - protected String getBrowserDelay() { - return "" + _delay; - } - - protected String[] processHtml(String html) { - boolean isAppendCSS = false; - StringBuffer script = new StringBuffer( - "", scriptStart); - if (scriptEnd == -1) - break; - scriptEnd += "".length(); - buffer.append(html.subSequence(scriptStart, scriptEnd)); - if ((scriptStart = html.indexOf(""); - ret[0] = script.toString(); - ret[1] = buffer.toString(); - } - return ret; - } -} diff --git a/zkplus/src/main/java/org/zkoss/zkplus/liferay/NonRootContextJQueryRenderPatch.java b/zkplus/src/main/java/org/zkoss/zkplus/liferay/NonRootContextJQueryRenderPatch.java deleted file mode 100644 index 1ad7ca2e328..00000000000 --- a/zkplus/src/main/java/org/zkoss/zkplus/liferay/NonRootContextJQueryRenderPatch.java +++ /dev/null @@ -1,50 +0,0 @@ -/* NonRootContextJQueryRenderPatch.java - - Purpose: - - Description: - - History: - Thu Feb 2 17:24:04 TST 2012, Created by jimmyshiau - -Copyright (C) 2012 Potix Corporation. All Rights Reserved. - -*/ -package org.zkoss.zkplus.liferay; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; - -import javax.portlet.PortletSession; - -import org.zkoss.zk.ui.Page; -import org.zkoss.zk.ui.sys.RequestInfo; - -/** - * 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"). - * - * @author jimmy - * @since 5.0.11 - */ -public class NonRootContextJQueryRenderPatch extends JQueryRenderPatch { - - public Writer beforeRender(RequestInfo reqInfo) { - return new StringWriter(); - } - - public void patchRender(RequestInfo reqInfo, Page page, Writer result, Writer out) throws IOException { - if (getDelay() >= 0) - super.patchRender(reqInfo, page, result, out); - PortletSession p = (PortletSession) reqInfo.getSession().getNativeSession(); - out.write(""); - } - -} diff --git a/zkplus/src/main/java/org/zkoss/zkplus/liferay/package.html b/zkplus/src/main/java/org/zkoss/zkplus/liferay/package.html deleted file mode 100644 index 8b6814864b4..00000000000 --- a/zkplus/src/main/java/org/zkoss/zkplus/liferay/package.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Utilities to support Liferay - - -

Utilities to support Liferay Portal.

- -