JBoss Rich Faces SVN: r22355 - in trunk/ui: common/ui/src/test/java/org/richfaces/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-01 11:23:27 -0400 (Fri, 01 Apr 2011)
New Revision: 22355
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
trunk/ui/common/ui/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
Log:
Imports optimization
Removed dead code
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2011-04-01 15:13:53 UTC (rev 22354)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/RenderKitUtils.java 2011-04-01 15:23:27 UTC (rev 22355)
@@ -645,22 +645,6 @@
}
}
- public static String concat(String... strings) {
- if (strings == null) {
- return "";
- }
-
- StringBuilder sb = new StringBuilder();
- for (String s : strings) {
- if (s == null || s.length() == 0) {
- continue;
- }
-
- sb.append(s);
- }
- return sb.toString();
- }
-
public static String toScriptArgs(Object... objects) {
if (objects == null) {
return "";
Modified: trunk/ui/common/ui/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java
===================================================================
--- trunk/ui/common/ui/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java 2011-04-01 15:13:53 UTC (rev 22354)
+++ trunk/ui/common/ui/src/test/java/org/richfaces/renderkit/RenderKitUtilsTest.java 2011-04-01 15:23:27 UTC (rev 22355)
@@ -27,7 +27,6 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
-import static org.richfaces.renderkit.RenderKitUtils.concat;
import static org.richfaces.renderkit.RenderKitUtils.toScriptArgs;
import java.util.ArrayList;
@@ -123,17 +122,6 @@
assertFalse(RenderKitUtils.shouldRenderAttribute(Boolean.FALSE));
}
- @Test
- public void testConcat() throws Exception {
- assertEquals("", concat());
- assertEquals("", concat((String) null));
- assertEquals("", concat((String[]) null));
- assertEquals("", concat(""));
- assertEquals("test", concat("test"));
- assertEquals("build a string", concat("build", " a ", "string"));
- assertEquals("omit nulls", concat(null, "omit", null, " ", null, "nulls", null));
- }
-
private static String dehydrate(String s) {
return s.replaceAll("\\s+", "");
}
Modified: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2011-04-01 15:13:53 UTC (rev 22354)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2011-04-01 15:23:27 UTC (rev 22355)
@@ -5,7 +5,6 @@
import java.io.IOException;
-import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXException;
Modified: trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
===================================================================
--- trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2011-04-01 15:13:53 UTC (rev 22354)
+++ trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2011-04-01 15:23:27 UTC (rev 22355)
@@ -27,7 +27,6 @@
import javax.faces.component.UIComponent;
-import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfBehavior;
import org.richfaces.cdk.annotations.Tag;
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2011-04-01 15:13:53 UTC (rev 22354)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2011-04-01 15:23:27 UTC (rev 22355)
@@ -28,7 +28,6 @@
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.cdk.annotations.*;
import org.richfaces.component.AbstractTogglePanel;
import org.richfaces.component.ComponentIterators;
13 years, 8 months
JBoss Rich Faces SVN: r22354 - in trunk: ui/core/ui/src/main/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-01 11:13:53 -0400 (Fri, 01 Apr 2011)
New Revision: 22354
Modified:
trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/VariableMapperImpl.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java
Log:
Minor cleanup in core
Added a4jSkin variable in resources plugin
Modified: trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/VariableMapperImpl.java
===================================================================
--- trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/VariableMapperImpl.java 2011-04-01 15:12:51 UTC (rev 22353)
+++ trunk/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/VariableMapperImpl.java 2011-04-01 15:13:53 UTC (rev 22354)
@@ -62,7 +62,7 @@
*/
@Override
public ValueExpression resolveVariable(String variable) {
- if ("richSkin".equals(variable)) {
+ if ("richSkin".equals(variable) || "a4jSkin".equals(variable)) {
return SKIN_VALUE_EXPRESSION;
} else if ("resource".equals(variable)) {
return RESOURCE_VALUE_EXPRESSION;
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2011-04-01 15:12:51 UTC (rev 22353)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2011-04-01 15:13:53 UTC (rev 22354)
@@ -30,7 +30,6 @@
import javax.faces.application.ResourceHandler;
import javax.faces.component.UIOutput;
-import org.ajax4jsf.resource.ResourceComponent;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
@@ -47,7 +46,7 @@
tag = @Tag(generate = false, handler = "org.richfaces.view.facelets.html.MediaOutputHandler", type = TagType.Facelets),
renderer = @JsfRenderer(type = "org.richfaces.MediaOutputRenderer")
)
-public abstract class AbstractMediaOutput extends UIOutput implements ResourceComponent {
+public abstract class AbstractMediaOutput extends UIOutput {
public static final String COMPONENT_TYPE = "org.richfaces.MediaOutput";
@@ -131,6 +130,8 @@
@Attribute
public abstract MethodExpression getCreateContent();
+
+ public abstract void setCreateContent(MethodExpression createContent);
@Attribute
public abstract String getRel();
@@ -171,6 +172,9 @@
@Attribute
public abstract String getFileName();
+ @Attribute
+ public abstract Object getValue();
+
@Attribute(events = @EventName("blur"))
public abstract String getOnblur();
@@ -207,15 +211,4 @@
@Attribute(events = @EventName("mouseup"))
public abstract String getOnmouseup();
- @Deprecated
- public boolean isSession() {
- return true;
- }
-
- @Deprecated
- public void setSession(boolean session) {
- if (!session) {
- // TODO: log
- }
- }
}
13 years, 8 months
JBoss Rich Faces SVN: r22353 - in trunk/core: api/src/main/java/org/richfaces/resource and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-01 11:12:51 -0400 (Fri, 01 Apr 2011)
New Revision: 22353
Removed:
trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
trunk/core/api/src/main/java/org/ajax4jsf/resource/package-info.java
Modified:
trunk/core/api/src/main/java/org/richfaces/resource/PostConstructResource.java
trunk/core/impl/src/main/java/org/richfaces/cache/EhCacheCache.java
trunk/core/impl/src/main/java/org/richfaces/cache/JBossCacheCache.java
trunk/core/impl/src/main/java/org/richfaces/renderkit/html/ResourceLibraryRenderer.java
trunk/core/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
Log:
Minor cleanup in core
Deleted: trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -1,132 +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.ajax4jsf.resource;
-
-import java.util.Date;
-
-import javax.el.MethodExpression;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:13 $
- *
- */
-public interface ResourceComponent {
-
- /**
- * Get Mime-type for target .
- * @return
- */
- public abstract String getMimeType();
-
- /**
- * Set Mime-type for target .
- * @param newvalue
- */
- public abstract void setMimeType(String newvalue);
-
- /**
- * Get Last modified date for target .
- * @return
- */
- @Deprecated
- public abstract Date getLastModified();
-
- /**
- * Set Last modified for target .
- * @param newvalue
- */
- @Deprecated
- public abstract void setLastModified(Date newvalue);
-
- /**
- * Get Expiration time for target .
- * @return
- */
- @Deprecated
- public abstract Date getExpires();
-
- /**
- * Set Expiration time for target .
- * @param newvalue
- */
- @Deprecated
- public abstract void setExpires(Date newvalue);
-
- /**
- * Get caching flag for resource.
- * @return
- */
- public abstract boolean isCacheable();
-
- /**
- * Set caching flag for resource.
- * @param newvalue
- */
- public abstract void setCacheable(boolean newvalue);
-
- /**
- * Get session-avare flag for resource.
- * @return true if resource depend of client session. If false, no JSESSIONID encoded in URI
- */
- @Deprecated
- public abstract boolean isSession();
-
- /**
- * Set session-avare flag for resource.
- * @param newvalue
- */
- @Deprecated
- public abstract void setSession(boolean newvalue);
-
- /**
- * Get Data object, encoded in uri and passed to "send" method for generate resource content.
- * @return
- */
- public abstract Object getValue();
-
- /**
- * Set Data object, encoded in uri and passed to "send" method for generate resource content.
- * @param newvalue
- */
- public abstract void setValue(Object newvalue);
-
- /**
- * Get MethodExpression to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @return MethodExpression
- */
- public abstract MethodExpression getCreateContent();
-
- /**
- * Set MethodExpression to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @param newvalue - new MethodExpression value
- */
- public abstract void setCreateContent(MethodExpression newvalue);
-}
Deleted: trunk/core/api/src/main/java/org/ajax4jsf/resource/package-info.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/resource/package-info.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/api/src/main/java/org/ajax4jsf/resource/package-info.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -1,5 +0,0 @@
-
-/**
- * Resources-handling functionality
- */
-package org.ajax4jsf.resource;
Modified: trunk/core/api/src/main/java/org/richfaces/resource/PostConstructResource.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/resource/PostConstructResource.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/api/src/main/java/org/richfaces/resource/PostConstructResource.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -31,7 +31,7 @@
*
*/
@Retention(RetentionPolicy.RUNTIME)
-(a)Target({ElementType.METHOD, ElementType.FIELD})
+(a)Target({ElementType.METHOD})
public @interface PostConstructResource {
}
Modified: trunk/core/impl/src/main/java/org/richfaces/cache/EhCacheCache.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/cache/EhCacheCache.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/impl/src/main/java/org/richfaces/cache/EhCacheCache.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -12,7 +12,7 @@
* @author Nick Belaevski
* @since 4.0
*/
-public class EhCacheCache implements org.richfaces.cache.Cache {
+public class EhCacheCache implements Cache {
private net.sf.ehcache.Ehcache cache;
private boolean preconfiguredCache;
Modified: trunk/core/impl/src/main/java/org/richfaces/cache/JBossCacheCache.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/cache/JBossCacheCache.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/impl/src/main/java/org/richfaces/cache/JBossCacheCache.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -14,7 +14,6 @@
import javax.transaction.SystemException;
import javax.transaction.Transaction;
-import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
import org.richfaces.log.Logger;
@@ -24,14 +23,14 @@
* @author Nick Belaevski
* @since 4.0
*/
-public class JBossCacheCache implements org.richfaces.cache.Cache {
+public class JBossCacheCache implements Cache {
private static final Logger LOGGER = RichfacesLogger.CACHE.getLogger();
private static final String RESOURCE = "resource";
- private Cache<String, Object> cache;
+ private org.jboss.cache.Cache<String, Object> cache;
- public JBossCacheCache(Cache<String, Object> cache) {
+ public JBossCacheCache(org.jboss.cache.Cache<String, Object> cache) {
super();
this.cache = cache;
}
Modified: trunk/core/impl/src/main/java/org/richfaces/renderkit/html/ResourceLibraryRenderer.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/renderkit/html/ResourceLibraryRenderer.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/impl/src/main/java/org/richfaces/renderkit/html/ResourceLibraryRenderer.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -52,19 +52,6 @@
public ResourceLibraryRenderer() {
super();
}
-
- private void setupResourceAttributes(UIComponent component, ResourceKey resourceKey) {
- Map<String, Object> attributes = component.getAttributes();
-
- attributes.put("name", resourceKey.getResourceName());
-
- String libraryName = resourceKey.getLibraryName();
- if (libraryName != null) {
- attributes.put("library", libraryName);
- } else {
- attributes.remove("library");
- }
- }
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
Modified: trunk/core/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2011-04-01 14:54:25 UTC (rev 22352)
+++ trunk/core/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2011-04-01 15:12:51 UTC (rev 22353)
@@ -70,6 +70,7 @@
if (mainSkin != null || baseSkin != null) {
skin = new CompositeSkinImpl(mainSkin, baseSkin);
} else {
+ //CompositeSkinImpl caches hash code
skin = new CompositeSkinImpl(getDefaultSkin(context));
}
@@ -87,6 +88,7 @@
if (baseSkin != null) {
skin = new CompositeSkinImpl(baseSkin);
} else {
+ //CompositeSkinImpl caches hash code
skin = new CompositeSkinImpl(getDefaultSkin(context));
}
13 years, 8 months
JBoss Rich Faces SVN: r22352 - in trunk/examples: parent and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-01 10:54:25 -0400 (Fri, 01 Apr 2011)
New Revision: 22352
Modified:
trunk/examples/parent/pom.xml
trunk/examples/pom.xml
Log:
Minor pom files update
Modified: trunk/examples/parent/pom.xml
===================================================================
--- trunk/examples/parent/pom.xml 2011-04-01 14:25:18 UTC (rev 22351)
+++ trunk/examples/parent/pom.xml 2011-04-01 14:54:25 UTC (rev 22352)
@@ -251,12 +251,12 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>2.0.4-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
</profile>
Modified: trunk/examples/pom.xml
===================================================================
--- trunk/examples/pom.xml 2011-04-01 14:25:18 UTC (rev 22351)
+++ trunk/examples/pom.xml 2011-04-01 14:54:25 UTC (rev 22352)
@@ -41,7 +41,7 @@
<modules>
<module>parent</module>
<module>template</module>
- <module>core-demo</module>
+ <module>core-demo</module>
<module>misc-demo</module>
<module>output-demo</module>
<module>input-demo</module>
@@ -50,8 +50,8 @@
<module>push-demo</module>
<module>richfaces-showcase</module>
<module>validator-demo</module>
- <module>dnd-demo</module>
- <module>irc-client</module>
+ <module>dnd-demo</module>
+ <module>irc-client</module>
</modules>
<scm>
13 years, 8 months
JBoss Rich Faces SVN: r22351 - in branches/4.0.X/examples/richfaces-showcase/src/main: java-gae/org and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-04-01 10:25:18 -0400 (Fri, 01 Apr 2011)
New Revision: 22351
Added:
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/
branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java
Modified:
branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
Log:
https://issues.jboss.org/browse/RF-10841
Added: branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java (rev 0)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/java-gae/org/richfaces/demo/filters/SessionBeansFilter.java 2011-04-01 14:25:18 UTC (rev 22351)
@@ -0,0 +1,29 @@
+package org.richfaces.demo.filters;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.util.Enumeration;
+
+/**
+ * User: Gleb Galkin
+ * Date: 31.03.11
+ */
+public class SessionBeansFilter implements Filter {
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
+
+ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+ HttpSession session = ((HttpServletRequest) servletRequest).getSession();
+ Enumeration attributes = session.getAttributeNames();
+ while (attributes.hasMoreElements()) {
+ String attribute = (String) attributes.nextElement();
+ session.setAttribute(attribute, session.getAttribute(attribute));
+ }
+ filterChain.doFilter(servletRequest, servletResponse);
+ }
+
+ public void destroy() {
+ }
+}
Modified: branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
===================================================================
--- branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml 2011-03-31 19:54:02 UTC (rev 22350)
+++ branches/4.0.X/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml 2011-04-01 14:25:18 UTC (rev 22351)
@@ -101,6 +101,16 @@
<servlet-name>_ah_sessioncleanup</servlet-name>
<url-pattern>/_ah/sessioncleanup</url-pattern>
</servlet-mapping>
+ <filter>
+ <filter-name>SessionBeansFilter</filter-name>
+ <filter-class>
+ org.richfaces.demo.filters.SessionBeansFilter
+ </filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>SessionBeansFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>session-cleanup</web-resource-name>
13 years, 8 months