Seam SVN: r9002 - trunk/seam-gen/build-scripts.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-09-17 05:21:20 -0400 (Wed, 17 Sep 2008)
New Revision: 9002
Modified:
trunk/seam-gen/build-scripts/.classpath
Log:
Remove jstl.jar from eclipseclasspath
Modified: trunk/seam-gen/build-scripts/.classpath
===================================================================
--- trunk/seam-gen/build-scripts/.classpath 2008-09-16 22:04:32 UTC (rev 9001)
+++ trunk/seam-gen/build-scripts/.classpath 2008-09-17 09:21:20 UTC (rev 9002)
@@ -17,7 +17,6 @@
<classpathentry kind="lib" path="lib/antlr.jar"/>
<classpathentry kind="lib" path="lib/jgroups.jar"/>
<classpathentry kind="lib" path="lib/jsf-facelets.jar"/>
- <classpathentry kind="lib" path="lib/jstl.jar"/>
<classpathentry kind="lib" path="lib/jsf-api.jar"/>
<classpathentry kind="lib" path="lib/servlet-api.jar"/>
<classpathentry kind="lib" path="lib/testng.jar"/>
16 years, 2 months
Seam SVN: r9001 - trunk/src/main/org/jboss/seam/core.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-09-16 18:04:32 -0400 (Tue, 16 Sep 2008)
New Revision: 9001
Modified:
trunk/src/main/org/jboss/seam/core/Interpolator.java
Log:
JBSEAM-2499
Modified: trunk/src/main/org/jboss/seam/core/Interpolator.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Interpolator.java 2008-09-16 09:34:31 UTC (rev 9000)
+++ trunk/src/main/org/jboss/seam/core/Interpolator.java 2008-09-16 22:04:32 UTC (rev 9001)
@@ -122,8 +122,15 @@
} else if (nextTok.equals("}")) {
if (--level == 0) {
try {
- String value = new MessageFormat(expr.toString(), Locale.instance()).format(params);
- builder.append(value);
+ if (params.length == 0)
+ {
+ builder.append(expr.toString());
+ }
+ else
+ {
+ String value = new MessageFormat(expr.toString(), Locale.instance()).format(params);
+ builder.append(value);
+ }
} catch (Exception e) {
// if it is a bad message, use the expression itself
builder.append(expr);
16 years, 2 months
Seam SVN: r9000 - branches/enterprise/JBPAPP_4_2_CP01/src/test/misc/org/jboss/seam/test.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-09-16 05:34:31 -0400 (Tue, 16 Sep 2008)
New Revision: 9000
Modified:
branches/enterprise/JBPAPP_4_2_CP01/src/test/misc/org/jboss/seam/test/InterpolatorTest.java
Log:
JBPAPP-1185
Modified: branches/enterprise/JBPAPP_4_2_CP01/src/test/misc/org/jboss/seam/test/InterpolatorTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/src/test/misc/org/jboss/seam/test/InterpolatorTest.java 2008-09-16 03:25:29 UTC (rev 8999)
+++ branches/enterprise/JBPAPP_4_2_CP01/src/test/misc/org/jboss/seam/test/InterpolatorTest.java 2008-09-16 09:34:31 UTC (rev 9000)
@@ -1,6 +1,8 @@
package org.jboss.seam.test;
+import java.text.DateFormat;
import java.util.Date;
+import java.util.Locale;
import org.jboss.seam.core.Interpolator;
import org.testng.Assert;
@@ -27,7 +29,9 @@
Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
- Assert.assertEquals("12/31/69", interpolator.interpolate("{0,date,short}", new Date(0)));
+ Date date = new Date(0);
+ DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US);
+ Assert.assertEquals(df.format(date), interpolator.interpolate("{0,date,short}", date));
// test that a messageformat error doesn't blow up
16 years, 2 months
Seam SVN: r8999 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-09-15 23:25:29 -0400 (Mon, 15 Sep 2008)
New Revision: 8999
Modified:
trunk/src/main/org/jboss/seam/Component.java
Log:
JBSEAM-808
Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java 2008-09-16 03:08:11 UTC (rev 8998)
+++ trunk/src/main/org/jboss/seam/Component.java 2008-09-16 03:25:29 UTC (rev 8999)
@@ -702,6 +702,12 @@
//can't use Init.instance() here because of unit tests
Init init = (Init) applicationContext.get(Seam.getComponentName(Init.class));
String contextVariable = toName( method.getAnnotation(org.jboss.seam.annotations.Factory.class).value(), method );
+
+ if ( contextVariable.equals(name) )
+ {
+ throw new IllegalStateException("@Factory method can not share name with its containing component: " + contextVariable);
+ }
+
init.addFactoryMethod(contextVariable, method, this);
if ( method.getAnnotation(org.jboss.seam.annotations.Factory.class).autoCreate() )
{
16 years, 2 months
Seam SVN: r8998 - trunk/examples/booking/src/org/jboss/seam/example/booking.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-09-15 23:08:11 -0400 (Mon, 15 Sep 2008)
New Revision: 8998
Modified:
trunk/examples/booking/src/org/jboss/seam/example/booking/HotelSearchingAction.java
Log:
JBSEAM-3176
Modified: trunk/examples/booking/src/org/jboss/seam/example/booking/HotelSearchingAction.java
===================================================================
--- trunk/examples/booking/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2008-09-16 03:00:43 UTC (rev 8997)
+++ trunk/examples/booking/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2008-09-16 03:08:11 UTC (rev 8998)
@@ -1,6 +1,7 @@
//$Id$
package org.jboss.seam.example.booking;
+import java.util.ArrayList;
import java.util.List;
import javax.ejb.Remove;
@@ -51,8 +52,9 @@
.getResultList();
nextPageAvailable = results.size() > pageSize;
- if (nextPageAvailable) {
- hotels = results.subList(0,pageSize);
+ if (nextPageAvailable)
+ {
+ hotels = new ArrayList<Hotel>(results.subList(0,pageSize));
} else {
hotels = results;
}
16 years, 2 months
Seam SVN: r8997 - trunk/src/main/org/jboss/seam/deployment.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-09-15 23:00:43 -0400 (Mon, 15 Sep 2008)
New Revision: 8997
Modified:
trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java
Log:
JBSEAM-3407
Modified: trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java
===================================================================
--- trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java 2008-09-16 02:10:16 UTC (rev 8996)
+++ trunk/src/main/org/jboss/seam/deployment/DeploymentStrategy.java 2008-09-16 03:00:43 UTC (rev 8997)
@@ -4,6 +4,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
@@ -85,7 +86,7 @@
private void addPropertyFromResourceBundle(String key, List<String> values)
{
for (String resourceName : RESOURCE_BUNDLES)
- {
+ {
try
{
// Hard to cache as we have to get it off the correct classloader
@@ -94,8 +95,19 @@
{
URL url = urlEnum.nextElement();
Properties properties = new Properties();
- properties.load(url.openStream());
- addProperty(key, properties.getProperty(key), values);
+ InputStream propertyStream = url.openStream();
+ try
+ {
+ properties.load(propertyStream);
+ addProperty(key, properties.getProperty(key), values);
+ }
+ finally
+ {
+ if (propertyStream != null)
+ {
+ propertyStream.close();
+ }
+ }
}
}
catch (IOException e)
16 years, 2 months
Seam SVN: r8996 - trunk/src/main/org/jboss/seam/web.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-09-15 22:10:16 -0400 (Mon, 15 Sep 2008)
New Revision: 8996
Modified:
trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java
Log:
JBSEAM-3374
Modified: trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java 2008-09-15 19:28:53 UTC (rev 8995)
+++ trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java 2008-09-16 02:10:16 UTC (rev 8996)
@@ -28,12 +28,13 @@
}
@Override
- public Principal getUserPrincipal() {
- return Identity.isSecurityEnabled() ? identity.getPrincipal() : null;
+ public Principal getUserPrincipal()
+ {
+ return Identity.isSecurityEnabled() && identity != null ? identity.getPrincipal() : null;
}
@Override
public boolean isUserInRole(String role) {
- return getUserPrincipal() != null ? identity.hasRole(role) : false;
+ return getUserPrincipal() != null && identity != null ? identity.hasRole(role) : false;
}
}
16 years, 2 months
Seam SVN: r8995 - trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-09-15 15:28:53 -0400 (Mon, 15 Sep 2008)
New Revision: 8995
Modified:
trunk/build.xml
Log:
Copy all migration guides
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-09-15 08:09:37 UTC (rev 8994)
+++ trunk/build.xml 2008-09-15 19:28:53 UTC (rev 8995)
@@ -616,7 +616,11 @@
<copy file="seam" todir="${dist.dir}" />
<copy file="seam-text.g" todir="${dist.dir}" />
<copy file="seam.bat" todir="${dist.dir}" />
- <copy file="seam2migration.txt" todir="${dist.dir}" />
+ <copy todir="${dist.dir}">
+ <fileset dir="${basedir}">
+ <include name="*migration.txt"/>
+ </fileset>
+ </copy>
<copy todir="${dist.dir}/extras">
<fileset dir="${basedir}/extras">
<include name="**/*" />
16 years, 2 months
Seam SVN: r8994 - trunk/src/main/org/jboss/seam/security/permission.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-09-15 04:09:37 -0400 (Mon, 15 Sep 2008)
New Revision: 8994
Modified:
trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java
Log:
JBSEAM-3313
Modified: trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java 2008-09-15 02:21:57 UTC (rev 8993)
+++ trunk/src/main/org/jboss/seam/security/permission/RuleBasedPermissionResolver.java 2008-09-15 08:09:37 UTC (rev 8994)
@@ -92,9 +92,9 @@
if (securityContext == null) return false;
- List<FactHandle> handles = new ArrayList<FactHandle>();
-
- PermissionCheck check = new PermissionCheck(target, action);
+ List<FactHandle> handles = new ArrayList<FactHandle>();
+
+ PermissionCheck check;
synchronized( securityContext )
{
@@ -105,9 +105,11 @@
else if (target instanceof Class)
{
String componentName = Seam.getComponentName((Class) target);
- target = componentName != null ? componentName : ((Class) target).getName();
- }
+ target = componentName != null ? componentName : ((Class) target).getName();
+ }
+ check = new PermissionCheck(target, action);
+
try
{
synchronizeContext();
16 years, 2 months
Seam SVN: r8993 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-09-14 22:21:57 -0400 (Sun, 14 Sep 2008)
New Revision: 8993
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Security.xml
Log:
added description for sequence diagram
Modified: trunk/doc/Seam_Reference_Guide/en-US/Security.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-09-15 01:49:00 UTC (rev 8992)
+++ trunk/doc/Seam_Reference_Guide/en-US/Security.xml 2008-09-15 02:21:57 UTC (rev 8993)
@@ -811,8 +811,8 @@
algorithm to be specified for password hashing. Possible values for <literal>hash</literal> are
<literal>md5</literal>, <literal>sha</literal> and <literal>none</literal>. E.g:
</para>
-
- <programlisting role="JAVA"><![CDATA[@UserPassword(hash = "md5")
+
+ <programlisting role="JAVA"><![CDATA[@UserPassword(hash = "md5")
public String getPasswordHash() {
return passwordHash;
}]]></programlisting>
@@ -3225,6 +3225,42 @@
</imageobject>
</mediaobject>
+ <itemizedlist>
+ <listitem>
+ <para>
+ 1. A permission check is initiated somewhere (either in code or via an EL
+ expression) resulting in a call to <literal>Identity.hasPermission()</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 1.1. <literal>Identity</literal> invokes
+ <literal>PermissionMapper.resolvePermission()</literal>, passing in the
+ permission to be resolved.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 1.1.1. <literal>PermissionMapper</literal> maintains a <literal>Map</literal> of
+ <literal>ResolverChain</literal> instances, keyed by class. It uses this map
+ to locate the correct <literal>ResolverChain</literal> for the permission's
+ target object. Once it has the correct <literal>ResolverChain</literal>, it
+ retrieves the list of <literal>PermissionResolver</literal>s it contains via
+ a call to <literal>ResolverChain.getResolvers()</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 1.1.2. For each <literal>PermissionResolver</literal> in the <literal>ResolverChain</literal>,
+ the <literal>PermissionMapper</literal> invokes its <literal>hasPermission()</literal> method,
+ passing in the permission instance to be checked. If any of the <literal>PermissionResolver</literal>s
+ return <literal>true</literal>, then the permission check has succeeded and the
+ <literal>PermissionMapper</literal> also returns <literal>true</literal> to <literal>Identity</literal>.
+ If none of the <literal>PermissionResolver</literal>s return true, then the permission check
+ has failed.
+ </para>
+ </listitem>
+ </itemizedlist>
</sect2>
16 years, 2 months