Seam SVN: r7509 - trunk/build.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 12:26:25 -0500 (Wed, 05 Mar 2008)
New Revision: 7509
Modified:
trunk/build/root.pom.xml
Log:
use jfreechart 1.0.8 since 1.0.9 is buggy
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-03-05 17:13:44 UTC (rev 7508)
+++ trunk/build/root.pom.xml 2008-03-05 17:26:25 UTC (rev 7509)
@@ -789,7 +789,7 @@
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
- <version>1.0.9</version>
+ <version>1.0.8a</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
18 years, 1 month
Seam SVN: r7508 - branches/Seam_2_0/build.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-05 12:13:44 -0500 (Wed, 05 Mar 2008)
New Revision: 7508
Modified:
branches/Seam_2_0/build/root.pom.xml
Log:
use jfreechart 1.0.8 since 1.0.9 is buggy
Modified: branches/Seam_2_0/build/root.pom.xml
===================================================================
--- branches/Seam_2_0/build/root.pom.xml 2008-03-04 20:32:41 UTC (rev 7507)
+++ branches/Seam_2_0/build/root.pom.xml 2008-03-05 17:13:44 UTC (rev 7508)
@@ -765,7 +765,7 @@
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
- <version>1.0.9</version>
+ <version>1.0.8a</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
18 years, 1 month
Seam SVN: r7507 - trunk/src/ioc/org/jboss/seam/ioc/spring.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2008-03-04 15:32:41 -0500 (Tue, 04 Mar 2008)
New Revision: 7507
Modified:
trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java
trunk/src/ioc/org/jboss/seam/ioc/spring/spring-2.1.xsd
Log:
JBSEAM-2702
Modified: trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java
===================================================================
--- trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java 2008-03-04 04:04:06 UTC (rev 7506)
+++ trunk/src/ioc/org/jboss/seam/ioc/spring/SpringTransaction.java 2008-03-04 20:32:41 UTC (rev 7507)
@@ -17,10 +17,12 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.core.Expressions.ValueExpression;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.transaction.AbstractUserTransaction;
+import org.springframework.beans.factory.BeanFactory;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
@@ -28,6 +30,7 @@
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import org.springframework.web.context.support.WebApplicationContextUtils;
@Name("org.jboss.seam.transaction.transaction")
@Scope(ScopeType.EVENT)
@@ -39,6 +42,8 @@
private ValueExpression<PlatformTransactionManager> platformTransactionManager;
+ private String platformTransactionManagerName;
+
private DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
private boolean conversationContextRequired = true;
@@ -52,13 +57,11 @@
{
if (TransactionSynchronizationManager.isSynchronizationActive())
{
- TransactionSynchronizationManager
- .registerSynchronization(new JtaSpringSynchronizationAdapter(sync));
+ TransactionSynchronizationManager.registerSynchronization(new JtaSpringSynchronizationAdapter(sync));
}
else
{
- throw new IllegalStateException(
- "TransactionSynchronization not available with this Spring Transaction Manager");
+ throw new IllegalStateException("TransactionSynchronization not available with this Spring Transaction Manager");
}
}
@@ -68,16 +71,60 @@
{
throw new NotSupportedException("A Spring transaction is already active.");
}
- currentTransaction = platformTransactionManager.getValue().getTransaction(definition);
+ currentTransaction = getPlatformTransactionManagerRequired().getTransaction(definition);
}
- public void commit() throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
+ /**
+ * Obtains a PlatformTransactionManager from either the name or expression
+ * specified.
+ *
+ * @return
+ */
+ protected PlatformTransactionManager getPlatformTransactionManager()
{
+ if (((platformTransactionManagerName == null || "".equals(platformTransactionManagerName)) && platformTransactionManager == null) || (platformTransactionManagerName != null && !"".equals(platformTransactionManagerName)) && platformTransactionManager != null)
+ {
+ throw new IllegalArgumentException("When configuring spring:spring-transaction you must specify either platformTransactionManager or platformTransactionManagerName.");
+ }
+ if ((platformTransactionManagerName == null || "".equals(platformTransactionManagerName)))
+ {
+ return platformTransactionManager.getValue();
+ }
+ BeanFactory beanFactory = findBeanFactory();
+ if (beanFactory == null)
+ {
+ log.debug("BeanFactory either not found or not yet available.");
+ return null;
+ }
+ PlatformTransactionManager ptm = (PlatformTransactionManager) beanFactory.getBean(platformTransactionManagerName);
+ return ptm;
+ }
+
+ private PlatformTransactionManager getPlatformTransactionManagerRequired() {
+ PlatformTransactionManager ptm = getPlatformTransactionManager();
+ if (ptm == null)
+ {
+ throw new IllegalStateException("Unable to find PlatformTransactionManager");
+ }
+ return ptm;
+ }
+
+ /**
+ * Attempts to find a BeanFactory and return the instance found.
+ *
+ * @return BeanFactory or null if non found.
+ */
+ protected BeanFactory findBeanFactory()
+ {
+ return WebApplicationContextUtils.getWebApplicationContext(ServletLifecycle.getServletContext());
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
+ {
assertActive();
try
{
- platformTransactionManager.getValue().commit(currentTransaction);
+ getPlatformTransactionManagerRequired().commit(currentTransaction);
}
finally
{
@@ -87,6 +134,11 @@
public int getStatus() throws SystemException
{
+ PlatformTransactionManager ptm = getPlatformTransactionManager();
+ if (ptm == null)
+ {
+ return Status.STATUS_NO_TRANSACTION;
+ }
if (TransactionSynchronizationManager.isActualTransactionActive())
{
TransactionStatus transaction = null;
@@ -94,7 +146,7 @@
{
if (currentTransaction == null)
{
- transaction = platformTransactionManager.getValue().getTransaction(definition);
+ transaction = ptm.getTransaction(definition);
if (transaction.isNewTransaction())
{
return Status.STATUS_COMMITTED;
@@ -128,7 +180,7 @@
{
if (currentTransaction == null)
{
- platformTransactionManager.getValue().commit(transaction);
+ ptm.commit(transaction);
}
}
}
@@ -140,7 +192,7 @@
assertActive();
try
{
- platformTransactionManager.getValue().rollback(currentTransaction);
+ getPlatformTransactionManagerRequired().rollback(currentTransaction);
}
finally
{
@@ -153,11 +205,9 @@
*/
private void assertActive()
{
- if (!TransactionSynchronizationManager.isActualTransactionActive()
- || currentTransaction == null)
+ if (!TransactionSynchronizationManager.isActualTransactionActive() || currentTransaction == null)
{
- throw new IllegalStateException("No transaction currently active that Seam started."
- + "Seam should only be able to committ or rollback transactions it started.");
+ throw new IllegalStateException("No transaction currently active that Seam started." + "Seam should only be able to committ or rollback transactions it started.");
}
}
@@ -168,11 +218,12 @@
throw new IllegalStateException("No Spring Transaction is currently available.");
}
TransactionStatus transaction = null;
+ PlatformTransactionManager ptm = getPlatformTransactionManagerRequired();
try
{
if (currentTransaction == null)
{
- transaction = platformTransactionManager.getValue().getTransaction(definition);
+ transaction = ptm.getTransaction(definition);
}
else
{
@@ -184,7 +235,7 @@
{
if (currentTransaction == null)
{
- platformTransactionManager.getValue().commit(transaction);
+ ptm.commit(transaction);
}
}
}
@@ -205,7 +256,7 @@
if (joinTransaction == null)
{
// If not set attempt to detect if we should join or not
- if (!(platformTransactionManager.getValue() instanceof JpaTransactionManager))
+ if (!(getPlatformTransactionManagerRequired() instanceof JpaTransactionManager))
{
super.enlist(entityManager);
}
@@ -217,23 +268,32 @@
}
@Destroy
- public void cleanupCurrentTransaction() {
- if(currentTransaction != null) {
- try {
+ public void cleanupCurrentTransaction()
+ {
+ if (currentTransaction != null)
+ {
+ try
+ {
log.debug("Attempting to rollback left over transaction. Should never be called.");
- platformTransactionManager.getValue().rollback(currentTransaction);
- } catch(Throwable e) {
- //ignore
+ getPlatformTransactionManagerRequired().rollback(currentTransaction);
}
+ catch (Throwable e)
+ {
+ // ignore
+ }
}
}
- public void setPlatformTransactionManager(
- ValueExpression<PlatformTransactionManager> platformTransactionManager)
+ public void setPlatformTransactionManager(ValueExpression<PlatformTransactionManager> platformTransactionManager)
{
this.platformTransactionManager = platformTransactionManager;
}
+ public void setPlatformTransactionManagerName(String platformTransactionManagerName)
+ {
+ this.platformTransactionManagerName = platformTransactionManagerName;
+ }
+
@Override
public boolean isConversationContextRequired()
{
@@ -277,15 +337,17 @@
sync.beforeCompletion();
}
- private int convertSpringStatus(int springStatus) {
- switch(springStatus) {
- case TransactionSynchronization.STATUS_COMMITTED :
- return Status.STATUS_COMMITTED;
- case TransactionSynchronization.STATUS_ROLLED_BACK :
- return Status.STATUS_ROLLEDBACK;
- default :
- return Status.STATUS_UNKNOWN;
- }
+ private int convertSpringStatus(int springStatus)
+ {
+ switch (springStatus)
+ {
+ case TransactionSynchronization.STATUS_COMMITTED:
+ return Status.STATUS_COMMITTED;
+ case TransactionSynchronization.STATUS_ROLLED_BACK:
+ return Status.STATUS_ROLLEDBACK;
+ default:
+ return Status.STATUS_UNKNOWN;
+ }
}
}
}
Modified: trunk/src/ioc/org/jboss/seam/ioc/spring/spring-2.1.xsd
===================================================================
--- trunk/src/ioc/org/jboss/seam/ioc/spring/spring-2.1.xsd 2008-03-04 04:04:06 UTC (rev 7506)
+++ trunk/src/ioc/org/jboss/seam/ioc/spring/spring-2.1.xsd 2008-03-04 20:32:41 UTC (rev 7507)
@@ -56,6 +56,15 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="platform-transaction-manager-name">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ A spring bean name of a PlatformTransactionManager obtained from a BeanFactory instead of EL.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
<xs:attribute name="conversation-context-required" type="xs:boolean" use="optional" default="true">
<xs:annotation>
<xs:documentation>
@@ -69,7 +78,7 @@
<xs:annotation>
<xs:documentation>
Should this transaction manager participate in request to join a transaction. For JTA
- transactions set to true.
+ transactions set to true.
</xs:documentation>
</xs:annotation>
</xs:attribute>
18 years, 1 month
Seam SVN: r7506 - trunk/build.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 23:04:06 -0500 (Mon, 03 Mar 2008)
New Revision: 7506
Modified:
trunk/build/root.pom.xml
Log:
JBSEAM-2661
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-03-04 03:55:51 UTC (rev 7505)
+++ trunk/build/root.pom.xml 2008-03-04 04:04:06 UTC (rev 7506)
@@ -789,11 +789,11 @@
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
- <version>1.0.5</version>
+ <version>1.0.9</version>
<exclusions>
<exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
18 years, 1 month
Seam SVN: r7505 - branches/Seam_2_0/build.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 22:55:51 -0500 (Mon, 03 Mar 2008)
New Revision: 7505
Modified:
branches/Seam_2_0/build/root.pom.xml
Log:
JBSEAM-2661
Modified: branches/Seam_2_0/build/root.pom.xml
===================================================================
--- branches/Seam_2_0/build/root.pom.xml 2008-03-04 03:16:19 UTC (rev 7504)
+++ branches/Seam_2_0/build/root.pom.xml 2008-03-04 03:55:51 UTC (rev 7505)
@@ -765,7 +765,7 @@
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
- <version>1.0.5</version>
+ <version>1.0.9</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
18 years, 1 month
Seam SVN: r7504 - trunk/src/main/org/jboss/seam/web.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 22:16:19 -0500 (Mon, 03 Mar 2008)
New Revision: 7504
Modified:
trunk/src/main/org/jboss/seam/web/RewriteFilter.java
Log:
don't install by default
Modified: trunk/src/main/org/jboss/seam/web/RewriteFilter.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/RewriteFilter.java 2008-03-04 02:19:18 UTC (rev 7503)
+++ trunk/src/main/org/jboss/seam/web/RewriteFilter.java 2008-03-04 03:16:19 UTC (rev 7504)
@@ -29,7 +29,7 @@
@Scope(APPLICATION)
@Name("org.jboss.seam.web.rewriteFilter")
-@Install(precedence = BUILT_IN, classDependencies="javax.faces.context.FacesContext")
+@Install(false)
@BypassInterceptors
@Filter(within="org.jboss.seam.debug.hotDeployFilter")
public class RewriteFilter
18 years, 1 month
Seam SVN: r7503 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 21:19:18 -0500 (Mon, 03 Mar 2008)
New Revision: 7503
Removed:
trunk/src/main/org/jboss/seam/components-2.1.dtd
trunk/src/main/org/jboss/seam/pages-2.1.dtd
Log:
JBSEAM-2612
Deleted: trunk/src/main/org/jboss/seam/components-2.1.dtd
===================================================================
--- trunk/src/main/org/jboss/seam/components-2.1.dtd 2008-03-04 02:16:36 UTC (rev 7502)
+++ trunk/src/main/org/jboss/seam/components-2.1.dtd 2008-03-04 02:19:18 UTC (rev 7503)
@@ -1,42 +0,0 @@
-<!--
-
-<!DOCTYPE components PUBLIC
- "-//JBoss/Seam Component Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/components-2.1.dtd">
-
--->
-
-<!ELEMENT components (component|factory|event)*>
-
-<!ELEMENT component (property*)>
-<!ATTLIST component name CDATA #IMPLIED>
-<!ATTLIST component class CDATA #IMPLIED>
-<!ATTLIST component scope (stateless|event|page|conversation|session|business_process|application|STATELESS|EVENT|PAGE|CONVERSATION|SESSION|BUSINESS_PROCESS|APPLICATION) #IMPLIED>
-<!ATTLIST component jndi-name CDATA #IMPLIED>
-<!ATTLIST component installed CDATA #IMPLIED>
-<!ATTLIST component precedence CDATA #IMPLIED>
-<!ATTLIST component auto-create (true|false) "false">
-
-<!ELEMENT factory EMPTY>
-<!ATTLIST factory name CDATA #REQUIRED>
-<!ATTLIST factory method CDATA #IMPLIED>
-<!ATTLIST factory value CDATA #IMPLIED>
-<!ATTLIST factory scope (stateless|event|page|conversation|session|business_process|application|STATELESS|EVENT|PAGE|CONVERSATION|SESSION|BUSINESS_PROCESS|APPLICATION) #IMPLIED>
-<!ATTLIST factory auto-create (true|false) #IMPLIED>
-<!ATTLIST factory startup (true|false) #IMPLIED>
-
-<!ELEMENT property (#PCDATA|key|value)*>
-<!ATTLIST property name CDATA #REQUIRED>
-
-<!ELEMENT key (#PCDATA)>
-<!ELEMENT value (#PCDATA)>
-
-<!ELEMENT import (#PCDATA)>
-
-<!-- event handling -->
-
-<!ELEMENT event (action*)>
-<!ATTLIST event type CDATA #REQUIRED>
-
-<!ELEMENT action EMPTY>
-<!ATTLIST action execute CDATA #REQUIRED>
Deleted: trunk/src/main/org/jboss/seam/pages-2.1.dtd
===================================================================
--- trunk/src/main/org/jboss/seam/pages-2.1.dtd 2008-03-04 02:16:36 UTC (rev 7502)
+++ trunk/src/main/org/jboss/seam/pages-2.1.dtd 2008-03-04 02:19:18 UTC (rev 7503)
@@ -1,113 +0,0 @@
-<!--
-
-<!DOCTYPE pages PUBLIC
- "-//JBoss/Seam Pages Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/pages-2.1.dtd">
-
--->
-
-<!ELEMENT pages ((conversation|page)*,exception*)>
-<!ATTLIST pages no-conversation-view-id CDATA #IMPLIED>
-<!ATTLIST pages login-view-id CDATA #IMPLIED>
-
-<!ELEMENT exception (end-conversation?,(http-error|redirect))>
-<!ATTLIST exception class CDATA #IMPLIED>
-
-<!ELEMENT conversation EMPTY>
-<!ATTLIST conversation name CDATA #REQUIRED>
-<!ATTLIST conversation parameter-name CDATA #REQUIRED>
-<!ATTLIST conversation parameter-value CDATA #IMPLIED>
-
-<!ELEMENT page (#PCDATA|restrict|description|param|begin-conversation|end-conversation|start-task|begin-task|end-task|create-process|resume-process|in|raise-event|action|navigation)*>
-<!ATTLIST page action CDATA #IMPLIED>
-<!ATTLIST page view-id CDATA #IMPLIED>
-<!ATTLIST page switch (enabled|disabled) "enabled">
-<!ATTLIST page no-conversation-view-id CDATA #IMPLIED>
-<!ATTLIST page conversation-required (true|false) "false">
-<!ATTLIST page login-required (true|false) "false">
-<!ATTLIST page scheme CDATA #IMPLIED>
-<!ATTLIST page timeout CDATA #IMPLIED>
-<!ATTLIST page bundle CDATA #IMPLIED>
-<!ATTLIST page conversation CDATA #IMPLIED>
-
-<!ELEMENT param EMPTY>
-<!ATTLIST param name CDATA #IMPLIED>
-<!ATTLIST param value CDATA #IMPLIED>
-<!ATTLIST param converter CDATA #IMPLIED>
-<!ATTLIST param converterId CDATA #IMPLIED>
-<!ATTLIST param validator CDATA #IMPLIED>
-<!ATTLIST param validatorId CDATA #IMPLIED>
-<!ATTLIST param required (true|false) "false">
-
-<!ELEMENT action EMPTY>
-<!ATTLIST action if CDATA #IMPLIED>
-<!ATTLIST action execute CDATA #REQUIRED>
-
-<!ELEMENT restrict (#PCDATA)>
-
-<!ELEMENT navigation (((begin-conversation|end-conversation|start-task|begin-task|end-task|create-process|resume-process)?,(out*),raise-event?,(render|redirect)?)|(rule*))>
-<!ATTLIST navigation from-action CDATA #IMPLIED>
-<!ATTLIST navigation evaluate CDATA #IMPLIED>
-
-<!ELEMENT rule ((begin-conversation|end-conversation|start-task|begin-task|end-task|create-process|resume-process)?,(out*),raise-event?,(render|redirect)?)>
-<!ATTLIST rule if-outcome CDATA #IMPLIED>
-<!ATTLIST rule if CDATA #IMPLIED>
-
-<!ELEMENT raise-event EMPTY>
-<!ATTLIST raise-event type CDATA #REQUIRED>
-
-<!ELEMENT begin-conversation EMPTY>
-<!ATTLIST begin-conversation join (true|false) "false">
-<!ATTLIST begin-conversation nested (true|false) "false">
-<!ATTLIST begin-conversation pageflow CDATA #IMPLIED>
-<!ATTLIST begin-conversation flush-mode (manual|auto|commit|MANUAL|AUTO|COMMIT) #IMPLIED>
-<!ATTLIST begin-conversation if CDATA #IMPLIED>
-
-<!ELEMENT end-conversation EMPTY>
-<!ATTLIST end-conversation before-redirect (true|false) "false">
-<!ATTLIST end-conversation if CDATA #IMPLIED>
-
-<!ELEMENT begin-task EMPTY>
-<!ATTLIST begin-task task-id CDATA #IMPLIED>
-<!ATTLIST begin-task pageflow CDATA #IMPLIED>
-<!ATTLIST begin-task flush-mode (manual|auto|commit|MANUAL|AUTO|COMMIT) #IMPLIED>
-
-<!ELEMENT start-task EMPTY>
-<!ATTLIST start-task task-id CDATA #IMPLIED>
-<!ATTLIST start-task pageflow CDATA #IMPLIED>
-<!ATTLIST start-task flush-mode (manual|auto|commit|MANUAL|AUTO|COMMIT) #IMPLIED>
-
-<!ELEMENT end-task EMPTY>
-<!ATTLIST end-task transition CDATA #IMPLIED>
-<!ATTLIST end-task before-redirect (true|false) "false">
-
-<!ELEMENT create-process EMPTY>
-<!ATTLIST create-process definition CDATA #IMPLIED>
-
-<!ELEMENT resume-process EMPTY>
-<!ATTLIST resume-process process-id CDATA #IMPLIED>
-
-<!ELEMENT in EMPTY>
-<!ATTLIST in name CDATA #REQUIRED>
-<!ATTLIST in scope (stateless|event|page|conversation|session|business_process|application|STATELESS|EVENT|PAGE|CONVERSATION|SESSION|BUSINESS_PROCESS|APPLICATION) #IMPLIED>
-<!ATTLIST in value CDATA #REQUIRED>
-
-<!ELEMENT out EMPTY>
-<!ATTLIST out name CDATA #REQUIRED>
-<!ATTLIST out scope (stateless|event|page|conversation|session|business_process|application|STATELESS|EVENT|PAGE|CONVERSATION|SESSION|BUSINESS_PROCESS|APPLICATION) "CONVERSATION">
-<!ATTLIST out value CDATA #REQUIRED>
-
-<!ELEMENT render (message?)>
-<!ATTLIST render view-id CDATA #IMPLIED>
-
-<!ELEMENT redirect (message?,param*)>
-<!ATTLIST redirect view-id CDATA #IMPLIED>
-
-<!ELEMENT http-error (message?)>
-<!ATTLIST http-error error-code CDATA #IMPLIED>
-
-<!ELEMENT message (#PCDATA)>
-<!ATTLIST message for CDATA #IMPLIED>
-<!ATTLIST message severity (info|warn|error|fatal|INFO|WARN|ERROR|FATAL) "INFO">
-
-<!ELEMENT description (#PCDATA)>
18 years, 1 month
Seam SVN: r7502 - in trunk/examples: remoting/chatroom/resources/WEB-INF and 3 other directories.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 21:16:36 -0500 (Mon, 03 Mar 2008)
New Revision: 7502
Modified:
trunk/examples/nestedbooking/resources/WEB-INF/pages.xml
trunk/examples/remoting/chatroom/resources/WEB-INF/components.xml
trunk/examples/remoting/helloworld/resources/WEB-INF/components.xml
trunk/examples/remoting/poker/resources/WEB-INF/components.xml
trunk/examples/remoting/progressbar/resources/WEB-INF/components.xml
Log:
JBSEAM-2612
Modified: trunk/examples/nestedbooking/resources/WEB-INF/pages.xml
===================================================================
--- trunk/examples/nestedbooking/resources/WEB-INF/pages.xml 2008-03-04 01:49:48 UTC (rev 7501)
+++ trunk/examples/nestedbooking/resources/WEB-INF/pages.xml 2008-03-04 02:16:36 UTC (rev 7502)
@@ -1,10 +1,7 @@
-<!DOCTYPE pages PUBLIC
- "-//JBoss/Seam Pages Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/pages-2.1.dtd">
+<pages xmlns="http://jboss.com/products/seam/pages"
+ no-conversation-view-id="/main.xhtml"
+ login-view-id="/home.xhtml">
-<pages no-conversation-view-id="/main.xhtml"
- login-view-id="/home.xhtml">
-
<page view-id="/register.xhtml">
<action if="#{validation.failed}"
Modified: trunk/examples/remoting/chatroom/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/remoting/chatroom/resources/WEB-INF/components.xml 2008-03-04 01:49:48 UTC (rev 7501)
+++ trunk/examples/remoting/chatroom/resources/WEB-INF/components.xml 2008-03-04 02:16:36 UTC (rev 7502)
@@ -1,9 +1,5 @@
-<!DOCTYPE components PUBLIC
- "-//JBoss/Seam Component Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/components-2.1.dtd">
+<components xmlns="http://jboss.com/products/seam/components">
-<components>
-
<component name="org.jboss.seam.core.init">
<property name="jndiPattern">@jndiPattern@</property>
</component>
Modified: trunk/examples/remoting/helloworld/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/remoting/helloworld/resources/WEB-INF/components.xml 2008-03-04 01:49:48 UTC (rev 7501)
+++ trunk/examples/remoting/helloworld/resources/WEB-INF/components.xml 2008-03-04 02:16:36 UTC (rev 7502)
@@ -1,9 +1,5 @@
-<!DOCTYPE components PUBLIC
- "-//JBoss/Seam Component Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/components-2.1.dtd">
+<components xmlns="http://jboss.com/products/seam/components">
-<components>
-
<component name="org.jboss.seam.core.init">
<property name="jndiPattern">@jndiPattern@</property>
</component>
Modified: trunk/examples/remoting/poker/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/remoting/poker/resources/WEB-INF/components.xml 2008-03-04 01:49:48 UTC (rev 7501)
+++ trunk/examples/remoting/poker/resources/WEB-INF/components.xml 2008-03-04 02:16:36 UTC (rev 7502)
@@ -1,9 +1,5 @@
-<!DOCTYPE components PUBLIC
- "-//JBoss/Seam Component Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/components-2.1.dtd">
+<components xmlns="http://jboss.com/products/seam/components">
-<components>
-
<component name="org.jboss.seam.core.init">
<property name="jndiPattern">@jndiPattern@</property>
</component>
Modified: trunk/examples/remoting/progressbar/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/remoting/progressbar/resources/WEB-INF/components.xml 2008-03-04 01:49:48 UTC (rev 7501)
+++ trunk/examples/remoting/progressbar/resources/WEB-INF/components.xml 2008-03-04 02:16:36 UTC (rev 7502)
@@ -1,9 +1,5 @@
-<!DOCTYPE components PUBLIC
- "-//JBoss/Seam Component Configuration DTD 2.1//EN"
- "http://jboss.com/products/seam/components-2.1.dtd">
+<components xmlns="http://jboss.com/products/seam/components">
-<components>
-
<component name="org.jboss.seam.core.init">
<property name="jndiPattern">@jndiPattern@</property>
</component>
18 years, 1 month
Seam SVN: r7501 - trunk/src/main/org/jboss/seam/web.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 20:49:48 -0500 (Mon, 03 Mar 2008)
New Revision: 7501
Modified:
trunk/src/main/org/jboss/seam/web/RewriteFilter.java
Log:
change filter order
Modified: trunk/src/main/org/jboss/seam/web/RewriteFilter.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/RewriteFilter.java 2008-03-03 21:59:04 UTC (rev 7500)
+++ trunk/src/main/org/jboss/seam/web/RewriteFilter.java 2008-03-04 01:49:48 UTC (rev 7501)
@@ -31,7 +31,7 @@
@Name("org.jboss.seam.web.rewriteFilter")
@Install(precedence = BUILT_IN, classDependencies="javax.faces.context.FacesContext")
@BypassInterceptors
-@Filter(around="org.jboss.seam.web.HotDeployFilter")
+@Filter(within="org.jboss.seam.debug.hotDeployFilter")
public class RewriteFilter
extends AbstractFilter
{
18 years, 1 month
Seam SVN: r7500 - in trunk/src/main/org/jboss/seam: web and 1 other directory.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-03-03 16:59:04 -0500 (Mon, 03 Mar 2008)
New Revision: 7500
Modified:
trunk/src/main/org/jboss/seam/navigation/Page.java
trunk/src/main/org/jboss/seam/navigation/Pages.java
trunk/src/main/org/jboss/seam/web/RewriteFilter.java
Log:
better rewrite config
Modified: trunk/src/main/org/jboss/seam/navigation/Page.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Page.java 2008-03-03 21:58:23 UTC (rev 7499)
+++ trunk/src/main/org/jboss/seam/navigation/Page.java 2008-03-03 21:59:04 UTC (rev 7500)
@@ -12,6 +12,7 @@
import org.jboss.seam.core.Interpolator;
import org.jboss.seam.core.ResourceLoader;
import org.jboss.seam.security.Identity;
+import org.jboss.seam.web.Pattern;
/**
* Metadata about page actions, page parameters, action navigation,
@@ -37,6 +38,7 @@
private ProcessControl processControl = new ProcessControl();
private ConversationIdParameter conversationIdParameter;
private String eventType;
+ private List<Pattern> rewritePatterns = new ArrayList<Pattern>();
/**
* The scheme (http/https) required by this page.
@@ -345,5 +347,35 @@
{
this.eventType = eventType;
}
-
+
+
+ public List<Pattern> getRewritePatterns() {
+ return rewritePatterns;
+ }
+
+ //public void setRewritePatterns(List<String> rewritePatterns) {
+ // this.rewritePatterns = rewritePatterns;
+ //}
+
+ public void addRewritePattern(String value) {
+ Pattern pattern = new Pattern(externalUrl(), value);
+ rewritePatterns.add(pattern);
+ }
+
+ // XXX - not the right implementation - assumes .seam
+ private String externalUrl() {
+ String id = viewId;
+
+ if (id.contains("*")) {
+ throw new IllegalArgumentException("rewrite patterns not allowed on wildcard page defs");
+ }
+
+ int pos = id.lastIndexOf(".xhtml");
+ if (pos!=-1) {
+ id = id.substring(0, pos) + ".seam";
+ }
+
+ return id;
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Pages.java 2008-03-03 21:58:23 UTC (rev 7499)
+++ trunk/src/main/org/jboss/seam/navigation/Pages.java 2008-03-03 21:59:04 UTC (rev 7500)
@@ -6,6 +6,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -35,6 +36,7 @@
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Events;
@@ -65,19 +67,21 @@
@BypassInterceptors
@Name("org.jboss.seam.navigation.pages")
@Install(precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
+@Startup
public class Pages
{
private static final LogProvider log = Logging.getLogProvider(Pages.class);
-
- private Map<String, Page> pagesByViewId = Collections.synchronizedMap( new HashMap<String, Page>() );
- private Map<String, List<Page>> pageStacksByViewId = Collections.synchronizedMap( new HashMap<String, List<Page>>() );
+
private String noConversationViewId;
private String loginViewId;
- private Map<String, ConversationIdParameter> conversations = Collections.synchronizedMap( new HashMap<String, ConversationIdParameter>() );
private Integer httpPort;
private Integer httpsPort;
+ private Map<String, Page> pagesByViewId;
+ private Map<String, List<Page>> pageStacksByViewId;
+ private Map<String, ConversationIdParameter> conversations;
+
private String[] resources = { "/WEB-INF/pages.xml" };
private SortedSet<String> wildcardViewIds = new TreeSet<String>(
@@ -95,19 +99,19 @@
@Create
public void initialize()
{
- for (String resource: resources)
- {
- InputStream stream = ResourceLoader.instance().getResourceAsStream(resource);
- if (stream==null)
- {
- log.info("no pages.xml file found: " + resource);
- }
- else
- {
- log.debug("reading pages.xml file: " + resource);
- parse(stream);
- }
- }
+ pagesByViewId = Collections.synchronizedMap(new HashMap<String, Page>());
+ pageStacksByViewId = Collections.synchronizedMap(new HashMap<String, List<Page>>());
+ conversations = Collections.synchronizedMap(new HashMap<String, ConversationIdParameter>());
+
+ for (String resource: resources) {
+ InputStream stream = ResourceLoader.instance().getResourceAsStream(resource);
+ if (stream==null) {
+ log.info("no pages.xml file found: " + resource);
+ } else {
+ log.debug("reading pages.xml file: " + resource);
+ parse(stream);
+ }
+ }
}
/**
* Run any navigation rule defined in pages.xml
@@ -572,7 +576,7 @@
protected void notLoggedIn()
{
-// TODO - Deprecated, remove for next major release
+ // TODO - Deprecated, remove for next major release
Events.instance().raiseEvent("org.jboss.seam.notLoggedIn");
Events.instance().raiseEvent(Identity.EVENT_NOT_LOGGED_IN);
}
@@ -1047,6 +1051,12 @@
ConversationIdParameter param = conversations.get( element.attributeValue("conversation") );
if (param != null) page.setConversationIdParameter(param);
+
+ List<Element> patterns = element.elements("rewrite");
+ for (Element pattern: patterns) {
+ page.addRewritePattern(pattern.attributeValue("pattern"));
+ }
+
Element eventElement = element.element("raise-event");
if (eventElement!=null)
{
@@ -1513,4 +1523,8 @@
getCurrentViewId().startsWith("/debug.");
}
+
+ public Collection<String> getKnownViewIds() {
+ return pagesByViewId.keySet();
+ }
}
Modified: trunk/src/main/org/jboss/seam/web/RewriteFilter.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/RewriteFilter.java 2008-03-03 21:58:23 UTC (rev 7499)
+++ trunk/src/main/org/jboss/seam/web/RewriteFilter.java 2008-03-03 21:59:04 UTC (rev 7500)
@@ -4,11 +4,9 @@
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.Comparator;
-import java.util.Map;
-import java.util.TreeSet;
-import java.util.Map.Entry;
+import java.util.List;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
@@ -18,6 +16,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.jboss.seam.Seam;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@@ -25,6 +24,8 @@
import org.jboss.seam.annotations.web.Filter;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
+import org.jboss.seam.navigation.Page;
+import org.jboss.seam.navigation.Pages;
@Scope(APPLICATION)
@Name("org.jboss.seam.web.rewriteFilter")
@@ -36,38 +37,24 @@
{
private static LogProvider log = Logging.getLogProvider(RewriteFilter.class);
- Collection<Pattern> patterns = null;
-
- // need to extract this from Pages!
- public void setPatterns(Map<String,String> patternMap) {
- patterns = new TreeSet<Pattern>(new Comparator<Pattern>() {
- public int compare(Pattern p1, Pattern p2) {
- return p2.pattern.compareTo(p1.pattern);
- }
- });
-
- for(Entry<String, String> entry: patternMap.entrySet()) {
- patterns.add(new Pattern(entry.getValue(), entry.getKey()));
- }
-
- log.info("Rewrite patterns: " + patterns);
- }
-
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException,
ServletException
{
- if (patterns != null) {
- if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
- response = new RewritingResponse((HttpServletRequest) request,
- (HttpServletResponse)response,
- patterns);
- process((HttpServletRequest) request, (HttpServletResponse) response);
- }
+ List<Pattern> allPatterns = getAllPatterns();
+
+ if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
+ response = new RewritingResponse((HttpServletRequest) request,
+ (HttpServletResponse)response,
+ allPatterns);
+ process((HttpServletRequest) request,
+ (HttpServletResponse) response,
+ allPatterns);
}
+
if (!response.isCommitted()) {
chain.doFilter(request, response);
}
@@ -76,16 +63,17 @@
@SuppressWarnings("unchecked")
public void process(HttpServletRequest request,
- HttpServletResponse response)
+ HttpServletResponse response, List<Pattern> patterns)
throws IOException,
ServletException
{
String fullPath = request.getRequestURI();
log.info("incoming URL is " + fullPath);
+ log.info("known patterns are " + patterns);
String localPath = strip(fullPath, request.getContextPath());
- Rewrite rewrite = matchPatterns(localPath);
+ Rewrite rewrite = matchPatterns(localPath, patterns);
if (rewrite!=null) {
String newPath = rewrite.rewrite();
@@ -99,7 +87,7 @@
}
- private Rewrite matchPatterns(String localPath) {
+ private Rewrite matchPatterns(String localPath, List<Pattern> patterns) {
for (Pattern pattern: patterns) {
Rewrite rewrite = pattern.matchIncoming(localPath);
if (rewrite!=null && rewrite.isMatch()) {
@@ -116,5 +104,24 @@
return fullPath;
}
}
+
+
+ private List<Pattern> getAllPatterns() {
+ List<Pattern> allPatterns = new ArrayList<Pattern>();
+
+ Pages pages = (Pages) getServletContext().getAttribute(Seam.getComponentName(Pages.class));
+ if (pages != null) {
+ Collection<String> ids = pages.getKnownViewIds();
+
+ for (String id: ids) {
+ Page page = pages.getPage(id);
+ allPatterns.addAll(page.getRewritePatterns());
+ }
+ } else {
+ log.warn("Pages is null for incoming request!");
+ }
+
+ return allPatterns;
+ }
}
18 years, 1 month