How to handle conditional dependencies in Seam 3?
by Marcel Kolsteren
For the external authentication support in the seam security module, I need a dependency on JAXB and a dependency on the XML digital signature API (JSR 105). The environment where Seam is deployed (JDK and application server) determines whether these dependent artifacts are "provided" or not. For example, JDK 6 has both JAXB and JSR 105 support, but when using JDK 5 it depends on the application server (and the version of the application server) whether JAXB and JSR 105 are provided. I see no way to express this kind of "conditional dependency" in module pom files. Two possible solutions:
1) Package the module with the dependent jars that are most likely not provided by the runtime environment. Use the reference documentation to instruct the Seam user to exclude/add dependencies based on his environment.
2) Create different artifacts for different runtime environments (the most used ones). This would have impact on how Seam distributions are made.
Is there already some best practice in Seam 3 regarding this?
Kind regards,
Marcel
14 years, 3 months
Meeting today
by Pete Muir
All
We will have the IRC meeting (#seam-dev on freenode) today at 15:00 UK/10:00 Eastern. No pressing topics, so please bring up any queries you may have.
Thanks!
14 years, 3 months
Seam Faces and replacing pages.xml
by Stuart Douglas
I have been thinking about the replacement for pages.xml and this is what I have come up with.
I think we need some kind of a hierarchal data store based on view id's, where the data is stored as annotations:
public class ViewDataStore
{
/**
* Adds data to the store.
*/
public <T extends Annotation> void addData(String path, T data);
/**
* Returns all data for the path in order from most specific to least specific. e.g. if the path is /app/data/MyScreen.xhtml then it will return data for
* /app/data/MyScreen.xhtml
* /app/data/*
* /app/*
* /*
* assuming all of the above have been placed in the store via addData()
*/
public <T extends Annotation> List<T> getAllDataForPath(String path, Class<T> dataType );
/**
* returns the most specific data for the given path.
*/
public <T extends Annotation> T getDataForPath(String path, Class<T> dataType);
}
This could then be configured in a variety of ways, with enum and xml support availible out of the box:
@ViewData
public enum SomeEnum
{
@View("/app/data/*")
@LoginRequired(true)
@SeamManagedTransaction(ENABLED)
APP_DATA,
@View("/app/data/public/*")
@LoginRequired(false)
APP_DATA_PUBLIC;
}
I have not really though about the xml format yet, but it would probably use seam-xml. We could also add support for the legacy pages.xml format.
Modules would be able to use this data as follows:
@Inject ViewDataStore data;
public void checkSecurity(String currentViewId, boolean loggedIn)
{
LoginRequired required = data.getDataForPath(currentViewId, LoginRequired.class);
if(required != null)
{
if(required.value() && !loggedIn)
{
throw new NotLoggedInException();
}
}
}
This API will probably need to be tweaked a bit, e.g. I would probably add some producers that let you inject the metadata for the current view directly, but this should be enough to give a general idea of what I am proposing.
I think this approach has a number of things going for it:
It is extensible, so if a 3rd party module or user code needs to store metadata about a view they can use the same mechanism as the official seam modules.
It uses annotations to store the data, which fits in very well with configuration via annotations rather than xml.
It allows for programmatic configuration and does not tie you to a specific configuration method
Does this sound like a good idea?
Stuart
14 years, 3 months
Fwd: Status for CDI/Seam/JSF. July 26 - 30, 2010
by Andersen Max
Hi guys,
any chance someone can help us with JBSEAM-4637 which we also bumped into when trying to verify AS 6/JEE6/Seam/JSF 2 deployment works ? (see below for related details)
/max
Begin forwarded message:
> - Worked on https://jira.jboss.org/browse/JBIDE-6738 (Make sure new JEE Eclipse 3.6 facet/natures are working).
> 1. New JSF Project Wizard works fine with AS 6 & Servelts 3.0. - Wizard/Deployment/Running. All facets are set correct. JBoss 5.0 supports EE 5 only. 5.1 has some limited tech-preview support of EE6. So I think there is no need to enable Servlets 3.0 for AS 5.*
> 2. Didn't find any problems with adding JSF/Seam capabilities to the project with Servlets 3.0/JSF 2.0 either. Deployment works.
> But I failed to run a Seam 2.2.1 project with faces-config 2.0. The reason is https://jira.jboss.org/browse/JBSEAM-4637
> So this is a problem of runtime. But there is one our issue with adding com.sun.facelets.FaceletViewHandler into faces-config 2.0. It's our issue. Reproted to JIRA and fixed.
> See https://jira.jboss.org/browse/JBIDE-6747
14 years, 3 months