Author: Alex.Kolonitsky
Date: 2010-09-03 08:00:31 -0400 (Fri, 03 Sep 2010)
New Revision: 19109
Added:
branches/RF-7944/core/api/src/main/java/org/richfaces/application/MessageFactory.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
branches/RF-7944/core/commons/src/test/resources/
branches/RF-7944/core/commons/src/test/resources/org/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
Removed:
branches/RF-7944/core/commons/src/main/java/org/richfaces/JavaLogger.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/LogFactory.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/Logger.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
branches/RF-7944/core/commons/src/test/resources/org/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java
branches/RF-7944/core/impl/src/test/resources/log4j.xml
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
branches/RF-7944/core/legacy-tests/src/test/resources/log4j.xml
Modified:
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java
branches/RF-7944/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml
branches/RF-7944/bom/pom.xml
branches/RF-7944/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java
branches/RF-7944/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
branches/RF-7944/cdk/generator/src/main/script/SchemaProcessorNamespaceContext.groovy
branches/RF-7944/cdk/maven-resources-plugin/pom.xml
branches/RF-7944/cdk/parent/pom.xml
branches/RF-7944/core/api/pom.xml
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
branches/RF-7944/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java
branches/RF-7944/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
branches/RF-7944/core/commons/pom.xml
branches/RF-7944/core/impl/pom.xml
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/VersionBean.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DefaultModule.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/InitializationListener.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UISequence.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java
branches/RF-7944/core/impl/src/main/java/org/richfaces/util/Util.java
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces.js
branches/RF-7944/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
branches/RF-7944/dist/readme-ui.txt
Log:
merge from trunk
Modified:
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml
===================================================================
---
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java
===================================================================
---
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml
===================================================================
---
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/api/pom.xml 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml
===================================================================
---
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/impl/pom.xml 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml
===================================================================
---
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/archetypes/richfaces-component/src/main/resources/archetype-resources/ui/pom.xml 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml
===================================================================
---
branches/RF-7944/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/archetypes/richfaces-component-short/src/main/resources/archetype-resources/pom.xml 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/bom/pom.xml
===================================================================
--- branches/RF-7944/bom/pom.xml 2010-09-03 08:56:24 UTC (rev 19108)
+++ branches/RF-7944/bom/pom.xml 2010-09-03 12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java
===================================================================
---
branches/RF-7944/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/cdk/commons/src/main/java/org/richfaces/cdk/JavaLogger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
---
branches/RF-7944/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/cdk/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -214,10 +214,10 @@
Element attr = tag.addElement("attribute");
addDescription(attr, attribute);
attr.addElement("name").addText(name);
- attr.addElement("type").addText(attribute.getType().getName());
if (attribute.isRequired()) {
attr.addElement("required").addText("true");
}
+ attr.addElement("type").addText(attribute.getType().getName());
return attr;
}
Modified:
branches/RF-7944/cdk/generator/src/main/script/SchemaProcessorNamespaceContext.groovy
===================================================================
---
branches/RF-7944/cdk/generator/src/main/script/SchemaProcessorNamespaceContext.groovy 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/cdk/generator/src/main/script/SchemaProcessorNamespaceContext.groovy 2010-09-03
12:00:31 UTC (rev 19109)
@@ -37,7 +37,7 @@
SchemaProcessorNamespaceContext() {
biMap = HashBiMap.create();
biMap.put("http://www.w3.org/2001/XMLSchema", "xs");
-
biMap.put("http://richfaces.org/cdk/additional-attributes-info",
"cdk-schema-info");
+
biMap.put("http://jboss.org/schema/richfaces/cdk/additional-attribut...;,
"cdk-schema-info");
}
@Override
Modified: branches/RF-7944/cdk/maven-resources-plugin/pom.xml
===================================================================
--- branches/RF-7944/cdk/maven-resources-plugin/pom.xml 2010-09-03 08:56:24 UTC (rev
19108)
+++ branches/RF-7944/cdk/maven-resources-plugin/pom.xml 2010-09-03 12:00:31 UTC (rev
19109)
@@ -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: branches/RF-7944/cdk/parent/pom.xml
===================================================================
--- branches/RF-7944/cdk/parent/pom.xml 2010-09-03 08:56:24 UTC (rev 19108)
+++ branches/RF-7944/cdk/parent/pom.xml 2010-09-03 12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/api/pom.xml
===================================================================
--- branches/RF-7944/core/api/pom.xml 2010-09-03 08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/api/pom.xml 2010-09-03 12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
===================================================================
---
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
---
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -31,13 +31,14 @@
// private char APOSTROPHE[] = { '\\', '\'' };
private static final char[] ENCODE_HEX = "0123456789ABCDEF".toCharArray();
- private static final char[] ENCODE_APOS = "\\'".toCharArray();
private static final char[] ENCODE_QUOT = "\\\"".toCharArray();
private static final char[] ENCODE_LF = "\\n".toCharArray();
+ private static final char[] ENCODE_BC = "\\b".toCharArray();
private static final char[] ENCODE_FF = "\\f".toCharArray();
private static final char[] ENCODE_CR = "\\r".toCharArray();
private static final char[] ENCODE_TAB = "\\t".toCharArray();
private static final char[] ENCODE_BS = "\\\\".toCharArray();
+ private static final char[] ENCODE_FS = "\\/".toCharArray();
// private static final char ENCODE_ESC[] = "\\e".toCharArray();
@@ -47,32 +48,34 @@
public JSEncoder() {}
/**
- * Return true or false wether this encoding can encode the specified
+ * Return true or false whether this encoding/format can encode the specified
* character or not.
* <p>
* This method will return true for the following character range: <br />
* <code>
- * <nobr>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
+ * <nobr>\b | \f | \t | \r | \n | " | \ | / | [#x20-#xD7FF] |
[#xE000-#xFFFD]</nobr>
* </code>
* </p>
*
* @see <a
href="http://www.w3.org/TR/REC-xml#charsets">W3C XML 1.0
</a>
+ * @see <a
href="http://json.org/">JSON.org</a>
*/
public boolean compile(char c) {
- if ((c == 0x09) || // [\t]
- (c == 0x0a) || // [\n]
- (c == 0x0d) || // [\r](c == 0x22) || // ["]
- (c == 0x22) || // ["]
- (c == 0x27) || // [']
- (c == 0x5c) || // [\]
- (c == 0x03) || // [esc]
- (c == ']') || // ] - to avoid conflicts
in CDATA
- (c == '<') || // - escape HTML markup
characters
- (c == '>') || // - HTML
- (c == '&') || // - HTML
- (c == '-') || // - HTML comments
- (c < 0x20) || // See
<
http://www.w3.org/TR/REC-xml#charsets>
- ((c > 0xd7ff) && (c < 0xe000)) ||
(c > 0xfffd) || (c > 0xff)) {
+ if ((c == '\b') ||
+ (c == '\f') |
+ (c == '\t') ||
+ (c == '\n') ||
+ (c == '\r') ||
+ (c == '"') ||
+ (c == '\\') ||
+ (c == '/') ||
+ (c == ']') || // ] - to avoid
conflicts in CDATA
+ (c == '<') || // - escape HTML
markup characters
+ (c == '>') || // - HTML
+ (c == '&') || // - HTML
+ (c == '-') || // - HTML comments
+ (c < 0x20) || // See
<
http://www.w3.org/TR/REC-xml#charsets>
+ ((c > 0xd7ff) && (c < 0xe000))
|| (c > 0xfffd) || (c > 0xff)) {
return false;
}
@@ -85,39 +88,36 @@
*/
public char[] encode(char c) {
switch (c) {
- case 0x03 :
- return ENCODE_FF; // (>) [>]
+ case '\b' :
+ return ENCODE_BC;
+
+ case '\f' :
+ return ENCODE_FF;
- case 0x09 :
- return ENCODE_TAB; // (>) [>]
+ case '\t' :
+ return ENCODE_TAB;
- case 0x0a :
- return ENCODE_LF; // (>) [>]
+ case '\n' :
+ return ENCODE_LF;
- case 0x0d :
- return ENCODE_CR; // (>) [>]
+ case '\r' :
+ return ENCODE_CR;
- case 0x22 :
- return ENCODE_QUOT; // (") ["]
+ case '"' :
+ return ENCODE_QUOT;
- case 0x27 :
- return ENCODE_APOS; // (') [']
+ case '\\' :
+ return ENCODE_BS;
- case 0x5c :
- return ENCODE_BS; // (<) [<]
-
+ case '/' :
+ return ENCODE_FS;
+
default : {
- if (c > 0xff) {
- char[] ret = {
- '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf],
ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
- ENCODE_HEX[c & 0xf]
- };
+ char[] ret = {
+ '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf],
ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
+ ENCODE_HEX[c & 0xf]
+ };
- return ret;
- }
-
- char[] ret = {'\\', 'x', ENCODE_HEX[c >> 0x4 &
0xf], ENCODE_HEX[c & 0xf]};
-
return ret;
}
}
Modified:
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java
===================================================================
---
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
---
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
===================================================================
---
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/api/src/main/java/org/richfaces/application/MessageFactory.java
(from rev 19108,
trunk/core/api/src/main/java/org/richfaces/application/MessageFactory.java)
===================================================================
--- branches/RF-7944/core/api/src/main/java/org/richfaces/application/MessageFactory.java
(rev 0)
+++
branches/RF-7944/core/api/src/main/java/org/richfaces/application/MessageFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1,40 @@
+/*
+ * 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);
+
+ public String getMessageText(FacesContext facesContext, Enum<?> messageKey,
Object... args);
+
+}
Modified: branches/RF-7944/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java
===================================================================
---
branches/RF-7944/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
===================================================================
---
branches/RF-7944/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -123,9 +123,9 @@
* Test method for {@link
org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testStringToScript() {
- Object obj = "foo";
+ Object obj = "f \b\r\t\f\n\"'\\/ oo";
- assertEquals("\"foo\"", ScriptUtils.toScript(obj));
+ assertEquals("\"f \\b\\r\\t\\f\\n\\\"'\\\\\\/ oo\"",
ScriptUtils.toScript(obj));
}
/**
@@ -260,8 +260,8 @@
public void testAddEncoded() {
StringBuilder buff = new StringBuilder();
- ScriptUtils.addEncoded(buff, "foo\"\'");
- assertEquals("foo\\\"\\\'", buff.toString());
+ ScriptUtils.addEncoded(buff, "foo");
+ assertEquals("foo", buff.toString());
}
/**
Modified: branches/RF-7944/core/commons/pom.xml
===================================================================
--- branches/RF-7944/core/commons/pom.xml 2010-09-03 08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/commons/pom.xml 2010-09-03 12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/JavaLogger.java
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/JavaLogger.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/commons/src/main/java/org/richfaces/JavaLogger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/LogFactory.java
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/LogFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/commons/src/main/java/org/richfaces/LogFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/Logger.java
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/Logger.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/commons/src/main/java/org/richfaces/Logger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/application (from rev
19108, trunk/core/commons/src/main/java/org/richfaces/application)
Deleted:
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
===================================================================
---
trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
(from rev 19108,
trunk/core/commons/src/main/java/org/richfaces/application/CoreMessages.java)
===================================================================
---
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/CoreMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
===================================================================
---
trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
(from rev 19108,
trunk/core/commons/src/main/java/org/richfaces/application/FacesMessages.java)
===================================================================
---
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/application/FacesMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n (from rev 19108,
trunk/core/commons/src/main/java/org/richfaces/l10n)
Deleted: branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
(from rev 19108, trunk/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java)
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/BundleLoader.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
===================================================================
---
trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
(from rev 19108,
trunk/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java)
===================================================================
---
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/InterpolationException.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
(from rev 19108, trunk/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java)
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageBundle.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
===================================================================
---
trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1,76 +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;
-
-/**
- * @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:
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
(from rev 19108,
trunk/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java)
===================================================================
---
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/l10n/MessageInterpolator.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/log (from rev 19108,
trunk/core/commons/src/main/java/org/richfaces/log)
Deleted: branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-09-03 08:56:24
UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1,253 +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.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));
- }
- }
-
-}
Copied: branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
(from rev 19108, trunk/core/commons/src/main/java/org/richfaces/log/JavaLogger.java)
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/JavaLogger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-09-03 08:56:24
UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1,62 +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: branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java
(from rev 19108, trunk/core/commons/src/main/java/org/richfaces/log/LogFactory.java)
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java
(rev 0)
+++
branches/RF-7944/core/commons/src/main/java/org/richfaces/log/LogFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java
===================================================================
--- trunk/core/commons/src/main/java/org/richfaces/log/Logger.java 2010-09-03 08:56:24 UTC
(rev 19108)
+++ branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1,311 +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 {
- 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: branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java (from
rev 19108, trunk/core/commons/src/main/java/org/richfaces/log/Logger.java)
===================================================================
--- branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java
(rev 0)
+++ branches/RF-7944/core/commons/src/main/java/org/richfaces/log/Logger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n (from rev 19108,
trunk/core/commons/src/test/java/org/richfaces/l10n)
Deleted:
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
===================================================================
---
trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
(from rev 19108,
trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java)
===================================================================
---
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java
(rev 0)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderCoreMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java (from
rev 19108, trunk/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java)
===================================================================
--- branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java
(rev 0)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/l10n/BundleLoaderTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/test/java/org/richfaces/log (from rev 19108,
trunk/core/commons/src/test/java/org/richfaces/log)
Deleted:
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
(from rev 19108, trunk/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java)
===================================================================
--- branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java
(rev 0)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/JavaLoggerTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
===================================================================
--- trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
(from rev 19108,
trunk/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java)
===================================================================
--- branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java
(rev 0)
+++
branches/RF-7944/core/commons/src/test/java/org/richfaces/log/LoggerTestMessages.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/commons/src/test/resources (from rev 19108,
trunk/core/commons/src/test/resources)
Copied: branches/RF-7944/core/commons/src/test/resources/org (from rev 19108,
trunk/core/commons/src/test/resources/org)
Copied: branches/RF-7944/core/commons/src/test/resources/org/richfaces (from rev 19108,
trunk/core/commons/src/test/resources/org/richfaces)
Copied: branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n (from rev
19108, trunk/core/commons/src/test/resources/org/richfaces/l10n)
Deleted:
branches/RF-7944/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 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1 +0,0 @@
-message=Dobro pozhalovat'
\ No newline at end of file
Copied:
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
(from rev 19108,
trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties)
===================================================================
---
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties
(rev 0)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_by_BY.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1 @@
+message=Dobro pozhalovat'
\ No newline at end of file
Deleted:
branches/RF-7944/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 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1 +0,0 @@
-message=Welcome to app
\ No newline at end of file
Copied:
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
(from rev 19108,
trunk/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties)
===================================================================
---
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties
(rev 0)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/AppMessages_en_US.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1 @@
+message=Welcome to app
\ No newline at end of file
Deleted:
branches/RF-7944/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 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1 +0,0 @@
-message=Hello
\ No newline at end of file
Copied:
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
(from rev 19108,
trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties)
===================================================================
---
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties
(rev 0)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_en_US.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1 @@
+message=Hello
\ No newline at end of file
Deleted:
branches/RF-7944/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 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1 +0,0 @@
-message=Zdravstvujte
\ No newline at end of file
Copied:
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
(from rev 19108,
trunk/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties)
===================================================================
---
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties
(rev 0)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/l10n/BundleLoaderMessages_ru_RU.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1 @@
+message=Zdravstvujte
\ No newline at end of file
Copied: branches/RF-7944/core/commons/src/test/resources/org/richfaces/log (from rev
19108, trunk/core/commons/src/test/resources/org/richfaces/log)
Deleted:
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties
===================================================================
---
trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1 +0,0 @@
-org.richfaces.TestMessage=RF-000000 Test message with arguments: {0} and {1}
\ No newline at end of file
Copied:
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties
(from rev 19108,
trunk/core/commons/src/test/resources/org/richfaces/log/Resources.properties)
===================================================================
---
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties
(rev 0)
+++
branches/RF-7944/core/commons/src/test/resources/org/richfaces/log/Resources.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1 @@
+org.richfaces.TestMessage=RF-000000 Test message with arguments: {0} and {1}
\ No newline at end of file
Modified: branches/RF-7944/core/impl/pom.xml
===================================================================
--- branches/RF-7944/core/impl/pom.xml 2010-09-03 08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/impl/pom.xml 2010-09-03 12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycle.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/application/DebugLifecycleFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/CacheManager.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/EhCacheCacheFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/JBossCacheCacheFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/OSCacheCacheFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/cache/lru/LRUMapCacheFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxRegionBrige.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/AjaxPhaseListener.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxChildrenRenderer.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -54,9 +54,11 @@
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;
+import com.google.common.base.Strings;
+
/**
* @author shura
* <p/>
@@ -680,6 +682,10 @@
String[] values = asArray(areasString);
Set<String> result = new
LinkedHashSet<String>(values.length);
for (String value : values) {
+ if (Strings.isNullOrEmpty(value)) {
+ continue;
+ }
+
result.add(value);
}
@@ -687,7 +693,9 @@
} else {
Set<String> areasSet = new LinkedHashSet<String>(5);
- areasSet.add(areasString);
+ if (!Strings.isNullOrEmpty(areasString)) {
+ areasSet.add(areasString);
+ }
return areasSet;
}
Modified:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/ChameleonRenderKitFactory.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/renderkit/RendererBase.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceBase.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/InternetResourceService.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/OneTimeRenderer.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/resource/ScriptRenderer.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
===================================================================
--- branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/util/ServicesUtils.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/CacheContent.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/FilterServletResponseWrapper.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/HtmlParser.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PollEventsManager.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/PushEventsCounter.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/ServletStreamWriter.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java
===================================================================
--- branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/WebXml.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/ajax4jsf/webapp/XMLResponseWriterState.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/richfaces/VersionBean.java
===================================================================
--- branches/RF-7944/core/impl/src/main/java/org/richfaces/VersionBean.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/impl/src/main/java/org/richfaces/VersionBean.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -22,16 +22,21 @@
package org.richfaces;
import java.io.IOException;
+import java.io.InputStream;
import java.net.JarURLConnection;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.text.MessageFormat;
import java.util.jar.Attributes;
+import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
/**
@@ -44,9 +49,6 @@
public static final Version VERSION = new Version();
- private static final org.slf4j.Logger LOGGER =
RichfacesLogger.APPLICATION.getLogger();
-
-
/**
* Class for incapsulate version info.
*
@@ -55,6 +57,8 @@
*/
public static class Version {
+ private static final Logger LOGGER = RichfacesLogger.APPLICATION.getLogger();
+
private static final String UNKNOWN = "";
private String implementationVendor = UNKNOWN;
@@ -124,6 +128,30 @@
if (codeSource != null) {
URL url = codeSource.getLocation();
if (url != null) {
+ InputStream manifestStream = null;
+ try {
+ manifestStream = URLToStreamHelper.urlToStream(new URL(url,
JarFile.MANIFEST_NAME));
+ return new Manifest(manifestStream);
+ } catch (MalformedURLException e1) {
+ //that's ok - just log in debug
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(e1.getMessage(), e1);
+ }
+ } catch (IOException e) {
+ //that's ok - just log in debug
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(e.getMessage(), e);
+ }
+ } finally {
+ if (manifestStream != null) {
+ try {
+ manifestStream.close();
+ } catch (IOException e) {
+ LOGGER.error(MessageFormat.format("Error closing
stream: {0}", e.getMessage()), e);
+ }
+ }
+ }
+
JarInputStream jis = null;
try {
URLConnection urlConnection = url.openConnection();
Modified:
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DefaultModule.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DefaultModule.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DefaultModule.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/DependencyInjectionServiceImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/InitializationListener.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/InitializationListener.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/InitializationListener.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java
(from rev 19108,
trunk/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java)
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java
(rev 0)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/application/MessageFactoryImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1,192 @@
+/*
+ * 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 {
+
+ protected static interface Factory<T> {
+
+ public T create(ResourceBundle bundle, Enum<?> messageKey, Object... args)
throws MissingResourceException;
+
+ }
+
+ private static final Factory<FacesMessage> MESSAGE_FACTORY = new
Factory<FacesMessage>() {
+
+ public FacesMessage create(ResourceBundle bundle, Enum<?> messageKey,
Object... args)
+ throws MissingResourceException {
+
+ String messageId = messageKey.toString();
+
+ String summary = null;
+ String detail = null;
+
+ try {
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ // do nothing
+ }
+
+ if (summary != null) {
+ String formattedSummary = MessageFormat.format(summary, args);
+ String formattedDetail = null;
+
+ if (detail != null) {
+ formattedDetail = MessageFormat.format(detail, args);
+ }
+
+ return new FacesMessage(formattedSummary, formattedDetail);
+ }
+
+ return null;
+ }
+ };
+
+ private static final Factory<String> LABEL_FACTORY = new
Factory<String>() {
+
+ public String create(ResourceBundle bundle, Enum<?> messageKey, Object...
args) throws MissingResourceException {
+ String pattern = bundle.getString(messageKey.toString());
+ return MessageFormat.format(pattern, args);
+ }
+
+ };
+
+ 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 = detectLocalesAndCreate(facesContext, MESSAGE_FACTORY,
messageKey, args);
+
+ if (result != null) {
+ result.setSeverity(severity);
+ }
+
+ return result;
+ }
+
+ public String getMessageText(FacesContext facesContext, Enum<?> messageKey,
Object... args) {
+ String text = detectLocalesAndCreate(facesContext, LABEL_FACTORY, messageKey,
args);
+ if (text == null) {
+ text = "???" + messageKey + "???";
+ }
+
+ return text;
+ }
+
+ protected <T> T detectLocalesAndCreate(FacesContext context, Factory<T>
factory, Enum<?> messageKey, Object... args) {
+
+ T result = null;
+
+ Locale locale = detectLocale(context);
+ if (locale != null) {
+ result = create(context, factory, locale, messageKey, args);
+ }
+
+ if (result == null) {
+ Locale defaultLocale = Locale.getDefault();
+
+ if (!defaultLocale.equals(locale)) {
+ result = create(context, factory, defaultLocale, messageKey, args);
+ }
+
+ }
+
+ return result;
+ }
+
+ protected <T> T create(FacesContext context, Factory<T> factory, Locale
locale, Enum<?> messageKey,
+ Object... args) {
+
+ MessageBundle messageBundle =
messageKey.getClass().getAnnotation(MessageBundle.class);
+
+ if (messageBundle == null) {
+ return null;
+ }
+
+ T result = null;
+
+ try {
+ ResourceBundle bundle = bundleLoader.getApplicationBundle(context,
messageKey, locale);
+ result = factory.create(bundle, messageKey, args);
+ } catch (MissingResourceException e) {
+ // do nothing
+ }
+
+ if (result == null) {
+ try {
+ ResourceBundle bundle = bundleLoader.getBundle(messageKey, locale);
+ result = factory.create(bundle, messageKey, args);
+ } catch (MissingResourceException e) {
+ // do nothing
+ }
+ }
+
+ return result;
+ }
+
+}
Modified:
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UISequence.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UISequence.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/component/UISequence.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -277,7 +277,7 @@
int rowIndex = getRowIndex();
int rows = getRows();
- if (rows > 0) {
+ if (rows > 1) {
return rowIndex % rows;
}
Modified:
branches/RF-7944/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/AbstractCacheableResource.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/ResourceLogger.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java
===================================================================
---
branches/RF-7944/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/java/org/richfaces/util/PropertiesUtil.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/impl/src/main/java/org/richfaces/util/Util.java
===================================================================
--- branches/RF-7944/core/impl/src/main/java/org/richfaces/util/Util.java 2010-09-03
08:56:24 UTC (rev 19108)
+++ branches/RF-7944/core/impl/src/main/java/org/richfaces/util/Util.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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
Modified:
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
---
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-09-03
12:00:31 UTC (rev 19109)
@@ -105,6 +105,10 @@
}
}
}
+
+ if (typeof this.queueOptions.requestGroupId == "undefined") {
+ this.queueOptions.requestGroupId = typeof this.source == "string" ?
this.source : this.source.id;
+ }
// copy of event should be created otherwise IE will fail
this.event = $.extend({}, event);
Modified: branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
---
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-09-03
12:00:31 UTC (rev 19109)
@@ -128,7 +128,7 @@
//there is the same pattern in server-side code:
//org.ajax4jsf.javascript.ScriptUtils.escapeCSSMetachars(String)
- var CSS_METACHARS_PATTERN = /([#;&,.+*~':"!^$[\]()=>|\/])/g;
+ var CSS_METACHARS_PATTERN = /([#;&,.+*~':"!^$\[\]()=>|\/])/g;
/**
* Escapes CSS meta-characters in string according to
Copied: branches/RF-7944/core/impl/src/test/java/org/richfaces/application (from rev
19108, trunk/core/impl/src/test/java/org/richfaces/application)
Deleted:
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java
===================================================================
---
trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -1,162 +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 testGetMessageTextFromFacesBundle() throws Exception {
- expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
-
expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
- facesEnvironment.replay();
-
- // {1}: Could not convert ''{0}'' to a string.
- String message =
messageFactory.getMessageText(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertEquals("Message: Could not convert 'something' to a
string.", message);
- }
-
- @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());
- }
-
- @Test
- public void testGetMessageTextFromApplicationBundle() 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.
- String message =
messageFactory.getMessageText(facesEnvironment.getFacesContext(),
- FacesMessages.CONVERTER_STRING, "something", "Message");
-
- assertEquals("Message: 'something' ne konvertiruyetsia v
stroku.", message);
-
- // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
- String otherMessage =
messageFactory.getMessageText(facesEnvironment.getFacesContext(),
- FacesMessages.UIINPUT_CONVERSION, "Failure message");
- assertEquals("Failure message: Conversion error occurred.",
otherMessage);
- }
-}
Copied:
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java
(from rev 19108,
trunk/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java)
===================================================================
---
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java
(rev 0)
+++
branches/RF-7944/core/impl/src/test/java/org/richfaces/application/MessageFactoryImplTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -0,0 +1,162 @@
+/*
+ * 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 testGetMessageTextFromFacesBundle() throws Exception {
+ expect(facesEnvironment.getFacesContext().getViewRoot()).andStubReturn(null);
+
expect(facesEnvironment.getApplication().getMessageBundle()).andStubReturn(null);
+ facesEnvironment.replay();
+
+ // {1}: Could not convert ''{0}'' to a string.
+ String message =
messageFactory.getMessageText(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertEquals("Message: Could not convert 'something' to a
string.", message);
+ }
+
+ @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());
+ }
+
+ @Test
+ public void testGetMessageTextFromApplicationBundle() 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.
+ String message =
messageFactory.getMessageText(facesEnvironment.getFacesContext(),
+ FacesMessages.CONVERTER_STRING, "something", "Message");
+
+ assertEquals("Message: 'something' ne konvertiruyetsia v
stroku.", message);
+
+ // javax.faces.component.UIInput.CONVERSION={0}: Conversion error occurred.
+ String otherMessage =
messageFactory.getMessageText(facesEnvironment.getFacesContext(),
+ FacesMessages.UIINPUT_CONVERSION, "Failure message");
+ assertEquals("Failure message: Conversion error occurred.",
otherMessage);
+ }
+}
Modified:
branches/RF-7944/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
===================================================================
---
branches/RF-7944/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-09-03
12:00:31 UTC (rev 19109)
@@ -43,6 +43,8 @@
import org.easymock.classextension.EasyMock;
import org.jboss.test.faces.AbstractFacesTest;
import org.jboss.test.faces.htmlunit.LocalWebClient;
+import org.richfaces.application.DependencyInjectionServiceImpl;
+import org.richfaces.application.DependencyInjector;
import org.richfaces.application.Module;
import org.richfaces.application.ServiceTracker;
import org.richfaces.application.ServicesFactory;
@@ -247,6 +249,7 @@
injector.setInstance(ResourceCodec.class,mockedCodec);
injector.setInstance(org.ajax4jsf.cache.Cache.class,mockCache);
injector.setInstance(Uptime.class, new Uptime());
+ injector.setInstance(DependencyInjector.class, new
DependencyInjectionServiceImpl());
}
}));
Deleted: branches/RF-7944/core/impl/src/test/resources/log4j.xml
===================================================================
--- branches/RF-7944/core/impl/src/test/resources/log4j.xml 2010-09-03 08:56:24 UTC (rev
19108)
+++ branches/RF-7944/core/impl/src/test/resources/log4j.xml 2010-09-03 12:00:31 UTC (rev
19109)
@@ -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: branches/RF-7944/core/impl/src/test/resources/org/richfaces/application (from rev
19108, trunk/core/impl/src/test/resources/org/richfaces/application)
Deleted:
branches/RF-7944/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 2010-09-03
08:56:24 UTC (rev 19108)
+++
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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:
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
(from rev 19108,
trunk/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties)
===================================================================
---
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties
(rev 0)
+++
branches/RF-7944/core/impl/src/test/resources/org/richfaces/application/MessageFactoryImplTest_ru_RU.properties 2010-09-03
12:00:31 UTC (rev 19109)
@@ -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: branches/RF-7944/core/legacy-tests/src/test/resources/log4j.xml
===================================================================
--- branches/RF-7944/core/legacy-tests/src/test/resources/log4j.xml 2010-09-03 08:56:24
UTC (rev 19108)
+++ branches/RF-7944/core/legacy-tests/src/test/resources/log4j.xml 2010-09-03 12:00:31
UTC (rev 19109)
@@ -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/RF-7944/dist/readme-ui.txt
===================================================================
--- branches/RF-7944/dist/readme-ui.txt 2010-09-03 08:56:24 UTC (rev 19108)
+++ branches/RF-7944/dist/readme-ui.txt 2010-09-03 12:00:31 UTC (rev 19109)
@@ -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.