You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/04/01 15:15:09 UTC
svn commit: r1583657 - in /myfaces/tobago/branches/tobago-1.5.x:
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/
tobago-example/tobago-ex...
Author: lofwyr
Date: Tue Apr 1 13:15:08 2014
New Revision: 1583657
URL: http://svn.apache.org/r1583657
Log:
TOBAGO-1367: Remove debugMode from ClientProperties
Removed:
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java
Modified:
myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java Tue Apr 1 13:15:08 2014
@@ -59,6 +59,9 @@ public class ClientProperties implements
private String contentType = "html";
private Theme theme;
private UserAgent userAgent = UserAgent.DEFAULT;
+
+ /** @deprecated since Tobago 1.5.14 */
+ @Deprecated
private boolean debugMode;
private Locale locale;
@@ -192,10 +195,14 @@ public class ClientProperties implements
reset();
}
+ /** @deprecated since Tobago 1.5.14 */
+ @Deprecated
public boolean isDebugMode() {
return debugMode;
}
+ /** @deprecated since Tobago 1.5.14 */
+ @Deprecated
public void setDebugMode(boolean debugMode) {
this.debugMode = debugMode;
}
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java Tue Apr 1 13:15:08 2014
@@ -25,6 +25,7 @@ package org.apache.myfaces.tobago.exampl
*/
import org.apache.commons.lang.ObjectUtils;
+import org.apache.myfaces.tobago.application.ProjectStage;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.Theme;
@@ -44,8 +45,6 @@ public class ClientConfigController {
private static final Logger LOG = LoggerFactory.getLogger(ClientConfigController.class);
- private boolean debugMode;
-
private Theme theme;
private SelectItem[] themeItems;
@@ -112,7 +111,6 @@ public class ClientConfigController {
ClientProperties client
= VariableResolverUtils.resolveClientProperties(FacesContext.getCurrentInstance());
- client.setDebugMode(debugMode);
client.setTheme(theme);
client.setContentType(contentType);
}
@@ -120,8 +118,6 @@ public class ClientConfigController {
public void loadFromClientProperties() {
ClientProperties client
= VariableResolverUtils.resolveClientProperties(FacesContext.getCurrentInstance());
-
- debugMode = client.isDebugMode();
theme = client.getTheme();
contentType = client.getContentType();
}
@@ -164,12 +160,8 @@ public class ClientConfigController {
.getVariableResolver().resolveVariable(facesContext, beanName);
}
- public boolean isDebugMode() {
- return debugMode;
- }
-
- public void setDebugMode(boolean debugMode) {
- this.debugMode = debugMode;
+ public boolean isDevelopment() {
+ return TobagoConfig.getInstance(FacesContext.getCurrentInstance()).getProjectStage() == ProjectStage.Development;
}
public Theme getTheme() {
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag Tue Apr 1 13:15:08 2014
@@ -42,10 +42,6 @@
<f:selectItems value="#{clientConfigController.localeItems}"/>
</tx:menuRadio>
</tc:menu>
- <%-- todo: may have something like immediate="true", but in this case, the value will not switched --%>
- <tx:menuCheckbox action="#{clientConfigController.submit}"
- label="#{overviewBundle.menu_debug}"
- value="#{clientConfigController.debugMode}"/>
<tc:menuCommand action="#{demo.resetSession}" label="Reset"/>
</tc:menu>
@@ -55,7 +51,7 @@
label="#{overviewBundle.menu_about}"/>
<tc:menuCommand link="http://myfaces.apache.org/tobago" label="Tobago in the Web"/>
<tc:menuCommand onclick="LOG.show();" label="#{overviewBundle.menu_showLog}"
- rendered="#{clientConfigController.debugMode}"/>
+ rendered="#{clientConfigController.development}"/>
<tc:menuCommand action="server-info" immediate="true"
label="Server Info" disabled="#{! info.enabled}"/>
</tc:menu>
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml Tue Apr 1 13:15:08 2014
@@ -41,10 +41,6 @@
<f:selectItems value="#{clientConfigController.localeItems}"/>
</tx:menuRadio>
</tc:menu>
- <!-- todo: may have something like immediate="true", but in this case, the value will not switched -->
- <tx:menuCheckbox action="#{clientConfigController.submit}"
- label="#{overviewBundle.menu_debug}"
- value="#{clientConfigController.debugMode}"/>
<tc:menuCommand action="#{demo.resetSession}" label="Reset"/>
</tc:menu>
@@ -55,7 +51,7 @@
<tc:menuCommand link="http://myfaces.apache.org/tobago" label="Tobago in the Web"/>
<tc:menuCommand onclick="LOG.show();"
label="#{overviewBundle.menu_showLog}"
- rendered="#{clientConfigController.debugMode}"/>
+ rendered="#{clientConfigController.development}"/>
<tc:menuCommand action="server-info" immediate="true"
label="Server Info"
disabled="#{! info.enabled}"/>
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml Tue Apr 1 13:15:08 2014
@@ -52,9 +52,6 @@
<tc:button action="#{clientConfigController2.submit}" label="#{overviewBundle.locale_submit}"/>
</tc:panel>
</tc:panel>
-
- <tx:selectBooleanCheckbox label="#{overviewBundle.menu_debug}"
- value="#{clientConfigController2.debugMode}" />
</tc:panel>
</ui:composition>
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java Tue Apr 1 13:15:08 2014
@@ -35,8 +35,6 @@ import java.util.Locale;
public class ClientConfigController {
- private boolean debugMode;
-
private Theme theme;
private SelectItem[] themeItems;
@@ -87,7 +85,6 @@ public class ClientConfigController {
public void storeInClientProperties() {
ClientProperties client = VariableResolverUtils.resolveClientProperties(FacesContext.getCurrentInstance());
- client.setDebugMode(debugMode);
client.setTheme(theme);
client.setContentType(contentType);
}
@@ -96,7 +93,6 @@ public class ClientConfigController {
ClientProperties client
= VariableResolverUtils.resolveClientProperties(FacesContext.getCurrentInstance());
- debugMode = client.isDebugMode();
theme = client.getTheme();
contentType = client.getContentType();
}
@@ -130,14 +126,6 @@ public class ClientConfigController {
.getVariableResolver().resolveVariable(facesContext, beanName);
}
- public boolean isDebugMode() {
- return debugMode;
- }
-
- public void setDebugMode(boolean debugMode) {
- this.debugMode = debugMode;
- }
-
public Theme getTheme() {
return theme;
}
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml Tue Apr 1 13:15:08 2014
@@ -202,12 +202,6 @@
</navigation-case>
</navigation-rule>
- <lifecycle>
- <phase-listener>
- org.apache.myfaces.tobago.example.test.DebugModePhaseListener
- </phase-listener>
- </lifecycle>
-
<!-- Wizard -->
<managed-bean>
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Tue Apr 1 13:15:08 2014
@@ -167,11 +167,10 @@ public class PageRenderer extends PageRe
final ClientProperties client = VariableResolverUtils.resolveClientProperties(facesContext);
final ProjectStage projectStage = TobagoConfig.getInstance(facesContext).getProjectStage();
final boolean developmentMode = projectStage == ProjectStage.Development;
- final boolean debugMode = client.isDebugMode() || developmentMode;
- final boolean productionMode = !debugMode && projectStage == ProjectStage.Production;
+ final boolean productionMode = projectStage == ProjectStage.Production;
boolean calculateScrollbarWeight = false;
int clientLogSeverity = 2;
- if (debugMode) {
+ if (developmentMode) {
String severity = (String) facesContext.getExternalContext().getRequestMap().get(CLIENT_DEBUG_SEVERITY);
if (LOG.isDebugEnabled()) {
LOG.debug("get " + CLIENT_DEBUG_SEVERITY + " = " + severity);
@@ -208,7 +207,7 @@ public class PageRenderer extends PageRe
writer.endElement(HtmlElements.TITLE);
final Theme theme = client.getTheme();
- if (debugMode) {
+ if (developmentMode) {
// This tag must not be earlier, because the
// IE doesn't accept some META tags, when they are not the first ones.
writer.writeJavascript("var TbgHeadStart = new Date();");
@@ -260,7 +259,7 @@ public class PageRenderer extends PageRe
writer.endElement(HtmlElements.STYLE);
}
- if (debugMode) {
+ if (developmentMode) {
boolean hideClientLogging = true;
String severity = (String) facesContext.getExternalContext().getRequestMap().get(CLIENT_DEBUG_SEVERITY);
if (LOG.isDebugEnabled()) {
@@ -399,17 +398,8 @@ public class PageRenderer extends PageRe
writer.write(ResourceManagerUtils.getImageWithPath(facesContext, "image/tobago-overlay-background.png"));
writer.write("';\n");
writer.endJavascript();
-/*
- if (debugMode) {
- final String[] jsFiles = new String[]{
- "script/logging.js"
- };
- final String[] jsCommand = new String[]{"new LOG.LogArea({hide: " + hideClientLogging + "});"};
- HtmlRendererUtils.writeScriptLoader(facesContext, jsFiles, jsCommand);
- writer.writeJavascript("TbgTimer.startBody = new Date();");
- }
-*/
- if (debugMode) {
+
+ if (developmentMode) {
writer.writeJavascript("TbgTimer.startBody = new Date();");
}
@@ -463,7 +453,7 @@ public class PageRenderer extends PageRe
Secret.encode(facesContext, writer);
}
- if (debugMode) {
+ if (developmentMode) {
writer.startElement(HtmlElements.INPUT, null);
writer.writeAttribute(HtmlAttributes.VALUE, clientLogSeverity);
writer.writeAttribute(HtmlAttributes.ID, clientId + ComponentUtils.SUB_SEPARATOR + "clientSeverity", false);
@@ -574,8 +564,6 @@ public class PageRenderer extends PageRe
}
String clientId = page.getClientId(facesContext);
- final boolean debugMode = VariableResolverUtils.resolveClientProperties(facesContext).isDebugMode();
-
// avoid submit page in ie if the form contains only one input and you press the enter key in the input
if (VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().isMsie()) {
@@ -660,7 +648,9 @@ public class PageRenderer extends PageRe
writer.endElement(HtmlElements.IMG);
// debugging...
- if (debugMode) {
+ final ProjectStage projectStage = TobagoConfig.getInstance(facesContext).getProjectStage();
+ final boolean developmentMode = projectStage == ProjectStage.Development;
+ if (developmentMode) {
List<String> logMessages = new ArrayList<String>();
for (Iterator ids = facesContext.getClientIdsWithMessages();
ids.hasNext();) {
@@ -678,9 +668,7 @@ public class PageRenderer extends PageRe
HtmlRendererUtils.writeScriptLoader(facesContext, null,
logMessages.toArray(new String[logMessages.size()]));
- }
- if (debugMode) {
writer.writeJavascript("TbgTimer.endBody = new Date();");
}
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml Tue Apr 1 13:15:08 2014
@@ -27,7 +27,6 @@
<entry key="configTheme">Theme</entry>
<entry key="configThemeWithAccessKey">_Theme</entry>
<entry key="configThemeText">Which theme should be used?</entry>
- <entry key="configDebugMode">Use _debug mode</entry>
<entry key="configLocale">Locale</entry>
<entry key="configLocaleText">Which locale should be used?</entry>
<entry key="configContentType">Content type</entry>
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml Tue Apr 1 13:15:08 2014
@@ -29,7 +29,6 @@
<entry key="configTitle">Konfiguration des Clients des Tobago-Frameworks</entry>
<entry key="configTheme">Design</entry>
<entry key="configThemeText">Welches Design soll verwendet werden?</entry>
- <entry key="configDebugMode">Soll der _Debugmodus aktiviert werden?</entry>
<entry key="configLocale">Sprache</entry>
<entry key="configLocaleText">Welche Sprache/Region soll verwendet werden?</entry>
<entry key="configContentType">Inhaltstyp</entry>
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml?rev=1583657&r1=1583656&r2=1583657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml Tue Apr 1 13:15:08 2014
@@ -27,7 +27,6 @@
<entry key="configTheme">Tema</entry>
<entry key="configThemeWithAccessKey">_Tema</entry>
<entry key="configThemeText">¿Que tema debe de ser utilizado?</entry>
- <entry key="configDebugMode">Usa modo de _debugueo</entry>
<entry key="configLocale">Idioma</entry>
<entry key="configLocaleText">¿Que idioma debe de ser utilizado?</entry>
<entry key="configContentType">Tipo de contenido</entry>