From adffaces-commits-return-1349-apmail-incubator-adffaces-commits-archive=incubator.apache.org@incubator.apache.org Tue Nov 28 20:36:41 2006 Return-Path: Delivered-To: apmail-incubator-adffaces-commits-archive@locus.apache.org Received: (qmail 20764 invoked from network); 28 Nov 2006 20:36:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 20:36:41 -0000 Received: (qmail 39850 invoked by uid 500); 28 Nov 2006 20:36:50 -0000 Delivered-To: apmail-incubator-adffaces-commits-archive@incubator.apache.org Received: (qmail 39831 invoked by uid 500); 28 Nov 2006 20:36:50 -0000 Mailing-List: contact adffaces-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-commits@incubator.apache.org Received: (qmail 39808 invoked by uid 99); 28 Nov 2006 20:36:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 12:36:50 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 12:36:39 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 1B1A71A9846; Tue, 28 Nov 2006 12:36:02 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r480192 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: renderkit/core/xhtml/ skin/ ui/laf/base/xhtml/ Date: Tue, 28 Nov 2006 20:36:01 -0000 To: adffaces-commits@incubator.apache.org From: jwaldman@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061128203602.1B1A71A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jwaldman Date: Tue Nov 28 12:36:01 2006 New Revision: 480192 URL: http://svn.apache.org/viewvc?view=rev&rev=480192 Log: revert checkins 47698 and 479709. I meant to check into my branch only. Somehow it checked it in both places. Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java?view=diff&rev=480192&r1=480191&r2=480192 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/StyleSheetRenderer.java Tue Nov 28 12:36:01 2006 @@ -29,7 +29,6 @@ import org.apache.myfaces.trinidad.context.RenderingContext; import org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext; -import org.apache.myfaces.trinidadinternal.share.config.Configuration; import org.apache.myfaces.trinidadinternal.style.StyleContext; import org.apache.myfaces.trinidadinternal.style.StyleProvider; import org.apache.myfaces.trinidadinternal.style.util.StyleUtils; @@ -42,6 +41,20 @@ */ public class StyleSheetRenderer extends XhtmlRenderer { + /** + * Disables optimizations that are normally performed by the + * Trinidad Renderers to reduce content size. + *

