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 2009/08/12 19:13:04 UTC
svn commit: r803605 - in /myfaces/tobago/branches/tobago-1.0.x:
core/src/main/java/org/apache/myfaces/tobago/taglib/component/
sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/
Author: lofwyr
Date: Wed Aug 12 17:13:03 2009
New Revision: 803605
URL: http://svn.apache.org/viewvc?rev=803605&view=rev
Log:
TOBAGO-762: Define a log category for deprected code.
- add error for using label attribute
Modified:
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/DateTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/FileTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTag.java
myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTag.java
myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/RichTextEditorTag.java
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/DateTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/DateTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/DateTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/DateTag.java Wed Aug 12 17:13:03 2009
@@ -22,18 +22,15 @@
* $Id$
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.TobagoConstants.RENDERER_TYPE_DATE;
-import org.apache.myfaces.tobago.component.UIDateInput;
import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.component.UIDateInput;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class DateTag extends InputTag implements DateTagDeclaration {
- private static final Log LOG = LogFactory.getLog(DateTag.class);
-
private String markup;
public String getComponentType() {
@@ -45,8 +42,8 @@
}
protected void setProperties(UIComponent component) {
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in tc:date, please use tx:date instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error("the label attribute is deprecated in tc:date, please use tx:date instead.");
}
ComponentUtil.setMarkup(component, markup);
super.setProperties(component);
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/FileTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/FileTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/FileTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/FileTag.java Wed Aug 12 17:13:03 2009
@@ -17,20 +17,17 @@
* limitations under the License.
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.UIFileInput;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.servlet.jsp.JspException;
public class FileTag extends InputTag implements FileTagDeclaration {
- private static final Log LOG = LogFactory.getLog(FileTag.class);
-
public int doStartTag() throws JspException {
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in t:in, please use tx:in instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error("the label attribute is deprecated in tc:file, please use tx:file instead.");
}
return super.doStartTag();
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/InTag.java Wed Aug 12 17:13:03 2009
@@ -22,18 +22,15 @@
* $Id$
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_PASSWORD;
import org.apache.myfaces.tobago.component.ComponentUtil;
import org.apache.myfaces.tobago.component.UIInput;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class InTag extends TextInputTag implements InTagDeclaration {
- private static final Log LOG = LogFactory.getLog(InTag.class);
-
private String password;
private String suggestMethod;
private String markup;
@@ -51,8 +48,8 @@
protected void setProperties(UIComponent component) {
super.setProperties(component);
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in t:in, please use tx:in instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error("the label attribute is deprecated in tc:in, please use tx:in instead.");
}
ComponentUtil.setBooleanProperty(component, ATTR_PASSWORD, password);
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyListboxTag.java Wed Aug 12 17:13:03 2009
@@ -17,23 +17,21 @@
* limitations under the License.
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.UISelectMany;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class SelectManyListboxTag extends SelectManyTag implements SelectManyListboxTagDeclaration {
- private static final Log LOG = LogFactory.getLog(SelectManyListboxTag.class);
-
public String getComponentType() {
return UISelectMany.COMPONENT_TYPE;
}
protected void setProperties(UIComponent component) {
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in tc:selectManyListbox, please use tx:selectManyListbox instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error(
+ "the label attribute is deprecated in tc:selectManyListbox, please use tx:selectManyListbox instead.");
}
super.setProperties(component);
}
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTag.java Wed Aug 12 17:13:03 2009
@@ -22,18 +22,16 @@
* $Id$
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class SelectOneChoiceTag extends SelectOneTag implements SelectOneChoiceTagDeclaration {
- private static final Log LOG = LogFactory.getLog(SelectOneChoiceTag.class);
-
protected void setProperties(UIComponent component) {
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in tc:selectOneChoice, please use tx:selectOneChoice instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error(
+ "the label attribute is deprecated in tc:selectOneChoice, please use tx:selectOneChoice instead.");
}
super.setProperties(component);
}
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneListboxTag.java Wed Aug 12 17:13:03 2009
@@ -22,18 +22,16 @@
* $Id$
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class SelectOneListboxTag extends SelectOneTag implements SelectOneListboxTagDeclaration {
- private static final Log LOG = LogFactory.getLog(SelectOneListboxTag.class);
-
protected void setProperties(UIComponent component) {
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in tc:selectOneListbox, please use tx:selectOneListbox instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error(
+ "the label attribute is deprecated in tc:selectOneListbox, please use tx:selectOneListbox instead.");
}
super.setProperties(component);
}
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TextAreaTag.java Wed Aug 12 17:13:03 2009
@@ -17,22 +17,18 @@
* limitations under the License.
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class TextAreaTag extends TextInputTag
implements TextAreaTagDeclaration {
- private static final Log LOG = LogFactory.getLog(TextAreaTag.class);
-
private String rows;
private String markup;
-
@Override
public void release() {
super.release();
@@ -42,12 +38,10 @@
@Override
protected void setProperties(UIComponent component) {
- super.setProperties(component);
-
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in t:in, please use tx:in instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error("the label attribute is deprecated in tc:textArea, please use tx:textArea instead.");
}
-
+ super.setProperties(component);
ComponentUtil.setStringProperty(component, ATTR_ROWS, rows);
ComponentUtil.setMarkup(component, markup);
}
Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TimeTag.java Wed Aug 12 17:13:03 2009
@@ -17,23 +17,20 @@
* limitations under the License.
*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.UITimeInput;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
public class TimeTag extends InputTag implements TimeTagDeclaration {
- private static final Log LOG = LogFactory.getLog(TimeTag.class);
-
public String getComponentType() {
return UITimeInput.COMPONENT_TYPE;
}
protected void setProperties(UIComponent component) {
- if (getLabel() != null) {
- LOG.warn("the label attribute is deprecated in tc:time, please use tx:time instead.");
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error("the label attribute is deprecated in tc:time, please use tx:time instead.");
}
super.setProperties(component);
}
Modified: myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/RichTextEditorTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/RichTextEditorTag.java?rev=803605&r1=803604&r2=803605&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/RichTextEditorTag.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/taglib/sandbox/RichTextEditorTag.java Wed Aug 12 17:13:03 2009
@@ -21,6 +21,7 @@
import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
import org.apache.myfaces.tobago.component.ComponentUtil;
import org.apache.myfaces.tobago.taglib.component.TextInputTag;
+import org.apache.myfaces.tobago.util.Deprecation;
import javax.faces.component.UIComponent;
import javax.servlet.jsp.JspException;
@@ -42,6 +43,10 @@
}
protected void setProperties(UIComponent component) {
+ if (getLabel() != null && Deprecation.LOG.isErrorEnabled()) {
+ Deprecation.LOG.error(
+ "the label attribute is deprecated in tc:richTextEditor, please use tx:richTextEditor instead.");
+ }
super.setProperties(component);
ComponentUtil.setBooleanProperty(component, ATTR_STATE_PREVIEW, statePreview);
}