Seam SVN: r8649 - in branches/Seam_2_0/src/main/org/jboss/seam: web and 1 other directory.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-08-10 12:31:18 -0400 (Sun, 10 Aug 2008)
New Revision: 8649
Added:
branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityFilter.java
branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityRequestWrapper.java
Modified:
branches/Seam_2_0/src/main/org/jboss/seam/web-2.0.xsd
Log:
JBSEAM-3249
Added: branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityFilter.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityFilter.java (rev 0)
+++ branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityFilter.java 2008-08-10 16:31:18 UTC (rev 8649)
@@ -0,0 +1,40 @@
+package org.jboss.seam.web;
+
+import java.io.IOException;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.annotations.web.Filter;
+
+/**
+ * A filter that provides integration between Servlet Security and the Seam
+ * identity component. This integration is accomplished by wrapping the
+ * HttpServletRequest with an HttpServletRequestWrapper implementation that
+ * delegates security-related calls to the Seam identity component.
+ *
+ * @author Dan Allen
+ */
+(a)Scope(ScopeType.APPLICATION)
+@Name("org.jboss.seam.web.identityFilter")
+@Install(precedence = Install.BUILT_IN, dependencies = "org.jboss.seam.security.identity")
+@BypassInterceptors
+@Filter(within = {"org.jboss.seam.web.multipartFilter"})
+public class IdentityFilter extends AbstractFilter {
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException {
+ if (!(request instanceof HttpServletRequest)) {
+ throw new ServletException("This filter can only process HttpServletRequest requests");
+ }
+
+ HttpServletRequest httpRequest = (HttpServletRequest) request;
+ chain.doFilter(new IdentityRequestWrapper(httpRequest), response);
+ }
+}
Added: branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityRequestWrapper.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityRequestWrapper.java (rev 0)
+++ branches/Seam_2_0/src/main/org/jboss/seam/web/IdentityRequestWrapper.java 2008-08-10 16:31:18 UTC (rev 8649)
@@ -0,0 +1,39 @@
+package org.jboss.seam.web;
+
+import java.security.Principal;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import org.jboss.seam.Seam;
+import org.jboss.seam.security.Identity;
+
+/**
+ * An HttpServletRequestWrapper implementation that provides integration
+ * between Servlet Security and the Seam identity component.
+ *
+ * @author Dan Allen
+ */
+class IdentityRequestWrapper extends HttpServletRequestWrapper {
+
+ private Identity identity;
+
+ public IdentityRequestWrapper(HttpServletRequest request) {
+ super(request);
+ identity = (Identity) request.getSession().
+ getAttribute(Seam.getComponentName(Identity.class));
+ }
+
+ @Override
+ public String getRemoteUser() {
+ return getUserPrincipal() != null ? getUserPrincipal().getName() : null;
+ }
+
+ @Override
+ public Principal getUserPrincipal() {
+ return Identity.isSecurityEnabled() ? identity.getPrincipal() : null;
+ }
+
+ @Override
+ public boolean isUserInRole(String role) {
+ return getUserPrincipal() != null ? identity.hasRole(role) : false;
+ }
+}
Modified: branches/Seam_2_0/src/main/org/jboss/seam/web-2.0.xsd
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/web-2.0.xsd 2008-08-09 21:32:20 UTC (rev 8648)
+++ branches/Seam_2_0/src/main/org/jboss/seam/web-2.0.xsd 2008-08-10 16:31:18 UTC (rev 8649)
@@ -4,6 +4,13 @@
xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
<xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.0.xsd"/>
+ <xs:element name="identity-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ </xs:complexType>
+ </xs:element>
+
<xs:element name="multipart-filter">
<xs:complexType mixed="true">
<xs:attributeGroup ref="components:attlist.component"/>
15 years, 9 months
Seam SVN: r8648 - in trunk/src/main/org/jboss/seam: international and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-09 17:32:20 -0400 (Sat, 09 Aug 2008)
New Revision: 8648
Modified:
trunk/src/main/org/jboss/seam/faces/FacesMessages.java
trunk/src/main/org/jboss/seam/international/StatusMessage.java
trunk/src/main/org/jboss/seam/international/StatusMessages.java
Log:
JBSEAM-3147
Modified: trunk/src/main/org/jboss/seam/faces/FacesMessages.java
===================================================================
--- trunk/src/main/org/jboss/seam/faces/FacesMessages.java 2008-08-09 20:58:00 UTC (rev 8647)
+++ trunk/src/main/org/jboss/seam/faces/FacesMessages.java 2008-08-09 21:32:20 UTC (rev 8648)
@@ -22,6 +22,8 @@
import org.jboss.seam.international.StatusMessages;
import org.jboss.seam.util.Strings;
+import com.sun.mail.handlers.message_rfc822;
+
/**
* A Seam component that propagates FacesMessages across redirects
* and interpolates EL expressions in the message string.
@@ -215,7 +217,7 @@
*/
public static FacesMessage createFacesMessage(javax.faces.application.FacesMessage.Severity severity, String messageTemplate, Object... params)
{
- return toFacesMessage(new StatusMessage(toSeverity(severity), null, null, messageTemplate, null, params));
+ return createFacesMessage(severity, null, messageTemplate, params);
}
/**
@@ -226,21 +228,23 @@
*/
public static FacesMessage createFacesMessage(javax.faces.application.FacesMessage.Severity severity, String key, String defaultMessageTemplate, Object... params)
{
- return toFacesMessage(new StatusMessage(toSeverity(severity), key, null, defaultMessageTemplate, null, params));
+ StatusMessage message = new StatusMessage(toSeverity(severity), key, null, defaultMessageTemplate, null);
+ message.interpolate(params);
+ return toFacesMessage(message);
}
/**
* Add a FacesMessage that will be used
* the next time a page is rendered.
*
- * Deprecated, use {@link #add(StatusMessage)} instead
+ * Deprecated, use a method in {@link StatusMessages} instead
*/
@Deprecated
public void add(FacesMessage facesMessage)
{
if (facesMessage!=null)
{
- add(new StatusMessage(facesMessage.getSummary(), facesMessage.getDetail(), toSeverity(facesMessage.getSeverity())));
+ add(toSeverity(facesMessage.getSeverity()), null, null, facesMessage.getSummary(), facesMessage.getDetail());
}
}
Modified: trunk/src/main/org/jboss/seam/international/StatusMessage.java
===================================================================
--- trunk/src/main/org/jboss/seam/international/StatusMessage.java 2008-08-09 20:58:00 UTC (rev 8647)
+++ trunk/src/main/org/jboss/seam/international/StatusMessage.java 2008-08-09 21:32:20 UTC (rev 8648)
@@ -30,7 +30,9 @@
FATAL;
}
+ private String summaryTemplate;
private String summary;
+ private String detailTemplate;
private String detail;
private Severity severity = Severity.INFO;
@@ -40,26 +42,26 @@
* the defaultMessageTemplate will be used.
*
*/
- public StatusMessage(Severity severity, String key, String detailKey, String defaultMessageTemplate, String defaultMessageDetailTemplate, Object... params)
+ public StatusMessage(Severity severity, String key, String detailKey, String defaultMessageTemplate, String defaultMessageDetailTemplate)
{
- String messageTemplate = getBundleMessage(key, defaultMessageTemplate);
- String messageDetailTemplate = getBundleMessage(detailKey, defaultMessageDetailTemplate);
- if ( !Strings.isEmpty(messageTemplate) )
+ this.summaryTemplate = getBundleMessage(key, defaultMessageTemplate);
+ this.detailTemplate = getBundleMessage(detailKey, defaultMessageDetailTemplate);
+ if ( !Strings.isEmpty(summaryTemplate) )
{
this.severity = severity;
- this.summary = Interpolator.instance().interpolate(messageTemplate, params);
- if (!Strings.isEmpty(messageDetailTemplate))
- {
- this.detail = Interpolator.instance().interpolate(messageDetailTemplate, params);
- }
}
}
- public StatusMessage(String summary, String detail, Severity severity)
+ public void interpolate(Object... params)
{
- this.summary = summary;
- this.detail = detail;
- this.severity = severity;
+ if (!Strings.isEmpty(summaryTemplate))
+ {
+ this.summary = Interpolator.instance().interpolate(summaryTemplate, params);
+ }
+ if (!Strings.isEmpty(detailTemplate))
+ {
+ this.detail = Interpolator.instance().interpolate(detailTemplate, params);
+ }
}
/**
Modified: trunk/src/main/org/jboss/seam/international/StatusMessages.java
===================================================================
--- trunk/src/main/org/jboss/seam/international/StatusMessages.java 2008-08-09 20:58:00 UTC (rev 8647)
+++ trunk/src/main/org/jboss/seam/international/StatusMessages.java 2008-08-09 21:32:20 UTC (rev 8648)
@@ -69,22 +69,17 @@
*
* You can also specify the severity, and parameters to be interpolated
*/
- public void add(final Severity severity, final String key, final String messageTemplate, final Object... params)
+ public void add(Severity severity, String key, String detailKey, String messageTemplate, String messageDetailTemplate, final Object... params)
{
- add(new StatusMessage(severity, key, null, messageTemplate, null, params));
- }
-
- public void add(final StatusMessage statusMessage)
- {
+ final StatusMessage message = new StatusMessage(severity, key, detailKey, messageTemplate, messageDetailTemplate);
+ messages.add(message);
getTasks().add(
new Runnable()
{
-
public void run()
{
- messages.add(statusMessage);
+ message.interpolate(params);
}
-
}
);
}
@@ -101,25 +96,26 @@
* You can also specify the severity, and parameters to be interpolated
*
*/
- public void add(final String id, final Severity severity, final String key, final String messageTemplate, final Object... params)
+ public void addToControl(String id, Severity severity, String key, String messageTemplate, final Object... params)
{
+ final StatusMessage message = new StatusMessage(severity, key, null, messageTemplate, null);
+ if (keyedMessages.containsKey(id))
+ {
+ keyedMessages.get(id).add(message);
+ }
+ else
+ {
+ List<StatusMessage> list = new ArrayList<StatusMessage>();
+ list.add(message);
+ keyedMessages.put(id, list);
+ }
getTasks().add(
new Runnable()
{
public void run()
{
- StatusMessage message = new StatusMessage(severity, key, null, messageTemplate, null, params);
- if (keyedMessages.containsKey(id))
- {
- keyedMessages.get(id).add(message);
- }
- else
- {
- List<StatusMessage> list = new ArrayList<StatusMessage>();
- list.add(message);
- keyedMessages.put(id, list);
- }
+ message.interpolate(params);
}
}
@@ -135,7 +131,7 @@
*/
public void add(String messageTemplate, Object... params)
{
- add(INFO, null, messageTemplate, params);
+ add(INFO, messageTemplate, params);
}
/**
@@ -146,7 +142,7 @@
*/
public void add(Severity severity, String messageTemplate, Object... params)
{
- add(severity, null, messageTemplate, params);
+ add(severity, null, null, messageTemplate, null, params);
}
/**
@@ -162,7 +158,7 @@
*/
public void addToControl(String id, String messageTemplate, Object... params)
{
- add(id, INFO, null, messageTemplate, params);
+ addToControl(id, INFO, null, messageTemplate, params);
}
/**
@@ -177,7 +173,7 @@
*/
public void addToControl(String id, Severity severity, String messageTemplate, Object... params)
{
- add(id, severity, null, messageTemplate, params);
+ addToControl(id, severity, null, messageTemplate, params);
}
/**
@@ -229,7 +225,7 @@
*/
public void addFromResourceBundleOrDefault(Severity severity, String key, String defaultMessageTemplate, Object... params)
{
- add(severity, key, defaultMessageTemplate, params);
+ add(severity, key, null, defaultMessageTemplate, null, params);
}
/**
@@ -297,7 +293,7 @@
*/
public void addToControlFromResourceBundleOrDefault(String id, Severity severity, String key, String defaultMessageTemplate, Object... params)
{
- add(id, severity, key, defaultMessageTemplate, params);
+ addToControl(id, severity, key, defaultMessageTemplate, params);
}
/**
15 years, 9 months
Seam SVN: r8647 - trunk/src/main/org/jboss/seam/core.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-09 16:58:00 -0400 (Sat, 09 Aug 2008)
New Revision: 8647
Modified:
trunk/src/main/org/jboss/seam/core/Validators.java
Log:
JBSEAM-3247
Modified: trunk/src/main/org/jboss/seam/core/Validators.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Validators.java 2008-08-08 22:40:33 UTC (rev 8646)
+++ trunk/src/main/org/jboss/seam/core/Validators.java 2008-08-09 20:58:00 UTC (rev 8647)
@@ -31,37 +31,36 @@
* Caches instances of Hibernate Validator ClassValidator
*
* @author Gavin King
- *
+ *
*/
@Name("org.jboss.seam.core.validators")
@BypassInterceptors
@Scope(ScopeType.APPLICATION)
-@Install(precedence=BUILT_IN)
+@Install(precedence = BUILT_IN, classDependencies = "org.hibernate.validator.ClassValidator")
public class Validators
{
-
- //TODO: should use weak references here...
+
+ // TODO: should use weak references here...
private Map<Key, ClassValidator> classValidators = new ConcurrentHashMap<Key, ClassValidator>();
-
+
class Key
{
private Class validatableClass;
private java.util.Locale locale;
-
+
public Key(Class validatableClass, java.util.Locale locale)
{
this.validatableClass = validatableClass;
this.locale = locale;
}
-
+
@Override
public boolean equals(Object other)
{
Key key = (Key) other;
- return key.validatableClass.equals(validatableClass)
- && key.locale.equals(locale);
+ return key.validatableClass.equals(validatableClass) && key.locale.equals(locale);
}
-
+
@Override
public int hashCode()
{
@@ -70,24 +69,19 @@
}
/**
- * Get the cached ClassValidator instance. If the
- * argument is an instance of a session bean Seam
- * component instance, the returned validator will
- * be aware of constraints defined on the bean class.
- * Therefore this method is preferred to
- * getValidator(Class) if the argument might be a
- * session bean.
+ * Get the cached ClassValidator instance. If the argument is an instance of
+ * a session bean Seam component instance, the returned validator will be
+ * aware of constraints defined on the bean class. Therefore this method is
+ * preferred to getValidator(Class) if the argument might be a session bean.
*
* @param model the object to be validated
*/
public <T> ClassValidator<T> getValidator(T model)
{
- Class modelClass = model instanceof Instance ?
- ( (Instance) model ).getComponent().getBeanClass() :
- model.getClass();
- return getValidator( (Class<T>) modelClass );
+ Class modelClass = model instanceof Instance ? ((Instance) model).getComponent().getBeanClass() : model.getClass();
+ return getValidator((Class<T>) modelClass);
}
-
+
/**
* Get the cached ClassValidator instance.
*
@@ -97,20 +91,20 @@
public <T> ClassValidator<T> getValidator(Class<T> modelClass)
{
java.util.ResourceBundle bundle = SeamResourceBundle.getBundle();
- Locale none = bundle==null ? new Locale("NONE") : bundle.getLocale();
+ Locale none = bundle == null ? new Locale("NONE") : bundle.getLocale();
Key key = new Key(modelClass, none);
ClassValidator result = classValidators.get(key);
- if (result==null)
+ if (result == null)
{
result = createValidator(modelClass);
classValidators.put(key, result);
}
return result;
}
-
+
/**
- * Create a new ClassValidator for the given class,
- * using the current Seam ResourceBundle.
+ * Create a new ClassValidator for the given class, using the current Seam
+ * ResourceBundle.
*
* @param modelClass the class to be validated
*/
@@ -118,15 +112,13 @@
protected <T> ClassValidator<T> createValidator(Class<T> modelClass)
{
java.util.ResourceBundle bundle = SeamResourceBundle.getBundle();
-
- return bundle==null ?
- new ClassValidator(modelClass) :
- new ClassValidator(modelClass, bundle);
+
+ return bundle == null ? new ClassValidator(modelClass) : new ClassValidator(modelClass, bundle);
}
-
+
/**
- * Validate that the given value can be assigned to the property given by the value
- * expression.
+ * Validate that the given value can be assigned to the property given by the
+ * value expression.
*
* @param valueExpression a value expression, referring to a property
* @param elContext the ELContext in which to evaluate the expression
@@ -135,12 +127,12 @@
*/
public InvalidValue[] validate(ValueExpression valueExpression, ELContext elContext, Object value)
{
- ValidatingResolver validatingResolver = new ValidatingResolver( elContext.getELResolver() );
+ ValidatingResolver validatingResolver = new ValidatingResolver(elContext.getELResolver());
ELContext decoratedContext = EL.createELContext(elContext, validatingResolver);
valueExpression.setValue(decoratedContext, value);
return validatingResolver.getInvalidValues();
}
-
+
class ValidatingResolver extends ELResolver
{
private ELResolver delegate;
@@ -150,7 +142,7 @@
{
this.delegate = delegate;
}
-
+
public InvalidValue[] getInvalidValues()
{
return invalidValues;
@@ -169,43 +161,39 @@
}
@Override
- public Class<?> getType(ELContext context, Object x, Object y)
- throws NullPointerException, PropertyNotFoundException, ELException
+ public Class<?> getType(ELContext context, Object x, Object y) throws NullPointerException, PropertyNotFoundException, ELException
{
return delegate.getType(context, x, y);
}
@Override
- public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException
+ public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException
{
return delegate.getValue(context, base, property);
}
@Override
- public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException
+ public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException
{
return delegate.isReadOnly(context, base, property);
}
@Override
- public void setValue(ELContext context, Object base, Object property, Object value)
- throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException
+ public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException
{
- if (base!=null && property!=null )
+ if (base != null && property != null)
{
context.setPropertyResolved(true);
- invalidValues = getValidator(base).getPotentialInvalidValues( property.toString(), value );
+ invalidValues = getValidator(base).getPotentialInvalidValues(property.toString(), value);
}
-
+
}
-
+
}
-
+
public static Validators instance()
{
- if ( !Contexts.isApplicationContextActive() )
+ if (!Contexts.isApplicationContextActive())
{
throw new IllegalStateException("No active application scope");
}
15 years, 9 months
Seam SVN: r8646 - in branches/Seam_2_0_FP/build/embedded: shaded and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-08 18:40:33 -0400 (Fri, 08 Aug 2008)
New Revision: 8646
Modified:
branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml
branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml
Log:
updated pom files for jboss-embedded
Modified: branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
+++ branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml 2008-08-08 22:40:33 UTC (rev 8646)
@@ -13,7 +13,7 @@
<dependency>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded</artifactId>
- <version>beta3-SNAPSHOT</version>
+ <version>beta3.SP1</version>
<exclusions>
<exclusion></exclusion>
</exclusions>
Modified: branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
+++ branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml 2008-08-08 22:40:33 UTC (rev 8646)
@@ -13,7 +13,7 @@
<dependency>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3-SNAPSHOT</version>
+ <version>beta3.SP1</version>
<exclusions>
<exclusion></exclusion>
</exclusions>
15 years, 9 months
Seam SVN: r8645 - in branches/Seam_2_0_FP/build: embedded and 1 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-08-08 16:15:59 -0400 (Fri, 08 Aug 2008)
New Revision: 8645
Modified:
branches/Seam_2_0_FP/build/common.build.xml
branches/Seam_2_0_FP/build/embedded/build.xml
branches/Seam_2_0_FP/build/embedded/hibernate-all.pom.xml
branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml
branches/Seam_2_0_FP/build/embedded/jboss-embedded.pom.xml
branches/Seam_2_0_FP/build/embedded/shaded/hibernate-all.pom.xml
branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml
branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded.pom.xml
branches/Seam_2_0_FP/build/embedded/shaded/thirdparty-all.pom.xml
branches/Seam_2_0_FP/build/embedded/thirdparty-all.pom.xml
branches/Seam_2_0_FP/build/root.pom.xml
Log:
update jboss-embedded jars
Modified: branches/Seam_2_0_FP/build/common.build.xml
===================================================================
--- branches/Seam_2_0_FP/build/common.build.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/common.build.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -23,7 +23,7 @@
<property name="maven.settings.xml" location="${build.dir}/settings.xml" />
- <property name="embedded.version" value="beta3" />
+ <property name="embedded.version" value="beta3.SP1" />
<import file="${build.dir}/utilities.build.xml" />
Modified: branches/Seam_2_0_FP/build/embedded/build.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/build.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/build.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -8,6 +8,7 @@
<property name="tmp.dir" value="${seam.dir}/classes" />
<property name="lib.dir" value="${seam.dir}/lib" />
<import file="../utilities.build.xml" />
+ <import file="../common.build.xml" />
<path id="maven-ant-tasks.classpath" path="${build.dir}/lib/maven-ant-tasks.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
Modified: branches/Seam_2_0_FP/build/embedded/hibernate-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/hibernate-all.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/hibernate-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>hibernate-all</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>The hibernate-all.jar distributed with JBoss Embedded. This contains Hibernate
for running in an EJB3 enviroment (Hibernate, Hibernate Annotations, Hibernate EntityManager, Hibernate Validator, Hibernate Commons Annotations)</description>
</project>
Modified: branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/jboss-embedded-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>The jboss-embedded-all.jar distributed with JBoss Embedded. This contains all depdencies
from JBoss AS that originate in JBoss. This jar has has the org.jboss.embedded packages split out.</description>
Modified: branches/Seam_2_0_FP/build/embedded/jboss-embedded.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/jboss-embedded.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/jboss-embedded.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>jboss-embedded</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>This jar has the org.jboss.embedded packages split out from jboss-embedded-all.</description>
<dependencies>
Modified: branches/Seam_2_0_FP/build/embedded/shaded/hibernate-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/shaded/hibernate-all.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/shaded/hibernate-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>hibernate-all</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>The hibernate-all.jar distributed with JBoss Embedded. This contains Hibernate
for running in an EJB3 enviroment (Hibernate, Hibernate Annotations, Hibernate EntityManager, Hibernate Validator, Hibernate Commons Annotations) and Hibernate Search (specific to this seam version of hibernate-all)</description>
</project>
Modified: branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-all</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>The jboss-embedded-all.jar distributed with JBoss Embedded. This contains all depdencies
from JBoss AS that originate in JBoss. This jar has has the org.jboss.embedded packages split out.</description>
Modified: branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/shaded/jboss-embedded.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>This jar has the org.jboss.embedded packages split out from jboss-embedded-all. This Seam specific version simply keeps the old jboss-embedded-api name for tooling compatibility</description>
<dependencies>
Modified: branches/Seam_2_0_FP/build/embedded/shaded/thirdparty-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/shaded/thirdparty-all.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/shaded/thirdparty-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>thirdparty-all</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>The thirdparty-all.jar distributed with JBoss Embedded. This contains thirdparty
dependencies distributed with JBoss AS. This Seam version also includes lucene, a dependency
of hibernate search</description>
Modified: branches/Seam_2_0_FP/build/embedded/thirdparty-all.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/embedded/thirdparty-all.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/embedded/thirdparty-all.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.embedded</groupId>
<artifactId>thirdparty-all</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
<description>The thirdparty-all.jar distributed with JBoss Embedded. This contains thirdparty
dependencies distributed with JBoss AS.</description>
</project>
Modified: branches/Seam_2_0_FP/build/root.pom.xml
===================================================================
--- branches/Seam_2_0_FP/build/root.pom.xml 2008-08-08 19:48:00 UTC (rev 8644)
+++ branches/Seam_2_0_FP/build/root.pom.xml 2008-08-08 20:15:59 UTC (rev 8645)
@@ -632,7 +632,7 @@
<dependency>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3</version>
+ <version>beta3.SP1</version>
</dependency>
<dependency>
15 years, 9 months
Seam SVN: r8644 - trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-08-08 15:48:00 -0400 (Fri, 08 Aug 2008)
New Revision: 8644
Modified:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumPostingHeader.xhtml
Log:
JBSEAM-2978, broken link after login in forum posting header
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumPostingHeader.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumPostingHeader.xhtml 2008-08-08 18:04:05 UTC (rev 8643)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/templates/forumPostingHeader.xhtml 2008-08-08 19:48:00 UTC (rev 8644)
@@ -92,7 +92,7 @@
</s:span>
<h:outputText value=" | "/>
<s:span styleClass="commentLink undecoratedLink">
- <h:outputLink value="#{wikiURLRenderer.renderURL(c)}">
+ <h:outputLink value="#{wikiURLRenderer.renderURL(currentDocument)}">
<h:outputText value="#{messages['lacewiki.label.Link']}"/>
</h:outputLink>
</s:span>
15 years, 9 months
Seam SVN: r8643 - in trunk/src: main/META-INF and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-08 14:04:05 -0400 (Fri, 08 Aug 2008)
New Revision: 8643
Removed:
trunk/src/excel/META-INF/components.xml
Modified:
trunk/src/main/META-INF/components.xml
Log:
Fix failing tests
Deleted: trunk/src/excel/META-INF/components.xml
===================================================================
--- trunk/src/excel/META-INF/components.xml 2008-08-08 17:26:13 UTC (rev 8642)
+++ trunk/src/excel/META-INF/components.xml 2008-08-08 18:04:05 UTC (rev 8643)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<components xmlns="http://jboss.com/products/seam/components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
-
- <import>org.jboss.seam.excel.exporter</import>
-
-</components>
Modified: trunk/src/main/META-INF/components.xml
===================================================================
--- trunk/src/main/META-INF/components.xml 2008-08-08 17:26:13 UTC (rev 8642)
+++ trunk/src/main/META-INF/components.xml 2008-08-08 18:04:05 UTC (rev 8643)
@@ -18,6 +18,7 @@
<import>org.jboss.seam.security.management</import>
<import>org.jboss.seam.security.permission</import>
<import>org.jboss.seam.captcha</import>
+ <import>org.jboss.seam.excel.excel.excelExporter</import>
<factory name="org.jboss.seam.web.webSession" auto-create="true" scope="stateless" value="#{org.jboss.seam.web.session}" />
15 years, 9 months
Seam SVN: r8642 - trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-08-08 13:26:13 -0400 (Fri, 08 Aug 2008)
New Revision: 8642
Added:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetMonitor.java
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetOperation.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostDeleteEventListener.java
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostInsertEventListener.java
Log:
Nested set modifications require some form of locking, serializing in-memory for now
Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetMonitor.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetMonitor.java (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetMonitor.java 2008-08-08 17:26:13 UTC (rev 8642)
@@ -0,0 +1,49 @@
+package org.jboss.seam.wiki.core.nestedset.listener;
+
+import org.hibernate.event.EventSource;
+
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * An alternative to table locking, we serialize nested set insert/updates in memory.
+ *
+ * <p>
+ * Any nested set tree modification potentially updates all rows in a database table. This
+ * requires several <tt>UPDATE</tt> statements, and also <tt>INSERT</tt> and <tt>DELETE</tt>.
+ * Any concurrent commit to the rows betwen <tt>UPDATE</tt> statements would be fatal and
+ * corrupt the tree information. The usual solution is to lock the whole table(s). Because
+ * MySQL has a compleltey unusable locking system (locking a table commits the current transaction, you
+ * need to lock all tables you are going to use from that point on, etc.), and because portability is
+ * a concern of this Nested Set implementation, we work around the problem with an in-memory exclusive lock.
+ * </p>
+ * <p>
+ * <b>NOTE:</b> This does NOT work if several applications modify the nested set
+ * tree in the same tables!
+ * </p>
+ *
+ * @author Christian Bauer
+ */
+public class NestedSetMonitor {
+
+ private static final int LOCK_TIMEOUT_SECONDS = 10;
+
+ private static final Lock lock = new ReentrantLock(true);
+
+ public static void executeOperation(NestedSetOperation operation, EventSource session) {
+ try {
+ if (lock.tryLock(LOCK_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
+ try {
+ operation.execute(session);
+ } finally {
+ lock.unlock();
+ }
+ } else {
+ throw new RuntimeException("Could not aquire lock to update nested set tree");
+ }
+ } catch (InterruptedException ex) {
+ throw new RuntimeException("Current thread could not aquire lock, has been interrupted");
+ }
+ }
+}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetOperation.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetOperation.java 2008-08-08 16:02:46 UTC (rev 8641)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetOperation.java 2008-08-08 17:26:13 UTC (rev 8642)
@@ -43,7 +43,7 @@
* for the deprecated <tt>Session#connection()</tt> method.
* </p>
*
- * TODO: We should lock the tables!
+ * TODO: We should lock the tables! Instead we are using the NestedSetMonitor as a workaround...
*
* @author Christian Bauer
*/
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostDeleteEventListener.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostDeleteEventListener.java 2008-08-08 16:02:46 UTC (rev 8641)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostDeleteEventListener.java 2008-08-08 17:26:13 UTC (rev 8642)
@@ -26,7 +26,10 @@
if ( NestedSetNode.class.isAssignableFrom(event.getEntity().getClass())) {
log.debug("executing nested set delete operation, recalculating the tree");
- new DeleteNestedSetOperation( (NestedSetNode)event.getEntity() ).execute(event.getSession());
+ NestedSetMonitor.executeOperation(
+ new DeleteNestedSetOperation( (NestedSetNode)event.getEntity() ),
+ event.getSession()
+ );
}
}
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostInsertEventListener.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostInsertEventListener.java 2008-08-08 16:02:46 UTC (rev 8641)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/nestedset/listener/NestedSetPostInsertEventListener.java 2008-08-08 17:26:13 UTC (rev 8642)
@@ -26,7 +26,10 @@
if ( NestedSetNode.class.isAssignableFrom(event.getEntity().getClass())) {
log.debug("executing nested set insert operation, recalculating the tree");
- new InsertNestedSetOperation( (NestedSetNode)event.getEntity() ).execute(event.getSession());
+ NestedSetMonitor.executeOperation(
+ new InsertNestedSetOperation((NestedSetNode)event.getEntity()),
+ event.getSession()
+ );
}
}
15 years, 9 months
Seam SVN: r8641 - trunk/src/main/org/jboss/seam/util.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-08-08 12:02:46 -0400 (Fri, 08 Aug 2008)
New Revision: 8641
Modified:
trunk/src/main/org/jboss/seam/util/Reflections.java
Log:
JBSEAM-3246
Modified: trunk/src/main/org/jboss/seam/util/Reflections.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Reflections.java 2008-08-08 15:56:40 UTC (rev 8640)
+++ trunk/src/main/org/jboss/seam/util/Reflections.java 2008-08-08 16:02:46 UTC (rev 8641)
@@ -194,6 +194,10 @@
throw new IllegalArgumentException("no type arguments for collection type");
}
Type typeArgument = typeArguments.length==1 ? typeArguments[0] : typeArguments[1]; //handle Maps
+ if (typeArgument instanceof ParameterizedType)
+ {
+ typeArgument = ((ParameterizedType) typeArgument).getRawType();
+ }
if ( !(typeArgument instanceof Class) )
{
throw new IllegalArgumentException("type argument not a class");
15 years, 9 months