Seam SVN: r8552 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-07-31 17:23:23 -0400 (Thu, 31 Jul 2008)
New Revision: 8552
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
Log:
Minor. Excel -> Microsoft(R) Excel(R)
Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-07-31 15:28:35 UTC (rev 8551)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-07-31 21:23:23 UTC (rev 8552)
@@ -1,19 +1,25 @@
<chapter id="excel">
- <title>Microsoft Excel workbook generation</title>
+ <title>
+ <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> spreadsheet generation
+ </title>
<para>
- Seam also supports generation of Microsoft Excel Workbook documents through the excellent JExcelAPI library. The
- generated document is compatible with Microsoft Excel versions 95, 97, 2000, XP and 2003. Currently a limited
- subset of the library functionality is exposed but the ultimate goal is to be able to do everything the library
- allows for. Please visit the JExcelAPI [link] home page for more information on capabilities and limitations.
+ Seam also supports generation of <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark>
+ spreadsheets through the excellent JExcelAPI library. The generated document is compatible with
+ <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> spreadsheet applications
+ versions 95, 97, 2000, XP and 2003. Currently a limited subset of the library functionality is exposed but the ultimate goal
+ is to be able to do everything the library allows for. Please visit the JExcelAPI [link] home page for more information on
+ capabilities and limitations.
</para>
<section id="excel.intro">
- <title>Microsoft Excel Support</title>
+ <title><trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> Support</title>
<para>
- Microsoft Excel support is provided by
+ <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> support is provided by
<literal>jboss-seam-excel.jar</literal>
- . This JAR contains the Excel JSF controls, which are used to construct views that can render the document, and
- the DocumentStore component, which serves the rendered document to the user. To include Microsoft Excel support
+ . This JAR contains the <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark>
+ JSF controls, which are used to construct views that can render the document, and
+ the DocumentStore component, which serves the rendered document to the user. To include
+ <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> spreadsheet support
in your application, included
<literal>jboss-seam-excel.jar</literal>
in your
@@ -22,17 +28,18 @@
web.xml
</para>
<para>
- The Seam Microsoft Excel module requires the use of Facelets as the view technology. Additionally, it requires
- the use of the seam-ui package.
+ The Seam <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> module
+ requires the use of Facelets as the view technology. Additionally, it requires the use of the seam-ui package.
</para>
<para>
The
<literal>examples/excel</literal>
- project contains an example of the Microsoft Excel support in action. It demonstrates proper deployment
- packaging, and it shows the exposed functionality
+ project contains an example of the <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark>
+ support in action. It demonstrates proper deployment packaging, and it shows the exposed functionality
</para>
<para>
- Customizing the module to support other kinds of Excel API's has been made very easy. Implement the
+ Customizing the module to support other kinds of <trademark class="registered">Microsoft</trademark>
+ <trademark class="registered">Excel</trademark> spreadsheet API's has been made very easy. Implement the
<literal>ExcelWorkbook</literal>
interface, set the component name to
<literal>org.jboss.seam.excel.<myModule></literal>
@@ -976,7 +983,8 @@
<para>
<literal>fontName</literal>
—The font name. The value is a string. Should be used with care, since the used
- font must be recognized by Excel.
+ font must be recognized by the <trademark class="registered">Microsoft</trademark>
+ <trademark class="registered">Excel</trademark> spreadsheet application
</para>
</listitem>
<listitem>
@@ -1542,7 +1550,8 @@
etc just as normal cells.
</para>
<para>
- The formula of the cell in placed in the value-attribute as a normal Excel-notation. Note that when doing
+ The formula of the cell in placed in the value-attribute as a normal <trademark class="registered">Microsoft</trademark>
+ <trademark class="registered">Excel</trademark> spreadsheet application notation. Note that when doing
cross-sheet formulas, the worksheets must exist before referencing a formula against them. The value is a
string.
@@ -1783,19 +1792,19 @@
<listitem>
<para>
<literal>left</literal>
- —The contents of the left Excel header/footer part.
+ —The contents of the left header/footer part.
</para>
</listitem>
<listitem>
<para>
<literal>center</literal>
- —The contents of the center Excel header/footer part.
+ —The contents of the center header/footer part.
</para>
</listitem>
<listitem>
<para>
<literal>right</literal>
- —The contents of the right Excel header/footer part.
+ —The contents of the right header/footer part.
</para>
</listitem>
</itemizedlist>
@@ -2404,7 +2413,8 @@
</h:form>
]]>
</programlisting>
- <para>that you want to view as an Microsoft Excel spreadsheet. Place a</para>
+ <para>that you want to view as an <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark>
+ spreadsheet. Place a</para>
<programlisting role="XML">
<![CDATA[
<h:commandLink
@@ -2545,8 +2555,9 @@
</entry>
<entry valign="top">
<para>
- The column widths. Note that the unit is internal to MicroSoft Excel, be prepared to use
- largeish numbers. Separate columns with a
+ The column widths. Note that the unit is internal to the <trademark class="registered">Microsoft</trademark>
+ <trademark class="registered">Excel</trademark> spreadsheet file format, be prepared to use largeish numbers.
+ Separate columns with a
<literal>,</literal>
and use
<literal>*</literal>
@@ -2695,12 +2706,13 @@
<section id="excel.links">
<title>Links and further documentation</title>
<para>
- The core of the Microsoft Excel functionality is based on the excellent JExcelAPI library which can be found on
+ The core of the <trademark class="registered">Microsoft</trademark> <trademark class="registered">Excel</trademark> spreadsheet
+ functionality is based on the excellent JExcelAPI library which can be found on
http://jexcelapi.sourceforge.net/ and most features and possible limitations are inherited from here.
</para>
<para>
If you use the forum or mailing list, please remember that they don't know anything about Seam and the usage of
- their library, any issues are best reported in the JBoss Seam JIRA under the Excel module.
+ their library, any issues are best reported in the JBoss Seam JIRA under the "excel" module.
</para>
</section>
</chapter>
16 years, 4 months
Seam SVN: r8551 - trunk/src/main/org/jboss/seam/mock.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-31 11:28:35 -0400 (Thu, 31 Jul 2008)
New Revision: 8551
Modified:
trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java
Log:
JBSEAM-2860
Modified: trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java 2008-07-31 15:19:10 UTC (rev 8550)
+++ trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java 2008-07-31 15:28:35 UTC (rev 8551)
@@ -24,6 +24,7 @@
import javax.naming.NamingException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@@ -71,7 +72,7 @@
{
private Application application;
- private MockServletContext servletContext;
+ private ServletContext servletContext;
private static SeamPhaseListener phases;
private MockHttpSession session;
private Map<String, Map> conversationViewRootAttributes;
@@ -911,13 +912,19 @@
protected void startSeam() throws Exception
{
startJbossEmbeddedIfNecessary();
- servletContext = new MockServletContext();
- initServletContext(servletContext.getInitParameters());
+ this.servletContext = createServletContext();
ServletLifecycle.beginApplication(servletContext);
new Initialization(servletContext).create().init();
((Init) servletContext.getAttribute(Seam.getComponentName(Init.class))).setDebug(false);
}
+ protected ServletContext createServletContext()
+ {
+ MockServletContext mockServletContext = new MockServletContext();
+ initServletContext(mockServletContext.getInitParameters());
+ return mockServletContext;
+ }
+
/**
* Shutdown Seam. Can be used at class, test group or suite level (e.g
* @AfterClass, @AfterTest, @AfterSuite)
16 years, 4 months
Seam SVN: r8550 - trunk/src/ioc/org/jboss/seam/ioc/spring.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2008-07-31 11:19:10 -0400 (Thu, 31 Jul 2008)
New Revision: 8550
Modified:
trunk/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java
Log:
JBSEAM-3125
Modified: trunk/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java
===================================================================
--- trunk/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java 2008-07-31 15:10:36 UTC (rev 8549)
+++ trunk/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java 2008-07-31 15:19:10 UTC (rev 8550)
@@ -23,7 +23,7 @@
/**
* A SessionFactory that delegates requests to open a Session to a
* "managed-hibernate-session".
- *
+ *
* @author Mike Youngstrom
*/
public class SeamManagedSessionFactoryBean extends AbstractFactoryBean
@@ -74,7 +74,7 @@
* Optionally provide an instance of the SessionFactory we are wrapping. Only
* necessary if the proxy needs to expose access to any interfaces besides
* SessionFactory.class.
- *
+ *
* @param baseSessionFactory
*/
public void setBaseSessionFactory(SessionFactory baseSessionFactory)
@@ -84,7 +84,7 @@
/**
* The name of the Seam "managed-hibernate-session" component.
- *
+ *
* @param sessionName
*/
@Required
@@ -96,9 +96,9 @@
/**
* Proxy for a SessionFactory. Returning a close suppressing proxy on calls
* to "openSession".
- *
+ *
* @author Mike Youngstrom
- *
+ *
*/
public static class SeamManagedSessionFactoryHandler implements InvocationHandler, Serializable
{
@@ -165,6 +165,8 @@
}
if (method.getName().equals("close"))
{
+ Session session = getSession();
+ session.disconnect();
isClosed = true;
return null;
}
@@ -228,7 +230,7 @@
/**
* Delegates calls to a hibernate session and suppresses calls to close.
- *
+ *
* @author Mike Youngstrom
*/
public static class SeamManagedSessionHandler implements InvocationHandler, Serializable
@@ -288,6 +290,7 @@
if (method.getName().equals("close"))
{
log.debug("Closing Session Proxy.");
+ delegate.disconnect();
closed = true;
return null;
}
16 years, 4 months
Seam SVN: r8549 - in trunk/src/main/org/jboss/seam: security and 2 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-07-31 11:10:36 -0400 (Thu, 31 Jul 2008)
New Revision: 8549
Modified:
trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java
trunk/src/main/org/jboss/seam/security/management/IdentityManager.java
trunk/src/main/org/jboss/seam/security/management/IdentityStore.java
trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java
trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java
trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java
Log:
clean up permissions on entity delete, added listGrantedRoles to id management
Modified: trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -8,6 +8,8 @@
import javax.persistence.LockModeType;
import javax.persistence.Query;
+import org.jboss.seam.security.permission.PermissionManager;
+
/**
* Proxies the EntityManager, and implements EL interpolation
* in JPA-QL
@@ -143,6 +145,7 @@
public void remove(Object entity)
{
delegate.remove(entity);
+ PermissionManager.instance().clearPermissions(entity);
}
public void setFlushMode(FlushModeType fm)
Modified: trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/EntityPermissionChecker.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -79,10 +79,7 @@
Class beanClass = provider.getBeanClass(entity);
if (beanClass != null)
- {
- String name = Seam.getComponentName(entity.getClass());
- if (name == null) name = beanClass.getName();
-
+ {
Method m = null;
switch (action)
{
Modified: trunk/src/main/org/jboss/seam/security/management/IdentityManager.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/IdentityManager.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/management/IdentityManager.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -217,10 +217,17 @@
return roles;
}
- public List<String> listAssignableRoles()
+ public List<String> listGrantableRoles()
{
- return listRoles();
- // TODO fix
+ List<String> roles = roleIdentityStore.listGrantableRoles();
+
+ Collections.sort(roles, new Comparator<String>() {
+ public int compare(String value1, String value2) {
+ return value1.compareTo(value2);
+ }
+ });
+
+ return roles;
}
/**
Modified: trunk/src/main/org/jboss/seam/security/management/IdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/IdentityStore.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/management/IdentityStore.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -186,6 +186,11 @@
* Returns a list of all the roles.
*/
List<String> listRoles();
+
+ /**
+ * Returns a list of roles that can be granted (i.e, excluding conditional roles)
+ */
+ List<String> listGrantableRoles();
/**
* Returns a list of all the roles explicitly granted to the specified user.
Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -715,6 +715,12 @@
}
public List<String> listRoles()
+ {
+ return lookupEntityManager().createQuery(
+ "select r." + roleNameProperty.getName() + " from " + roleClass.getName() + " r").getResultList();
+ }
+
+ public List<String> listGrantableRoles()
{
StringBuilder roleQuery = new StringBuilder();
@@ -732,7 +738,7 @@
}
return lookupEntityManager().createQuery(roleQuery.toString()).getResultList();
- }
+ }
protected void persistEntity(Object entity)
{
Modified: trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/management/LdapIdentityStore.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -1049,7 +1049,14 @@
}
}
}
+
+ public List<String> listGrantableRoles()
+ {
+ // TODO should we support conditional roles with LDAP?
+ return listRoles();
+ }
+
public List<String> listUsers()
{
return listUsers(null);
Modified: trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/permission/JpaPermissionStore.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -32,6 +32,8 @@
import org.jboss.seam.log.Logging;
import org.jboss.seam.security.Role;
import org.jboss.seam.security.SimplePrincipal;
+import org.jboss.seam.security.management.IdentityManager;
+import org.jboss.seam.security.management.IdentityStore;
import org.jboss.seam.security.management.JpaIdentityStore;
import org.jboss.seam.security.permission.PermissionMetadata.ActionSet;
import org.jboss.seam.util.AnnotatedBeanProperty;
@@ -542,8 +544,11 @@
protected Principal resolvePrincipal(Object principal, boolean isUser)
{
- JpaIdentityStore identityStore = (JpaIdentityStore) Component.getInstance(JpaIdentityStore.class, true);
+ IdentityStore ids = IdentityManager.instance().getRoleIdentityStore();
+ JpaIdentityStore identityStore = null;
+ if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
+
if (principal instanceof String)
{
return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
@@ -572,6 +577,7 @@
*/
public List<Permission> listPermissions(Set<Object> targets, String action)
{
+ // TODO limit the number of targets passed at a single time to 25
return listPermissions(null, targets, action);
}
@@ -775,4 +781,25 @@
{
this.rolePermissionClass = rolePermissionClass;
}
+
+ public void clearPermissions(Object target)
+ {
+ EntityManager em = lookupEntityManager();
+ String identifier = identifierPolicy.getIdentifier(target);
+
+ em.createQuery(
+ "delete from " + userPermissionClass.getName() + " p where p." +
+ targetProperty.getName() + " = :target")
+ .setParameter("target", identifier)
+ .executeUpdate();
+
+ if (rolePermissionClass != null)
+ {
+ em.createQuery(
+ "delete from " + rolePermissionClass.getName() + " p where p." +
+ roleTargetProperty.getName() + " = :target")
+ .setParameter("target", identifier)
+ .executeUpdate();
+ }
+ }
}
Modified: trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/permission/PermissionManager.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -131,4 +131,12 @@
{
return permissionStore.listAvailableActions(target);
}
+
+ public void clearPermissions(Object target)
+ {
+ if (permissionStore != null)
+ {
+ permissionStore.clearPermissions(target);
+ }
+ }
}
Modified: trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java 2008-07-31 15:09:05 UTC (rev 8548)
+++ trunk/src/main/org/jboss/seam/security/permission/PermissionStore.java 2008-07-31 15:10:36 UTC (rev 8549)
@@ -18,4 +18,5 @@
boolean revokePermission(Permission permission);
boolean revokePermissions(List<Permission> permissions);
List<String> listAvailableActions(Object target);
+ void clearPermissions(Object target);
}
16 years, 4 months
Seam SVN: r8548 - branches/Seam_2_0/src/ioc/org/jboss/seam/ioc/spring.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2008-07-31 11:09:05 -0400 (Thu, 31 Jul 2008)
New Revision: 8548
Modified:
branches/Seam_2_0/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java
Log:
JBSEAM-3125
Modified: branches/Seam_2_0/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java
===================================================================
--- branches/Seam_2_0/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java 2008-07-31 11:48:29 UTC (rev 8547)
+++ branches/Seam_2_0/src/ioc/org/jboss/seam/ioc/spring/SeamManagedSessionFactoryBean.java 2008-07-31 15:09:05 UTC (rev 8548)
@@ -23,7 +23,7 @@
/**
* A SessionFactory that delegates requests to open a Session to a
* "managed-hibernate-session".
- *
+ *
* @author Mike Youngstrom
*/
public class SeamManagedSessionFactoryBean extends AbstractFactoryBean
@@ -74,7 +74,7 @@
* Optionally provide an instance of the SessionFactory we are wrapping. Only
* necessary if the proxy needs to expose access to any interfaces besides
* SessionFactory.class.
- *
+ *
* @param baseSessionFactory
*/
public void setBaseSessionFactory(SessionFactory baseSessionFactory)
@@ -84,7 +84,7 @@
/**
* The name of the Seam "managed-hibernate-session" component.
- *
+ *
* @param sessionName
*/
@Required
@@ -96,9 +96,9 @@
/**
* Proxy for a SessionFactory. Returning a close suppressing proxy on calls
* to "openSession".
- *
+ *
* @author Mike Youngstrom
- *
+ *
*/
public static class SeamManagedSessionFactoryHandler implements InvocationHandler, Serializable
{
@@ -165,6 +165,8 @@
}
if (method.getName().equals("close"))
{
+ Session session = getSession();
+ session.disconnect();
isClosed = true;
return null;
}
@@ -228,7 +230,7 @@
/**
* Delegates calls to a hibernate session and suppresses calls to close.
- *
+ *
* @author Mike Youngstrom
*/
public static class SeamManagedSessionHandler implements InvocationHandler, Serializable
@@ -288,6 +290,7 @@
if (method.getName().equals("close"))
{
log.debug("Closing Session Proxy.");
+ delegate.disconnect();
closed = true;
return null;
}
16 years, 4 months
Seam SVN: r8547 - in trunk: src/main/org/jboss/seam/async and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-31 07:48:29 -0400 (Thu, 31 Jul 2008)
New Revision: 8547
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Jms.xml
trunk/src/main/org/jboss/seam/async/QuartzDispatcher.java
trunk/src/main/org/jboss/seam/async/QuartzTriggerHandle.java
Log:
JBSEAM-3106
Modified: trunk/doc/Seam_Reference_Guide/en-US/Jms.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Jms.xml 2008-07-31 11:11:35 UTC (rev 8546)
+++ trunk/doc/Seam_Reference_Guide/en-US/Jms.xml 2008-07-31 11:48:29 UTC (rev 8547)
@@ -228,9 +228,11 @@
The Quartz dispatcher (see earlier on how to install it) allows you to use the <literal>@Asynchronous</literal>, <literal>@Duration</literal>, <literal>@Expiration</literal>, and <literal>@IntervalDuration</literal> annotations as above. But it has some powerful additional features. The Quartz dispatcher supports three new annotations.
</para>
- <para>The <literal>@FinalExpiration</literal> annotation specifies an end date for the recurring task.</para>
+ <para>The <literal>@FinalExpiration</literal> annotation specifies an end date for the recurring task. Note that you can inject the <code>QuartzTriggerHandle</code>.</para>
<programlisting role="JAVA"><![CDATA[
+ @In QuartzTriggerHandle timer;
+
// Defines the method in the "processor" component
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
Modified: trunk/src/main/org/jboss/seam/async/QuartzDispatcher.java
===================================================================
--- trunk/src/main/org/jboss/seam/async/QuartzDispatcher.java 2008-07-31 11:11:35 UTC (rev 8546)
+++ trunk/src/main/org/jboss/seam/async/QuartzDispatcher.java 2008-07-31 11:48:29 UTC (rev 8547)
@@ -237,7 +237,7 @@
{
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
async = (Asynchronous)dataMap.get("async");
- async.execute(null);
+ async.execute(new QuartzTriggerHandle(context.getTrigger().getName()));
}
}
Modified: trunk/src/main/org/jboss/seam/async/QuartzTriggerHandle.java
===================================================================
--- trunk/src/main/org/jboss/seam/async/QuartzTriggerHandle.java 2008-07-31 11:11:35 UTC (rev 8546)
+++ trunk/src/main/org/jboss/seam/async/QuartzTriggerHandle.java 2008-07-31 11:48:29 UTC (rev 8547)
@@ -22,7 +22,6 @@
public QuartzTriggerHandle(String triggerName)
{
this.triggerName = triggerName;
- this.scheduler = QuartzDispatcher.instance().getScheduler();
}
public void cancel() throws SchedulerException
16 years, 4 months
Seam SVN: r8546 - trunk/examples/seamdiscs/src/org/jboss/seam/trinidad.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-31 07:11:35 -0400 (Thu, 31 Jul 2008)
New Revision: 8546
Modified:
trunk/examples/seamdiscs/src/org/jboss/seam/trinidad/SeamCollectionModel.java
Log:
JBSEAM-3120, thanks to Alex Savitsky
Modified: trunk/examples/seamdiscs/src/org/jboss/seam/trinidad/SeamCollectionModel.java
===================================================================
--- trunk/examples/seamdiscs/src/org/jboss/seam/trinidad/SeamCollectionModel.java 2008-07-31 10:20:32 UTC (rev 8545)
+++ trunk/examples/seamdiscs/src/org/jboss/seam/trinidad/SeamCollectionModel.java 2008-07-31 11:11:35 UTC (rev 8546)
@@ -2,11 +2,12 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.StringTokenizer;
+import java.util.regex.Pattern;
import org.apache.myfaces.trinidad.model.CollectionModel;
import org.apache.myfaces.trinidad.model.SortCriterion;
import org.jboss.seam.framework.Query;
+import org.jboss.seam.util.Strings;
/**
* Abstract base class for an Apache Trinidad CollectionModel
@@ -24,6 +25,9 @@
public abstract class SeamCollectionModel extends CollectionModel
{
+ private static final Pattern COMMA = Pattern.compile(",");
+ private static final Pattern SPACE = Pattern.compile("\\s+");
+
//private Object rowKey;
private int rowIndex = -1;
@@ -79,11 +83,10 @@
@Override
public void setSortCriteria(List<SortCriterion> criteria)
{
- if (criteria != null && !criteria.equals(this.criteria))
+ if (criteria != null && !criteria.equals(getSortCriteria()))
{
getQuery().setOrder(asQl(criteria));
- this.criteria = null;
- refresh();
+ this.criteria = criteria;
}
}
@@ -160,63 +163,44 @@
return getRowIndex() >= 0 && getRowIndex() < getRowCount();
}
- protected String asQl(List<SortCriterion> criteria)
+ public static String asQl(List<SortCriterion> criteria)
{
if (criteria != null && criteria.size() > 0)
{
- String sql = "";
+ StringBuffer sb = new StringBuffer();
+ boolean first = true;
for (SortCriterion sortCriterion : criteria)
{
- sql += sortCriterion.getProperty() + (sortCriterion.isAscending() ? " ASC" : " DESC");
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ sb.append(',');
+ }
+ sb.append(sortCriterion.getProperty()).append(sortCriterion.isAscending() ? " ASC" : " DESC");
}
- if (!"".equals(sql))
- {
- sql.substring(0, sql.length() - 1);
- }
- return sql;
+ return sb.toString();
}
- else
- {
- return null;
- }
+ return null;
}
-
- protected List<SortCriterion> asCriteria(String sql)
+
+ public static List<SortCriterion> asCriteria(String sql)
{
- List<SortCriterion> criteria = new ArrayList<SortCriterion>();
- if (!(sql == null || "".equals(sql)))
+ if (!Strings.isEmpty(sql))
{
- StringTokenizer tokenizer = new StringTokenizer(sql, ",");
- while (tokenizer.hasMoreTokens())
+ String[] tokens = COMMA.split(sql.trim());
+ List<SortCriterion> criteria = new ArrayList<SortCriterion>(tokens.length);
+ for (int i = 0; i != tokens.length; i++)
{
- SortCriterion sortCriterion;
- String fragment = tokenizer.nextToken();
- int index = fragment.lastIndexOf(" ");
- if (index > 0)
- {
- String s = fragment.substring(index);
- if (" ASC".equalsIgnoreCase(s))
- {
- sortCriterion = new SortCriterion(fragment.substring(0, fragment.length() - 4), true);
- }
- else if (" DESC".equalsIgnoreCase(s))
- {
- sortCriterion = new SortCriterion(fragment.substring(0, fragment.length() - 5),
- false);
- }
- else
- {
- sortCriterion = new SortCriterion(fragment, false);
- }
- }
- else
- {
- sortCriterion = new SortCriterion(fragment, false);
- }
- criteria.add(sortCriterion);
+ String[] terms = SPACE.split(tokens[i].trim());
+ SortCriterion sortCriterion = new SortCriterion(terms[0], terms.length == 1 ? false : "ASC".equalsIgnoreCase(terms[1]));
+ criteria.add(i, sortCriterion);
}
+ return criteria;
}
- return criteria;
+ return new ArrayList<SortCriterion>();
}
-
+
}
\ No newline at end of file
16 years, 4 months
Seam SVN: r8545 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-31 06:20:32 -0400 (Thu, 31 Jul 2008)
New Revision: 8545
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
Log:
Minor
Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-07-31 10:16:44 UTC (rev 8544)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-07-31 10:20:32 UTC (rev 8545)
@@ -12,7 +12,7 @@
<para>
Microsoft Excel support is provided by
<literal>jboss-seam-excel.jar</literal>
- . This JAR contains the iText JSF controls, which are used to construct views that can render the document, and
+ . This JAR contains the Excel JSF controls, which are used to construct views that can render the document, and
the DocumentStore component, which serves the rendered document to the user. To include Microsoft Excel support
in your application, included
<literal>jboss-seam-excel.jar</literal>
@@ -48,17 +48,9 @@
<para>
Basic usage of the worksheet support is simple; it is used like a familiar
<literal><h:dataTable></literal>
- and you can bind to a
- <literal>List</literal>
- ,
- <literal>Set</literal>
- ,
- <literal>Map</literal>
- ,
- <literal>Array</literal>
- or
- <literal>DataModel</literal>
- .
+ and you can bind to a <literal>List</literal>, <literal>Set</literal>,
+ <literal>Map</literal>, <literal>Array</literal> or
+ <literal>DataModel</literal>.
</para>
<programlisting role="XML">
<![CDATA[
16 years, 4 months
Seam SVN: r8544 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-31 06:16:44 -0400 (Thu, 31 Jul 2008)
New Revision: 8544
Modified:
trunk/build/excel.pom.xml
Log:
Remove testng dependency
Modified: trunk/build/excel.pom.xml
===================================================================
--- trunk/build/excel.pom.xml 2008-07-31 10:16:09 UTC (rev 8543)
+++ trunk/build/excel.pom.xml 2008-07-31 10:16:44 UTC (rev 8544)
@@ -59,20 +59,6 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.6</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-
</dependencies>
</project>
16 years, 4 months
Seam SVN: r8543 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-31 06:16:09 -0400 (Thu, 31 Jul 2008)
New Revision: 8543
Modified:
trunk/build/root.pom.xml
Log:
Remove resteasy deps
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-07-31 10:13:19 UTC (rev 8542)
+++ trunk/build/root.pom.xml 2008-07-31 10:16:09 UTC (rev 8543)
@@ -256,6 +256,30 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.scannotation</groupId>
+ <artifactId>scannotation</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -496,54 +520,6 @@
</dependency>
<dependency>
- <groupId>com.octo.captcha</groupId>
- <artifactId>jcaptcha-all</artifactId>
- <version>1.0-RC6</version>
- <exclusions>
- <exclusion>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
- </exclusion>
- <exclusion>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xmlParserAPIs</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- </exclusion>
- <exclusion>
- <groupId>quartz</groupId>
- <artifactId>quartz</artifactId>
- </exclusion>
- <exclusion>
- <groupId>concurrent</groupId>
- <artifactId>concurrent</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<version>1.3</version>
16 years, 4 months