JBoss Rich Faces SVN: r19033 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-08-31 07:26:53 -0400 (Tue, 31 Aug 2010)
New Revision: 19033
Added:
branches/autocomplete/
Log:
Create branch for autocomplete
Copied: branches/autocomplete (from rev 19032, trunk)
14 years, 4 months
JBoss Rich Faces SVN: r19032 - in modules/tests/metamer/trunk/application: src/main/java/org/richfaces/tests/metamer/bean and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-08-31 07:23:39 -0400 (Tue, 31 Aug 2010)
New Revision: 19032
Modified:
modules/tests/metamer/trunk/application/pom.xml
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java
Log:
* fixed dependencies on SLF4J
Modified: modules/tests/metamer/trunk/application/pom.xml
===================================================================
--- modules/tests/metamer/trunk/application/pom.xml 2010-08-31 00:06:13 UTC (rev 19031)
+++ modules/tests/metamer/trunk/application/pom.xml 2010-08-31 11:23:39 UTC (rev 19032)
@@ -72,12 +72,13 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- </dependency><dependency>
+ <version>1.6.1</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- </dependency><!-- Logging -->
-
-
+ <version>1.6.1</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java 2010-08-31 00:06:13 UTC (rev 19031)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java 2010-08-31 11:23:39 UTC (rev 19032)
@@ -28,7 +28,7 @@
import javax.faces.bean.ManagedBean;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* Vendor and version information for project Metamer.
14 years, 4 months
JBoss Rich Faces SVN: r19031 - branches/RFPL-434/core/impl/src/test/java/org/richfaces/application.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 20:06:13 -0400 (Mon, 30 Aug 2010)
New Revision: 19031
Added:
branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java
Removed:
branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java
Log:
Test class renamed
Copied: branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java (from rev 19030, branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java)
===================================================================
--- branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java (rev 0)
+++ branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java 2010-08-31 00:06:13 UTC (rev 19031)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Locale;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.l10n.BundleLoader;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MessageFactoryImplTest {
+
+ private MockFacesEnvironment facesEnvironment;
+
+ private MessageFactory messageFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ Locale.setDefault(Locale.US);
+
+ facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
+
+ messageFactory = new MessageFactoryImpl(new BundleLoader());
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ facesEnvironment.verify();
+ facesEnvironment.release();
+ facesEnvironment = null;
+
+ messageFactory = null;
+ }
+
+ @Test
+ public void testCreateMessageFromFacesBundle() throws Exception {
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
+ facesEnvironment.replay();
+
+ // {1}: Could not convert ''{0}'' to a string.
+ FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertNotNull(stringConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
+ assertEquals("Message: Could not convert 'something' to a string.", stringConverterMessage.getSummary());
+ assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
+
+ // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' must be convertible to an enum.
+ // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' must be convertible to an enum from the enum that contains the constant ''{1}''.
+ FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
+ assertNotNull(longConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
+ assertEquals("Failed: 'field' must be convertible to an enum.", longConverterMessage.getSummary());
+ assertEquals(
+ "Failed: 'field' must be convertible to an enum from the enum that contains the constant 'anotherField'.",
+ longConverterMessage.getDetail());
+ }
+
+ @Test
+ public void testCreateMessageFromApplicationBundle() throws Exception {
+ UIViewRoot mockViewRoot = facesEnvironment.createMock(UIViewRoot.class);
+ expect(mockViewRoot.getLocale()).andStubReturn(new Locale("ru", "RU"));
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(mockViewRoot);
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.application.MessageFactoryImplTest");
+ facesEnvironment.replay();
+
+ // {1}: ''{0}'' ne konvertiruyetsia v stroku.
+ FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertNotNull(stringConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
+ assertEquals("Message: 'something' ne konvertiruyetsia v stroku.", stringConverterMessage.getSummary());
+ assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
+
+ // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
+ // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
+ FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
+ assertNotNull(longConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
+ assertEquals("Failed: 'field' dolzhno konvertirovat'sia v enum.", longConverterMessage.getSummary());
+ assertEquals(
+ "Failed: 'field' dolzhno konvertirovat'sia v enum iz enum s konstantoj 'anotherField'.",
+ longConverterMessage.getDetail());
+
+ // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
+ FacesMessage inputConversionMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.UIINPUT_CONVERSION, "Failure message");
+ assertNotNull(inputConversionMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, inputConversionMessage.getSeverity());
+ assertEquals("Failure message: Conversion error occurred.", inputConversionMessage.getSummary());
+ }
+}
Deleted: branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java
===================================================================
--- branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java 2010-08-31 00:05:21 UTC (rev 19030)
+++ branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java 2010-08-31 00:06:13 UTC (rev 19031)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Locale;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIViewRoot;
-
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.richfaces.l10n.BundleLoader;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class MessageFactoryImplTest1 {
-
- private MockFacesEnvironment facesEnvironment;
-
- private MessageFactory messageFactory;
-
- @Before
- public void setUp() throws Exception {
- Locale.setDefault(Locale.US);
-
- facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
-
- messageFactory = new MessageFactoryImpl(new BundleLoader());
- }
-
- @After
- public void tearDown() throws Exception {
- facesEnvironment.verify();
- facesEnvironment.release();
- facesEnvironment = null;
-
- messageFactory = null;
- }
-
- @Test
- public void testCreateMessageFromFacesBundle() throws Exception {
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
- facesEnvironment.replay();
-
- // {1}: Could not convert ''{0}'' to a string.
- FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertNotNull(stringConverterMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
- assertEquals("Message: Could not convert 'something' to a string.", stringConverterMessage.getSummary());
- assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
-
- // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' must be convertible to an enum.
- // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' must be convertible to an enum from the enum that contains the constant ''{1}''.
- FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
- assertNotNull(longConverterMessage);
- assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
- assertEquals("Failed: 'field' must be convertible to an enum.", longConverterMessage.getSummary());
- assertEquals(
- "Failed: 'field' must be convertible to an enum from the enum that contains the constant 'anotherField'.",
- longConverterMessage.getDetail());
- }
-
- @Test
- public void testCreateMessageFromApplicationBundle() throws Exception {
- UIViewRoot mockViewRoot = facesEnvironment.createMock(UIViewRoot.class);
- expect(mockViewRoot.getLocale()).andStubReturn(new Locale("ru", "RU"));
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(mockViewRoot);
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.application.MessageFactoryImplTest");
- facesEnvironment.replay();
-
- // {1}: ''{0}'' ne konvertiruyetsia v stroku.
- FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertNotNull(stringConverterMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
- assertEquals("Message: 'something' ne konvertiruyetsia v stroku.", stringConverterMessage.getSummary());
- assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
-
- // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
- // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
- FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
- assertNotNull(longConverterMessage);
- assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
- assertEquals("Failed: 'field' dolzhno konvertirovat'sia v enum.", longConverterMessage.getSummary());
- assertEquals(
- "Failed: 'field' dolzhno konvertirovat'sia v enum iz enum s konstantoj 'anotherField'.",
- longConverterMessage.getDetail());
-
- // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
- FacesMessage inputConversionMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.UIINPUT_CONVERSION, "Failure message");
- assertNotNull(inputConversionMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, inputConversionMessage.getSeverity());
- assertEquals("Failure message: Conversion error occurred.", inputConversionMessage.getSummary());
- }
-}
14 years, 4 months
JBoss Rich Faces SVN: r19030 - branches/RFPL-434/core/impl/src/test/java/org/richfaces/application.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 20:05:21 -0400 (Mon, 30 Aug 2010)
New Revision: 19030
Added:
branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java
Removed:
branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java
Log:
Test class renamed
Copied: branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java (from rev 19025, branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java)
===================================================================
--- branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java (rev 0)
+++ branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest1.java 2010-08-31 00:05:21 UTC (rev 19030)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Locale;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.l10n.BundleLoader;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MessageFactoryImplTest1 {
+
+ private MockFacesEnvironment facesEnvironment;
+
+ private MessageFactory messageFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ Locale.setDefault(Locale.US);
+
+ facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
+
+ messageFactory = new MessageFactoryImpl(new BundleLoader());
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ facesEnvironment.verify();
+ facesEnvironment.release();
+ facesEnvironment = null;
+
+ messageFactory = null;
+ }
+
+ @Test
+ public void testCreateMessageFromFacesBundle() throws Exception {
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
+ facesEnvironment.replay();
+
+ // {1}: Could not convert ''{0}'' to a string.
+ FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertNotNull(stringConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
+ assertEquals("Message: Could not convert 'something' to a string.", stringConverterMessage.getSummary());
+ assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
+
+ // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' must be convertible to an enum.
+ // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' must be convertible to an enum from the enum that contains the constant ''{1}''.
+ FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
+ assertNotNull(longConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
+ assertEquals("Failed: 'field' must be convertible to an enum.", longConverterMessage.getSummary());
+ assertEquals(
+ "Failed: 'field' must be convertible to an enum from the enum that contains the constant 'anotherField'.",
+ longConverterMessage.getDetail());
+ }
+
+ @Test
+ public void testCreateMessageFromApplicationBundle() throws Exception {
+ UIViewRoot mockViewRoot = facesEnvironment.createMock(UIViewRoot.class);
+ expect(mockViewRoot.getLocale()).andStubReturn(new Locale("ru", "RU"));
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(mockViewRoot);
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.application.MessageFactoryImplTest");
+ facesEnvironment.replay();
+
+ // {1}: ''{0}'' ne konvertiruyetsia v stroku.
+ FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertNotNull(stringConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
+ assertEquals("Message: 'something' ne konvertiruyetsia v stroku.", stringConverterMessage.getSummary());
+ assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
+
+ // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
+ // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
+ FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
+ assertNotNull(longConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
+ assertEquals("Failed: 'field' dolzhno konvertirovat'sia v enum.", longConverterMessage.getSummary());
+ assertEquals(
+ "Failed: 'field' dolzhno konvertirovat'sia v enum iz enum s konstantoj 'anotherField'.",
+ longConverterMessage.getDetail());
+
+ // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
+ FacesMessage inputConversionMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.UIINPUT_CONVERSION, "Failure message");
+ assertNotNull(inputConversionMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, inputConversionMessage.getSeverity());
+ assertEquals("Failure message: Conversion error occurred.", inputConversionMessage.getSummary());
+ }
+}
Deleted: branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java
===================================================================
--- branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java 2010-08-30 23:21:27 UTC (rev 19029)
+++ branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java 2010-08-31 00:05:21 UTC (rev 19030)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Locale;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIViewRoot;
-
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.richfaces.l10n.BundleLoader;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class MessageFactoryImpltest {
-
- private MockFacesEnvironment facesEnvironment;
-
- private MessageFactory messageFactory;
-
- @Before
- public void setUp() throws Exception {
- Locale.setDefault(Locale.US);
-
- facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
-
- messageFactory = new MessageFactoryImpl(new BundleLoader());
- }
-
- @After
- public void tearDown() throws Exception {
- facesEnvironment.verify();
- facesEnvironment.release();
- facesEnvironment = null;
-
- messageFactory = null;
- }
-
- @Test
- public void testCreateMessageFromFacesBundle() throws Exception {
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
- facesEnvironment.replay();
-
- // {1}: Could not convert ''{0}'' to a string.
- FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertNotNull(stringConverterMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
- assertEquals("Message: Could not convert 'something' to a string.", stringConverterMessage.getSummary());
- assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
-
- // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' must be convertible to an enum.
- // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' must be convertible to an enum from the enum that contains the constant ''{1}''.
- FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
- assertNotNull(longConverterMessage);
- assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
- assertEquals("Failed: 'field' must be convertible to an enum.", longConverterMessage.getSummary());
- assertEquals(
- "Failed: 'field' must be convertible to an enum from the enum that contains the constant 'anotherField'.",
- longConverterMessage.getDetail());
- }
-
- @Test
- public void testCreateMessageFromApplicationBundle() throws Exception {
- UIViewRoot mockViewRoot = facesEnvironment.createMock(UIViewRoot.class);
- expect(mockViewRoot.getLocale()).andStubReturn(new Locale("ru", "RU"));
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(mockViewRoot);
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.application.MessageFactoryImplTest");
- facesEnvironment.replay();
-
- // {1}: ''{0}'' ne konvertiruyetsia v stroku.
- FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertNotNull(stringConverterMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
- assertEquals("Message: 'something' ne konvertiruyetsia v stroku.", stringConverterMessage.getSummary());
- assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
-
- // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
- // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
- FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
- assertNotNull(longConverterMessage);
- assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
- assertEquals("Failed: 'field' dolzhno konvertirovat'sia v enum.", longConverterMessage.getSummary());
- assertEquals(
- "Failed: 'field' dolzhno konvertirovat'sia v enum iz enum s konstantoj 'anotherField'.",
- longConverterMessage.getDetail());
-
- // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
- FacesMessage inputConversionMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.UIINPUT_CONVERSION, "Failure message");
- assertNotNull(inputConversionMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, inputConversionMessage.getSeverity());
- assertEquals("Failure message: Conversion error occurred.", inputConversionMessage.getSummary());
- }
-}
14 years, 4 months
JBoss Rich Faces SVN: r19029 - branches/RFPL-434.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 19:21:27 -0400 (Mon, 30 Aug 2010)
New Revision: 19029
Modified:
branches/RFPL-434/
Log:
Reverted change from r19026
Property changes on: branches/RFPL-434
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-19022
+ /branches/RFPL-754:1-18909 /trunk:1-19022
14 years, 4 months
JBoss Rich Faces SVN: r19028 - in trunk: archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources and 74 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 19:15:03 -0400 (Mon, 30 Aug 2010)
New Revision: 19028
Added:
trunk/core/api/src/main/java/org/richfaces/application/MessageFactory.java
trunk/core/commons/src/main/java/org/richfaces/application/
trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
trunk/core/commons/src/main/java/org/richfaces/l10n/
trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
trunk/core/commons/src/main/java/org/richfaces/log/
trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java
trunk/core/commons/src/main/java/org/richfaces/log/Logger.java
trunk/core/commons/src/test/java/org/richfaces/l10n/
trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
trunk/core/commons/src/test/java/org/richfaces/log/
trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
trunk/core/commons/src/test/resources/
trunk/core/commons/src/test/resources/org/
trunk/core/commons/src/test/resources/org/richfaces/
trunk/core/commons/src/test/resources/org/richfaces/l10n/
trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
trunk/core/commons/src/test/resources/org/richfaces/log/
trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties
trunk/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java
trunk/core/impl/src/test/java/org/richfaces/application/
trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java
trunk/core/impl/src/test/resources/org/richfaces/application/
trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
Removed:
trunk/core/commons/src/main/java/org/richfaces/JavaLogger.java
trunk/core/commons/src/main/java/org/richfaces/LogFactory.java
trunk/core/commons/src/main/java/org/richfaces/Logger.java
trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java
trunk/core/commons/src/main/java/org/richfaces/log/Logger.java
trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
trunk/core/commons/src/test/resources/org/
trunk/core/commons/src/test/resources/org/richfaces/
trunk/core/commons/src/test/resources/org/richfaces/l10n/
trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
trunk/core/commons/src/test/resources/org/richfaces/log/
trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties
trunk/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java
trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java
trunk/core/impl/src/test/resources/log4j.xml
trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
trunk/core/legacy-tests/src/test/resources/log4j.xml
trunk/examples/core-demo/src/main/resources/log4j.xml
trunk/examples/richfaces-showcase/src/main/resources/log4j.properties
trunk/examples/richfaces-showcase/src/main/resources/log4j.xml
Modified:
trunk/
trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml
trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java
trunk/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml
trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml
trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml
trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml
trunk/bom/pom.xml
trunk/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java
trunk/cdk/maven-resources-plugin/pom.xml
trunk/cdk/parent/pom.xml
trunk/core/api/pom.xml
trunk/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
trunk/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java
trunk/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
trunk/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
trunk/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java
trunk/core/commons/pom.xml
trunk/core/impl/pom.xml
trunk/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java
trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java
trunk/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
trunk/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java
trunk/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java
trunk/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java
trunk/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java
trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
trunk/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
trunk/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
trunk/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
trunk/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java
trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java
trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java
trunk/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java
trunk/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
trunk/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java
trunk/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
trunk/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java
trunk/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java
trunk/core/impl/src/main/java/org/richfaces/VersionBean.java
trunk/core/impl/src/main/java/org/richfaces/application/DefaultModule.java
trunk/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java
trunk/core/impl/src/main/java/org/richfaces/application/InitializationListener.java
trunk/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
trunk/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
trunk/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java
trunk/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
trunk/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
trunk/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
trunk/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
trunk/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java
trunk/core/impl/src/main/java/org/richfaces/util/Util.java
trunk/dist/readme-ui.txt
trunk/examples/core-demo/pom.xml
trunk/examples/core-demo/src/main/java/org/richfaces/demo/PhaseTracker.java
trunk/examples/input-demo/pom.xml
trunk/examples/iteration-demo/pom.xml
trunk/examples/misc-demo/pom.xml
trunk/examples/output-demo/pom.xml
trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
trunk/examples/repeater-demo/pom.xml
trunk/examples/richfaces-showcase/pom.xml
trunk/ui/core/ui/src/main/java/org/richfaces/component/QueueRegistry.java
trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataGrid.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
trunk/ui/parent/pom.xml
Log:
https://jira.jboss.org/browse/RFPL-434 - merging into /trunk
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RFPL-434:1-18939 /branches/RFPL-754:1-18909
+ /branches/RFPL-434:1-19024 /branches/RFPL-754:1-18909
Modified: trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml
===================================================================
--- trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -107,8 +107,8 @@
<configuration>
<webappDirectory>${symbol_dollar}{project.build.directory}/${symbol_dollar}{project.build.finalName}-jee6</webappDirectory>
<classifier>jee6</classifier>
- <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</packagingExcludes>
- <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</packagingExcludes>
+ <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</warSourceExcludes>
</configuration>
</execution>
</executions>
@@ -171,33 +171,12 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
-
<!-- Tests -->
<dependency>
<groupId>org.testng</groupId>
Modified: trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java
===================================================================
--- trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,7 +1,7 @@
package org.richfaces;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
import java.io.Serializable;
@@ -12,7 +12,7 @@
private String name;
public RichBean() {
- logger = LoggerFactory.getLogger(RichBean.class);
+ logger = LogFactory.getLogger(RichBean.class);
logger.info("post construct: initialize");
name = "John";
}
Modified: trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml
===================================================================
--- trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -75,12 +75,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
Modified: trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml
===================================================================
--- trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -91,12 +91,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
Modified: trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml
===================================================================
--- trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -90,12 +90,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
Modified: trunk/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml
===================================================================
--- trunk/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -85,12 +85,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
Modified: trunk/bom/pom.xml
===================================================================
--- trunk/bom/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/bom/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -185,18 +185,6 @@
<version>0.9.5</version>
</dependency>
- <!-- Logging -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.5.8</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
-
<!-- Optional cache dependencies -->
<dependency>
<groupId>opensymphony</groupId>
Modified: trunk/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java
===================================================================
--- trunk/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -24,75 +24,138 @@
package org.richfaces.cdk;
import java.util.logging.Level;
+import java.util.logging.LogRecord;
/**
- * <p class="changed_added_4_0">That logger delegates all calls to the JDK {@link java.util.logging.Logger}</p>
- *
+ * <p class="changed_added_4_0">
+ * That logger delegates all calls to the JDK {@link java.util.logging.Logger}
+ * </p>
+ *
* @author asmirnov(a)exadel.com
*/
public class JavaLogger implements Logger {
-
+
public static final String CDK_LOG = "org.richfaces.cdk";
+ private static final String CLASS_NAME = JavaLogger.class.getName();
+
private int errorCount = 0;
-
+
private java.util.logging.Logger jdkLogger = java.util.logging.Logger.getLogger(CDK_LOG);
+ private void fillCallerData(String fqn, LogRecord record) {
+ StackTraceElement[] stackTrace = new Exception().getStackTrace();
+
+ int i = 0;
+
+ for (; i < stackTrace.length; i++) {
+ if (fqn.equals(stackTrace[i].getClassName())) {
+ break;
+ }
+ }
+
+ int idx = i + 1;
+
+ for (; idx < stackTrace.length; idx++) {
+ if (!fqn.equals(stackTrace[idx].getClassName())) {
+ break;
+ }
+ }
+
+ if (idx < stackTrace.length) {
+ record.setSourceMethodName(stackTrace[idx].getMethodName());
+ record.setSourceClassName(stackTrace[idx].getClassName());
+ }
+ }
+
+ private LogRecord createRecord(Level level, CharSequence message, Throwable thrown) {
+ // millis and thread are filled by the constructor
+ LogRecord record = new LogRecord(level, message != null ? message.toString() : null);
+
+ // TODO resource bundle?
+ record.setLoggerName(jdkLogger.getName());
+ record.setThrown(thrown);
+ fillCallerData(CLASS_NAME, record);
+
+ return record;
+ }
+
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#debug(java.lang.CharSequence)
*/
@Override
public void debug(CharSequence content) {
- jdkLogger.fine(String.valueOf(content));
+ if (jdkLogger.isLoggable(Level.FINE)) {
+ jdkLogger.log(createRecord(Level.FINE, content, null));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#debug(java.lang.CharSequence, java.lang.Throwable)
*/
@Override
public void debug(CharSequence content, Throwable error) {
- jdkLogger.log(Level.FINE, String.valueOf(content), error);
+ if (jdkLogger.isLoggable(Level.FINE)) {
+ jdkLogger.log(createRecord(Level.FINE, content, error));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#debug(java.lang.Throwable)
*/
@Override
public void debug(Throwable error) {
- jdkLogger.log(Level.FINE, "", error);
+ if (jdkLogger.isLoggable(Level.FINE)) {
+ jdkLogger.log(createRecord(Level.FINE, "", error));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#error(java.lang.CharSequence)
*/
@Override
public void error(CharSequence content) {
errorCount++;
- jdkLogger.severe(String.valueOf(content));
+
+ if (jdkLogger.isLoggable(Level.SEVERE)) {
+ jdkLogger.log(createRecord(Level.SEVERE, content, null));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#error(java.lang.CharSequence, java.lang.Throwable)
*/
@Override
public void error(CharSequence content, Throwable error) {
errorCount++;
- jdkLogger.log(Level.SEVERE, String.valueOf(content), error);
+
+ if (jdkLogger.isLoggable(Level.SEVERE)) {
+ jdkLogger.log(createRecord(Level.SEVERE, content, error));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#error(java.lang.Throwable)
*/
@Override
public void error(Throwable error) {
errorCount++;
- jdkLogger.log(Level.SEVERE, "", error);
+
+ if (jdkLogger.isLoggable(Level.SEVERE)) {
+ jdkLogger.log(createRecord(Level.SEVERE, "", error));
+ }
}
@Override
@@ -101,34 +164,44 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#info(java.lang.CharSequence)
*/
@Override
public void info(CharSequence content) {
- jdkLogger.info(String.valueOf(content));
+ if (jdkLogger.isLoggable(Level.INFO)) {
+ jdkLogger.log(createRecord(Level.INFO, content, null));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#info(java.lang.CharSequence, java.lang.Throwable)
*/
@Override
public void info(CharSequence content, Throwable error) {
- jdkLogger.log(Level.INFO, String.valueOf(content), error);
+ if (jdkLogger.isLoggable(Level.INFO)) {
+ jdkLogger.log(createRecord(Level.INFO, content, error));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#info(java.lang.Throwable)
*/
@Override
public void info(Throwable error) {
- jdkLogger.log(Level.INFO, "", error);
+ if (jdkLogger.isLoggable(Level.INFO)) {
+ jdkLogger.log(createRecord(Level.INFO, "", error));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#isDebugEnabled()
*/
@Override
@@ -137,7 +210,8 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#isErrorEnabled()
*/
@Override
@@ -146,7 +220,8 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#isInfoEnabled()
*/
@Override
@@ -155,7 +230,8 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#isWarnEnabled()
*/
@Override
@@ -164,29 +240,38 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#warn(java.lang.CharSequence)
*/
@Override
public void warn(CharSequence content) {
- jdkLogger.warning(String.valueOf(content));
+ if (jdkLogger.isLoggable(Level.WARNING)) {
+ jdkLogger.log(createRecord(Level.WARNING, content, null));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#warn(java.lang.CharSequence, java.lang.Throwable)
*/
@Override
public void warn(CharSequence content, Throwable error) {
- jdkLogger.log(Level.WARNING, String.valueOf(content), error);
+ if (jdkLogger.isLoggable(Level.WARNING)) {
+ jdkLogger.log(createRecord(Level.WARNING, content, error));
+ }
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.Logger#warn(java.lang.Throwable)
*/
@Override
public void warn(Throwable error) {
- jdkLogger.log(Level.WARNING, "", error);
+ if (jdkLogger.isLoggable(Level.WARNING)) {
+ jdkLogger.log(createRecord(Level.WARNING, "", error));
+ }
}
}
Modified: trunk/cdk/maven-resources-plugin/pom.xml
===================================================================
--- trunk/cdk/maven-resources-plugin/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/cdk/maven-resources-plugin/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -78,10 +78,6 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
<dependency>
<groupId>com.yahoo.platform.yui</groupId>
Modified: trunk/cdk/parent/pom.xml
===================================================================
--- trunk/cdk/parent/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/cdk/parent/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -227,11 +227,6 @@
<version>1.0</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
- <dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
<version>2.3.6</version>
Modified: trunk/core/api/pom.xml
===================================================================
--- trunk/core/api/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/api/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -41,10 +41,6 @@
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
<!-- Provided dependencies -->
<dependency>
@@ -65,11 +61,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
Modified: trunk/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -24,9 +24,7 @@
package org.ajax4jsf.application;
import java.io.IOException;
-
import java.lang.reflect.Constructor;
-
import java.util.Locale;
import javax.faces.FacesException;
@@ -35,11 +33,9 @@
import javax.faces.context.FacesContext;
import org.ajax4jsf.Messages;
-
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
/**
* Base wrapper for {@link javax.faces.application.ViewHandler} . By default, delegate all
* method calls to wrapped handler.
Modified: trunk/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -28,16 +28,13 @@
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
import java.text.MessageFormat;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
/**
* @author Nick Belaevski
* @since 4.0
Modified: trunk/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -40,8 +40,8 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.Messages;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
Modified: trunk/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -25,14 +25,12 @@
import java.io.IOException;
import java.io.InputStream;
-
import java.net.URL;
import java.net.URLConnection;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
/**
* Utility class to solve JAR locking issue using {@link URLConnection#setUseCaches(boolean)} method.
* Contains one utility method that gets {@link InputStream} from {@link URL} with caching disabled.
Copied: trunk/core/api/src/main/java/org/richfaces/application/MessageFactory.java (from rev 19022, branches/RFPL-434/core/api/src/main/java/org/richfaces/application/MessageFactory.java)
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/application/MessageFactory.java (rev 0)
+++ trunk/core/api/src/main/java/org/richfaces/application/MessageFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MessageFactory {
+
+ public FacesMessage createMessage(FacesContext facesContext, Enum<?> messageKey, Object... args);
+
+ public FacesMessage createMessage(FacesContext facesContext, Severity severity, Enum<?> messageKey, Object... args);
+
+}
Modified: trunk/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -3,9 +3,6 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* @author Anton Belevich
*
@@ -27,7 +24,7 @@
}
public Logger getLogger() {
- return LoggerFactory.getLogger(loggerName);
+ return LogFactory.getLogger(loggerName);
}
/**
Modified: trunk/core/commons/pom.xml
===================================================================
--- trunk/core/commons/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/commons/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -54,6 +54,10 @@
<artifactId>jsf-mock</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
</dependencies>
<scm>
Deleted: trunk/core/commons/src/main/java/org/richfaces/JavaLogger.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/JavaLogger.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/commons/src/main/java/org/richfaces/JavaLogger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,214 +0,0 @@
-/*
- * $Id: JavaLogger.java 16812 2010-04-26 20:43:19Z alexsmirnov $
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-
-
-/**
- * <p class="changed_added_4_0">That logger delegates all calls to the JDK {@link java.util.logging.Logger}</p>
- *
- * @author asmirnov(a)exadel.com
- */
-public class JavaLogger implements Logger {
-
- public static final String RICHFACES_LOG = "org.richfaces.cdk";
-
-
- private static final String DEFAULT_MESSAGE = "Exception";
-
-
- private final java.util.logging.Logger jdkLogger;
-
- JavaLogger(String category) {
- jdkLogger = java.util.logging.Logger.getLogger(category);
- }
-
- JavaLogger() {
- this(RICHFACES_LOG);
- }
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#debug(java.lang.CharSequence)
- */
- public void debug(CharSequence content) {
- jdkLogger.fine(String.valueOf(content));
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#debug(java.lang.CharSequence, java.lang.Throwable)
- */
- public void debug(CharSequence content, Throwable error) {
- jdkLogger.log(java.util.logging.Level.FINE, String.valueOf(content), error);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#debug(java.lang.Throwable)
- */
- public void debug(Throwable error) {
- jdkLogger.log(java.util.logging.Level.FINE, "", error);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#error(java.lang.CharSequence)
- */
- public void error(CharSequence content) {
- jdkLogger.severe(String.valueOf(content));
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#error(java.lang.CharSequence, java.lang.Throwable)
- */
- public void error(CharSequence content, Throwable error) {
-
- jdkLogger.log(java.util.logging.Level.SEVERE, String.valueOf(content), error);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#error(java.lang.Throwable)
- */
- public void error(Throwable error) {
-
- jdkLogger.log(java.util.logging.Level.SEVERE, "", error);
- }
-
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#info(java.lang.CharSequence)
- */
- public void info(CharSequence content) {
- jdkLogger.info(String.valueOf(content));
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#info(java.lang.CharSequence, java.lang.Throwable)
- */
- public void info(CharSequence content, Throwable error) {
- jdkLogger.log(java.util.logging.Level.INFO, String.valueOf(content), error);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#info(java.lang.Throwable)
- */
- public void info(Throwable error) {
- jdkLogger.log(java.util.logging.Level.INFO, "", error);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#isDebugEnabled()
- */
- public boolean isDebugEnabled() {
- return jdkLogger.isLoggable(java.util.logging.Level.FINE);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#isErrorEnabled()
- */
- public boolean isErrorEnabled() {
- return jdkLogger.isLoggable(java.util.logging.Level.SEVERE);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#isInfoEnabled()
- */
- public boolean isInfoEnabled() {
- return jdkLogger.isLoggable(java.util.logging.Level.INFO);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#isWarnEnabled()
- */
- public boolean isWarnEnabled() {
- return jdkLogger.isLoggable(java.util.logging.Level.WARNING);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#warn(java.lang.CharSequence)
- */
- public void warn(CharSequence content) {
- jdkLogger.warning(String.valueOf(content));
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#warn(java.lang.CharSequence, java.lang.Throwable)
- */
- public void warn(CharSequence content, Throwable error) {
- jdkLogger.log(java.util.logging.Level.WARNING, String.valueOf(content), error);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.Logger#warn(java.lang.Throwable)
- */
- public void warn(Throwable error) {
- jdkLogger.log(java.util.logging.Level.WARNING, "", error);
- }
-
- public boolean isLogEnabled(Logger.Level level) {
- return jdkLogger.isLoggable(toJavaLevel(level));
- }
-
- public void log(org.richfaces.Logger.Level level, CharSequence content) {
- jdkLogger.log(toJavaLevel(level), String.valueOf(content));
-
- }
-
- public void log(org.richfaces.Logger.Level level, CharSequence content, Throwable error) {
- jdkLogger.log(toJavaLevel(level), String.valueOf(content),error);
- }
-
- public void log(org.richfaces.Logger.Level level, Throwable error) {
- jdkLogger.log(toJavaLevel(level),DEFAULT_MESSAGE, error);
- }
-
- private java.util.logging.Level toJavaLevel(Logger.Level level){
- switch (level) {
- case ERROR:
- return java.util.logging.Level.SEVERE;
- case INFO:
- return java.util.logging.Level.INFO;
- case WARNING:
- return java.util.logging.Level.WARNING;
- case DEBUG:
- return java.util.logging.Level.FINE;
- default :{
- //No level set
- throw new IllegalArgumentException("Logging level must be set to obtain a logger");
- }
- }
- }
-}
Deleted: trunk/core/commons/src/main/java/org/richfaces/LogFactory.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/LogFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/commons/src/main/java/org/richfaces/LogFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,61 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-/**
- * <p class="changed_added_4_0">This class produces loggers used by whole RichFaces library.</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public final class LogFactory {
-
- private static final Logger DEFAULT_LOGGER = new JavaLogger();
-
- private LogFactory(){
- // This class is not instantiable.
- }
-
-
- /**
- * <p class="changed_added_4_0">This method creates default logger.</p>
- * @return
- */
- public static Logger getLogger(){
- return DEFAULT_LOGGER;
- }
-
- /**
- * <p class="changed_added_4_0">This method produces logger instance for given category.</p>
- * @param category
- * @return
- */
- public static Logger getLogger(String category){
- return new JavaLogger(category);
- }
-
- public static Logger getLogger(Class<?> clazz){
- return getLogger(clazz.getName());
- }
-
-}
Deleted: trunk/core/commons/src/main/java/org/richfaces/Logger.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/Logger.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/commons/src/main/java/org/richfaces/Logger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,174 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-
-
-/**
- * That interface hides current logging system from classes.
- * Concrete implementation should provide appropriate logger instance that delegates
- * messages to the current log system.
- *
- * @author shura
- */
-public interface Logger {
-
- public enum Level {
- ERROR,
- INFO,
- WARNING,
- DEBUG
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return
- */
- public boolean isDebugEnabled();
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- */
- public void debug(CharSequence content);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- * @param error
- */
- public void debug(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param error
- */
- /**
- * <p class="changed_added_4_0"></p>
- * @param error
- */
- public void debug(Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return
- */
- public boolean isInfoEnabled();
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- */
- public void info(CharSequence content);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- * @param error
- */
- public void info(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param error
- */
- public void info(Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return
- */
- public boolean isWarnEnabled();
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- */
- public void warn(CharSequence content);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- * @param error
- */
- public void warn(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param error
- */
- public void warn(Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return
- */
- public boolean isErrorEnabled();
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- */
- public void error(CharSequence content);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param content
- * @param error
- */
- public void error(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param error
- */
- public void error(Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param level
- * @return
- */
- public boolean isLogEnabled(Level level);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param level
- * @param content
- */
- public void log(Level level,CharSequence content);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param level
- * @param content
- * @param error
- */
- public void log(Level level,CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param level
- * @param error
- */
- public void log(Level level, Throwable error);
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/application (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/application)
Deleted: trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/application/CoreMessages.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import org.richfaces.l10n.MessageBundle;
-
-
-/**
- * @author Nick Belaevski
- *
- */
-@MessageBundle(baseName = "org.richfaces.Messages")
-public final class CoreMessages {
-
- private CoreMessages() {}
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/application/CoreMessages.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import org.richfaces.l10n.MessageBundle;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@MessageBundle(baseName = "org.richfaces.Messages")
+public final class CoreMessages {
+
+ private CoreMessages() {}
+
+}
Deleted: trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/application/FacesMessages.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import javax.faces.application.FacesMessage;
-
-import org.richfaces.l10n.MessageBundle;
-
-/**
- * @author Nick Belaevski
- *
- */
-@MessageBundle(baseName = FacesMessage.FACES_MESSAGES)
-public enum FacesMessages {
-
- UIINPUT_CONVERSION("javax.faces.component.UIInput.CONVERSION"),
- UIINPUT_REQUIRED("javax.faces.component.UIInput.REQUIRED"),
- UIINPUT_UPDATE("javax.faces.component.UIInput.UPDATE"),
- UISELECTONE_INVALID("javax.faces.component.UISelectOne.INVALID"),
- UISELECTMANY_INVALID("javax.faces.component.UISelectMany.INVALID"),
- BIG_DECIMAL_CONVERTER_DECIMAL("javax.faces.converter.BigDecimalConverter.DECIMAL"),
- BIG_DECIMAL_CONVERTER_DECIMAL_DETAIL("javax.faces.converter.BigDecimalConverter.DECIMAL_detail"),
- BIG_INTEGER_CONVERTER_BIGINTEGER("javax.faces.converter.BigIntegerConverter.BIGINTEGER"),
- BIG_INTEGER_CONVERTER_BIGINTEGER_DETAIL("javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail"),
- BOOLEAN_CONVERTER_BOOLEAN("javax.faces.converter.BooleanConverter.BOOLEAN"),
- BOOLEAN_CONVERTER_BOOLEAN_DETAIL("javax.faces.converter.BooleanConverter.BOOLEAN_detail"),
- BYTE_CONVERTER_BYTE("javax.faces.converter.ByteConverter.BYTE"),
- BYTE_CONVERTER_BYTE_DETAIL("javax.faces.converter.ByteConverter.BYTE_detail"),
- CHARACTER_CONVERTER_CHARACTER("javax.faces.converter.CharacterConverter.CHARACTER"),
- CHARACTER_CONVERTER_CHARACTER_DETAIL("javax.faces.converter.CharacterConverter.CHARACTER_detail"),
- DATE_TIME_CONVERTER_DATE("javax.faces.converter.DateTimeConverter.DATE"),
- DATE_TIME_CONVERTER_DATE_DETAIL("javax.faces.converter.DateTimeConverter.DATE_detail"),
- DATE_TIME_CONVERTER_TIME("javax.faces.converter.DateTimeConverter.TIME"),
- DATE_TIME_CONVERTER_TIME_DETAIL("javax.faces.converter.DateTimeConverter.TIME_detail"),
- DATE_TIME_CONVERTER_DATETIME("javax.faces.converter.DateTimeConverter.DATETIME"),
- DATE_TIME_CONVERTER_DATETIME_DETAIL("javax.faces.converter.DateTimeConverter.DATETIME_detail"),
- DATE_TIME_CONVERTER_PATTERN_TYPE("javax.faces.converter.DateTimeConverter.PATTERN_TYPE"),
- DOUBLE_CONVERTER_DOUBLE("javax.faces.converter.DoubleConverter.DOUBLE"),
- DOUBLE_CONVERTER_DOUBLE_DETAIL("javax.faces.converter.DoubleConverter.DOUBLE_detail"),
- ENUM_CONVERTER_ENUM("javax.faces.converter.EnumConverter.ENUM"),
- ENUM_CONVERTER_ENUM_DETAIL("javax.faces.converter.EnumConverter.ENUM_detail"),
- ENUM_CONVERTER_ENUM_NO_CLASS("javax.faces.converter.EnumConverter.ENUM_NO_CLASS"),
- ENUM_CONVERTER_ENUM_NO_CLASS_DETAIL("javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail"),
- FLOAT_CONVERTER_FLOAT("javax.faces.converter.FloatConverter.FLOAT"),
- FLOAT_CONVERTER_FLOAT_DETAIL("javax.faces.converter.FloatConverter.FLOAT_detail"),
- INTEGER_CONVERTER_INTEGER("javax.faces.converter.IntegerConverter.INTEGER"),
- INTEGER_CONVERTER_INTEGER_DETAIL("javax.faces.converter.IntegerConverter.INTEGER_detail"),
- LONG_CONVERTER_LONG("javax.faces.converter.LongConverter.LONG"),
- LONG_CONVERTER_LONG_DETAIL("javax.faces.converter.LongConverter.LONG_detail"),
- NUMBER_CONVERTER_CURRENCY("javax.faces.converter.NumberConverter.CURRENCY"),
- NUMBER_CONVERTER_CURRENCY_DETAIL("javax.faces.converter.NumberConverter.CURRENCY_detail"),
- NUMBER_CONVERTER_PERCENT("javax.faces.converter.NumberConverter.PERCENT"),
- NUMBER_CONVERTER_PERCENT_DETAIL("javax.faces.converter.NumberConverter.PERCENT_detail"),
- NUMBER_CONVERTER_NUMBER("javax.faces.converter.NumberConverter.NUMBER"),
- NUMBER_CONVERTER_NUMBER_DETAIL("javax.faces.converter.NumberConverter.NUMBER_detail"),
- NUMBER_CONVERTER_PATTERN("javax.faces.converter.NumberConverter.PATTERN"),
- NUMBER_CONVERTER_PATTERN_DETAIL("javax.faces.converter.NumberConverter.PATTERN_detail"),
- SHORT_CONVERTER_SHORT("javax.faces.converter.ShortConverter.SHORT"),
- SHORT_CONVERTER_SHORT_DETAIL("javax.faces.converter.ShortConverter.SHORT_detail"),
- CONVERTER_STRING("javax.faces.converter.STRING"),
- DOUBLE_RANGE_VALIDATOR_MAXIMUM("javax.faces.validator.DoubleRangeValidator.MAXIMUM"),
- DOUBLE_RANGE_VALIDATOR_MINIMUM("javax.faces.validator.DoubleRangeValidator.MINIMUM"),
- DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE("javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE"),
- DOUBLE_RANGE_VALIDATOR_TYPE("javax.faces.validator.DoubleRangeValidator.TYPE"),
- LENGTH_VALIDATOR_MAXIMUM("javax.faces.validator.LengthValidator.MAXIMUM"),
- LENGTH_VALIDATOR_MINIMUM("javax.faces.validator.LengthValidator.MINIMUM"),
- LONG_RANGE_VALIDATOR_MAXIMUM("javax.faces.validator.LongRangeValidator.MAXIMUM"),
- LONG_RANGE_VALIDATOR_MINIMUM("javax.faces.validator.LongRangeValidator.MINIMUM"),
- LONG_RANGE_VALIDATOR_NOT_IN_RANGE("javax.faces.validator.LongRangeValidator.NOT_IN_RANGE"),
- LONG_RANGE_VALIDATOR_TYPE("javax.faces.validator.LongRangeValidator.TYPE"),
- VALIDATOR_NOT_IN_RANGE("javax.faces.validator.NOT_IN_RANGE"),
- REGEX_VALIDATOR_PATTERN_NOT_SET("javax.faces.validator.RegexValidator.PATTERN_NOT_SET"),
- REGEX_VALIDATOR_PATTERN_NOT_SET_DETAIL("javax.faces.validator.RegexValidator.PATTERN_NOT_SET_detail"),
- REGEX_VALIDATOR_NOT_MATCHED("javax.faces.validator.RegexValidator.NOT_MATCHED"),
- REGEX_VALIDATOR_NOT_MATCHED_DETAIL("javax.faces.validator.RegexValidator.NOT_MATCHED_detail"),
- REGEX_VALIDATOR_MATCH_EXCEPTION("javax.faces.validator.RegexValidator.MATCH_EXCEPTION"),
- REGEX_VALIDATOR_MATCH_EXCEPTION_DETAIL("javax.faces.validator.RegexValidator.MATCH_EXCEPTION_detail"),
- BEAN_VALIDATOR_MESSAGE("javax.faces.validator.BeanValidator.MESSAGE");
-
- private String key;
-
- private FacesMessages(String key) {
- this.key = key;
- }
-
- @Override
- public String toString() {
- return key;
- }
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/application/FacesMessages.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import javax.faces.application.FacesMessage;
+
+import org.richfaces.l10n.MessageBundle;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@MessageBundle(baseName = FacesMessage.FACES_MESSAGES)
+public enum FacesMessages {
+
+ UIINPUT_CONVERSION("javax.faces.component.UIInput.CONVERSION"),
+ UIINPUT_REQUIRED("javax.faces.component.UIInput.REQUIRED"),
+ UIINPUT_UPDATE("javax.faces.component.UIInput.UPDATE"),
+ UISELECTONE_INVALID("javax.faces.component.UISelectOne.INVALID"),
+ UISELECTMANY_INVALID("javax.faces.component.UISelectMany.INVALID"),
+ BIG_DECIMAL_CONVERTER_DECIMAL("javax.faces.converter.BigDecimalConverter.DECIMAL"),
+ BIG_DECIMAL_CONVERTER_DECIMAL_DETAIL("javax.faces.converter.BigDecimalConverter.DECIMAL_detail"),
+ BIG_INTEGER_CONVERTER_BIGINTEGER("javax.faces.converter.BigIntegerConverter.BIGINTEGER"),
+ BIG_INTEGER_CONVERTER_BIGINTEGER_DETAIL("javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail"),
+ BOOLEAN_CONVERTER_BOOLEAN("javax.faces.converter.BooleanConverter.BOOLEAN"),
+ BOOLEAN_CONVERTER_BOOLEAN_DETAIL("javax.faces.converter.BooleanConverter.BOOLEAN_detail"),
+ BYTE_CONVERTER_BYTE("javax.faces.converter.ByteConverter.BYTE"),
+ BYTE_CONVERTER_BYTE_DETAIL("javax.faces.converter.ByteConverter.BYTE_detail"),
+ CHARACTER_CONVERTER_CHARACTER("javax.faces.converter.CharacterConverter.CHARACTER"),
+ CHARACTER_CONVERTER_CHARACTER_DETAIL("javax.faces.converter.CharacterConverter.CHARACTER_detail"),
+ DATE_TIME_CONVERTER_DATE("javax.faces.converter.DateTimeConverter.DATE"),
+ DATE_TIME_CONVERTER_DATE_DETAIL("javax.faces.converter.DateTimeConverter.DATE_detail"),
+ DATE_TIME_CONVERTER_TIME("javax.faces.converter.DateTimeConverter.TIME"),
+ DATE_TIME_CONVERTER_TIME_DETAIL("javax.faces.converter.DateTimeConverter.TIME_detail"),
+ DATE_TIME_CONVERTER_DATETIME("javax.faces.converter.DateTimeConverter.DATETIME"),
+ DATE_TIME_CONVERTER_DATETIME_DETAIL("javax.faces.converter.DateTimeConverter.DATETIME_detail"),
+ DATE_TIME_CONVERTER_PATTERN_TYPE("javax.faces.converter.DateTimeConverter.PATTERN_TYPE"),
+ DOUBLE_CONVERTER_DOUBLE("javax.faces.converter.DoubleConverter.DOUBLE"),
+ DOUBLE_CONVERTER_DOUBLE_DETAIL("javax.faces.converter.DoubleConverter.DOUBLE_detail"),
+ ENUM_CONVERTER_ENUM("javax.faces.converter.EnumConverter.ENUM"),
+ ENUM_CONVERTER_ENUM_DETAIL("javax.faces.converter.EnumConverter.ENUM_detail"),
+ ENUM_CONVERTER_ENUM_NO_CLASS("javax.faces.converter.EnumConverter.ENUM_NO_CLASS"),
+ ENUM_CONVERTER_ENUM_NO_CLASS_DETAIL("javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail"),
+ FLOAT_CONVERTER_FLOAT("javax.faces.converter.FloatConverter.FLOAT"),
+ FLOAT_CONVERTER_FLOAT_DETAIL("javax.faces.converter.FloatConverter.FLOAT_detail"),
+ INTEGER_CONVERTER_INTEGER("javax.faces.converter.IntegerConverter.INTEGER"),
+ INTEGER_CONVERTER_INTEGER_DETAIL("javax.faces.converter.IntegerConverter.INTEGER_detail"),
+ LONG_CONVERTER_LONG("javax.faces.converter.LongConverter.LONG"),
+ LONG_CONVERTER_LONG_DETAIL("javax.faces.converter.LongConverter.LONG_detail"),
+ NUMBER_CONVERTER_CURRENCY("javax.faces.converter.NumberConverter.CURRENCY"),
+ NUMBER_CONVERTER_CURRENCY_DETAIL("javax.faces.converter.NumberConverter.CURRENCY_detail"),
+ NUMBER_CONVERTER_PERCENT("javax.faces.converter.NumberConverter.PERCENT"),
+ NUMBER_CONVERTER_PERCENT_DETAIL("javax.faces.converter.NumberConverter.PERCENT_detail"),
+ NUMBER_CONVERTER_NUMBER("javax.faces.converter.NumberConverter.NUMBER"),
+ NUMBER_CONVERTER_NUMBER_DETAIL("javax.faces.converter.NumberConverter.NUMBER_detail"),
+ NUMBER_CONVERTER_PATTERN("javax.faces.converter.NumberConverter.PATTERN"),
+ NUMBER_CONVERTER_PATTERN_DETAIL("javax.faces.converter.NumberConverter.PATTERN_detail"),
+ SHORT_CONVERTER_SHORT("javax.faces.converter.ShortConverter.SHORT"),
+ SHORT_CONVERTER_SHORT_DETAIL("javax.faces.converter.ShortConverter.SHORT_detail"),
+ CONVERTER_STRING("javax.faces.converter.STRING"),
+ DOUBLE_RANGE_VALIDATOR_MAXIMUM("javax.faces.validator.DoubleRangeValidator.MAXIMUM"),
+ DOUBLE_RANGE_VALIDATOR_MINIMUM("javax.faces.validator.DoubleRangeValidator.MINIMUM"),
+ DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE("javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE"),
+ DOUBLE_RANGE_VALIDATOR_TYPE("javax.faces.validator.DoubleRangeValidator.TYPE"),
+ LENGTH_VALIDATOR_MAXIMUM("javax.faces.validator.LengthValidator.MAXIMUM"),
+ LENGTH_VALIDATOR_MINIMUM("javax.faces.validator.LengthValidator.MINIMUM"),
+ LONG_RANGE_VALIDATOR_MAXIMUM("javax.faces.validator.LongRangeValidator.MAXIMUM"),
+ LONG_RANGE_VALIDATOR_MINIMUM("javax.faces.validator.LongRangeValidator.MINIMUM"),
+ LONG_RANGE_VALIDATOR_NOT_IN_RANGE("javax.faces.validator.LongRangeValidator.NOT_IN_RANGE"),
+ LONG_RANGE_VALIDATOR_TYPE("javax.faces.validator.LongRangeValidator.TYPE"),
+ VALIDATOR_NOT_IN_RANGE("javax.faces.validator.NOT_IN_RANGE"),
+ REGEX_VALIDATOR_PATTERN_NOT_SET("javax.faces.validator.RegexValidator.PATTERN_NOT_SET"),
+ REGEX_VALIDATOR_PATTERN_NOT_SET_DETAIL("javax.faces.validator.RegexValidator.PATTERN_NOT_SET_detail"),
+ REGEX_VALIDATOR_NOT_MATCHED("javax.faces.validator.RegexValidator.NOT_MATCHED"),
+ REGEX_VALIDATOR_NOT_MATCHED_DETAIL("javax.faces.validator.RegexValidator.NOT_MATCHED_detail"),
+ REGEX_VALIDATOR_MATCH_EXCEPTION("javax.faces.validator.RegexValidator.MATCH_EXCEPTION"),
+ REGEX_VALIDATOR_MATCH_EXCEPTION_DETAIL("javax.faces.validator.RegexValidator.MATCH_EXCEPTION_detail"),
+ BEAN_VALIDATOR_MESSAGE("javax.faces.validator.BeanValidator.MESSAGE");
+
+ private String key;
+
+ private FacesMessages(String key) {
+ this.key = key;
+ }
+
+ @Override
+ public String toString() {
+ return key;
+ }
+}
Copied: trunk/core/commons/src/main/java/org/richfaces/l10n (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n)
Deleted: trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.l10n;
-
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class BundleLoader {
-
- private ClassLoader getClassLoader() {
- return Thread.currentThread().getContextClassLoader();
- }
-
- private MessageBundle asMessageBundle(Enum<?> messageKey) throws IllegalArgumentException {
- MessageBundle bundleAnnotation = messageKey.getClass().getAnnotation(MessageBundle.class);
-
- if (bundleAnnotation == null) {
- throw new IllegalArgumentException(MessageFormat.format(
- "Cannot detect baseName for enumeration {0} in class {1}", messageKey.toString(), messageKey.getClass()
- .getName()));
- }
-
- return bundleAnnotation;
- }
-
- public ResourceBundle getBundle(Enum<?> messageKey, Locale locale) throws MissingResourceException,
- IllegalArgumentException {
- MessageBundle bundleAnnotation = asMessageBundle(messageKey);
-
- return ResourceBundle.getBundle(bundleAnnotation.baseName(), locale, getClassLoader());
- }
-
- public ResourceBundle getApplicationBundle(FacesContext facesContext, Enum<?> messageKey, Locale locale)
- throws MissingResourceException {
-
- if (facesContext == null) {
- throw new MissingResourceException("FacesContext is null", getClass().getName(), messageKey.toString());
- }
-
- Application application = facesContext.getApplication();
-
- if (application == null || application.getMessageBundle() == null) {
- throw new MissingResourceException("Cannot read message bundle name from application",
- getClass().getName(), messageKey.toString());
- }
-
- return ResourceBundle.getBundle(application.getMessageBundle(), locale, getClassLoader());
- }
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.l10n;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class BundleLoader {
+
+ private ClassLoader getClassLoader() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+
+ private MessageBundle asMessageBundle(Enum<?> messageKey) throws IllegalArgumentException {
+ MessageBundle bundleAnnotation = messageKey.getClass().getAnnotation(MessageBundle.class);
+
+ if (bundleAnnotation == null) {
+ throw new IllegalArgumentException(MessageFormat.format(
+ "Cannot detect baseName for enumeration {0} in class {1}", messageKey.toString(), messageKey.getClass()
+ .getName()));
+ }
+
+ return bundleAnnotation;
+ }
+
+ public ResourceBundle getBundle(Enum<?> messageKey, Locale locale) throws MissingResourceException,
+ IllegalArgumentException {
+ MessageBundle bundleAnnotation = asMessageBundle(messageKey);
+
+ return ResourceBundle.getBundle(bundleAnnotation.baseName(), locale, getClassLoader());
+ }
+
+ public ResourceBundle getApplicationBundle(FacesContext facesContext, Enum<?> messageKey, Locale locale)
+ throws MissingResourceException {
+
+ if (facesContext == null) {
+ throw new MissingResourceException("FacesContext is null", getClass().getName(), messageKey.toString());
+ }
+
+ Application application = facesContext.getApplication();
+
+ if (application == null || application.getMessageBundle() == null) {
+ throw new MissingResourceException("Cannot read message bundle name from application",
+ getClass().getName(), messageKey.toString());
+ }
+
+ return ResourceBundle.getBundle(application.getMessageBundle(), locale, getClassLoader());
+ }
+}
Deleted: trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.l10n;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class InterpolationException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 218954633540769880L;
-
- private String messageKey;
-
- /**
- *
- */
- public InterpolationException() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- */
- public InterpolationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public InterpolationException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public InterpolationException(Throwable cause) {
- super(cause);
- }
-
- public InterpolationException initMessageKey(String messageKey) {
- this.messageKey = messageKey;
- return this;
- }
-
- public String getMessageKey() {
- return messageKey;
- }
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.l10n;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class InterpolationException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 218954633540769880L;
+
+ private String messageKey;
+
+ /**
+ *
+ */
+ public InterpolationException() {
+ super();
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public InterpolationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param message
+ */
+ public InterpolationException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public InterpolationException(Throwable cause) {
+ super(cause);
+ }
+
+ public InterpolationException initMessageKey(String messageKey) {
+ this.messageKey = messageKey;
+ return this;
+ }
+
+ public String getMessageKey() {
+ return messageKey;
+ }
+}
Deleted: trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.l10n;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @author Nick Belaevski
- *
- */
-(a)Retention(RetentionPolicy.RUNTIME)
-(a)Target(ElementType.TYPE)
-public @interface MessageBundle {
-
- public String baseName();
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.l10n;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target(ElementType.TYPE)
+public @interface MessageBundle {
+
+ public String baseName();
+
+}
Deleted: trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.l10n;
-
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class MessageInterpolator {
-
- private BundleLoader bundleLoader;
-
- public MessageInterpolator(BundleLoader bundleLoader) {
- super();
- this.bundleLoader = bundleLoader;
- }
-
- protected String getMessageKey(Enum<?> key) {
- return key.toString();
- }
-
- protected String getPattern(Locale locale, Enum<?> key) {
- String messageKey = getMessageKey(key);
-
- try {
- ResourceBundle bundle = bundleLoader.getBundle(key, locale);
- return bundle.getString(messageKey);
- } catch (MissingResourceException e) {
- //do nothing
- }
-
- return null;
- }
-
- public String interpolate(Locale locale, Enum<?> key, Object... args) throws InterpolationException {
- String messagePattern = getPattern(locale, key);
-
- if (messagePattern == null) {
- Locale defaultLocale = Locale.getDefault();
- if (!defaultLocale.equals(locale)) {
- messagePattern = getPattern(defaultLocale, key);
- }
- }
-
- if (messagePattern != null) {
- return MessageFormat.format(messagePattern, args);
- } else {
- throw new InterpolationException().initMessageKey(key.toString());
- }
- }
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java (from rev 19022, branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.l10n;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MessageInterpolator {
+
+ private BundleLoader bundleLoader;
+
+ public MessageInterpolator(BundleLoader bundleLoader) {
+ super();
+ this.bundleLoader = bundleLoader;
+ }
+
+ protected String getMessageKey(Enum<?> key) {
+ return key.toString();
+ }
+
+ protected String getPattern(Locale locale, Enum<?> key) {
+ String messageKey = getMessageKey(key);
+
+ try {
+ ResourceBundle bundle = bundleLoader.getBundle(key, locale);
+ return bundle.getString(messageKey);
+ } catch (MissingResourceException e) {
+ //do nothing
+ }
+
+ return null;
+ }
+
+ public String interpolate(Locale locale, Enum<?> key, Object... args) throws InterpolationException {
+ String messagePattern = getPattern(locale, key);
+
+ if (messagePattern == null) {
+ Locale defaultLocale = Locale.getDefault();
+ if (!defaultLocale.equals(locale)) {
+ messagePattern = getPattern(defaultLocale, key);
+ }
+ }
+
+ if (messagePattern != null) {
+ return MessageFormat.format(messagePattern, args);
+ } else {
+ throw new InterpolationException().initMessageKey(key.toString());
+ }
+ }
+
+}
Copied: trunk/core/commons/src/main/java/org/richfaces/log (from rev 18973, branches/RFPL-434/core/commons/src/main/java/org/richfaces/log)
Deleted: trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-08-25 19:14:48 UTC (rev 18973)
+++ trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,182 +0,0 @@
-/*
- * $Id: JavaLogger.java 16812 2010-04-26 20:43:19Z alexsmirnov $
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.log;
-
-import java.util.EnumMap;
-import java.util.Map;
-import java.util.logging.LogRecord;
-
-
-
-
-/**
- * <p class="changed_added_4_0">That logger delegates all calls to the JDK {@link java.util.logging.Logger}</p>
- *
- * @author asmirnov(a)exadel.com
- * @author nick
- */
-public class JavaLogger implements Logger {
-
- public static final String RICHFACES_LOG = "org.richfaces.cdk";
-
- private static final String CLASS_NAME = JavaLogger.class.getName();
-
- private static final Map<Level, java.util.logging.Level> LEVELS_MAP =
- new EnumMap<Level, java.util.logging.Level>(Level.class);
-
- static {
- LEVELS_MAP.put(Level.ERROR, java.util.logging.Level.SEVERE);
- LEVELS_MAP.put(Level.INFO, java.util.logging.Level.INFO);
- LEVELS_MAP.put(Level.WARNING, java.util.logging.Level.WARNING);
- LEVELS_MAP.put(Level.DEBUG, java.util.logging.Level.FINE);
- }
-
- private final java.util.logging.Logger jdkLogger;
-
- JavaLogger(String category) {
- jdkLogger = java.util.logging.Logger.getLogger(category);
- }
-
- JavaLogger() {
- this(RICHFACES_LOG);
- }
-
- private void fillCallerData(String fqn, LogRecord record) {
- StackTraceElement[] stackTrace = new Exception().getStackTrace();
-
- int i = 0;
-
- for (; i < stackTrace.length; i++) {
- if (fqn.equals(stackTrace[i].getClassName())) {
- break;
- }
- }
-
- int idx = i + 1;
-
- for (; idx < stackTrace.length; idx++) {
- if (!fqn.equals(stackTrace[idx].getClassName())) {
- break;
- }
- }
-
- if (idx < stackTrace.length) {
- record.setSourceMethodName(stackTrace[idx].getMethodName());
- record.setSourceClassName(stackTrace[idx].getClassName());
- }
- }
-
- private LogRecord createRecord(Level level, CharSequence message, Throwable thrown) {
- // millis and thread are filled by the constructor
- LogRecord record = new LogRecord(LEVELS_MAP.get(level), message != null ? message.toString() : null);
-
- //TODO resource bundle?
- record.setLoggerName(jdkLogger.getName());
- record.setThrown(thrown);
- fillCallerData(CLASS_NAME, record);
-
- return record;
- }
-
- public boolean isDebugEnabled() {
- return isLogEnabled(Level.DEBUG);
- }
-
- public void debug(CharSequence content) {
- log(Level.DEBUG, content);
- }
-
- public void debug(CharSequence content, Throwable thrown) {
- log(Level.DEBUG, content, thrown);
- }
-
- public void debug(Throwable thrown) {
- log(Level.DEBUG, thrown);
- }
-
- public boolean isInfoEnabled() {
- return isLogEnabled(Level.INFO);
- }
-
- public void info(CharSequence content) {
- log(Level.INFO, content);
- }
-
- public void info(CharSequence content, Throwable thrown) {
- log(Level.INFO, content, thrown);
- }
-
- public void info(Throwable thrown) {
- log(Level.INFO, thrown);
- }
-
- public boolean isWarnEnabled() {
- return isLogEnabled(Level.WARNING);
- }
-
- public void warn(CharSequence content) {
- log(Level.WARNING, content);
- }
-
- public void warn(CharSequence content, Throwable thrown) {
- log(Level.WARNING, content, thrown);
- }
-
- public void warn(Throwable thrown) {
- log(Level.WARNING, thrown);
- }
-
- public boolean isErrorEnabled() {
- return isLogEnabled(Level.ERROR);
- }
-
- public void error(CharSequence content) {
- log(Level.ERROR, content);
- }
-
- public void error(CharSequence content, Throwable thrown) {
- log(Level.ERROR, content, thrown);
- }
-
- public void error(Throwable thrown) {
- log(Level.ERROR, thrown);
- }
-
- public boolean isLogEnabled(Level level) {
- return jdkLogger.isLoggable(LEVELS_MAP.get(level));
- }
-
- public void log(Level level, CharSequence content) {
- jdkLogger.log(createRecord(level, content, null));
- }
-
- public void log(Level level, CharSequence content, Throwable thrown) {
- jdkLogger.log(createRecord(level, content, thrown));
- }
-
- public void log(Level level, Throwable thrown) {
- jdkLogger.log(createRecord(level, null, thrown));
- }
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java (from rev 18973, branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/JavaLogger.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,253 @@
+/*
+ * $Id: JavaLogger.java 16812 2010-04-26 20:43:19Z alexsmirnov $
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.log;
+
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.logging.LogRecord;
+
+import org.richfaces.l10n.BundleLoader;
+import org.richfaces.l10n.InterpolationException;
+import org.richfaces.l10n.MessageInterpolator;
+
+
+
+
+/**
+ * <p class="changed_added_4_0">That logger delegates all calls to the JDK {@link java.util.logging.Logger}</p>
+ *
+ * @author asmirnov(a)exadel.com
+ * @author nick
+ */
+public class JavaLogger implements Logger {
+
+ public static final String RICHFACES_LOG = "org.richfaces";
+
+ static final Map<Level, java.util.logging.Level> LEVELS_MAP =
+ new EnumMap<Level, java.util.logging.Level>(Level.class);
+
+ static {
+ LEVELS_MAP.put(Level.ERROR, java.util.logging.Level.SEVERE);
+ LEVELS_MAP.put(Level.INFO, java.util.logging.Level.INFO);
+ LEVELS_MAP.put(Level.WARNING, java.util.logging.Level.WARNING);
+ LEVELS_MAP.put(Level.DEBUG, java.util.logging.Level.FINE);
+ }
+
+ private static final String CLASS_NAME = JavaLogger.class.getName();
+
+ private final java.util.logging.Logger jdkLogger;
+
+ private MessageInterpolator messageInterpolator;
+
+ JavaLogger(String category) {
+ jdkLogger = java.util.logging.Logger.getLogger(category);
+ messageInterpolator = new MessageInterpolator(new BundleLoader());
+ }
+
+ JavaLogger() {
+ this(RICHFACES_LOG);
+ }
+
+ private void fillCallerData(String fqn, LogRecord record) {
+ StackTraceElement[] stackTrace = new Exception().getStackTrace();
+
+ int i = 0;
+
+ for (; i < stackTrace.length; i++) {
+ if (fqn.equals(stackTrace[i].getClassName())) {
+ break;
+ }
+ }
+
+ int idx = i + 1;
+
+ for (; idx < stackTrace.length; idx++) {
+ if (!fqn.equals(stackTrace[idx].getClassName())) {
+ break;
+ }
+ }
+
+ if (idx < stackTrace.length) {
+ record.setSourceMethodName(stackTrace[idx].getMethodName());
+ record.setSourceClassName(stackTrace[idx].getClassName());
+ }
+ }
+
+ private String interpolate(Enum<?> messageKey, Object... args) {
+ try {
+ return messageInterpolator.interpolate(Locale.getDefault(), messageKey, args);
+ } catch (InterpolationException e) {
+ return "???" + e.getMessageKey() + "???";
+ }
+ }
+
+ private LogRecord createRecord(java.util.logging.Level level, CharSequence message, Throwable thrown) {
+ // millis and thread are filled by the constructor
+ LogRecord record = new LogRecord(level, message != null ? message.toString() : null);
+
+ //TODO resource bundle?
+ record.setLoggerName(jdkLogger.getName());
+ record.setThrown(thrown);
+ fillCallerData(CLASS_NAME, record);
+
+ return record;
+ }
+
+ public boolean isDebugEnabled() {
+ return isLogEnabled(Level.DEBUG);
+ }
+
+ public void debug(CharSequence content) {
+ log(Level.DEBUG, content);
+ }
+
+ public void debug(Enum<?> messageKey, Object... args) {
+ log(Level.DEBUG, messageKey, args);
+ }
+
+ public void debug(CharSequence content, Throwable thrown) {
+ log(Level.DEBUG, content, thrown);
+ }
+
+ public void debug(Throwable error, Enum<?> messageKey, Object... args) {
+ log(Level.DEBUG, error, messageKey, args);
+ }
+
+ public void debug(Throwable thrown) {
+ log(Level.DEBUG, thrown);
+ }
+
+ public boolean isInfoEnabled() {
+ return isLogEnabled(Level.INFO);
+ }
+
+ public void info(CharSequence content) {
+ log(Level.INFO, content);
+ }
+
+ public void info(Enum<?> messageKey, Object... args) {
+ log(Level.INFO, messageKey, args);
+ }
+
+ public void info(CharSequence content, Throwable thrown) {
+ log(Level.INFO, content, thrown);
+ }
+
+ public void info(Throwable error, Enum<?> messageKey, Object... args) {
+ log(Level.INFO, error, messageKey, args);
+ }
+
+ public void info(Throwable thrown) {
+ log(Level.INFO, thrown);
+ }
+
+ public boolean isWarnEnabled() {
+ return isLogEnabled(Level.WARNING);
+ }
+
+ public void warn(CharSequence content) {
+ log(Level.WARNING, content);
+ }
+
+ public void warn(Enum<?> messageKey, Object... args) {
+ log(Level.WARNING, messageKey, args);
+ }
+
+ public void warn(CharSequence content, Throwable thrown) {
+ log(Level.WARNING, content, thrown);
+ }
+
+ public void warn(Throwable error, Enum<?> messageKey, Object... args) {
+ log(Level.WARNING, error, messageKey, args);
+ }
+
+ public void warn(Throwable thrown) {
+ log(Level.WARNING, thrown);
+ }
+
+ public boolean isErrorEnabled() {
+ return isLogEnabled(Level.ERROR);
+ }
+
+ public void error(CharSequence content) {
+ log(Level.ERROR, content);
+ }
+
+ public void error(Enum<?> messageKey, Object... args) {
+ log(Level.ERROR, messageKey, args);
+ }
+
+ public void error(CharSequence content, Throwable thrown) {
+ log(Level.ERROR, content, thrown);
+ }
+
+ public void error(Throwable error, Enum<?> messageKey, Object... args) {
+ log(Level.ERROR, error, messageKey, args);
+ }
+
+ public void error(Throwable thrown) {
+ log(Level.ERROR, thrown);
+ }
+
+ public boolean isLogEnabled(Level level) {
+ return jdkLogger.isLoggable(LEVELS_MAP.get(level));
+ }
+
+ public void log(Level level, CharSequence content) {
+ java.util.logging.Level julLevel = LEVELS_MAP.get(level);
+ if (jdkLogger.isLoggable(julLevel)) {
+ jdkLogger.log(createRecord(julLevel, content, null));
+ }
+ }
+
+ public void log(Level level, Enum<?> messageKey, Object... args) {
+ java.util.logging.Level julLevel = LEVELS_MAP.get(level);
+ if (jdkLogger.isLoggable(julLevel)) {
+ jdkLogger.log(createRecord(julLevel, interpolate(messageKey, args), null));
+ }
+ }
+
+ public void log(Level level, CharSequence content, Throwable thrown) {
+ java.util.logging.Level julLevel = LEVELS_MAP.get(level);
+ if (jdkLogger.isLoggable(julLevel)) {
+ jdkLogger.log(createRecord(julLevel, content, thrown));
+ }
+ }
+
+ public void log(Level level, Throwable thrown, Enum<?> messageKey, Object... args) {
+ java.util.logging.Level julLevel = LEVELS_MAP.get(level);
+ if (jdkLogger.isLoggable(julLevel)) {
+ jdkLogger.log(createRecord(julLevel, interpolate(messageKey, args), thrown));
+ }
+ }
+
+ public void log(Level level, Throwable thrown) {
+ java.util.logging.Level julLevel = LEVELS_MAP.get(level);
+ if (jdkLogger.isLoggable(julLevel)) {
+ jdkLogger.log(createRecord(julLevel, null, thrown));
+ }
+ }
+
+}
Deleted: trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-08-25 19:14:48 UTC (rev 18973)
+++ trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,61 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.log;
-
-/**
- * <p class="changed_added_4_0">This class produces loggers used by whole RichFaces library.</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public final class LogFactory {
-
- private static final Logger DEFAULT_LOGGER = new JavaLogger();
-
- private LogFactory(){
- // This class is not instantiable.
- }
-
-
- /**
- * <p class="changed_added_4_0">This method creates default logger.</p>
- * @return
- */
- public static Logger getLogger(){
- return DEFAULT_LOGGER;
- }
-
- /**
- * <p class="changed_added_4_0">This method produces logger instance for given category.</p>
- * @param category
- * @return
- */
- public static Logger getLogger(String category){
- return new JavaLogger(category);
- }
-
- public static Logger getLogger(Class<?> clazz){
- return getLogger(clazz.getName());
- }
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java (from rev 18973, branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/LogFactory.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.log;
+
+
+/**
+ * <p class="changed_added_4_0">This class produces loggers used by whole RichFaces library.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public final class LogFactory {
+
+ private static final Logger DEFAULT_LOGGER = new JavaLogger();
+
+ private LogFactory(){
+ // This class is not instantiable.
+ }
+
+
+ /**
+ * <p class="changed_added_4_0">This method creates default logger.</p>
+ * @return
+ */
+ public static Logger getLogger(){
+ return DEFAULT_LOGGER;
+ }
+
+ /**
+ * <p class="changed_added_4_0">This method produces logger instance for given category.</p>
+ * @param category
+ * @return
+ */
+ public static Logger getLogger(String category){
+ return new JavaLogger(category);
+ }
+
+ public static Logger getLogger(Class<?> clazz){
+ return getLogger(clazz.getName());
+ }
+
+}
Deleted: trunk/core/commons/src/main/java/org/richfaces/log/Logger.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/Logger.java 2010-08-25 19:14:48 UTC (rev 18973)
+++ trunk/core/commons/src/main/java/org/richfaces/log/Logger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,212 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.log;
-
-/**
- * That interface hides current logging system from classes. Concrete implementation should provide appropriate logger
- * instance that delegates messages to the current log system.
- *
- * @author shura
- */
-public interface Logger {
-
- public enum Level {
- ERROR, INFO, WARNING, DEBUG
- }
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return
- */
- public boolean isDebugEnabled();
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- */
- public void debug(CharSequence content);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- * @param error
- */
- public void debug(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param error
- */
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param error
- */
- public void debug(Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return
- */
- public boolean isInfoEnabled();
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- */
- public void info(CharSequence content);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- * @param error
- */
- public void info(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param error
- */
- public void info(Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return
- */
- public boolean isWarnEnabled();
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- */
- public void warn(CharSequence content);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- * @param error
- */
- public void warn(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param error
- */
- public void warn(Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return
- */
- public boolean isErrorEnabled();
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- */
- public void error(CharSequence content);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param content
- * @param error
- */
- public void error(CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param error
- */
- public void error(Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param level
- * @return
- */
- public boolean isLogEnabled(Level level);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param level
- * @param content
- */
- public void log(Level level, CharSequence content);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param level
- * @param content
- * @param error
- */
- public void log(Level level, CharSequence content, Throwable error);
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param level
- * @param error
- */
- public void log(Level level, Throwable error);
-
-
-}
Copied: trunk/core/commons/src/main/java/org/richfaces/log/Logger.java (from rev 18973, branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/Logger.java)
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/log/Logger.java (rev 0)
+++ trunk/core/commons/src/main/java/org/richfaces/log/Logger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,311 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.log;
+
+/**
+ * That interface hides current logging system from classes. Concrete implementation should provide appropriate logger
+ * instance that delegates messages to the current log system.
+ *
+ * @author shura
+ */
+public interface Logger {
+
+ public enum Level {
+ DEBUG,
+ INFO,
+ WARNING,
+ ERROR
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ */
+ public boolean isDebugEnabled();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ */
+ public void debug(CharSequence content);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param messageKey
+ * @param args
+ */
+ public void debug(Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ * @param error
+ */
+ public void debug(CharSequence content, Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ * @param messageKey
+ * @param args
+ */
+ public void debug(Throwable error, Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ */
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ */
+ public void debug(Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ */
+ public boolean isInfoEnabled();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ */
+ public void info(CharSequence content);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param messageKey
+ * @param args
+ */
+ public void info(Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ * @param error
+ */
+ public void info(CharSequence content, Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ * @param messageKey
+ * @param args
+ */
+ public void info(Throwable error, Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ */
+ public void info(Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ */
+ public boolean isWarnEnabled();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ */
+ public void warn(CharSequence content);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param messageKey
+ * @param args
+ */
+ public void warn(Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ * @param error
+ */
+ public void warn(CharSequence content, Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ * @param messageKey
+ * @param args
+ */
+ public void warn(Throwable error, Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ */
+ public void warn(Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return
+ */
+ public boolean isErrorEnabled();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ */
+ public void error(CharSequence content);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param messageKey
+ * @param args
+ */
+ public void error(Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param content
+ * @param error
+ */
+ public void error(CharSequence content, Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ * @param messageKey
+ * @param args
+ */
+ public void error(Throwable error, Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param error
+ */
+ public void error(Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param level
+ * @return
+ */
+ public boolean isLogEnabled(Level level);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param level
+ * @param content
+ */
+ public void log(Level level, CharSequence content);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param level
+ * @param content
+ * @param error
+ */
+ public void log(Level level, CharSequence content, Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param level
+ * @param error
+ */
+ public void log(Level level, Throwable error);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param level
+ * @param messageKey
+ * @param args
+ */
+ public void log(Level level, Enum<?> messageKey, Object... args);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param level
+ * @param error
+ * @param messageKey
+ * @param args
+ */
+ public void log(Level level, Throwable error, Enum<?> messageKey, Object... args);
+
+}
Copied: trunk/core/commons/src/test/java/org/richfaces/l10n (from rev 19022, branches/RFPL-434/core/commons/src/test/java/org/richfaces/l10n)
Deleted: trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
===================================================================
--- branches/RFPL-434/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.l10n;
-
-/**
- * @author Nick Belaevski
- *
- */
-@MessageBundle(baseName = "org.richfaces.l10n.BundleLoaderMessages")
-public enum BundleLoaderCoreMessages {
-
- message
-
-}
Copied: trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java (from rev 19022, branches/RFPL-434/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java)
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java (rev 0)
+++ trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.l10n;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@MessageBundle(baseName = "org.richfaces.l10n.BundleLoaderMessages")
+public enum BundleLoaderCoreMessages {
+
+ message
+
+}
Deleted: trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
===================================================================
--- branches/RFPL-434/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.l10n;
-
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class BundleLoaderTest {
-
- private MockFacesEnvironment facesEnvironment;
-
- private BundleLoader bundleLoader;
-
- @Before
- public void setUp() throws Exception {
- Locale.setDefault(Locale.ENGLISH);
-
- bundleLoader = new BundleLoader();
-
- facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
- }
-
- @After
- public void tearDown() throws Exception {
- bundleLoader = null;
-
- facesEnvironment.verify();
- facesEnvironment.release();
-
- facesEnvironment = null;
- }
-
- @Test
- public void testGetMessageBundle() throws Exception {
- facesEnvironment.replay();
-
- assertEquals("Hello", bundleLoader.getBundle(BundleLoaderCoreMessages.message, Locale.US).getString("message"));
- assertEquals("Zdravstvujte", bundleLoader.getBundle(BundleLoaderCoreMessages.message, new Locale("ru", "RU"))
- .getString("message"));
-
- try {
- bundleLoader.getBundle(BundleLoaderCoreMessages.message, new Locale("by", "BY"));
- fail();
- } catch (MissingResourceException e) {
- // ok
- }
-
- }
-
- @Test
- public void testGetApplicationBundle() throws Exception {
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.l10n.AppMessages");
-
- facesEnvironment.replay();
-
- assertEquals(
- "Welcome to app",
- bundleLoader.getApplicationBundle(facesEnvironment.getFacesContext(), BundleLoaderCoreMessages.message,
- Locale.US).getString("message"));
- assertEquals(
- "Dobro pozhalovat'",
- bundleLoader.getApplicationBundle(facesEnvironment.getFacesContext(), BundleLoaderCoreMessages.message,
- new Locale("by", "BY")).getString("message"));
-
- try {
- bundleLoader.getApplicationBundle(facesEnvironment.getFacesContext(), BundleLoaderCoreMessages.message,
- new Locale("ru", "RU"));
- fail();
- } catch (MissingResourceException e) {
- // ok
- }
- }
-}
Copied: trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java (from rev 19022, branches/RFPL-434/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java)
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java (rev 0)
+++ trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.l10n;
+
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class BundleLoaderTest {
+
+ private MockFacesEnvironment facesEnvironment;
+
+ private BundleLoader bundleLoader;
+
+ @Before
+ public void setUp() throws Exception {
+ Locale.setDefault(Locale.ENGLISH);
+
+ bundleLoader = new BundleLoader();
+
+ facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ bundleLoader = null;
+
+ facesEnvironment.verify();
+ facesEnvironment.release();
+
+ facesEnvironment = null;
+ }
+
+ @Test
+ public void testGetMessageBundle() throws Exception {
+ facesEnvironment.replay();
+
+ assertEquals("Hello", bundleLoader.getBundle(BundleLoaderCoreMessages.message, Locale.US).getString("message"));
+ assertEquals("Zdravstvujte", bundleLoader.getBundle(BundleLoaderCoreMessages.message, new Locale("ru", "RU"))
+ .getString("message"));
+
+ try {
+ bundleLoader.getBundle(BundleLoaderCoreMessages.message, new Locale("by", "BY"));
+ fail();
+ } catch (MissingResourceException e) {
+ // ok
+ }
+
+ }
+
+ @Test
+ public void testGetApplicationBundle() throws Exception {
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.l10n.AppMessages");
+
+ facesEnvironment.replay();
+
+ assertEquals(
+ "Welcome to app",
+ bundleLoader.getApplicationBundle(facesEnvironment.getFacesContext(), BundleLoaderCoreMessages.message,
+ Locale.US).getString("message"));
+ assertEquals(
+ "Dobro pozhalovat'",
+ bundleLoader.getApplicationBundle(facesEnvironment.getFacesContext(), BundleLoaderCoreMessages.message,
+ new Locale("by", "BY")).getString("message"));
+
+ try {
+ bundleLoader.getApplicationBundle(facesEnvironment.getFacesContext(), BundleLoaderCoreMessages.message,
+ new Locale("ru", "RU"));
+ fail();
+ } catch (MissingResourceException e) {
+ // ok
+ }
+ }
+}
Copied: trunk/core/commons/src/test/java/org/richfaces/log (from rev 19022, branches/RFPL-434/core/commons/src/test/java/org/richfaces/log)
Deleted: trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
===================================================================
--- branches/RFPL-434/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,194 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.log;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.logging.Handler;
-import java.util.logging.LogManager;
-import java.util.logging.LogRecord;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.richfaces.log.Logger.Level;
-
-
-/**
- * @author Nick Belaevski
- *
- */
-public class JavaLoggerTest {
-
- private static final String ANOTHER_DUMMY_MESSAGE = "another message";
-
- private static final String DUMMY_MESSAGE = "message";
-
- private static final String TEST_MESSAGE_PATTERN = "RF-000000 Test message with arguments: {0} and {1}";
-
- private static final String CHAR_SEQUENCE_THROWABLE_PATTERN = "(CharSequence, Throwable)({0})";
-
- private static final String CHAR_SEQUENCE_PATTERN = "(CharSequence)({0})";
-
- /**
- * @author Nick Belaevski
- *
- */
- private final class TrackingHandler extends Handler {
- @Override
- public void publish(LogRecord record) {
- publishedRecords.add(record);
- }
-
- @Override
- public void flush() {
- }
-
- @Override
- public void close() throws SecurityException {
- }
- }
-
- private java.util.logging.Logger wrappedLogger;
-
- private JavaLogger logger;
-
- private List<LogRecord> publishedRecords;
-
- @Before
- public void setUp() throws Exception {
- LogManager.getLogManager().reset();
- publishedRecords = new ArrayList<LogRecord>();
-
- wrappedLogger = java.util.logging.Logger.getLogger("org.richfaces.JavaLoggerTest");
- wrappedLogger.addHandler(new TrackingHandler());
-
- logger = new JavaLogger(wrappedLogger.getName());
- }
-
- @After
- public void tearDown() throws Exception {
- publishedRecords = null;
-
- wrappedLogger = null;
- logger = null;
- }
-
- private void verifyLogRecord(LogRecord logRecord, Level level, String message, Class<? extends Throwable> thrownClass, String thrownMessage) {
- assertEquals(JavaLogger.LEVELS_MAP.get(level), logRecord.getLevel());
- assertEquals(message, logRecord.getMessage());
-
- if (thrownClass != null && thrownMessage != null) {
- assertTrue(thrownClass.isInstance(logRecord.getThrown()));
- assertEquals(thrownMessage, logRecord.getThrown().getMessage());
- } else {
- assertNull(logRecord.getThrown());
- }
- }
-
- private void verifyEnabledMethods(Level loggerLevel) throws Exception {
- String[] levels = {"Debug", "Info", "Warn", "Error"};
-
- for (Level level : Level.values()) {
- boolean enabledValue = (Boolean) Logger.class.getMethod(MessageFormat.format("is{0}Enabled", levels[level.ordinal()])).
- invoke(logger);
-
- if (level.compareTo(loggerLevel) < 0) {
- assertFalse(loggerLevel.toString(), enabledValue);
- } else {
- assertTrue(loggerLevel.toString(), enabledValue);
- }
- }
- }
-
- private void verifyLoggingLevels(Level loggerLevel) {
- for (Level messageLevel : Level.values()) {
- logger.log(messageLevel, "test");
-
- if (messageLevel.compareTo(loggerLevel) < 0) {
- assertTrue(publishedRecords.isEmpty());
- } else {
- assertTrue(publishedRecords.size() == 1);
- publishedRecords.clear();
- }
- }
- }
-
- @Test
- public void testLogging() throws Exception {
- wrappedLogger.setLevel(java.util.logging.Level.ALL);
-
- String[] levels = {"debug", "info", "warn", "error"};
-
- for (String levelName : levels) {
- Logger.class.getMethod(levelName, CharSequence.class).invoke(logger, MessageFormat.format(CHAR_SEQUENCE_PATTERN, levelName));
- Logger.class.getMethod(levelName, CharSequence.class, Throwable.class).invoke(logger,
- MessageFormat.format(CHAR_SEQUENCE_THROWABLE_PATTERN, levelName), new NullPointerException(levelName));
-
- Logger.class.getMethod(levelName, Enum.class, Object[].class).invoke(logger,
- LoggerTestMessages.TEST_MESSAGE, new Object[] {levelName, DUMMY_MESSAGE});
-
- Logger.class.getMethod(levelName, Throwable.class).invoke(logger, new IllegalArgumentException(levelName));
-
- Logger.class.getMethod(levelName, Throwable.class, Enum.class, Object[].class).invoke(logger,
- new UnsupportedOperationException(levelName), LoggerTestMessages.TEST_MESSAGE, new Object[] {levelName,
- ANOTHER_DUMMY_MESSAGE});
- }
-
- Iterator<LogRecord> iterator = publishedRecords.iterator();
-
- for (Level level: Level.values()) {
- String levelName = levels[level.ordinal()];
-
- verifyLogRecord(iterator.next(), level, MessageFormat.format(CHAR_SEQUENCE_PATTERN, levelName), null, null);
- verifyLogRecord(iterator.next(), level, MessageFormat.format(CHAR_SEQUENCE_THROWABLE_PATTERN, levelName),
- NullPointerException.class, levelName);
-
- verifyLogRecord(iterator.next(), level, MessageFormat.format(TEST_MESSAGE_PATTERN,
- levelName, DUMMY_MESSAGE), null, null);
-
- verifyLogRecord(iterator.next(), level, null, IllegalArgumentException.class, levelName);
-
- verifyLogRecord(iterator.next(), level, MessageFormat.format(TEST_MESSAGE_PATTERN,
- levelName, ANOTHER_DUMMY_MESSAGE), UnsupportedOperationException.class, levelName);
-
- }
- }
-
- @Test
- public void testLevels() throws Exception {
- for (Level loggerLevel : Level.values()) {
- wrappedLogger.setLevel(JavaLogger.LEVELS_MAP.get(loggerLevel));
-
- verifyEnabledMethods(loggerLevel);
- verifyLoggingLevels(loggerLevel);
- }
- }
-
-}
Copied: trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java (from rev 19022, branches/RFPL-434/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java)
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java (rev 0)
+++ trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.log;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Handler;
+import java.util.logging.LogManager;
+import java.util.logging.LogRecord;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.log.Logger.Level;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class JavaLoggerTest {
+
+ private static final String ANOTHER_DUMMY_MESSAGE = "another message";
+
+ private static final String DUMMY_MESSAGE = "message";
+
+ private static final String TEST_MESSAGE_PATTERN = "RF-000000 Test message with arguments: {0} and {1}";
+
+ private static final String CHAR_SEQUENCE_THROWABLE_PATTERN = "(CharSequence, Throwable)({0})";
+
+ private static final String CHAR_SEQUENCE_PATTERN = "(CharSequence)({0})";
+
+ /**
+ * @author Nick Belaevski
+ *
+ */
+ private final class TrackingHandler extends Handler {
+ @Override
+ public void publish(LogRecord record) {
+ publishedRecords.add(record);
+ }
+
+ @Override
+ public void flush() {
+ }
+
+ @Override
+ public void close() throws SecurityException {
+ }
+ }
+
+ private java.util.logging.Logger wrappedLogger;
+
+ private JavaLogger logger;
+
+ private List<LogRecord> publishedRecords;
+
+ @Before
+ public void setUp() throws Exception {
+ LogManager.getLogManager().reset();
+ publishedRecords = new ArrayList<LogRecord>();
+
+ wrappedLogger = java.util.logging.Logger.getLogger("org.richfaces.JavaLoggerTest");
+ wrappedLogger.addHandler(new TrackingHandler());
+
+ logger = new JavaLogger(wrappedLogger.getName());
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ publishedRecords = null;
+
+ wrappedLogger = null;
+ logger = null;
+ }
+
+ private void verifyLogRecord(LogRecord logRecord, Level level, String message, Class<? extends Throwable> thrownClass, String thrownMessage) {
+ assertEquals(JavaLogger.LEVELS_MAP.get(level), logRecord.getLevel());
+ assertEquals(message, logRecord.getMessage());
+
+ if (thrownClass != null && thrownMessage != null) {
+ assertTrue(thrownClass.isInstance(logRecord.getThrown()));
+ assertEquals(thrownMessage, logRecord.getThrown().getMessage());
+ } else {
+ assertNull(logRecord.getThrown());
+ }
+ }
+
+ private void verifyEnabledMethods(Level loggerLevel) throws Exception {
+ String[] levels = {"Debug", "Info", "Warn", "Error"};
+
+ for (Level level : Level.values()) {
+ boolean enabledValue = (Boolean) Logger.class.getMethod(MessageFormat.format("is{0}Enabled", levels[level.ordinal()])).
+ invoke(logger);
+
+ if (level.compareTo(loggerLevel) < 0) {
+ assertFalse(loggerLevel.toString(), enabledValue);
+ } else {
+ assertTrue(loggerLevel.toString(), enabledValue);
+ }
+ }
+ }
+
+ private void verifyLoggingLevels(Level loggerLevel) {
+ for (Level messageLevel : Level.values()) {
+ logger.log(messageLevel, "test");
+
+ if (messageLevel.compareTo(loggerLevel) < 0) {
+ assertTrue(publishedRecords.isEmpty());
+ } else {
+ assertTrue(publishedRecords.size() == 1);
+ publishedRecords.clear();
+ }
+ }
+ }
+
+ @Test
+ public void testLogging() throws Exception {
+ wrappedLogger.setLevel(java.util.logging.Level.ALL);
+
+ String[] levels = {"debug", "info", "warn", "error"};
+
+ for (String levelName : levels) {
+ Logger.class.getMethod(levelName, CharSequence.class).invoke(logger, MessageFormat.format(CHAR_SEQUENCE_PATTERN, levelName));
+ Logger.class.getMethod(levelName, CharSequence.class, Throwable.class).invoke(logger,
+ MessageFormat.format(CHAR_SEQUENCE_THROWABLE_PATTERN, levelName), new NullPointerException(levelName));
+
+ Logger.class.getMethod(levelName, Enum.class, Object[].class).invoke(logger,
+ LoggerTestMessages.TEST_MESSAGE, new Object[] {levelName, DUMMY_MESSAGE});
+
+ Logger.class.getMethod(levelName, Throwable.class).invoke(logger, new IllegalArgumentException(levelName));
+
+ Logger.class.getMethod(levelName, Throwable.class, Enum.class, Object[].class).invoke(logger,
+ new UnsupportedOperationException(levelName), LoggerTestMessages.TEST_MESSAGE, new Object[] {levelName,
+ ANOTHER_DUMMY_MESSAGE});
+ }
+
+ Iterator<LogRecord> iterator = publishedRecords.iterator();
+
+ for (Level level: Level.values()) {
+ String levelName = levels[level.ordinal()];
+
+ verifyLogRecord(iterator.next(), level, MessageFormat.format(CHAR_SEQUENCE_PATTERN, levelName), null, null);
+ verifyLogRecord(iterator.next(), level, MessageFormat.format(CHAR_SEQUENCE_THROWABLE_PATTERN, levelName),
+ NullPointerException.class, levelName);
+
+ verifyLogRecord(iterator.next(), level, MessageFormat.format(TEST_MESSAGE_PATTERN,
+ levelName, DUMMY_MESSAGE), null, null);
+
+ verifyLogRecord(iterator.next(), level, null, IllegalArgumentException.class, levelName);
+
+ verifyLogRecord(iterator.next(), level, MessageFormat.format(TEST_MESSAGE_PATTERN,
+ levelName, ANOTHER_DUMMY_MESSAGE), UnsupportedOperationException.class, levelName);
+
+ }
+ }
+
+ @Test
+ public void testLevels() throws Exception {
+ for (Level loggerLevel : Level.values()) {
+ wrappedLogger.setLevel(JavaLogger.LEVELS_MAP.get(loggerLevel));
+
+ verifyEnabledMethods(loggerLevel);
+ verifyLoggingLevels(loggerLevel);
+ }
+ }
+
+}
Deleted: trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
===================================================================
--- branches/RFPL-434/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.log;
-
-import org.richfaces.l10n.MessageBundle;
-
-/**
- * @author Nick Belaevski
- *
- */
-@MessageBundle(baseName = "org.richfaces.log.Resources")
-public enum LoggerTestMessages {
-
- TEST_MESSAGE("org.richfaces.TestMessage");
-
-
- private String s;
-
- private LoggerTestMessages(String s) {
- this.s = s;
- }
-
- @Override
- public String toString() {
- return s;
- }
-}
Copied: trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java (from rev 19022, branches/RFPL-434/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java)
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java (rev 0)
+++ trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.log;
+
+import org.richfaces.l10n.MessageBundle;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@MessageBundle(baseName = "org.richfaces.log.Resources")
+public enum LoggerTestMessages {
+
+ TEST_MESSAGE("org.richfaces.TestMessage");
+
+
+ private String s;
+
+ private LoggerTestMessages(String s) {
+ this.s = s;
+ }
+
+ @Override
+ public String toString() {
+ return s;
+ }
+}
Copied: trunk/core/commons/src/test/resources (from rev 19022, branches/RFPL-434/core/commons/src/test/resources)
Copied: trunk/core/commons/src/test/resources/org (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org)
Copied: trunk/core/commons/src/test/resources/org/richfaces (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces)
Copied: trunk/core/commons/src/test/resources/org/richfaces/l10n (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n)
Deleted: trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
===================================================================
--- branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1 +0,0 @@
-message=Dobro pozhalovat'
\ No newline at end of file
Copied: trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties)
===================================================================
--- trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties (rev 0)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1 @@
+message=Dobro pozhalovat'
\ No newline at end of file
Deleted: trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
===================================================================
--- branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1 +0,0 @@
-message=Welcome to app
\ No newline at end of file
Copied: trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties)
===================================================================
--- trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties (rev 0)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1 @@
+message=Welcome to app
\ No newline at end of file
Deleted: trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
===================================================================
--- branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1 +0,0 @@
-message=Hello
\ No newline at end of file
Copied: trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties)
===================================================================
--- trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties (rev 0)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1 @@
+message=Hello
\ No newline at end of file
Deleted: trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
===================================================================
--- branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1 +0,0 @@
-message=Zdravstvujte
\ No newline at end of file
Copied: trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties)
===================================================================
--- trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties (rev 0)
+++ trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1 @@
+message=Zdravstvujte
\ No newline at end of file
Copied: trunk/core/commons/src/test/resources/org/richfaces/log (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/log)
Deleted: trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties
===================================================================
--- branches/RFPL-434/core/commons/src/test/resources/org/richfaces/log/Resources.properties 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1 +0,0 @@
-org.richfaces.TestMessage=RF-000000 Test message with arguments: {0} and {1}
\ No newline at end of file
Copied: trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties (from rev 19022, branches/RFPL-434/core/commons/src/test/resources/org/richfaces/log/Resources.properties)
===================================================================
--- trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties (rev 0)
+++ trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1 @@
+org.richfaces.TestMessage=RF-000000 Test message with arguments: {0} and {1}
\ No newline at end of file
Modified: trunk/core/impl/pom.xml
===================================================================
--- trunk/core/impl/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -47,10 +47,6 @@
<groupId>net.sourceforge.cssparser</groupId>
<artifactId>cssparser</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -116,11 +112,6 @@
<artifactId>easymockclassextension</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -30,7 +30,7 @@
import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.FilterServletResponseWrapper;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.faces.FacesException;
import javax.faces.application.Resource;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -22,7 +22,7 @@
package org.ajax4jsf.application;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -22,7 +22,7 @@
package org.ajax4jsf.application;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -32,7 +32,7 @@
import org.ajax4jsf.cache.lru.LRUMapCacheFactory;
import org.ajax4jsf.resource.util.URLToStreamHelper;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* TODO stop caches on application stop
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -14,7 +14,7 @@
import org.ajax4jsf.context.ContextInitParameters;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -24,7 +24,7 @@
import org.jboss.cache.eviction.EvictionAlgorithmConfigBase;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -35,7 +35,7 @@
import org.ajax4jsf.context.ContextInitParameters;
import org.ajax4jsf.resource.util.URLToStreamHelper;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import com.opensymphony.oscache.base.AbstractCacheAdministrator;
import com.opensymphony.oscache.general.GeneralCacheAdministrator;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -29,7 +29,7 @@
import org.ajax4jsf.cache.CacheFactory;
import org.ajax4jsf.context.ContextInitParameters;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Nick - mailto:nbelaevski@exadel.com
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -24,7 +24,7 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.event.AjaxEvent;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.el.ELContext;
import javax.el.MethodExpression;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -29,7 +29,7 @@
import org.ajax4jsf.event.EventsQueue;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.el.MethodExpression;
import javax.faces.FacesException;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -2,7 +2,7 @@
import org.ajax4jsf.util.ELUtils;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -55,7 +55,7 @@
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* This class incapsulated
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -30,8 +30,8 @@
import javax.faces.event.PhaseListener;
import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* Listener for act before Render phase to set RenderKit Id for current skin.
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -23,7 +23,7 @@
import org.ajax4jsf.application.AjaxViewHandler;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,21 +21,22 @@
package org.ajax4jsf.renderkit;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxChildrenEncoder;
import org.ajax4jsf.component.AjaxOutput;
import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
/**
* @author shura
*/
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,20 +21,21 @@
package org.ajax4jsf.renderkit;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxContainer;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-
/**
* Base renderer for all AJAX - subview components.
*
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -54,8 +54,8 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.application.ServiceTracker;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* @author shura
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,17 +21,18 @@
package org.ajax4jsf.renderkit;
-import org.ajax4jsf.Messages;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import java.util.Iterator;
import javax.faces.FactoryFinder;
import javax.faces.application.ApplicationFactory;
import javax.faces.context.FacesContext;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
-import java.util.Iterator;
+import org.ajax4jsf.Messages;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:50 $
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -30,11 +30,11 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.resource.InternetResource;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.renderkit.RenderKitUtils;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
-import org.slf4j.Logger;
/**
* Base Renderer for all chameleon Skin's and components.
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,18 +21,19 @@
package org.ajax4jsf.resource;
-import org.ajax4jsf.Messages;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.util.Util;
-import org.slf4j.Logger;
-
-import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.Messages;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.util.Util;
+
/**
* Base class for all Html page resources - images, scripts, styles etc. Realise
* as "brige" pattern - different subclasses for different resource source
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -45,8 +45,8 @@
import org.ajax4jsf.resource.util.URLToStreamHelper;
import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.WebXml;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
public class InternetResourceService {
static final String ENABLE_CACHING_PARAMETER = "enable-cache";
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,14 +21,15 @@
package org.ajax4jsf.resource;
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
import org.ajax4jsf.Messages;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import javax.faces.context.FacesContext;
-import java.io.IOException;
-import java.util.Map;
-
/**
* Base class for resources, rendered only one time in page ( JavaScript, CSS )
*
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,8 +21,8 @@
package org.ajax4jsf.resource;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import java.io.IOException;
+import java.util.Locale;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -34,9 +34,10 @@
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
import javax.faces.render.RenderKitFactory;
-import java.io.IOException;
-import java.util.Locale;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
/**
* Lifecycle for simulate faces request processing for resource.
*
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,15 +21,15 @@
package org.ajax4jsf.resource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
import org.ajax4jsf.Messages;
import org.ajax4jsf.javascript.JSMin;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
class CountingOutputStream extends OutputStream {
private int written = 0;
private OutputStream outputStream;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,9 +21,15 @@
package org.ajax4jsf.util;
-import org.ajax4jsf.Messages;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
import javax.el.ELContext;
import javax.el.ValueExpression;
@@ -38,16 +44,11 @@
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.model.SelectItem;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
+import org.ajax4jsf.Messages;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
/**
* @author Maksim Kaszynski
*/
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,11 +21,6 @@
package org.ajax4jsf.util;
-import org.ajax4jsf.resource.util.URLToStreamHelper;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
-import javax.faces.FacesException;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -33,6 +28,12 @@
import java.util.HashMap;
import java.util.Map;
+import javax.faces.FacesException;
+
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
/**
* @author shura
*/
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,14 +21,16 @@
package org.ajax4jsf.webapp;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.renderkit.AjaxContainerRenderer;
-import org.ajax4jsf.request.MultipartRequest;
-import org.ajax4jsf.resource.InternetResourceService;
-import org.richfaces.component.FileUploadConstants;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
import javax.faces.application.ViewHandler;
import javax.servlet.Filter;
@@ -42,17 +44,16 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Pattern;
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.renderkit.AjaxContainerRenderer;
+import org.ajax4jsf.request.MultipartRequest;
+import org.ajax4jsf.resource.InternetResourceService;
+import org.richfaces.component.FileUploadConstants;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
/**
* Base class for request processing filters, with convert Htmp content to XML
* for ajax requests, and serve request to application off-page resources
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,12 +21,11 @@
package org.ajax4jsf.webapp;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.application.AjaxViewHandler;
-import org.ajax4jsf.context.ContextInitParameters;
-import org.ajax4jsf.renderkit.AjaxContainerRenderer;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.Map;
import javax.faces.application.ViewExpiredException;
import javax.servlet.FilterChain;
@@ -37,12 +36,14 @@
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.Map;
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.application.AjaxViewHandler;
+import org.ajax4jsf.context.ContextInitParameters;
+import org.ajax4jsf.renderkit.AjaxContainerRenderer;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
public abstract class BaseXMLFilter {
public static final String AJAX_EXPIRED = "Ajax-Expired";
public static final String APPLICATION_XHTML_XML = "application/xhtml+xml";
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,15 +21,6 @@
package org.ajax4jsf.webapp;
-import org.ajax4jsf.io.FastBufferOutputStream;
-import org.ajax4jsf.io.FastBufferWriter;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.util.Util;
-import org.slf4j.Logger;
-
-import javax.faces.context.ExternalContext;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
@@ -40,6 +31,16 @@
import java.util.Map;
import java.util.Map.Entry;
+import javax.faces.context.ExternalContext;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ajax4jsf.io.FastBufferOutputStream;
+import org.ajax4jsf.io.FastBufferWriter;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.util.Util;
+
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:20 $
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -35,19 +35,6 @@
package org.ajax4jsf.webapp;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.io.FastBufferInputStream;
-import org.ajax4jsf.io.FastBufferOutputStream;
-import org.ajax4jsf.io.FastBufferReader;
-import org.ajax4jsf.io.FastBufferWriter;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import org.xml.sax.InputSource;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
@@ -61,6 +48,20 @@
import java.util.Locale;
import java.util.Map;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.io.FastBufferInputStream;
+import org.ajax4jsf.io.FastBufferOutputStream;
+import org.ajax4jsf.io.FastBufferReader;
+import org.ajax4jsf.io.FastBufferWriter;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+import org.xml.sax.InputSource;
+
/**
* Base wrapper save JSF page response, for parse to XML with different parsers
*
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,13 +21,13 @@
package org.ajax4jsf.webapp;
-import org.w3c.dom.Node;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.Writer;
+import org.w3c.dom.Node;
+
public interface HtmlParser {
public abstract void parseHtml(InputStream input, Writer output) throws IOException;
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,11 +21,12 @@
package org.ajax4jsf.webapp;
-import javax.servlet.ServletContext;
import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import javax.servlet.ServletContext;
+
/**
* @author asmirnov
*/
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,11 +21,11 @@
package org.ajax4jsf.webapp;
-import org.ajax4jsf.event.PushEventListener;
-
import java.io.Serializable;
import java.util.EventObject;
+import org.ajax4jsf.event.PushEventListener;
+
public class PushEventsCounter implements PushEventListener, Serializable {
/**
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,10 +21,11 @@
package org.ajax4jsf.webapp;
-import javax.servlet.ServletOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
+import javax.servlet.ServletOutputStream;
+
/**
* HACK - for case if servlet response already use Writer, create wrapper to stream -
* since most of serializers use outputStream. In future, must be replaced by Dual serialization
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -31,8 +31,8 @@
import org.ajax4jsf.config.WebXMLParser;
import org.richfaces.VersionBean;
import org.richfaces.VersionBean.Version;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* Parse at startup application web.xml and store servlet and filter mappings.
Modified: trunk/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java
===================================================================
--- trunk/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -21,11 +21,12 @@
package org.ajax4jsf.webapp;
-import org.ajax4jsf.Messages;
+import java.io.IOException;
import javax.faces.component.UIComponent;
-import java.io.IOException;
+import org.ajax4jsf.Messages;
+
/**
* @author shura Class to implement state pattern for
* <code>ResponceWriter</code> Real states must extend this. By
Modified: trunk/core/impl/src/main/java/org/richfaces/VersionBean.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/VersionBean.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/VersionBean.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -32,6 +32,7 @@
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
/**
@@ -44,7 +45,7 @@
public static final Version VERSION = new Version();
- private static final org.slf4j.Logger LOGGER = RichfacesLogger.APPLICATION.getLogger();
+ private static final Logger LOGGER = RichfacesLogger.APPLICATION.getLogger();
/**
Modified: trunk/core/impl/src/main/java/org/richfaces/application/DefaultModule.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/application/DefaultModule.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/application/DefaultModule.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -3,6 +3,7 @@
import org.ajax4jsf.cache.Cache;
import org.ajax4jsf.context.InitParametersStorage;
import org.ajax4jsf.renderkit.AJAXDataSerializer;
+import org.richfaces.l10n.BundleLoader;
import org.richfaces.resource.DefaultResourceCodec;
import org.richfaces.resource.ResourceCodec;
import org.richfaces.skin.SkinFactory;
@@ -18,6 +19,7 @@
factory.setInstance(Uptime.class, new Uptime());
factory.setInstance(DependencyInjector.class, new DependencyInjectionServiceImpl());
factory.setInstance(InitParametersStorage.class, new InitParametersStorage());
+ factory.setInstance(MessageFactory.class, new MessageFactoryImpl(new BundleLoader()));
}
}
Modified: trunk/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -42,11 +42,11 @@
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.resource.PostConstructResource;
import org.richfaces.resource.ResourceParameter;
import org.richfaces.resource.ResourceParameterELResolver;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/richfaces/application/InitializationListener.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/application/InitializationListener.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/application/InitializationListener.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -39,8 +39,8 @@
import org.ajax4jsf.context.ContextInitParameters;
import org.richfaces.VersionBean;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Copied: trunk/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java (from rev 19022, branches/RFPL-434/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java)
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java (rev 0)
+++ trunk/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.l10n.BundleLoader;
+import org.richfaces.l10n.MessageBundle;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MessageFactoryImpl implements MessageFactory {
+
+ private BundleLoader bundleLoader;
+
+ public MessageFactoryImpl(BundleLoader bundleLoader) {
+ super();
+ this.bundleLoader = bundleLoader;
+ }
+
+ private Locale detectLocale(FacesContext context) {
+ UIViewRoot viewRoot = context.getViewRoot();
+ if (viewRoot != null && viewRoot.getLocale() != null) {
+ return viewRoot.getLocale();
+ }
+
+ return null;
+ }
+
+ public FacesMessage createMessage(FacesContext facesContext, Enum<?> messageKey, Object... args) {
+ return createMessage(facesContext, FacesMessage.SEVERITY_INFO, messageKey, args);
+ }
+
+ public FacesMessage createMessage(FacesContext facesContext, Severity severity, Enum<?> messageKey, Object... args) {
+ if (facesContext == null) {
+ throw new NullPointerException("context");
+ }
+
+ if (severity == null) {
+ throw new NullPointerException("severity");
+ }
+
+ if (messageKey == null) {
+ throw new NullPointerException("messageKey");
+ }
+
+ FacesMessage result = null;
+
+ Locale locale = detectLocale(facesContext);
+ if (locale != null) {
+ result = createMessage(facesContext, severity, locale, messageKey, args);
+ }
+
+ if (result == null) {
+ Locale defaultLocale = Locale.getDefault();
+
+ if (!defaultLocale.equals(locale)) {
+ result = createMessage(facesContext, severity, defaultLocale, messageKey, args);
+ }
+
+ }
+
+ return result;
+ }
+
+ protected FacesMessage createMessage(FacesContext context, Severity severity, Locale locale, Enum<?> messageKey,
+ Object... args) {
+
+ MessageBundle messageBundle = messageKey.getClass().getAnnotation(MessageBundle.class);
+
+ if (messageBundle == null) {
+ return null;
+ }
+
+ String messageId = messageKey.toString();
+
+ String summary = null;
+ String detail = null;
+
+ try {
+ ResourceBundle bundle = bundleLoader.getApplicationBundle(context, messageKey, locale);
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ // do nothing
+ }
+
+ if (summary == null) {
+ try {
+ ResourceBundle bundle = bundleLoader.getBundle(messageKey, locale);
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ // do nothing
+ }
+ }
+
+ if (summary == null) {
+ return null;
+ }
+
+ String formattedSummary = MessageFormat.format(summary, args);
+ String formattedDetail = null;
+
+ if (detail != null) {
+ formattedDetail = MessageFormat.format(detail, args);
+ }
+
+ return new FacesMessage(severity, formattedSummary, formattedDetail);
+ }
+
+}
Modified: trunk/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -72,8 +72,8 @@
import org.ajax4jsf.model.Range;
import org.ajax4jsf.model.SerializableDataModel;
import org.richfaces.context.ExtendedVisitContext;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* Base class for iterable components, like dataTable, Tomahawk dataList, Facelets repeat, tree etc., with support for
Modified: trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -45,8 +45,8 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.component.MetaComponentEncoder;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -39,9 +39,9 @@
import org.richfaces.application.ServiceTracker;
import org.richfaces.application.Uptime;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.Util;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -31,9 +31,9 @@
import javax.faces.context.FacesContext;
import org.ajax4jsf.context.ContextInitParameters;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.Util;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -41,9 +41,9 @@
import org.ajax4jsf.io.ByteBuffer;
import org.ajax4jsf.io.FastBufferInputStream;
import org.ajax4jsf.io.FastBufferOutputStream;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.Util;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -33,11 +33,11 @@
import javax.faces.application.Resource;
import javax.faces.context.FacesContext;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.resource.css.CSSVisitorImpl;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
-import org.slf4j.Logger;
import org.w3c.css.sac.CSSException;
import org.w3c.css.sac.CSSParseException;
import org.w3c.css.sac.ErrorHandler;
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -29,12 +29,15 @@
import java.util.Properties;
import java.util.Set;
+import javax.faces.application.ProjectStage;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
import org.richfaces.application.DependencyInjector;
import org.richfaces.application.ServiceTracker;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.PropertiesUtil;
import org.richfaces.util.Util;
@@ -49,7 +52,7 @@
private static final Joiner RESOURCE_QUALIFIER_JOINER = Joiner.on(':').skipNulls();
- private static final ResourceLogger LOGGER = ResourceLogger.INSTANCE;
+ private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
private static class ExternalStaticResourceFactory {
@@ -100,6 +103,28 @@
initializeExternalResourcesMap();
}
+ private void logResourceProblem(FacesContext context, Throwable throwable, String messagePattern,
+ Object... arguments) {
+ boolean isProductionStage = context.isProjectStage(ProjectStage.Production);
+
+ if (LOGGER.isWarnEnabled() || (!isProductionStage && LOGGER.isInfoEnabled())) {
+ String formattedMessage = MessageFormat.format(messagePattern, arguments);
+
+ if (throwable != null) {
+ LOGGER.warn(formattedMessage, throwable);
+ } else {
+ if (isProductionStage) {
+ LOGGER.info(formattedMessage);
+ } else {
+ LOGGER.warn(formattedMessage);
+ }
+ }
+ }
+ }
+
+ private void logMissingResource(FacesContext context, String resourceData) {
+ logResourceProblem(context, null, "Resource {0} was not found", resourceData);
+ }
private String getResourceNameFromQualifier(String qualifier) {
int idx = qualifier.lastIndexOf(':');
if (idx < 0) {
@@ -252,10 +277,10 @@
} catch (ClassNotFoundException e) {
// do nothing
} catch (Exception e) {
- LOGGER.logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
+ logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
resourceName);
} catch (LinkageError e) {
- LOGGER.logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
+ logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
resourceName);
}
}
@@ -274,7 +299,7 @@
Resource resource = createResource(resourceName, libraryName, null);
if (resource == null) {
- LOGGER.logMissingResource(context, resourceData.getResourceKey());
+ logMissingResource(context, resourceData.getResourceKey());
return null;
}
@@ -289,7 +314,7 @@
}
if ((existingVersion != null) && (requestedVersion != null) && !existingVersion.equals(requestedVersion)) {
- LOGGER.logResourceProblem(context, null, "Resource {0} of version {1} was not found", resourceName,
+ logResourceProblem(context, null, "Resource {0} of version {1} was not found", resourceName,
requestedVersion);
return null;
}
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -40,6 +40,8 @@
import org.ajax4jsf.cache.Cache;
import org.richfaces.application.ServiceTracker;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.RequestStateManager.BooleanRequestStateVariable;
import org.richfaces.util.Util;
@@ -53,7 +55,7 @@
public static final String RESOURCE_CACHE_NAME = "org.richfaces.ResourcesCache";
public static final String HANDLER_START_TIME_ATTRIBUTE = ResourceHandlerImpl.class.getName() + ":StartTime";
- private static final ResourceLogger LOGGER = ResourceLogger.INSTANCE;
+ private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
private ResourceFactory resourceFactory;
Deleted: trunk/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,313 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.resource;
-
-import java.text.MessageFormat;
-
-import javax.faces.application.ProjectStage;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import org.slf4j.Marker;
-
-/**
- * @author Nick Belaevski
- *
- */
-final class ResourceLogger implements Logger {
-
- static final ResourceLogger INSTANCE = new ResourceLogger();
-
- private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
-
- private ResourceLogger() {}
-
- void logResourceProblem(FacesContext context, Throwable throwable, String messagePattern,
- Object... arguments) {
- boolean isProductionStage = context.isProjectStage(ProjectStage.Production);
-
- if (LOGGER.isWarnEnabled() || (!isProductionStage && LOGGER.isInfoEnabled())) {
- String formattedMessage = MessageFormat.format(messagePattern, arguments);
-
- if (throwable != null) {
- LOGGER.warn(formattedMessage, throwable);
- } else {
- if (isProductionStage) {
- LOGGER.info(formattedMessage);
- } else {
- LOGGER.warn(formattedMessage);
- }
- }
- }
- }
-
- void logMissingResource(FacesContext context, String resourceData) {
- logResourceProblem(context, null, "Resource {0} was not found", resourceData);
- }
-
- public String getName() {
- return LOGGER.getName();
- }
-
- public boolean isTraceEnabled() {
- return LOGGER.isTraceEnabled();
- }
-
- public void trace(String msg) {
- LOGGER.trace(msg);
- }
-
- public void trace(String format, Object arg) {
- LOGGER.trace(format, arg);
- }
-
- public void trace(String format, Object arg1, Object arg2) {
- LOGGER.trace(format, arg1, arg2);
- }
-
- public void trace(String format, Object[] argArray) {
- LOGGER.trace(format, argArray);
- }
-
- public void trace(String msg, Throwable t) {
- LOGGER.trace(msg, t);
- }
-
- public boolean isTraceEnabled(Marker marker) {
- return LOGGER.isTraceEnabled(marker);
- }
-
- public void trace(Marker marker, String msg) {
- LOGGER.trace(marker, msg);
- }
-
- public void trace(Marker marker, String format, Object arg) {
- LOGGER.trace(marker, format, arg);
- }
-
- public void trace(Marker marker, String format, Object arg1, Object arg2) {
- LOGGER.trace(marker, format, arg1, arg2);
- }
-
- public void trace(Marker marker, String format, Object[] argArray) {
- LOGGER.trace(marker, format, argArray);
- }
-
- public void trace(Marker marker, String msg, Throwable t) {
- LOGGER.trace(marker, msg, t);
- }
-
- public boolean isDebugEnabled() {
- return LOGGER.isDebugEnabled();
- }
-
- public void debug(String msg) {
- LOGGER.debug(msg);
- }
-
- public void debug(String format, Object arg) {
- LOGGER.debug(format, arg);
- }
-
- public void debug(String format, Object arg1, Object arg2) {
- LOGGER.debug(format, arg1, arg2);
- }
-
- public void debug(String format, Object[] argArray) {
- LOGGER.debug(format, argArray);
- }
-
- public void debug(String msg, Throwable t) {
- LOGGER.debug(msg, t);
- }
-
- public boolean isDebugEnabled(Marker marker) {
- return LOGGER.isDebugEnabled(marker);
- }
-
- public void debug(Marker marker, String msg) {
- LOGGER.debug(marker, msg);
- }
-
- public void debug(Marker marker, String format, Object arg) {
- LOGGER.debug(marker, format, arg);
- }
-
- public void debug(Marker marker, String format, Object arg1, Object arg2) {
- LOGGER.debug(marker, format, arg1, arg2);
- }
-
- public void debug(Marker marker, String format, Object[] argArray) {
- LOGGER.debug(marker, format, argArray);
- }
-
- public void debug(Marker marker, String msg, Throwable t) {
- LOGGER.debug(marker, msg, t);
- }
-
- public boolean isInfoEnabled() {
- return LOGGER.isInfoEnabled();
- }
-
- public void info(String msg) {
- LOGGER.info(msg);
- }
-
- public void info(String format, Object arg) {
- LOGGER.info(format, arg);
- }
-
- public void info(String format, Object arg1, Object arg2) {
- LOGGER.info(format, arg1, arg2);
- }
-
- public void info(String format, Object[] argArray) {
- LOGGER.info(format, argArray);
- }
-
- public void info(String msg, Throwable t) {
- LOGGER.info(msg, t);
- }
-
- public boolean isInfoEnabled(Marker marker) {
- return LOGGER.isInfoEnabled(marker);
- }
-
- public void info(Marker marker, String msg) {
- LOGGER.info(marker, msg);
- }
-
- public void info(Marker marker, String format, Object arg) {
- LOGGER.info(marker, format, arg);
- }
-
- public void info(Marker marker, String format, Object arg1, Object arg2) {
- LOGGER.info(marker, format, arg1, arg2);
- }
-
- public void info(Marker marker, String format, Object[] argArray) {
- LOGGER.info(marker, format, argArray);
- }
-
- public void info(Marker marker, String msg, Throwable t) {
- LOGGER.info(marker, msg, t);
- }
-
- public boolean isWarnEnabled() {
- return LOGGER.isWarnEnabled();
- }
-
- public void warn(String msg) {
- LOGGER.warn(msg);
- }
-
- public void warn(String format, Object arg) {
- LOGGER.warn(format, arg);
- }
-
- public void warn(String format, Object[] argArray) {
- LOGGER.warn(format, argArray);
- }
-
- public void warn(String format, Object arg1, Object arg2) {
- LOGGER.warn(format, arg1, arg2);
- }
-
- public void warn(String msg, Throwable t) {
- LOGGER.warn(msg, t);
- }
-
- public boolean isWarnEnabled(Marker marker) {
- return LOGGER.isWarnEnabled(marker);
- }
-
- public void warn(Marker marker, String msg) {
- LOGGER.warn(marker, msg);
- }
-
- public void warn(Marker marker, String format, Object arg) {
- LOGGER.warn(marker, format, arg);
- }
-
- public void warn(Marker marker, String format, Object arg1, Object arg2) {
- LOGGER.warn(marker, format, arg1, arg2);
- }
-
- public void warn(Marker marker, String format, Object[] argArray) {
- LOGGER.warn(marker, format, argArray);
- }
-
- public void warn(Marker marker, String msg, Throwable t) {
- LOGGER.warn(marker, msg, t);
- }
-
- public boolean isErrorEnabled() {
- return LOGGER.isErrorEnabled();
- }
-
- public void error(String msg) {
- LOGGER.error(msg);
- }
-
- public void error(String format, Object arg) {
- LOGGER.error(format, arg);
- }
-
- public void error(String format, Object arg1, Object arg2) {
- LOGGER.error(format, arg1, arg2);
- }
-
- public void error(String format, Object[] argArray) {
- LOGGER.error(format, argArray);
- }
-
- public void error(String msg, Throwable t) {
- LOGGER.error(msg, t);
- }
-
- public boolean isErrorEnabled(Marker marker) {
- return LOGGER.isErrorEnabled(marker);
- }
-
- public void error(Marker marker, String msg) {
- LOGGER.error(marker, msg);
- }
-
- public void error(Marker marker, String format, Object arg) {
- LOGGER.error(marker, format, arg);
- }
-
- public void error(Marker marker, String format, Object arg1, Object arg2) {
- LOGGER.error(marker, format, arg1, arg2);
- }
-
- public void error(Marker marker, String format, Object[] argArray) {
- LOGGER.error(marker, format, argArray);
- }
-
- public void error(Marker marker, String msg, Throwable t) {
- LOGGER.error(marker, msg, t);
- }
-
-
-}
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -32,8 +32,8 @@
import javax.faces.context.FacesContext;
import org.ajax4jsf.util.ELUtils;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
import org.w3c.dom.css.CSSCharsetRule;
import org.w3c.dom.css.CSSFontFaceRule;
import org.w3c.dom.css.CSSImportRule;
Modified: trunk/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -29,8 +29,8 @@
import java.util.Properties;
import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Modified: trunk/core/impl/src/main/java/org/richfaces/util/Util.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/util/Util.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/main/java/org/richfaces/util/Util.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -82,9 +82,9 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.util.base64.Codec;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.resource.StateHolderResource;
-import org.slf4j.Logger;
/**
* @author Nick Belaevski
Copied: trunk/core/impl/src/test/java/org/richfaces/application (from rev 19022, branches/RFPL-434/core/impl/src/test/java/org/richfaces/application)
Deleted: trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java
===================================================================
--- branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Locale;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIViewRoot;
-
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.richfaces.l10n.BundleLoader;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class MessageFactoryImpltest {
-
- private MockFacesEnvironment facesEnvironment;
-
- private MessageFactory messageFactory;
-
- @Before
- public void setUp() throws Exception {
- Locale.setDefault(Locale.US);
-
- facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
-
- messageFactory = new MessageFactoryImpl(new BundleLoader());
- }
-
- @After
- public void tearDown() throws Exception {
- facesEnvironment.verify();
- facesEnvironment.release();
- facesEnvironment = null;
-
- messageFactory = null;
- }
-
- @Test
- public void testCreateMessageFromFacesBundle() throws Exception {
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
- facesEnvironment.replay();
-
- // {1}: Could not convert ''{0}'' to a string.
- FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertNotNull(stringConverterMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
- assertEquals("Message: Could not convert 'something' to a string.", stringConverterMessage.getSummary());
- assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
-
- // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' must be convertible to an enum.
- // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' must be convertible to an enum from the enum that contains the constant ''{1}''.
- FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
- assertNotNull(longConverterMessage);
- assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
- assertEquals("Failed: 'field' must be convertible to an enum.", longConverterMessage.getSummary());
- assertEquals(
- "Failed: 'field' must be convertible to an enum from the enum that contains the constant 'anotherField'.",
- longConverterMessage.getDetail());
- }
-
- @Test
- public void testCreateMessageFromApplicationBundle() throws Exception {
- UIViewRoot mockViewRoot = facesEnvironment.createMock(UIViewRoot.class);
- expect(mockViewRoot.getLocale()).andStubReturn(new Locale("ru", "RU"));
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(mockViewRoot);
- expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.application.MessageFactoryImplTest");
- facesEnvironment.replay();
-
- // {1}: ''{0}'' ne konvertiruyetsia v stroku.
- FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertNotNull(stringConverterMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
- assertEquals("Message: 'something' ne konvertiruyetsia v stroku.", stringConverterMessage.getSummary());
- assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
-
- // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
- // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
- FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
- assertNotNull(longConverterMessage);
- assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
- assertEquals("Failed: 'field' dolzhno konvertirovat'sia v enum.", longConverterMessage.getSummary());
- assertEquals(
- "Failed: 'field' dolzhno konvertirovat'sia v enum iz enum s konstantoj 'anotherField'.",
- longConverterMessage.getDetail());
-
- // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
- FacesMessage inputConversionMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
- FacesMessages.UIINPUT_CONVERSION, "Failure message");
- assertNotNull(inputConversionMessage);
- assertEquals(FacesMessage.SEVERITY_INFO, inputConversionMessage.getSeverity());
- assertEquals("Failure message: Conversion error occurred.", inputConversionMessage.getSummary());
- }
-}
Copied: trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java (from rev 19022, branches/RFPL-434/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java)
===================================================================
--- trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java (rev 0)
+++ trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImpltest.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Locale;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.l10n.BundleLoader;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MessageFactoryImpltest {
+
+ private MockFacesEnvironment facesEnvironment;
+
+ private MessageFactory messageFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ Locale.setDefault(Locale.US);
+
+ facesEnvironment = MockFacesEnvironment.createEnvironment().withApplication();
+
+ messageFactory = new MessageFactoryImpl(new BundleLoader());
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ facesEnvironment.verify();
+ facesEnvironment.release();
+ facesEnvironment = null;
+
+ messageFactory = null;
+ }
+
+ @Test
+ public void testCreateMessageFromFacesBundle() throws Exception {
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
+ facesEnvironment.replay();
+
+ // {1}: Could not convert ''{0}'' to a string.
+ FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertNotNull(stringConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
+ assertEquals("Message: Could not convert 'something' to a string.", stringConverterMessage.getSummary());
+ assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
+
+ // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' must be convertible to an enum.
+ // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' must be convertible to an enum from the enum that contains the constant ''{1}''.
+ FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
+ assertNotNull(longConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
+ assertEquals("Failed: 'field' must be convertible to an enum.", longConverterMessage.getSummary());
+ assertEquals(
+ "Failed: 'field' must be convertible to an enum from the enum that contains the constant 'anotherField'.",
+ longConverterMessage.getDetail());
+ }
+
+ @Test
+ public void testCreateMessageFromApplicationBundle() throws Exception {
+ UIViewRoot mockViewRoot = facesEnvironment.createMock(UIViewRoot.class);
+ expect(mockViewRoot.getLocale()).andStubReturn(new Locale("ru", "RU"));
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(mockViewRoot);
+ expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn("org.richfaces.application.MessageFactoryImplTest");
+ facesEnvironment.replay();
+
+ // {1}: ''{0}'' ne konvertiruyetsia v stroku.
+ FacesMessage stringConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertNotNull(stringConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, stringConverterMessage.getSeverity());
+ assertEquals("Message: 'something' ne konvertiruyetsia v stroku.", stringConverterMessage.getSummary());
+ assertEquals(stringConverterMessage.getSummary(), stringConverterMessage.getDetail());
+
+ // javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
+ // javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
+ FacesMessage longConverterMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessage.SEVERITY_ERROR, FacesMessages.ENUM_CONVERTER_ENUM, "field", "anotherField", "Failed");
+ assertNotNull(longConverterMessage);
+ assertEquals(FacesMessage.SEVERITY_ERROR, longConverterMessage.getSeverity());
+ assertEquals("Failed: 'field' dolzhno konvertirovat'sia v enum.", longConverterMessage.getSummary());
+ assertEquals(
+ "Failed: 'field' dolzhno konvertirovat'sia v enum iz enum s konstantoj 'anotherField'.",
+ longConverterMessage.getDetail());
+
+ // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
+ FacesMessage inputConversionMessage = messageFactory.createMessage(facesEnvironment.getFacesContext(),
+ FacesMessages.UIINPUT_CONVERSION, "Failure message");
+ assertNotNull(inputConversionMessage);
+ assertEquals(FacesMessage.SEVERITY_INFO, inputConversionMessage.getSeverity());
+ assertEquals("Failure message: Conversion error occurred.", inputConversionMessage.getSummary());
+ }
+}
Deleted: trunk/core/impl/src/test/resources/log4j.xml
===================================================================
--- trunk/core/impl/src/test/resources/log4j.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/impl/src/test/resources/log4j.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!DOCTYPE log4j:configuration SYSTEM "file:///eclipse/dtdcache/log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <!-- This is a sample configuration for log4j.
- It simply just logs everything into a single
- log file.
- Note, that you can use properties for value substitution.
- -->
- <appender name="DEFAULT" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} [%c] %C %M %n%-5p: %m%n" />
- </layout>
- </appender>
-
-<!--
- <appender name="FACES" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
-
- <appender name="CHAMELEON" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
- -->
- <category name="com.sun.faces">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="org.apache.myfaces">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="javax.faces">
- <priority value="INFO" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="faces">
- <priority value="INFO" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="org.richfaces">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
-
- <category name="org.ajax4jsf">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <!--
- <root>
- <priority value ="info" />
- <appender-ref ref="DEFAULT" />
- </root>
- -->
-</log4j:configuration>
Copied: trunk/core/impl/src/test/resources/org/richfaces/application (from rev 19022, branches/RFPL-434/core/impl/src/test/resources/org/richfaces/application)
Deleted: trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
===================================================================
--- branches/RFPL-434/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties 2010-08-30 16:51:33 UTC (rev 19022)
+++ trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,3 +0,0 @@
-javax.faces.converter.STRING={1}: ''{0}'' ne konvertiruyetsia v stroku.
-javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
-javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
\ No newline at end of file
Copied: trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties (from rev 19022, branches/RFPL-434/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties)
===================================================================
--- trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties (rev 0)
+++ trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -0,0 +1,3 @@
+javax.faces.converter.STRING={1}: ''{0}'' ne konvertiruyetsia v stroku.
+javax.faces.converter.EnumConverter.ENUM={2}: ''{0}'' dolzhno konvertirovat''sia v enum.
+javax.faces.converter.EnumConverter.ENUM_detail={2}: ''{0}'' dolzhno konvertirovat''sia v enum iz enum s konstantoj ''{1}''.
\ No newline at end of file
Deleted: trunk/core/legacy-tests/src/test/resources/log4j.xml
===================================================================
--- trunk/core/legacy-tests/src/test/resources/log4j.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/core/legacy-tests/src/test/resources/log4j.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!DOCTYPE log4j:configuration SYSTEM "file:///eclipse/dtdcache/log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <!-- This is a sample configuration for log4j.
- It simply just logs everything into a single
- log file.
- Note, that you can use properties for value substitution.
- -->
- <appender name="DEFAULT" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
-
-<!--
- <appender name="FACES" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
-
- <appender name="CHAMELEON" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
- -->
- <category name="com.sun.faces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="org.apache.myfaces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="javax.faces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="faces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="com.exadel.vcp">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
-
- <category name="org.ajax4jsf">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <!--
- <root>
- <priority value ="WARN" />
- <appender-ref ref="DEFAULT" />
- </root>
- -->
-</log4j:configuration>
Modified: trunk/dist/readme-ui.txt
===================================================================
--- trunk/dist/readme-ui.txt 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/dist/readme-ui.txt 2010-08-30 23:15:03 UTC (rev 19028)
@@ -13,11 +13,9 @@
1.3) richfaces-core-impl-4.0.0.20100824-M2.jar
1.4) richfaces-components-api-4.0.0.20100824-M2.jar
1.5) richfaces-components-ui-4.0.0.20100824-M2.jar
- 1.6) slf4j-api
- 1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging framework that you use)
- 1.8) sac-1.3, cssparser-0.9.5 - required for components CSS work
- 1.9) google-guava-r06 - core runtime dependency.
- 1.10) annotations.jar from org.richfaces.cdk . It's optional and should be added only if some RichFaces components will be
+ 1.6) sac-1.3, cssparser-0.9.5 - required for components CSS work
+ 1.7) google-guava-r06 - core runtime dependency.
+ 1.8) annotations.jar from org.richfaces.cdk . It's optional and should be added only if some RichFaces components will be
created/accessed dynamically from some appication actions/listeners.
For optimal performance it's recommended to add one of these caching frameworks to application classpath: EhCache, JBoss Cache, OsCache.
Modified: trunk/examples/core-demo/pom.xml
===================================================================
--- trunk/examples/core-demo/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/core-demo/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -39,22 +39,6 @@
<dependencyManagement>
<dependencies>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
</dependencies>
</dependencyManagement>
@@ -87,14 +71,6 @@
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
</dependencies>
<build>
Modified: trunk/examples/core-demo/src/main/java/org/richfaces/demo/PhaseTracker.java
===================================================================
--- trunk/examples/core-demo/src/main/java/org/richfaces/demo/PhaseTracker.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/core-demo/src/main/java/org/richfaces/demo/PhaseTracker.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -27,8 +27,8 @@
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
/**
* @author Nick Belaevski
@@ -38,7 +38,7 @@
private static final long serialVersionUID = 6358081870120864332L;
- private Logger logger = LoggerFactory.getLogger(PhaseTracker.class);
+ private Logger logger = LogFactory.getLogger(PhaseTracker.class);
private ThreadLocal<Long> phaseTimer = new ThreadLocal<Long>();
Deleted: trunk/examples/core-demo/src/main/resources/log4j.xml
===================================================================
--- trunk/examples/core-demo/src/main/resources/log4j.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/core-demo/src/main/resources/log4j.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
- </layout>
- </appender>
- <logger name="org.richfaces">
- <level value="info" />
- </logger>
- <logger name="org.richfaces.demo.PhaseTracker">
- <level value="debug" />
- </logger>
- <root>
- <priority value="info" />
- <appender-ref ref="console" />
- </root>
-
-</log4j:configuration>
\ No newline at end of file
Modified: trunk/examples/input-demo/pom.xml
===================================================================
--- trunk/examples/input-demo/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/input-demo/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -83,8 +83,8 @@
<configuration>
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
<classifier>jee6</classifier>
- <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</packagingExcludes>
- <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</packagingExcludes>
+ <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</warSourceExcludes>
</configuration>
</execution>
</executions>
@@ -131,38 +131,12 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
-
<!-- Tests -->
<dependency>
<groupId>org.testng</groupId>
Modified: trunk/examples/iteration-demo/pom.xml
===================================================================
--- trunk/examples/iteration-demo/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/iteration-demo/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -39,22 +39,6 @@
<dependencyManagement>
<dependencies>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
</dependencies>
</dependencyManagement>
@@ -71,14 +55,6 @@
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
<!-- API implementation for runtime -->
Modified: trunk/examples/misc-demo/pom.xml
===================================================================
--- trunk/examples/misc-demo/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/misc-demo/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -39,22 +39,6 @@
<dependencyManagement>
<dependencies>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
</dependencies>
</dependencyManagement>
@@ -96,15 +80,6 @@
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
<profiles>
Modified: trunk/examples/output-demo/pom.xml
===================================================================
--- trunk/examples/output-demo/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/output-demo/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -87,8 +87,8 @@
<configuration>
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
<classifier>jee6</classifier>
- <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</packagingExcludes>
- <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/slf4j-*</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</packagingExcludes>
+ <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</warSourceExcludes>
</configuration>
</execution>
</executions>
@@ -135,38 +135,12 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
-
<!-- Tests -->
<dependency>
<groupId>org.testng</groupId>
Modified: trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,15 +1,15 @@
package org.richfaces;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
import java.io.Serializable;
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
+
public class TogglePanelBean implements Serializable {
private static final long serialVersionUID = -2403138958014741653L;
- private static final Logger LOGGER = LoggerFactory.getLogger(TogglePanelBean.class);
+ private static final Logger LOGGER = LogFactory.getLogger(TogglePanelBean.class);
private String name;
Modified: trunk/examples/repeater-demo/pom.xml
===================================================================
--- trunk/examples/repeater-demo/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/repeater-demo/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -40,22 +40,6 @@
<dependencyManagement>
<dependencies>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
</dependencies>
</dependencyManagement>
Modified: trunk/examples/richfaces-showcase/pom.xml
===================================================================
--- trunk/examples/richfaces-showcase/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/richfaces-showcase/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -54,22 +54,6 @@
<artifactId>ehcache</artifactId>
</dependency>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
</dependencies>
<build>
Deleted: trunk/examples/richfaces-showcase/src/main/resources/log4j.properties
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/log4j.properties 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/richfaces-showcase/src/main/resources/log4j.properties 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,24 +0,0 @@
-# A default log4j configuration for log4j users.
-#
-# To use this configuration, deploy it into your application's WEB-INF/classes
-# directory. You are also encouraged to edit it as you like.
-
-# Configure the console as our one appender
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
-
-# tighten logging on the DataNucleus Categories
-log4j.category.DataNucleus.JDO=WARN, A1
-log4j.category.DataNucleus.Persistence=WARN, A1
-log4j.category.DataNucleus.Cache=WARN, A1
-log4j.category.DataNucleus.MetaData=WARN, A1
-log4j.category.DataNucleus.General=WARN, A1
-log4j.category.DataNucleus.Utility=WARN, A1
-log4j.category.DataNucleus.Transaction=WARN, A1
-log4j.category.DataNucleus.Datastore=WARN, A1
-log4j.category.DataNucleus.ClassLoading=WARN, A1
-log4j.category.DataNucleus.Plugin=WARN, A1
-log4j.category.DataNucleus.ValueGeneration=WARN, A1
-log4j.category.DataNucleus.Enhancer=WARN, A1
-log4j.category.DataNucleus.SchemaTool=WARN, A1
Deleted: trunk/examples/richfaces-showcase/src/main/resources/log4j.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/log4j.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/examples/richfaces-showcase/src/main/resources/log4j.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
- </layout>
- </appender>
- <root>
- <priority value="info" />
- <appender-ref ref="console" />
- </root>
-
-</log4j:configuration>
\ No newline at end of file
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/QueueRegistry.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/QueueRegistry.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/QueueRegistry.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -29,7 +29,7 @@
import javax.faces.context.FacesContext;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Nick Belaevski
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/AjaxCommandRendererBase.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -34,7 +34,7 @@
import org.ajax4jsf.renderkit.HandlersChain;
import org.ajax4jsf.renderkit.RendererBase;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -36,9 +36,10 @@
import org.ajax4jsf.context.ContextInitParameters;
import org.richfaces.component.QueueRegistry;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+
/**
* @author Nick Belaevski Base class for rendering Queue
*/
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/BehaviorsTagHandlerDelegateFactoryImpl.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -34,7 +34,7 @@
import javax.faces.view.facelets.ValidatorHandler;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Nick Belaevski
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -30,7 +30,7 @@
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Anton Belevich
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataGrid.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataGrid.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataGrid.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -44,7 +44,7 @@
import org.richfaces.context.ExtendedVisitContextMode;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.renderkit.MetaComponentRenderer;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
* @author Anton Belevich
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractExtendedDataTable.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -40,7 +40,7 @@
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.context.ExtendedVisitContextMode;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
/**
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -60,7 +60,7 @@
import org.richfaces.model.SortField;
import org.richfaces.model.SortMode;
import org.richfaces.renderkit.MetaComponentRenderer;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
public abstract class UIDataTableBase extends UISequence implements Row, MetaComponentResolver, MetaComponentEncoder {
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2010-08-30 23:15:03 UTC (rev 19028)
@@ -41,7 +41,7 @@
import org.richfaces.component.UIDataAdaptor;
import org.richfaces.component.util.MessageUtil;
import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import org.richfaces.log.Logger;
public class DataTablePreRenderListener implements SystemEventListener {
Modified: trunk/ui/parent/pom.xml
===================================================================
--- trunk/ui/parent/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
+++ trunk/ui/parent/pom.xml 2010-08-30 23:15:03 UTC (rev 19028)
@@ -129,12 +129,6 @@
<!-- tests -->
<dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
14 years, 4 months
JBoss Rich Faces SVN: r19027 - in modules/docs/trunk: Component_Development_Kit_Guide and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-08-30 19:09:40 -0400 (Mon, 30 Aug 2010)
New Revision: 19027
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-a4jrepeat_example.xml_sample
modules/docs/trunk/trunk/
Removed:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Tables_and_grids-a4jrepeat_example.xml_sample
Modified:
modules/docs/trunk/Component_Development_Kit_Guide/pom.xml
modules/docs/trunk/Component_Reference/pom.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample
modules/docs/trunk/Developer_Guide/pom.xml
modules/docs/trunk/Migration_Guide/pom.xml
modules/docs/trunk/parent/pom.xml
modules/docs/trunk/pom.xml
Log:
Simple updates for M2 added (RFPL-767), fixed colours in PDFs
Modified: modules/docs/trunk/Component_Development_Kit_Guide/pom.xml
===================================================================
--- modules/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -2,11 +2,12 @@
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs</groupId>
+ <groupId>org.richfaces.cdk-guide</groupId>
<artifactId>richfaces-cdk-guide</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>RichFaces CDK Guide</name>
+ <url>http://www.jboss.org/richfaces</url>
<parent>
<groupId>org.richfaces.docs</groupId>
@@ -106,9 +107,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Compo...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/docs/trunk/Componen...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/docs/trunk/Component_De...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/cdk/docs/guide</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/cdk/docs/guide</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
Modified: modules/docs/trunk/Component_Reference/pom.xml
===================================================================
--- modules/docs/trunk/Component_Reference/pom.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Component_Reference/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -7,6 +7,7 @@
<version>4.0.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>RichFaces Component Reference</name>
+ <url>http://www.jboss.org/richfaces</url>
<parent>
<groupId>org.richfaces.docs</groupId>
@@ -106,9 +107,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Compo...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/docs/trunk/Componen...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/docs/trunk/Component_Re...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/docs/Component_Ref...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/docs/Component_Reference</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/</url>
</scm>
</project>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -7,8 +7,7 @@
<important>
<title>Documentation in development</title>
<para>
- Some concepts covered in this chapter may refer to the previous version of <productname>Richfaces</productname>
- , version 3.3.3. This chapter is scheduled for review to ensure all information is up to date.
+ Some concepts covered in this chapter may refer to the previous version of <productname>Richfaces</productname>, version 3.3.3. This chapter is scheduled for review to ensure all information is up to date.
</para>
</important>
<para>
@@ -25,19 +24,35 @@
<section id="sect-Component_Reference-a4jrepeat-Basic_usage">
<title>Basic usage</title>
<para>
- The contents of the collection are determined using Expression Language (<acronym>EL</acronym>). The data model for the contents is specified with the <varname>value</varname> attribute. The <varname>var</varname> attribute names the object to use when iterating through the collection. This object is then referenced in the relevant child components. After an Ajax request, only the rows specified with the <varname>ajaxKeys</varname> attribute are updated rather than the entire collection. <xref linkend="exam-Component_Reference-a4jrepeat-a4jrepeat_example" /> shows how to use <sgmltag><a4j:repeat></sgmltag> to maintain a simple table.
+ The contents of the collection are determined using Expression Language (<acronym>EL</acronym>). The data model for the contents is specified with the <varname>value</varname> attribute. The <varname>var</varname> attribute names the object to use when iterating through the collection. This object is then referenced in the relevant child components. <xref linkend="exam-Component_Reference-a4jrepeat-a4jrepeat_example" /> shows how to use <sgmltag><a4j:repeat></sgmltag> to maintain a simple table.
</para>
<example id="exam-Component_Reference-a4jrepeat-a4jrepeat_example">
<title><sgmltag><a4j:repeat></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-a4jrepeat_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-a4jrepeat-a4jrepeat_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<para>
Each row of a table contains two cells: one showing the item code, and the other showing the item price. The table is generated by iterating through items in the <code>repeatBeans.items</code> data model.
</para>
</example>
+ </section>
+
+ <!-- TODO
+ <section id="sect-Component_Reference-a4jrepeat-Limited_views_and_partial_updates">
+ <title>Limited views and partial updates</title>
<para>
The <sgmltag><a4j:repeat></sgmltag> component uses other attributes common to iteration components, such as the <varname>first</varname> attribute for specifying the first item for iteration, and the <varname>rows</varname> attribute for specifying the number of rows of items to display.
</para>
+ <para>
+ After an Ajax request, only the rows specified with the <varname>ajaxKeys</varname> attribute are updated rather than the entire collection.
+ </para>
+ <example id="exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates">
+ <title>Limited views and partial updates</title>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-Limited_views_and_partial_updates.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The table rows are limited using the <varname>first</varname> and <varname>rows</varname> attributes. Only those rows specified through the <varname>ajaxKeys</varname> are updated after an Ajax request.
+ </para>
+ </example>
</section>
+ -->
<section id="sect-Component_Reference-a4jrepeat-Reference_data">
<title>Reference data</title>
@@ -70,7 +85,7 @@
<section id="sect-Component_Reference-Tables_and_grids-richcolumn">
<title><sgmltag><rich:column></sgmltag></title>
<para>
- The <sgmltag><rich:column></sgmltag> component facilitates columns in a table or other <classname>UIData</classname> component. It supports merging columns and rows, sorting, filtering, and customized skinning.
+ The <sgmltag><rich:column></sgmltag> component facilitates columns in a table. It supports merging columns and rows, sorting, filtering, and customized skinning.
</para>
<section id="sect-Component_Reference-richcolumn-Basic_usage">
@@ -250,7 +265,9 @@
</section>
</section>
+ <!-- Removed -->
<!--<rich:columns>-->
+ <!--
<section id="sect-Component_Reference-Tables_and_grids-richcolumns">
<title><sgmltag><rich:columns></sgmltag></title>
<para>
@@ -304,79 +321,8 @@
</itemizedlist>
</section>
</section>
+ -->
- <!--<rich:dataDefinitionList>-->
- <section id="sect-Component_Reference-Tables_and_grids-richdataDefinitionList">
- <title><sgmltag><rich:dataDefinitionList></sgmltag></title>
- <para>
- The <sgmltag><rich:dataDefinitionList></sgmltag> component renders a list of items with definitions. The component uses a data model for managing the list items, which can be updated dynamically.
- </para>
-
- <section id="sect-Component_Reference-richdataDefinitionList-Basic_usage">
- <title>Basic usage</title>
- <para>
- The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
- </para>
- </section>
-
- <section id="sect-Component_Reference-richdataDefinitionList-Customizing_the_list">
- <title>Customizing the list</title>
- <para>
- The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example" /> shows a simple example using the <sgmltag><rich:dataDefinitionList></sgmltag> component.
- </para>
- <example id="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example">
- <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataDefinitionList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- <blockquote>
- <figure id="figu-Component_Reference-richdataDefinitionList_example-richdataDefinitionList_example">
- <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataDefinitionList_example.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- A list of cars with their price and mileage displayed as a data definition.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
- </example>
- </section>
-
- <section id="sect-Component_Reference-richdataDefinitionList-Reference_data">
- <title>Reference data</title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataDefinitionList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.DataDefinitionListRenderer</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataDefinitionListTag</classname>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-
<!-- TODO not in M2 -->
<!--
<section id="sect-Component_Reference-Tables_and_grids-richdataFilterSlider">
@@ -549,232 +495,6 @@
</section>
</section>
- <!--<rich:dataOrderedList>-->
- <section id="sect-Component_Reference-Tables_and_grids-richdataList">
- <title><sgmltag><rich:dataList></sgmltag></title>
- <para>
- The <sgmltag><rich:dataList></sgmltag> component renders an unordered list of items. The component uses a data model for managing the list items, which can be updated dynamically.
- </para>
-
- <section id="sect-Component_Reference-richdataList-Basic_usage">
- <title>Basic usage</title>
- <para>
- The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
- </para>
- </section>
-
- <section id="sect-Component_Reference-richdataList-Bullet_point_type">
- <title>Bullet point type</title>
- <para>
- The <varname>type</varname> attribute refers to the appearance of the bullet points. The values of the attribute correspond to the <varname>type</varname> parameter for the <sgmltag><ul></sgmltag> HTML element:
- </para>
- <variablelist>
- <varlistentry>
- <term><literal>circle</literal></term>
- <listitem>
- <para>
- Displays an unfilled circle as a bullet point.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>disc</literal></term>
- <listitem>
- <para>
- Displays a filled disc as a bullet point.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>square</literal></term>
- <listitem>
- <para>
- Displays a square as a bullet point.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
-
- <section id="sect-Component_Reference-richdataList-Customizing_the_list">
- <title>Customizing the list</title>
- <para>
- The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example" /> shows a simple example using the <sgmltag><rich:dataDefinitionList></sgmltag> component.
- </para>
- <example id="exam-Component_Reference-richdataList-richdataList_example">
- <title><sgmltag><rich:dataList></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- <blockquote>
- <figure id="figu-Component_Reference-richdataList_example-richdataList_example">
- <title><sgmltag><rich:dataList></sgmltag> example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richdataList-richdataList_example.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- A list of cars displayed in a list with bullet points.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
- </example>
- </section>
-
- <section id="sect-Component_Reference-richdataList-Reference_data">
- <title>Reference data</title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.richfaces.DataList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.richfaces.DataList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.DataListRenderer</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataListTag</classname>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-
- <!--<rich:dataOrderedList>-->
- <section id="sect-Component_Reference-Tables_and_grids-richdataOrderedList">
- <title><sgmltag><rich:dataOrderedList></sgmltag></title>
- <para>
- The <sgmltag><rich:dataOrderedList></sgmltag> component renders an ordered list of items from a data model. Specific rows can be updated dynamically without updating the entire list.
- </para>
-
- <section id="sect-Component_Reference-richdataOrderedList-Basic_usage">
- <title>Basic usage</title>
- <para>
- The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
- </para>
- </section>
-
- <section id="sect-Component_Reference-richdataOrderedList-Numeration_type">
- <title>Numeration type</title>
- <para>
- The <varname>type</varname> attribute defines the appearance of the numerating list markers for the list. The possible values for the <varname>type</varname> attribute are as follows:
- </para>
- <variablelist>
- <varlistentry>
- <term><literal>A</literal></term>
- <listitem>
- <para>
- Numerates the list items as <wordasword>A</wordasword>, <wordasword>B</wordasword>, <wordasword>C</wordasword>, etc.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>a</literal></term>
- <listitem>
- <para>
- Numerates the list items as <wordasword>a</wordasword>, <wordasword>b</wordasword>, <wordasword>c</wordasword>, etc.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>I</literal></term>
- <listitem>
- <para>
- Numerates the list items as <wordasword>I</wordasword>, <wordasword>II</wordasword>, <wordasword>III</wordasword>, etc.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>i</literal></term>
- <listitem>
- <para>
- Numerates the list items as <wordasword>i</wordasword>, <wordasword>ii</wordasword>, <wordasword>iii</wordasword>, etc.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>1</literal></term>
- <listitem>
- <para>
- Numerates the list items as <wordasword>1</wordasword>, <wordasword>2</wordasword>, <wordasword>3</wordasword>, etc.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
-
- <section id="sect-Component_Reference-richdataOrderedList-Customizing_the_list">
- <title>Customizing the list</title>
- <para>
- The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute defines a pop-up title. To only update a sub-set of the rows in the list, use the <varname>ajaxKeys</varname> attribute, which points to an object that contains the specified rows.
- </para>
- <example id="exam-Component_Reference-richdataOrderedList-richdataOrderedList_example">
- <title><sgmltag><rich:dataOrderedList></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataOrderedList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- <blockquote>
- <figure id="figu-Component_Reference-richdataOrderedList_example-richdataOrderedList_example">
- <title><sgmltag><rich:dataOrderedList></sgmltag> example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataOrderedList_example.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- A list of cars displayed in a numbered list.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
- </example>
- </section>
-
- <section id="sect-Component_Reference-richdataOrderedList-Reference_data">
- <title>Reference data</title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.richfaces.DataOrderedList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataOrderedList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.richfaces.DataOrderedList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.DataOrderedListRenderer</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataOrderedListTag</classname>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-
<!-- TODO not in M2 -->
<!--
<section id="sect-Component_Reference-Tables_and_grids-richdataScroller">
@@ -816,7 +536,7 @@
<section id="sect-Component_Reference-Tables_and_grids-richdataTable">
<title><sgmltag><rich:dataTable></sgmltag></title>
<para>
- The <sgmltag><rich:dataTable></sgmltag> component is used to render a table, including the table's header and footer. It works in conjunction with the <sgmltag><rich:column></sgmltag>, <sgmltag><rich:columnGroup></sgmltag>, and <sgmltag><rich:columns></sgmltag> components to list the contents of a data model.
+ The <sgmltag><rich:dataTable></sgmltag> component is used to render a table, including the table's header and footer. It works in conjunction with the <sgmltag><rich:column></sgmltag> and <sgmltag><rich:columnGroup></sgmltag> components to list the contents of a data model.
</para>
<note>
<title><sgmltag><rich:extendedDataTable></sgmltag></title>
@@ -912,10 +632,7 @@
The <sgmltag><rich:extendedDataTable></sgmltag> component includes the following attributes not included in the <sgmltag><rich:dataTable></sgmltag> component:
</para>
<simplelist columns="3">
- <member><varname>activeClass</varname></member>
- <member><varname>activeRowKey</varname></member>
- <member><varname>enableContextMenu</varname></member>
- <member><varname>groupingColumn</varname></member>
+ <member><varname>frozenColumns</varname></member>
<member><varname>height</varname></member>
<member><varname>noDataLabel</varname></member>
<member><varname>onselectionchange</varname></member>
@@ -938,11 +655,6 @@
<varname>columnsWidth</varname>
</para>
</listitem>
- <listitem>
- <para>
- <varname>onRowContextMenu</varname>
- </para>
- </listitem>
</itemizedlist>
<section id="sect-Component_Reference-richextendedDataTable-Basic_usage">
<title>Basic usage</title>
@@ -954,7 +666,7 @@
<section id="sect-Component_Reference-richextendedDataTable-Table_appearance">
<title>Table appearance</title>
<para>
- The <varname>height</varname> attribute defines the height of the table on the page. This is set to <literal>500px</literal> by default. The width of the table can be set by using the <varname>width</varname> attribute. As with the <sgmltag><rich:dataTable></sgmltag> component, the look of the <sgmltag><rich:extendedDataTable></sgmltag> component can be customized and skinned using the <literal>header</literal>, <literal>footer</literal>, and <literal>caption</literal> facets.
+ The <varname>height</varname> attribute defines the height of the table on the page. This is set to <literal>100%</literal> by default. The width of the table can be set by using the <varname>width</varname> attribute. As with the <sgmltag><rich:dataTable></sgmltag> component, the look of the <sgmltag><rich:extendedDataTable></sgmltag> component can be customized and skinned using the <literal>header</literal>, <literal>footer</literal>, and <literal>caption</literal> facets.
</para>
</section>
@@ -1006,12 +718,16 @@
<section id="sect-Component_Reference-richextendedDataTable-Filtering">
<title>Filtering</title>
<para>
- The example uses the <literal>filter</literal> facet of the <sgmltag><rich:column></sgmltag> component to display the text field. A user can type their criteria into the text field to customize the filter of the column below. For full details on filtering tables, refer to <xref linkend="sect-Component_Reference-Tables_and_grids-Table_filtering" />.
+ <!--
+ The example uses the <literal>filter</literal> facet of the <sgmltag><rich:column></sgmltag> component to display the text field.
+ -->
+ A user can type their criteria into the text field to customize the filter of the column below. For full details on filtering tables, refer to <xref linkend="sect-Component_Reference-Tables_and_grids-Table_filtering" />.
</para>
</section>
<section id="sect-Component_Reference-richextendedDataTable-Sorting">
<title>Sorting</title>
+ <!--
<para>
When hovering the mouse over a column header, a menu button appears to the right-hand side, as shown in <xref linkend="figu-Component_Reference-richextendedDataTable-Column_menu" />. This menu allows the user to sort the contents of the column, group the table by the column, or hide and show columns.
</para>
@@ -1028,11 +744,16 @@
</textobject>
</mediaobject>
</figure>
+ -->
<para>
- Each column can allow sorting by setting the <sgmltag><rich:column></sgmltag> component's <varname>sortable</varname> attribute to <literal>true</literal>. The value of the data model to sort by is specified with the <varname>sortBy</varname> attribute. In addition to using the menu for sorting, columns can be quickly sorted either ascending or descending by clicking on the directional icon next to the column title. The directional icons are defined in each <sgmltag><rich:column></sgmltag> component with the <varname>sortIconAscending</varname> and <varname>sortIconDescending</varname> attributes, for ascending and descending icons respectively. For full details on sorting tables, refer to <xref linkend="sect-Component_Reference-Tables_and_grids-Table_sorting" />.
+ <!--
+ Each column can allow sorting by setting the <sgmltag><rich:column></sgmltag> component's <varname>sortable</varname> attribute to <literal>true</literal>.
+ -->
+ Each column can be used to sort the contents of the table. The value of the data model to sort by is specified with the <varname>sortBy</varname> attribute. Columns can be quickly sorted either ascending or descending by clicking on the directional icon next to the column title. The directional icons are defined in each <sgmltag><rich:column></sgmltag> component with the <varname>sortIconAscending</varname> and <varname>sortIconDescending</varname> attributes, for ascending and descending icons respectively. For full details on sorting tables, refer to <xref linkend="sect-Component_Reference-Tables_and_grids-Table_sorting" />.
</para>
</section>
+ <!--
<section id="sect-Component_Reference-richextendedDataTable-Grouping">
<title>Grouping</title>
<para>
@@ -1072,6 +793,7 @@
</mediaobject>
</figure>
</section>
+ -->
<section id="sect-Component_Reference-richextendedDataTable-Rearranging_columns">
<title>Rearranging columns</title>
@@ -1142,6 +864,383 @@
</para>
</section>
-->
+
+ <!--<rich:list>-->
+ <section id="sect-Component_Reference-Tables_and_grids-richlist">
+ <title><sgmltag><rich:list></sgmltag></title>
+ <para>
+ The <sgmltag><rich:list></sgmltag> component renders a list of items. The list can be an numerically ordered list, an unordered bullet-point list, or a data definition list. The component uses a data model for managing the list items, which can be updated dynamically.
+ </para>
+
+ <section id="sect-Component_Reference-richlist-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richlist-Type_of_list">
+ <title>Type of list</title>
+ <para>
+ By default, the list is displayed as an unordered bullet-point list. The <varname>type</varname> attribute is used to specify different list types:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>unordered</literal></term>
+ <listitem>
+ <para>
+ The default presentation. The list is presented as a series of bullet-points, similar to the <sgmltag><ul></sgmltag> HTML element.
+ </para>
+ <figure id="figu-Component_Reference-richlist-Unordered_list">
+ <title>Unordered list</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richdataList-richdataList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars displayed in a list with bullet points.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>ordered</literal></term>
+ <listitem>
+ <para>
+ The list is presented as a numbered series of items, similar to the <sgmltag><ol></sgmltag> HTML element.
+ </para>
+ <figure id="figu-Component_Reference-richlist-Ordered_list">
+ <title>Ordered list</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataOrderedList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars displayed in a numbered list.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>data</literal></term>
+ <listitem>
+ <para>
+ The list is presented as a series of data definitions. Part of the data model, specified as the term, is listed prominently. The other associated data is listed after each term.
+ </para>
+ <figure id="figu-Component_Reference-richlist-Data_definition_list">
+ <title>Data definition list</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataDefinitionList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars with their price and mileage displayed as a data definition.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+
+ <!-- TODO
+ <section id="sect-Component_Reference-richlist-Bullet_point_type">
+ <title>Bullet point type</title>
+ <para>
+ The <varname>type</varname> attribute refers to the appearance of the bullet points. The values of the attribute correspond to the <varname>type</varname> parameter for the <sgmltag><ul></sgmltag> HTML element:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>circle</literal></term>
+ <listitem>
+ <para>
+ Displays an unfilled circle as a bullet point.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>disc</literal></term>
+ <listitem>
+ <para>
+ Displays a filled disc as a bullet point.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>square</literal></term>
+ <listitem>
+ <para>
+ Displays a square as a bullet point.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ -->
+
+ <section id="sect-Component_Reference-richlist-Customizing_the_list">
+ <title>Customizing the list</title>
+ <para>
+ The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richlist-richlist_example" /> shows a simple example using the <sgmltag><rich:dataList></sgmltag> component.
+ </para>
+ <example id="exam-Component_Reference-richlist-richlist_example">
+ <title><sgmltag><rich:list></sgmltag> example</title>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <blockquote>
+ <figure id="figu-Component_Reference-richlist-richlist_example">
+ <title><sgmltag><rich:list></sgmltag> example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richdataList-richdataList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars displayed in a list with bullet points.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
+ </example>
+ </section>
+
+ <section id="sect-Component_Reference-richlist-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.List</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.List</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.ListRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ListTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
+ <!--<rich:dataDefinitionList>-->
+ <!-- TODO
+ <section id="sect-Component_Reference-Tables_and_grids-richdataDefinitionList">
+ <title><sgmltag><rich:dataDefinitionList></sgmltag></title>
+ <para>
+ The <sgmltag><rich:dataDefinitionList></sgmltag> component renders a list of items with definitions. The component uses a data model for managing the list items, which can be updated dynamically.
+ </para>
+
+ <section id="sect-Component_Reference-richdataDefinitionList-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richdataDefinitionList-Customizing_the_list">
+ <title>Customizing the list</title>
+ <para>
+ The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example" /> shows a simple example using the <sgmltag><rich:dataDefinitionList></sgmltag> component.
+ </para>
+ <example id="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example">
+ <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataDefinitionList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <blockquote>
+ <figure id="figu-Component_Reference-richdataDefinitionList_example-richdataDefinitionList_example">
+ <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataDefinitionList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars with their price and mileage displayed as a data definition.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
+ </example>
+ </section>
+
+ <section id="sect-Component_Reference-richdataDefinitionList-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataDefinitionList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataDefinitionListRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataDefinitionListTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ -->
+
+ <!--<rich:dataOrderedList>-->
+ <!-- TODO
+ <section id="sect-Component_Reference-Tables_and_grids-richdataOrderedList">
+ <title><sgmltag><rich:dataOrderedList></sgmltag></title>
+ <para>
+ The <sgmltag><rich:dataOrderedList></sgmltag> component renders an ordered list of items from a data model. Specific rows can be updated dynamically without updating the entire list.
+ </para>
+
+ <section id="sect-Component_Reference-richdataOrderedList-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richdataOrderedList-Numeration_type">
+ <title>Numeration type</title>
+ <para>
+ The <varname>type</varname> attribute defines the appearance of the numerating list markers for the list. The possible values for the <varname>type</varname> attribute are as follows:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>A</literal></term>
+ <listitem>
+ <para>
+ Numerates the list items as <wordasword>A</wordasword>, <wordasword>B</wordasword>, <wordasword>C</wordasword>, etc.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>a</literal></term>
+ <listitem>
+ <para>
+ Numerates the list items as <wordasword>a</wordasword>, <wordasword>b</wordasword>, <wordasword>c</wordasword>, etc.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>I</literal></term>
+ <listitem>
+ <para>
+ Numerates the list items as <wordasword>I</wordasword>, <wordasword>II</wordasword>, <wordasword>III</wordasword>, etc.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>i</literal></term>
+ <listitem>
+ <para>
+ Numerates the list items as <wordasword>i</wordasword>, <wordasword>ii</wordasword>, <wordasword>iii</wordasword>, etc.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>1</literal></term>
+ <listitem>
+ <para>
+ Numerates the list items as <wordasword>1</wordasword>, <wordasword>2</wordasword>, <wordasword>3</wordasword>, etc.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+
+ <section id="sect-Component_Reference-richdataOrderedList-Customizing_the_list">
+ <title>Customizing the list</title>
+ <para>
+ The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute defines a pop-up title. To only update a sub-set of the rows in the list, use the <varname>ajaxKeys</varname> attribute, which points to an object that contains the specified rows.
+ </para>
+ <example id="exam-Component_Reference-richdataOrderedList-richdataOrderedList_example">
+ <title><sgmltag><rich:dataOrderedList></sgmltag> example</title>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataOrderedList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <blockquote>
+ <figure id="figu-Component_Reference-richdataOrderedList_example-richdataOrderedList_example">
+ <title><sgmltag><rich:dataOrderedList></sgmltag> example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataOrderedList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars displayed in a numbered list.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
+ </example>
+ </section>
+
+ <section id="sect-Component_Reference-richdataOrderedList-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataOrderedList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataOrderedList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataOrderedList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataOrderedListRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataOrderedListTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ -->
+
<section id="sect-Component_Reference-Tables_and_grids-Table_filtering">
<title>Table filtering</title>
<para>
Deleted: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Tables_and_grids-a4jrepeat_example.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Tables_and_grids-a4jrepeat_example.xml_sample 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-Tables_and_grids-a4jrepeat_example.xml_sample 2010-08-30 23:09:40 UTC (rev 19027)
@@ -1,10 +0,0 @@
-<table>
- <tbody>
- <a4j:repeat value="#{repeatBean.items}" var="item" ajaxKeys="#{updateBean.updatedRow}">
- <tr>
- <td><h:outputText value="#{item.code}" id="item1" /></td>
- <td><h:outputText value="#{item.price}" id="item2" /></td>
- </tr>
- </a4j:repeat>
- </tbody>
-</table>
Copied: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates.xml_sample (from rev 19026, modules/docs/branches/draft/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates.xml_sample)
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates.xml_sample 2010-08-30 23:09:40 UTC (rev 19027)
@@ -0,0 +1,10 @@
+<table>
+ <tbody>
+ <a4j:repeat value="#{repeatBean.items}" var="item" ajaxKeys="#{updateBean.updatedRow}" first="5" rows="5">
+ <tr>
+ <td><h:outputText value="#{item.code}" id="item1" /></td>
+ <td><h:outputText value="#{item.price}" id="item2" /></td>
+ </tr>
+ </a4j:repeat>
+ </tbody>
+</table>
Copied: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-a4jrepeat_example.xml_sample (from rev 19026, modules/docs/branches/draft/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-a4jrepeat_example.xml_sample)
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-a4jrepeat_example.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-a4jrepeat-a4jrepeat_example.xml_sample 2010-08-30 23:09:40 UTC (rev 19027)
@@ -0,0 +1,10 @@
+<table>
+ <tbody>
+ <a4j:repeat value="#{repeatBean.items}" var="item">
+ <tr>
+ <td><h:outputText value="#{item.code}" id="item1" /></td>
+ <td><h:outputText value="#{item.price}" id="item2" /></td>
+ </tr>
+ </a4j:repeat>
+ </tbody>
+</table>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample 2010-08-30 23:09:40 UTC (rev 19027)
@@ -1,5 +1,5 @@
<h:form>
- <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="disc" title="Car Store">
+ <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="unordered" title="Car Store">
<h:outputText value="#{car.make} #{car.model}"/><br/>
<h:outputText value="Price:" styleClass="label"></h:outputText>
<h:outputText value="#{car.price} "/><br/>
Modified: modules/docs/trunk/Developer_Guide/pom.xml
===================================================================
--- modules/docs/trunk/Developer_Guide/pom.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Developer_Guide/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -7,6 +7,7 @@
<version>4.0.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>RichFaces Developer Guide</name>
+ <url>http://www.jboss.org/richfaces</url>
<parent>
<groupId>org.richfaces.docs</groupId>
@@ -107,9 +108,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Devel...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/docs/trunk/Develope...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/docs/trunk/Developer_Guide</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/docs/Developer_Guide</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/docs/Developer_Guide</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/</url>
</scm>
</project>
Modified: modules/docs/trunk/Migration_Guide/pom.xml
===================================================================
--- modules/docs/trunk/Migration_Guide/pom.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/Migration_Guide/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -7,6 +7,7 @@
<version>4.0.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
<name>RichFaces Migration Guide</name>
+ <url>http://www.jboss.org/richfaces</url>
<parent>
<groupId>org.richfaces.docs</groupId>
@@ -107,9 +108,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/Migra...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/docs/trunk/Migratio...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/docs/trunk/Migration_Guide</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/docs/Migration_Guide</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/docs/Migration_Guide</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/</url>
</scm>
</project>
Modified: modules/docs/trunk/parent/pom.xml
===================================================================
--- modules/docs/trunk/parent/pom.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/parent/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>10</version>
+ <version>9</version>
</parent>
<groupId>org.richfaces.docs</groupId>
@@ -31,7 +31,6 @@
<version>4.0.0-SNAPSHOT</version>
<name>Richfaces Docs: Parent</name>
<packaging>pom</packaging>
- <url>http://richfaces.org</url>
<build>
<pluginManagement>
@@ -45,7 +44,7 @@
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.1</version>
+ <version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
@@ -218,8 +217,8 @@
-->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk/parent</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/docs/trunk/parent</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/docs/trunk/parent</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/docs/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/docs/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/</url>
</scm>
</project>
Modified: modules/docs/trunk/pom.xml
===================================================================
--- modules/docs/trunk/pom.xml 2010-08-30 21:59:01 UTC (rev 19026)
+++ modules/docs/trunk/pom.xml 2010-08-30 23:09:40 UTC (rev 19027)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>10</version>
+ <version>9</version>
</parent>
<groupId>org.richfaces.docs</groupId>
@@ -22,9 +22,9 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/docs/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/docs/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/docs/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/root/docs</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/root/docs</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/</url>
</scm>
</project>
Copied: modules/docs/trunk/trunk (from rev 19026, modules/docs/branches/draft/trunk)
Property changes on: modules/docs/trunk/trunk
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
14 years, 4 months
JBoss Rich Faces SVN: r19026 - branches/RFPL-434.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 17:59:01 -0400 (Mon, 30 Aug 2010)
New Revision: 19026
Modified:
branches/RFPL-434/
Log:
Removed RFPL-754 branch from merge tracking in RFPL-434
Property changes on: branches/RFPL-434
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RFPL-754:1-18909 /trunk:1-19022
+ /trunk:1-19022
14 years, 4 months
JBoss Rich Faces SVN: r19025 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 15:18:12 -0400 (Mon, 30 Aug 2010)
New Revision: 19025
Modified:
trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-18939" from
https://svn.jboss.org/repos/richfaces/branches/RFPL-434
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RFPL-754:1-18909
+ /branches/RFPL-434:1-18939 /branches/RFPL-754:1-18909
14 years, 4 months
JBoss Rich Faces SVN: r19024 - in branches/RFPL-434: core/commons/src/main/java/org/richfaces/log and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-30 15:11:36 -0400 (Mon, 30 Aug 2010)
New Revision: 19024
Removed:
branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java
branches/RFPL-434/core/impl/src/test/resources/log4j.xml
branches/RFPL-434/core/legacy-tests/src/test/resources/log4j.xml
branches/RFPL-434/examples/core-demo/src/main/resources/log4j.xml
branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.properties
branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.xml
Modified:
branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/LogFactory.java
branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
branches/RFPL-434/dist/readme-ui.txt
Log:
https://jira.jboss.org/browse/RFPL-434
Modified: branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-08-30 19:11:36 UTC (rev 19024)
@@ -26,8 +26,6 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import javax.faces.context.FacesContext;
-
/**
* @author Nick Belaevski
*
Modified: branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-08-30 19:11:36 UTC (rev 19024)
@@ -45,8 +45,6 @@
public static final String RICHFACES_LOG = "org.richfaces";
- private static final String CLASS_NAME = JavaLogger.class.getName();
-
static final Map<Level, java.util.logging.Level> LEVELS_MAP =
new EnumMap<Level, java.util.logging.Level>(Level.class);
@@ -57,6 +55,8 @@
LEVELS_MAP.put(Level.DEBUG, java.util.logging.Level.FINE);
}
+ private static final String CLASS_NAME = JavaLogger.class.getName();
+
private final java.util.logging.Logger jdkLogger;
private MessageInterpolator messageInterpolator;
Modified: branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/LogFactory.java
===================================================================
--- branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-08-30 19:11:36 UTC (rev 19024)
@@ -23,7 +23,6 @@
package org.richfaces.log;
-import org.richfaces.log.Logger.Level;
/**
* <p class="changed_added_4_0">This class produces loggers used by whole RichFaces library.</p>
Modified: branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
===================================================================
--- branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-08-30 19:11:36 UTC (rev 19024)
@@ -29,12 +29,15 @@
import java.util.Properties;
import java.util.Set;
+import javax.faces.application.ProjectStage;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
import org.richfaces.application.DependencyInjector;
import org.richfaces.application.ServiceTracker;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.PropertiesUtil;
import org.richfaces.util.Util;
@@ -49,7 +52,7 @@
private static final Joiner RESOURCE_QUALIFIER_JOINER = Joiner.on(':').skipNulls();
- private static final ResourceLogger LOGGER = ResourceLogger.INSTANCE;
+ private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
private static class ExternalStaticResourceFactory {
@@ -100,6 +103,28 @@
initializeExternalResourcesMap();
}
+ private void logResourceProblem(FacesContext context, Throwable throwable, String messagePattern,
+ Object... arguments) {
+ boolean isProductionStage = context.isProjectStage(ProjectStage.Production);
+
+ if (LOGGER.isWarnEnabled() || (!isProductionStage && LOGGER.isInfoEnabled())) {
+ String formattedMessage = MessageFormat.format(messagePattern, arguments);
+
+ if (throwable != null) {
+ LOGGER.warn(formattedMessage, throwable);
+ } else {
+ if (isProductionStage) {
+ LOGGER.info(formattedMessage);
+ } else {
+ LOGGER.warn(formattedMessage);
+ }
+ }
+ }
+ }
+
+ private void logMissingResource(FacesContext context, String resourceData) {
+ logResourceProblem(context, null, "Resource {0} was not found", resourceData);
+ }
private String getResourceNameFromQualifier(String qualifier) {
int idx = qualifier.lastIndexOf(':');
if (idx < 0) {
@@ -252,10 +277,10 @@
} catch (ClassNotFoundException e) {
// do nothing
} catch (Exception e) {
- LOGGER.logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
+ logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
resourceName);
} catch (LinkageError e) {
- LOGGER.logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
+ logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}",
resourceName);
}
}
@@ -274,7 +299,7 @@
Resource resource = createResource(resourceName, libraryName, null);
if (resource == null) {
- LOGGER.logMissingResource(context, resourceData.getResourceKey());
+ logMissingResource(context, resourceData.getResourceKey());
return null;
}
@@ -289,7 +314,7 @@
}
if ((existingVersion != null) && (requestedVersion != null) && !existingVersion.equals(requestedVersion)) {
- LOGGER.logResourceProblem(context, null, "Resource {0} of version {1} was not found", resourceName,
+ logResourceProblem(context, null, "Resource {0} of version {1} was not found", resourceName,
requestedVersion);
return null;
}
Modified: branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
--- branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-08-30 19:11:36 UTC (rev 19024)
@@ -40,6 +40,8 @@
import org.ajax4jsf.cache.Cache;
import org.richfaces.application.ServiceTracker;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
import org.richfaces.util.RequestStateManager.BooleanRequestStateVariable;
import org.richfaces.util.Util;
@@ -53,7 +55,7 @@
public static final String RESOURCE_CACHE_NAME = "org.richfaces.ResourcesCache";
public static final String HANDLER_START_TIME_ATTRIBUTE = ResourceHandlerImpl.class.getName() + ":StartTime";
- private static final ResourceLogger LOGGER = ResourceLogger.INSTANCE;
+ private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
private ResourceFactory resourceFactory;
Deleted: branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java
===================================================================
--- branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java 2010-08-30 19:11:36 UTC (rev 19024)
@@ -1,238 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.resource;
-
-import java.text.MessageFormat;
-
-import javax.faces.application.ProjectStage;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.log.Logger;
-import org.richfaces.log.RichfacesLogger;
-
-/**
- * @author Nick Belaevski
- *
- */
-final class ResourceLogger implements Logger {
-
- static final ResourceLogger INSTANCE = new ResourceLogger();
-
- private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
-
- private ResourceLogger() {}
-
- void logResourceProblem(FacesContext context, Throwable throwable, String messagePattern,
- Object... arguments) {
- boolean isProductionStage = context.isProjectStage(ProjectStage.Production);
-
- if (LOGGER.isWarnEnabled() || (!isProductionStage && LOGGER.isInfoEnabled())) {
- String formattedMessage = MessageFormat.format(messagePattern, arguments);
-
- if (throwable != null) {
- LOGGER.warn(formattedMessage, throwable);
- } else {
- if (isProductionStage) {
- LOGGER.info(formattedMessage);
- } else {
- LOGGER.warn(formattedMessage);
- }
- }
- }
- }
-
- void logMissingResource(FacesContext context, String resourceData) {
- logResourceProblem(context, null, "Resource {0} was not found", resourceData);
- }
-
- /**
- * @return
- * @see org.richfaces.log.Logger#isDebugEnabled()
- */
- public boolean isDebugEnabled() {
- return LOGGER.isDebugEnabled();
- }
-
- /**
- * @param content
- * @see org.richfaces.log.Logger#debug(java.lang.CharSequence)
- */
- public void debug(CharSequence content) {
- LOGGER.debug(content);
- }
-
- /**
- * @param content
- * @param error
- * @see org.richfaces.log.Logger#debug(java.lang.CharSequence, java.lang.Throwable)
- */
- public void debug(CharSequence content, Throwable error) {
- LOGGER.debug(content, error);
- }
-
- /**
- * @param error
- * @see org.richfaces.log.Logger#debug(java.lang.Throwable)
- */
- public void debug(Throwable error) {
- LOGGER.debug(error);
- }
-
- /**
- * @return
- * @see org.richfaces.log.Logger#isInfoEnabled()
- */
- public boolean isInfoEnabled() {
- return LOGGER.isInfoEnabled();
- }
-
- /**
- * @param content
- * @see org.richfaces.log.Logger#info(java.lang.CharSequence)
- */
- public void info(CharSequence content) {
- LOGGER.info(content);
- }
-
- /**
- * @param content
- * @param error
- * @see org.richfaces.log.Logger#info(java.lang.CharSequence, java.lang.Throwable)
- */
- public void info(CharSequence content, Throwable error) {
- LOGGER.info(content, error);
- }
-
- /**
- * @param error
- * @see org.richfaces.log.Logger#info(java.lang.Throwable)
- */
- public void info(Throwable error) {
- LOGGER.info(error);
- }
-
- /**
- * @return
- * @see org.richfaces.log.Logger#isWarnEnabled()
- */
- public boolean isWarnEnabled() {
- return LOGGER.isWarnEnabled();
- }
-
- /**
- * @param content
- * @see org.richfaces.log.Logger#warn(java.lang.CharSequence)
- */
- public void warn(CharSequence content) {
- LOGGER.warn(content);
- }
-
- /**
- * @param content
- * @param error
- * @see org.richfaces.log.Logger#warn(java.lang.CharSequence, java.lang.Throwable)
- */
- public void warn(CharSequence content, Throwable error) {
- LOGGER.warn(content, error);
- }
-
- /**
- * @param error
- * @see org.richfaces.log.Logger#warn(java.lang.Throwable)
- */
- public void warn(Throwable error) {
- LOGGER.warn(error);
- }
-
- /**
- * @return
- * @see org.richfaces.log.Logger#isErrorEnabled()
- */
- public boolean isErrorEnabled() {
- return LOGGER.isErrorEnabled();
- }
-
- /**
- * @param content
- * @see org.richfaces.log.Logger#error(java.lang.CharSequence)
- */
- public void error(CharSequence content) {
- LOGGER.error(content);
- }
-
- /**
- * @param content
- * @param error
- * @see org.richfaces.log.Logger#error(java.lang.CharSequence, java.lang.Throwable)
- */
- public void error(CharSequence content, Throwable error) {
- LOGGER.error(content, error);
- }
-
- /**
- * @param error
- * @see org.richfaces.log.Logger#error(java.lang.Throwable)
- */
- public void error(Throwable error) {
- LOGGER.error(error);
- }
-
- /**
- * @param level
- * @return
- * @see org.richfaces.log.Logger#isLogEnabled(org.richfaces.log.Logger.Level)
- */
- public boolean isLogEnabled(Level level) {
- return LOGGER.isLogEnabled(level);
- }
-
- /**
- * @param level
- * @param content
- * @see org.richfaces.log.Logger#log(org.richfaces.log.Logger.Level, java.lang.CharSequence)
- */
- public void log(Level level, CharSequence content) {
- LOGGER.log(level, content);
- }
-
- /**
- * @param level
- * @param content
- * @param error
- * @see org.richfaces.log.Logger#log(org.richfaces.log.Logger.Level, java.lang.CharSequence, java.lang.Throwable)
- */
- public void log(Level level, CharSequence content, Throwable error) {
- LOGGER.log(level, content, error);
- }
-
- /**
- * @param level
- * @param error
- * @see org.richfaces.log.Logger#log(org.richfaces.log.Logger.Level, java.lang.Throwable)
- */
- public void log(Level level, Throwable error) {
- LOGGER.log(level, error);
- }
-
-
-
-}
Deleted: branches/RFPL-434/core/impl/src/test/resources/log4j.xml
===================================================================
--- branches/RFPL-434/core/impl/src/test/resources/log4j.xml 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/impl/src/test/resources/log4j.xml 2010-08-30 19:11:36 UTC (rev 19024)
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!DOCTYPE log4j:configuration SYSTEM "file:///eclipse/dtdcache/log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <!-- This is a sample configuration for log4j.
- It simply just logs everything into a single
- log file.
- Note, that you can use properties for value substitution.
- -->
- <appender name="DEFAULT" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} [%c] %C %M %n%-5p: %m%n" />
- </layout>
- </appender>
-
-<!--
- <appender name="FACES" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
-
- <appender name="CHAMELEON" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
- -->
- <category name="com.sun.faces">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="org.apache.myfaces">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="javax.faces">
- <priority value="INFO" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="faces">
- <priority value="INFO" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="org.richfaces">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
-
- <category name="org.ajax4jsf">
- <priority value="DEBUG" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <!--
- <root>
- <priority value ="info" />
- <appender-ref ref="DEFAULT" />
- </root>
- -->
-</log4j:configuration>
Deleted: branches/RFPL-434/core/legacy-tests/src/test/resources/log4j.xml
===================================================================
--- branches/RFPL-434/core/legacy-tests/src/test/resources/log4j.xml 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/core/legacy-tests/src/test/resources/log4j.xml 2010-08-30 19:11:36 UTC (rev 19024)
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!DOCTYPE log4j:configuration SYSTEM "file:///eclipse/dtdcache/log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <!-- This is a sample configuration for log4j.
- It simply just logs everything into a single
- log file.
- Note, that you can use properties for value substitution.
- -->
- <appender name="DEFAULT" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
-
-<!--
- <appender name="FACES" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
-
- <appender name="CHAMELEON" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m:%n"/>
- </layout>
- </appender>
- -->
- <category name="com.sun.faces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="org.apache.myfaces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="javax.faces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="faces">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <category name="com.exadel.vcp">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
-
- <category name="org.ajax4jsf">
- <priority value="WARN" />
- <appender-ref ref="DEFAULT"/>
- </category>
-
- <!--
- <root>
- <priority value ="WARN" />
- <appender-ref ref="DEFAULT" />
- </root>
- -->
-</log4j:configuration>
Modified: branches/RFPL-434/dist/readme-ui.txt
===================================================================
--- branches/RFPL-434/dist/readme-ui.txt 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/dist/readme-ui.txt 2010-08-30 19:11:36 UTC (rev 19024)
@@ -13,11 +13,9 @@
1.3) richfaces-core-impl-4.0.0.20100824-M2.jar
1.4) richfaces-components-api-4.0.0.20100824-M2.jar
1.5) richfaces-components-ui-4.0.0.20100824-M2.jar
- 1.6) slf4j-api
- 1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging framework that you use)
- 1.8) sac-1.3, cssparser-0.9.5 - required for components CSS work
- 1.9) google-guava-r06 - core runtime dependency.
- 1.10) annotations.jar from org.richfaces.cdk . It's optional and should be added only if some RichFaces components will be
+ 1.6) sac-1.3, cssparser-0.9.5 - required for components CSS work
+ 1.7) google-guava-r06 - core runtime dependency.
+ 1.8) annotations.jar from org.richfaces.cdk . It's optional and should be added only if some RichFaces components will be
created/accessed dynamically from some appication actions/listeners.
For optimal performance it's recommended to add one of these caching frameworks to application classpath: EhCache, JBoss Cache, OsCache.
Deleted: branches/RFPL-434/examples/core-demo/src/main/resources/log4j.xml
===================================================================
--- branches/RFPL-434/examples/core-demo/src/main/resources/log4j.xml 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/examples/core-demo/src/main/resources/log4j.xml 2010-08-30 19:11:36 UTC (rev 19024)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
- </layout>
- </appender>
- <logger name="org.richfaces">
- <level value="info" />
- </logger>
- <logger name="org.richfaces.demo.PhaseTracker">
- <level value="debug" />
- </logger>
- <root>
- <priority value="info" />
- <appender-ref ref="console" />
- </root>
-
-</log4j:configuration>
\ No newline at end of file
Deleted: branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.properties
===================================================================
--- branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.properties 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.properties 2010-08-30 19:11:36 UTC (rev 19024)
@@ -1,24 +0,0 @@
-# A default log4j configuration for log4j users.
-#
-# To use this configuration, deploy it into your application's WEB-INF/classes
-# directory. You are also encouraged to edit it as you like.
-
-# Configure the console as our one appender
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
-
-# tighten logging on the DataNucleus Categories
-log4j.category.DataNucleus.JDO=WARN, A1
-log4j.category.DataNucleus.Persistence=WARN, A1
-log4j.category.DataNucleus.Cache=WARN, A1
-log4j.category.DataNucleus.MetaData=WARN, A1
-log4j.category.DataNucleus.General=WARN, A1
-log4j.category.DataNucleus.Utility=WARN, A1
-log4j.category.DataNucleus.Transaction=WARN, A1
-log4j.category.DataNucleus.Datastore=WARN, A1
-log4j.category.DataNucleus.ClassLoading=WARN, A1
-log4j.category.DataNucleus.Plugin=WARN, A1
-log4j.category.DataNucleus.ValueGeneration=WARN, A1
-log4j.category.DataNucleus.Enhancer=WARN, A1
-log4j.category.DataNucleus.SchemaTool=WARN, A1
Deleted: branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.xml
===================================================================
--- branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.xml 2010-08-30 18:45:51 UTC (rev 19023)
+++ branches/RFPL-434/examples/richfaces-showcase/src/main/resources/log4j.xml 2010-08-30 19:11:36 UTC (rev 19024)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
- </layout>
- </appender>
- <root>
- <priority value="info" />
- <appender-ref ref="console" />
- </root>
-
-</log4j:configuration>
\ No newline at end of file
14 years, 4 months