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:26:16 UTC
svn commit: r1583660 - in /myfaces/tobago/trunk:
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-example-demo/src/m...
Author: lofwyr
Date: Tue Apr 1 13:26:15 2014
New Revision: 1583660
URL: http://svn.apache.org/r1583660
Log:
TOBAGO-1367: Remove debugMode from ClientProperties
Removed:
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java Tue Apr 1 13:26:15 2014
@@ -56,6 +56,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 Measure verticalScrollbarWeight;
@@ -132,10 +135,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(final boolean debugMode) {
this.debugMode = debugMode;
}
Modified: myfaces/tobago/trunk/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/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/clientConfig/ClientConfigController.java Tue Apr 1 13:26:15 2014
@@ -38,8 +38,6 @@ public class ClientConfigController {
private static final Logger LOG = LoggerFactory.getLogger(ClientConfigController.class);
- private boolean debugMode;
-
private Theme theme;
private SelectItem[] themeItems;
@@ -93,15 +91,11 @@ public class ClientConfigController {
public void storeInClientProperties() {
final ClientProperties client = ClientProperties.getInstance(FacesContext.getCurrentInstance());
-
- client.setDebugMode(debugMode);
client.setTheme(theme);
}
public void loadFromClientProperties() {
final ClientProperties client = ClientProperties.getInstance(FacesContext.getCurrentInstance());
-
- debugMode = client.isDebugMode();
theme = client.getTheme();
}
@@ -143,14 +137,6 @@ public class ClientConfigController {
.getVariableResolver().resolveVariable(facesContext, beanName);
}
- public boolean isDebugMode() {
- return debugMode;
- }
-
- public void setDebugMode(final boolean debugMode) {
- this.debugMode = debugMode;
- }
-
public Theme getTheme() {
return theme;
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.tag Tue Apr 1 13:26:15 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>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tags/layout/overview.xhtml Tue Apr 1 13:26:15 2014
@@ -44,10 +44,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>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/10-locale/locale.xhtml Tue Apr 1 13:26:15 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/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ClientConfigController.java Tue Apr 1 13:26:15 2014
@@ -34,8 +34,6 @@ import java.util.Locale;
public class ClientConfigController {
- private boolean debugMode;
-
private Theme theme;
private SelectItem[] themeItems;
@@ -74,15 +72,11 @@ public class ClientConfigController {
public void storeInClientProperties() {
final ClientProperties client = ClientProperties.getInstance(FacesContext.getCurrentInstance());
-
- client.setDebugMode(debugMode);
client.setTheme(theme);
}
public void loadFromClientProperties() {
final ClientProperties client = ClientProperties.getInstance(FacesContext.getCurrentInstance());
-
- debugMode = client.isDebugMode();
theme = client.getTheme();
}
@@ -109,14 +103,6 @@ public class ClientConfigController {
}
}
- public boolean isDebugMode() {
- return debugMode;
- }
-
- public void setDebugMode(final boolean debugMode) {
- this.debugMode = debugMode;
- }
-
public Theme getTheme() {
return theme;
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml Tue Apr 1 13:26:15 2014
@@ -23,12 +23,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
- <lifecycle>
- <phase-listener>
- org.apache.myfaces.tobago.example.test.DebugModePhaseListener
- </phase-listener>
- </lifecycle>
-
<factory>
<exception-handler-factory>
org.apache.myfaces.tobago.example.test.TestExceptionHandlerFactory
Modified: myfaces/tobago/trunk/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/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml Tue Apr 1 13:26:15 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/trunk/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/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_de.properties.xml (original)
+++ myfaces/tobago/trunk/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:26:15 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/trunk/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/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago_es.properties.xml (original)
+++ myfaces/tobago/trunk/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:26:15 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>
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java?rev=1583660&r1=1583659&r2=1583660&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java Tue Apr 1 13:26:15 2014
@@ -179,10 +179,9 @@ public class PageRenderer extends PageRe
final ClientProperties client = ClientProperties.getInstance(facesContext);
final ProjectStage projectStage = tobagoConfig.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;
int clientLogSeverity = 2;
- if (debugMode) {
+ if (developmentMode) {
final String severity = (String) externalContext.getRequestMap().get(CLIENT_DEBUG_SEVERITY);
if (LOG.isDebugEnabled()) {
LOG.debug("get " + CLIENT_DEBUG_SEVERITY + " = " + severity);
@@ -392,7 +391,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);
@@ -501,7 +500,8 @@ public class PageRenderer extends PageRe
final String clientId = page.getClientId(facesContext);
final ClientProperties clientProperties = ClientProperties.getInstance(facesContext);
- final boolean debugMode = clientProperties.isDebugMode();
+ final ProjectStage projectStage = TobagoConfig.getInstance(facesContext).getProjectStage();
+ final boolean developmentMode = projectStage == ProjectStage.Development;
// avoid submit page in ie if the form contains only one input and you press the enter key in the input
if (clientProperties.getUserAgent().isMsie()) {
@@ -573,7 +573,7 @@ public class PageRenderer extends PageRe
writer.endElement(HtmlElements.IMG);
// debugging...
- if (debugMode) {
+ if (developmentMode) {
final List<String> logMessages = new ArrayList<String>();
String id = null;
for (final Iterator<String> ids = facesContext.getClientIdsWithMessages(); ids.hasNext(); id = ids.next()) {