+ * This Boolean property controls whether or not Trinidad Renderer + * implementations should attempt to reduce the size of generated + * content, for example, by compressing style class names. These + * optimizations are enabled by default. In general, + * clients should not need to disable these optimizations. However, + * clients that want to disable this functionality for testing or + * debugging purposes can do so by setting this property to Boolean.TRUE. + */ + static public final String DISABLE_CONTENT_COMPRESSION = + "org.apache.myfaces.trinidadinternal.DISABLE_CONTENT_COMPRESSION"; public StyleSheetRenderer() { @@ -122,7 +135,9 @@ // Hand the Faces-major renderers the style Map for compressing. // Oddly enough, this code has to be after provider.getStyleSheetURI(), // because that call boostraps up the style provider in general. - if (!XhtmlUtils.isDisableContentCompression(context, arc)) + if (!"true".equals( + context.getExternalContext().getInitParameter( + DISABLE_CONTENT_COMPRESSION))) { if (arc instanceof CoreRenderingContext) { Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java?view=diff&rev=480192&r1=480191&r2=480192 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlUtils.java Tue Nov 28 12:36:01 2006 @@ -39,11 +39,9 @@ import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent; import org.apache.myfaces.trinidad.context.RenderingContext; -import org.apache.myfaces.trinidad.context.RequestContext; import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet; import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.XhtmlScriptletFactory; -import org.apache.myfaces.trinidadinternal.share.config.Configuration; import org.apache.myfaces.trinidadinternal.share.util.FastMessageFormat; @@ -86,39 +84,6 @@ Boolean.TRUE.equals( agent.getCapabilities().get(TrinidadAgent.CAP_PARTIAL_RENDERING))); } - - /** - * Return true if we should disable content compression - * @param fContext FacesContext - * @param renderingContext RenderingContext, where we can get the outputMode. - * @return true if we should disable content compression. If in a portlet, then we want to - * disable content compression. - */ - static public boolean isDisableContentCompression( - FacesContext fContext, - RenderingContext renderingContext) - { - String outputMode = renderingContext.getOutputMode(); - return _isDisableContentCompression(fContext, outputMode); - } - - /** - * Return true if we should disable content compression - * @param fContext FacesContext - * @param requestContext RequestContext, where we can get the outputMode. - * @return true if we should disable content compression. If in a portlet, then we want to - * disable content compression. - */ - static public boolean isDisableContentCompression( - FacesContext fContext, - RequestContext requestContext) - { - String outputMode = requestContext.getOutputMode(); - return _isDisableContentCompression(fContext, outputMode); - } - - - /** Library key for the locale lib */ public static final String CORE_LIB = @@ -537,25 +502,6 @@ { FastMessageFormat formatter = new FastMessageFormat(pattern); return formatter.format(parameters); - } - - - /** - * Return true if we should disable content compression. It looks at both the disable - * content compression init parameter and the outputMode. - * @param fContext - * @param outputMode String. We compare this against XhtmlConstants.OUTPUT_MODE_PORTLET - * @return - */ - static private boolean _isDisableContentCompression( - FacesContext fContext, - String outputMode) - { - String disableContentCompressionParam = - fContext.getExternalContext().getInitParameter(Configuration.DISABLE_CONTENT_COMPRESSION); - return ("true".equals(disableContentCompressionParam) || - XhtmlConstants.OUTPUT_MODE_PORTLET.equals(outputMode)); - } /** HashMap mapping names to their scriptlets */ Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java?view=diff&rev=480192&r1=480191&r2=480192 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java Tue Nov 28 12:36:01 2006 @@ -20,12 +20,10 @@ import java.util.Map; import javax.faces.context.FacesContext; - -import org.apache.myfaces.trinidad.context.RequestContext; import org.apache.myfaces.trinidad.logging.TrinidadLogger; import org.apache.myfaces.trinidad.skin.Skin; import org.apache.myfaces.trinidad.skin.SkinFactory; -import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlConstants; + /** @@ -96,8 +94,6 @@ /** * given the skinFamily and renderKitId, pass back the Skin. - * If outputMode is PORTLET, then we ignore - * the render-kit-id and get the 'portlet' skin for that skin family. * @param context FacesContext for the request currently being * processed, or null if none is available. * @param family skin family of the requested {@link Skin} instance @@ -117,12 +113,9 @@ if (family == null) throw new NullPointerException("Null skin family"); - // default render-kit-id, if needed. - if (XhtmlConstants.OUTPUT_MODE_PORTLET.equals( - RequestContext.getCurrentInstance().getOutputMode())) - renderKitId = XhtmlConstants.OUTPUT_MODE_PORTLET; - else if (renderKitId == null) - renderKitId = _RENDER_KIT_ID_CORE; + // if there isn't a specific renderKitId specified, get the skin + // with the default render kit. + if (renderKitId == null) renderKitId = _RENDER_KIT_ID_CORE; // loop through each skin in the SkinFactory // and see if the family and the renderKitId match @@ -146,16 +139,15 @@ " and renderkit " + renderKitId + ", so we will" + " use the simple skin"); } - - // if we get here, that means we couldn't find an exact - // family/renderKitId match, so return the simple skin - // that matches the renderkitid. - if (renderKitId.equals(XhtmlConstants.OUTPUT_MODE_PORTLET)) - return getSkin(context, _SIMPLE_PORTLET); - else if (renderKitId.equals(_RENDER_KIT_ID_PDA)) + + if (renderKitId.equals(_RENDER_KIT_ID_PDA)) + { return getSkin(context, _SIMPLE_PDA); - else + } + else + { return getSkin(context, _SIMPLE_DESKTOP); + } } @@ -173,7 +165,6 @@ static private final String _RENDER_KIT_ID_PDA = "org.apache.myfaces.trinidad.pda"; static private final String _SIMPLE_PDA = "simple.pda"; static private final String _SIMPLE_DESKTOP = "simple.desktop"; - static private final String _SIMPLE_PORTLET = "simple.portlet"; static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(SkinFactoryImpl.class); Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java?view=diff&rev=480192&r1=480191&r2=480192 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/XhtmlLafUtils.java Tue Nov 28 12:36:01 2006 @@ -29,7 +29,6 @@ import javax.faces.context.ResponseWriter; import org.apache.myfaces.trinidad.context.RenderingContext; -import org.apache.myfaces.trinidad.context.RequestContext; import org.apache.myfaces.trinidad.logging.TrinidadLogger; import org.apache.myfaces.trinidad.skin.Icon; import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent; @@ -311,9 +310,12 @@ // try to get it now if (styleClasses == null) { - if (!(XhtmlUtils.isDisableContentCompression(context.getFacesContext(), - RequestContext.getCurrentInstance()))) + ExternalContext external = + context.getFacesContext().getExternalContext(); + if (!"true".equals( + external.getInitParameter( + Configuration.DISABLE_CONTENT_COMPRESSION))) { StyleContext styleContext = context.getStyleContext(); StyleProvider provider = context.getStyleContext().getStyleProvider();