Seam SVN: r10544 - in modules/trunk: security and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-21 05:40:40 -0400 (Tue, 21 Apr 2009)
New Revision: 10544
Modified:
modules/trunk/logging/
modules/trunk/security/
Log:
ignores
Property changes on: modules/trunk/logging
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: modules/trunk/security
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
15 years, 7 months
Seam SVN: r10543 - modules/trunk/logging.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-21 05:39:41 -0400 (Tue, 21 Apr 2009)
New Revision: 10543
Removed:
modules/trunk/logging/target/
Log:
oops
15 years, 7 months
Seam SVN: r10542 - in modules/trunk: logging and 15 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-21 05:38:36 -0400 (Tue, 21 Apr 2009)
New Revision: 10542
Added:
modules/trunk/logging/
modules/trunk/logging/pom.xml
modules/trunk/logging/src/
modules/trunk/logging/src/main/
modules/trunk/logging/src/main/java/
modules/trunk/logging/src/main/java/org/
modules/trunk/logging/src/main/java/org/jboss/
modules/trunk/logging/src/main/java/org/jboss/seam/
modules/trunk/logging/src/main/java/org/jboss/seam/log/
modules/trunk/logging/src/main/java/org/jboss/seam/log/JDKProvider.java
modules/trunk/logging/src/main/java/org/jboss/seam/log/Log.java
modules/trunk/logging/src/main/java/org/jboss/seam/log/Log4JProvider.java
modules/trunk/logging/src/main/java/org/jboss/seam/log/LogImpl.java
modules/trunk/logging/src/main/java/org/jboss/seam/log/LogProvider.java
modules/trunk/logging/src/main/java/org/jboss/seam/log/Logging.java
modules/trunk/logging/target/
modules/trunk/logging/target/classes/
modules/trunk/logging/target/classes/org/
modules/trunk/logging/target/classes/org/jboss/
modules/trunk/logging/target/classes/org/jboss/seam/
modules/trunk/logging/target/classes/org/jboss/seam/log/
modules/trunk/parent/
modules/trunk/parent/pom.xml
Modified:
modules/trunk/security/pom.xml
modules/trunk/version-matrix/pom.xml
Log:
added logging module, parent pom, updated version-matrix pom
Added: modules/trunk/logging/pom.xml
===================================================================
--- modules/trunk/logging/pom.xml (rev 0)
+++ modules/trunk/logging/pom.xml 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,22 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>seam-parent</artifactId>
+ <groupId>org.jboss.seam</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-logging</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <name>Seam Logging</name>
+ <dependencies>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ </dependencies>
+</project>
Added: modules/trunk/logging/src/main/java/org/jboss/seam/log/JDKProvider.java
===================================================================
--- modules/trunk/logging/src/main/java/org/jboss/seam/log/JDKProvider.java (rev 0)
+++ modules/trunk/logging/src/main/java/org/jboss/seam/log/JDKProvider.java 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,140 @@
+package org.jboss.seam.log;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author Gavin King
+ *
+ */
+class JDKProvider implements LogProvider
+{
+ private final Logger logger;
+ private final boolean isWrapped;
+
+ JDKProvider(String category, boolean wrapped)
+ {
+ this.logger = Logger.getLogger(category);
+ this.isWrapped = wrapped;
+ }
+
+ private void log(Level level, Object object, Throwable ex)
+ {
+
+ if (logger.isLoggable(level))
+ {
+ Throwable dummyException = new Throwable();
+ StackTraceElement locations[] = dummyException.getStackTrace();
+ String className = "unknown";
+ String methodName = "unknown";
+ int depth = isWrapped ? 3 : 2;
+ if (locations != null && locations.length > depth)
+ {
+ StackTraceElement caller = locations[depth];
+ className = caller.getClassName();
+ methodName = caller.getMethodName();
+ }
+ if (ex == null)
+ {
+ logger.logp(level, className, methodName, String.valueOf(object));
+ }
+ else
+ {
+ logger.logp(level, className, methodName, String.valueOf(object), ex);
+ }
+ }
+
+ }
+
+ public void debug(Object object, Throwable t)
+ {
+ log(Level.FINE, object, t);
+ }
+
+ public void debug(Object object)
+ {
+ log(Level.FINE, object, null);
+ }
+
+ public void error(Object object, Throwable t)
+ {
+ log(Level.SEVERE, object, t);
+ }
+
+ public void error(Object object)
+ {
+ log(Level.SEVERE, object, null);
+ }
+
+ public void fatal(Object object, Throwable t)
+ {
+ log(Level.SEVERE, object, t);
+ }
+
+ public void fatal(Object object)
+ {
+ log(Level.SEVERE, object, null);
+ }
+
+ public void info(Object object, Throwable t)
+ {
+ log(Level.INFO, object, t);
+ }
+
+ public void info(Object object)
+ {
+ log(Level.INFO, object, null);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return logger.isLoggable(Level.FINE);
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return logger.isLoggable(Level.SEVERE);
+ }
+
+ public boolean isFatalEnabled()
+ {
+ return logger.isLoggable(Level.SEVERE);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return logger.isLoggable(Level.INFO);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return logger.isLoggable(Level.FINER);
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return logger.isLoggable(Level.WARNING);
+ }
+
+ public void trace(Object object, Throwable t)
+ {
+ log(Level.FINER, object, t);
+ }
+
+ public void trace(Object object)
+ {
+ log(Level.FINER, object, null);
+ }
+
+ public void warn(Object object, Throwable t)
+ {
+ log(Level.WARNING, object, t);
+ }
+
+ public void warn(Object object)
+ {
+ log(Level.WARNING, object, null);
+ }
+
+}
Added: modules/trunk/logging/src/main/java/org/jboss/seam/log/Log.java
===================================================================
--- modules/trunk/logging/src/main/java/org/jboss/seam/log/Log.java (rev 0)
+++ modules/trunk/logging/src/main/java/org/jboss/seam/log/Log.java 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,86 @@
+package org.jboss.seam.log;
+
+/**
+ * <p>A <code>Log</code> object is used to log messages.
+ * They will be logged in any environment that has setup a logging service
+ * such as Log4J or the standard JDK logging facilities. In fact, this
+ * logging interface is very similar to the other facilities with the
+ * difference that logging methods also take any number of optional
+ * parameters beyond the message object for later interpolation
+ * into the message.</p>
+ *
+ * <p>The idea of using interpolation parameters is very important for
+ * performance reasons in production code. Normally developers write
+ * logging messages similar to this one:
+ * <pre>
+ * log.debug("Started processing of " + obj1 + " with action " + obj2);
+ * </pre>
+ * The problem that arises at runtime in production systems, is that DEBUG
+ * level logging may not be enabled. And even if this logging is going to
+ * be a no-op call, Java must still build the string dynamically that is the
+ * argument to the call. It is the building of this string that can be quite
+ * time consuming. The more complex the objects being concatenated are, the
+ * worse the time penalty incurred is. And this time is completely wasted
+ * since the string may never be used.</p>
+ *
+ * <p>Normally to combat the problem of making this call and building the
+ * string dynamically, the developer uses a conditional statement to invoke
+ * the call only if the corresponding logging level is enabled. So the above
+ * call may end up looking like:
+ * <pre>
+ * if (log.isDebugEnabled())
+ * {
+ * log.debug("Started processing of " + obj1 + " with action " + obj2);
+ * }
+ * </pre>
+ * Ideally, this structure should always be used to avoid the cost of building the
+ * dynamic string (concatenation) and making the unnecessary call. The only
+ * drawback to this is that code can become less readable. In some cases, there
+ * might be more code devoted to logging than the actual behavior required by a
+ * method.</p>
+ *
+ * <p>A cleaner way to do the logging is to use this interface where simple
+ * objects without any concatenation are passed as arguments. Albeit the call
+ * itself may still be a no-op when the logging level is not enabled, this is
+ * still much smaller than the concatenation process with dynamic strings. Each
+ * of the methods defined here will first check to see if the logging level is enabled,
+ * if that feature exists in the underlying logging system. If and only if that logging
+ * level is enabled, will the implementation proceed with concatenation of the strings
+ * and objects passed. So the above code using this interface becomes:
+ * <pre>
+ * log.debug("Started processing of {0} with action {1}, obj1, obj2);
+ * </pre>
+ * </p>
+ *
+ * <p>The interpolation of parameters into the message string are done using
+ * {@link java.text.MessageFormat}. See the documentation on that class for
+ * more ideas of interpolation possibilities. In the above code, <code>obj1</code>
+ * and <code>obj2</code> simply have their <code>toString()</code> methods invoked
+ * to produce a string which is then concatenated.</p>
+ *
+ * @author Gavin King
+ * @author David Allen
+ *
+ */
+public interface Log
+{
+ public boolean isDebugEnabled();
+ public boolean isErrorEnabled();
+ public boolean isFatalEnabled();
+ public boolean isInfoEnabled();
+ public boolean isTraceEnabled();
+ public boolean isWarnEnabled();
+ public void trace(Object object, Object... params);
+ public void trace(Object object, Throwable t, Object... params);
+ public void debug(Object object, Object... params);
+ public void debug(Object object, Throwable t, Object... params);
+ public void info(Object object, Object... params);
+ public void info(Object object, Throwable t, Object... params);
+ public void warn(Object object, Object... params);
+ public void warn(Object object, Throwable t, Object... params);
+ public void error(Object object, Object... params);
+ public void error(Object object, Throwable t, Object... params);
+ public void fatal(Object object, Object... params);
+ public void fatal(Object object, Throwable t, Object... params);
+
+}
\ No newline at end of file
Added: modules/trunk/logging/src/main/java/org/jboss/seam/log/Log4JProvider.java
===================================================================
--- modules/trunk/logging/src/main/java/org/jboss/seam/log/Log4JProvider.java (rev 0)
+++ modules/trunk/logging/src/main/java/org/jboss/seam/log/Log4JProvider.java 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,135 @@
+package org.jboss.seam.log;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ *
+ * @author Gavin King
+ *
+ */
+final class Log4JProvider implements LogProvider
+{
+ private final Logger logger;
+ private final boolean isWrapped;
+
+ private static final String LOG_IMPL_FQCN = LogImpl.class.getName();
+ private static final String LOG_PROVIDER_FQCN = Log4JProvider.class.getName();
+
+ private static final Level TRACE;
+ static
+ {
+ Object trace;
+ try
+ {
+ trace = Level.class.getDeclaredField("TRACE").get(null);
+ }
+ catch (Exception e)
+ {
+ trace = Level.DEBUG;
+ }
+ TRACE = (Level) trace;
+ }
+
+ Log4JProvider(String category, boolean wrapped)
+ {
+ logger = Logger.getLogger(category);
+ isWrapped = wrapped;
+ }
+
+ private String getFQCN()
+ {
+ return isWrapped ? LOG_IMPL_FQCN : LOG_PROVIDER_FQCN;
+ }
+
+ public void debug(Object object)
+ {
+ logger.log(getFQCN(), Level.DEBUG, object, null);
+ }
+
+ public void debug(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.DEBUG, object, t);
+ }
+
+ public void error(Object object)
+ {
+ logger.log(getFQCN(), Level.ERROR, object, null);
+ }
+
+ public void error(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.ERROR, object, t);
+ }
+
+ public void fatal(Object object)
+ {
+ logger.log(getFQCN(), Level.FATAL, object, null);
+ }
+
+ public void fatal(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.FATAL, object, t);
+ }
+
+ public void info(Object object)
+ {
+ logger.log(getFQCN(), Level.INFO, object, null);
+ }
+
+ public void info(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.INFO, object, t);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return logger.isEnabledFor(Level.DEBUG);
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return logger.isEnabledFor(Level.ERROR);
+ }
+
+ public boolean isFatalEnabled()
+ {
+ return logger.isEnabledFor(Level.FATAL);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return logger.isEnabledFor(Level.INFO);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return logger.isEnabledFor(TRACE);
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return logger.isEnabledFor(Level.WARN);
+ }
+
+ public void trace(Object object)
+ {
+ logger.log(getFQCN(), TRACE, object, null);
+ }
+
+ public void trace(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), TRACE, object, t);
+ }
+
+ public void warn(Object object)
+ {
+ logger.log(getFQCN(), Level.WARN, object, null);
+ }
+
+ public void warn(Object object, Throwable t)
+ {
+ logger.log(getFQCN(), Level.WARN, object, t);
+ }
+
+}
Added: modules/trunk/logging/src/main/java/org/jboss/seam/log/LogImpl.java
===================================================================
--- modules/trunk/logging/src/main/java/org/jboss/seam/log/LogImpl.java (rev 0)
+++ modules/trunk/logging/src/main/java/org/jboss/seam/log/LogImpl.java 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,184 @@
+package org.jboss.seam.log;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.text.MessageFormat;
+import java.util.Arrays;
+
+/**
+ *
+ * @author Gavin King
+ *
+ */
+class LogImpl implements Log, Externalizable
+{
+ private transient LogProvider log;
+ private String category;
+
+ public LogImpl()
+ {
+ }
+
+ LogImpl(String category)
+ {
+ this.category = category;
+ this.log = Logging.getLogProvider(category, true);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return log.isDebugEnabled();
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return log.isErrorEnabled();
+ }
+
+ public boolean isFatalEnabled()
+ {
+ return log.isFatalEnabled();
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return log.isInfoEnabled();
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return log.isTraceEnabled();
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return log.isWarnEnabled();
+ }
+
+ public void trace(Object object, Object... params)
+ {
+ if (isTraceEnabled())
+ {
+ log.trace(interpolate(object, params));
+ }
+ }
+
+ public void trace(Object object, Throwable t, Object... params)
+ {
+ if (isTraceEnabled())
+ {
+ log.trace(interpolate(object, params), t);
+ }
+ }
+
+ public void debug(Object object, Object... params)
+ {
+ if (isDebugEnabled())
+ {
+ log.debug(interpolate(object, params));
+ }
+ }
+
+ public void debug(Object object, Throwable t, Object... params)
+ {
+ if (isDebugEnabled())
+ {
+ log.debug(interpolate(object, params), t);
+ }
+ }
+
+ public void info(Object object, Object... params)
+ {
+ if (isInfoEnabled())
+ {
+ log.info(interpolate(object, params));
+ }
+ }
+
+ public void info(Object object, Throwable t, Object... params)
+ {
+ if (isInfoEnabled())
+ {
+ log.info(interpolate(object, params), t);
+ }
+ }
+
+ public void warn(Object object, Object... params)
+ {
+ if (isWarnEnabled())
+ {
+ log.warn(interpolate(object, params));
+ }
+ }
+
+ public void warn(Object object, Throwable t, Object... params)
+ {
+ if (isWarnEnabled())
+ {
+ log.warn(interpolate(object, params), t);
+ }
+ }
+
+ public void error(Object object, Object... params)
+ {
+ if (isErrorEnabled())
+ {
+ log.error(interpolate(object, params));
+ }
+ }
+
+ public void error(Object object, Throwable t, Object... params)
+ {
+ if (isErrorEnabled())
+ {
+ log.error(interpolate(object, params), t);
+ }
+ }
+
+ public void fatal(Object object, Object... params)
+ {
+ if (isFatalEnabled())
+ {
+ log.fatal(interpolate(object, params));
+ }
+ }
+
+ public void fatal(Object object, Throwable t, Object... params)
+ {
+ if (isFatalEnabled())
+ {
+ log.fatal(interpolate(object, params), t);
+ }
+ }
+
+ private Object interpolate(Object message, Object... params)
+ {
+ Object interpolatedMessage = message;
+ if (params.length > 0)
+ {
+ for (int i = 0; i < params.length; i++)
+ {
+ if (params[i].getClass().isArray())
+ {
+ params[i] = Arrays.asList((Object[]) params[i]);
+ }
+ }
+ interpolatedMessage = MessageFormat.format(message.toString(), params);
+ }
+ return interpolatedMessage;
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ category = (String) in.readObject();
+ log = Logging.getLogProvider(category, true);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ out.writeObject(category);
+ }
+
+}
Added: modules/trunk/logging/src/main/java/org/jboss/seam/log/LogProvider.java
===================================================================
--- modules/trunk/logging/src/main/java/org/jboss/seam/log/LogProvider.java (rev 0)
+++ modules/trunk/logging/src/main/java/org/jboss/seam/log/LogProvider.java 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,28 @@
+package org.jboss.seam.log;
+
+/**
+ *
+ * @author Gavin King
+ *
+ */
+public interface LogProvider
+{
+ public void trace(Object object);
+ public void trace(Object object, Throwable t);
+ public void debug(Object object);
+ public void debug(Object object, Throwable t);
+ public void info(Object object);
+ public void info(Object object, Throwable t);
+ public void warn(Object object);
+ public void warn(Object object, Throwable t);
+ public void error(Object object);
+ public void error(Object object, Throwable t);
+ public void fatal(Object object);
+ public void fatal(Object object, Throwable t);
+ public boolean isTraceEnabled();
+ public boolean isDebugEnabled();
+ public boolean isInfoEnabled();
+ public boolean isWarnEnabled();
+ public boolean isErrorEnabled();
+ public boolean isFatalEnabled();
+}
Added: modules/trunk/logging/src/main/java/org/jboss/seam/log/Logging.java
===================================================================
--- modules/trunk/logging/src/main/java/org/jboss/seam/log/Logging.java (rev 0)
+++ modules/trunk/logging/src/main/java/org/jboss/seam/log/Logging.java 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,47 @@
+package org.jboss.seam.log;
+
+/**
+ *
+ * @author Gavin King
+ *
+ */
+public class Logging
+{
+ private static final boolean isLog4JAvailable;
+
+ static
+ {
+ boolean available;
+ try
+ {
+ Class.forName("org.apache.log4j.Logger");
+ available = true;
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ available = false;
+ }
+ isLog4JAvailable = available;
+ }
+
+ public static Log getLog(String category)
+ {
+ return new LogImpl(category);
+ }
+
+ public static Log getLog(Class<?> clazz)
+ {
+ return new LogImpl(clazz.getName());
+ }
+
+ static LogProvider getLogProvider(String category, boolean wrapped)
+ {
+ return isLog4JAvailable ? new Log4JProvider(category, wrapped) : new JDKProvider(category, wrapped);
+ }
+
+ public static LogProvider getLogProvider(Class<?> clazz)
+ {
+ return getLogProvider(clazz.getName(), false);
+ }
+
+}
Added: modules/trunk/parent/pom.xml
===================================================================
--- modules/trunk/parent/pom.xml (rev 0)
+++ modules/trunk/parent/pom.xml 2009-04-21 09:38:36 UTC (rev 10542)
@@ -0,0 +1,206 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-version-matrix</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <name>JBoss Seam</name>
+ <url>http://www.seamframework.org</url>
+
+ <description>
+ JBoss Seam, an Enterprise Java Framework
+ </description>
+
+ <developers>
+ <developer>
+ <name>Pete Muir</name>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ <email>pete.muir(a)jboss.org</email>
+ <organization>JBoss, a division of Red Hat</organization>
+ <url>http://in.relation.to/Bloggers/Pete</url>
+ </developer>
+
+ <developer>
+ <name>Shane Bryzak</name>
+ <organization>JBoss, a division of Red Hat</organization>
+ </developer>
+
+ <developer>
+ <name>Norman Richards</name>
+ <organization>JBoss, a division of Red Hat</organization>
+ </developer>
+
+ <developer>
+ <name>Dan Allen</name>
+ <organization>JBoss, a division of Red Hat</organization>
+ </developer>
+ </developers>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-8</version>
+ <configuration>
+ <tagBase>https://svn.jboss.org/repos/webbeans/ri/tags</tagBase>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ </configuration>
+ </plugin>
+ </plugins>
+ <defaultGoal>package</defaultGoal>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ <addDefaultSpecificationEntries>
+ true
+ </addDefaultSpecificationEntries>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <configuration>
+ <forkMode>once</forkMode>
+ <metadataFile>../target/coverage.em</metadataFile>
+ <outputDirectory>${project.build.directory}/generated-classes</outputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>api-coverage</id>
+ <activation>
+ <property>
+ <name>apiCoverage</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <forkMode>once</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>emma</groupId>
+ <artifactId>emma</artifactId>
+ <version>2.0.5312</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <ciManagement>
+ <system>Hudson</system>
+ <url />
+ </ciManagement>
+
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://jira.jboss.org/browse/JBSEAM</url>
+ </issueManagement>
+
+ <inceptionYear>2008</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>Lesser Gnu Public License, Version 2.1</name>
+ <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
+ </license>
+ </licenses>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam</url>
+ </scm>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
+ </formats>
+ <instrumentation>
+ </instrumentation>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Modified: modules/trunk/security/pom.xml
===================================================================
--- modules/trunk/security/pom.xml 2009-04-21 08:51:33 UTC (rev 10541)
+++ modules/trunk/security/pom.xml 2009-04-21 09:38:36 UTC (rev 10542)
@@ -1,8 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
+ <parent>
+ <artifactId>seam-parent</artifactId>
+ <groupId>org.jboss.seam</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam</groupId>
<artifactId>seam-security</artifactId>
<packaging>jar</packaging>
@@ -13,7 +18,6 @@
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>jsr299-api</artifactId>
- <version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
Modified: modules/trunk/version-matrix/pom.xml
===================================================================
--- modules/trunk/version-matrix/pom.xml 2009-04-21 08:51:33 UTC (rev 10541)
+++ modules/trunk/version-matrix/pom.xml 2009-04-21 09:38:36 UTC (rev 10542)
@@ -51,7 +51,6 @@
<properties>
<seam.version>3.0.0-SNAPSHOT</seam.version>
- <webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
</properties>
<dependencyManagement>
@@ -141,31 +140,7 @@
<artifactId>el-ri</artifactId>
<version>1.2</version>
</dependency>
-
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
- <version>${webbeans.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-core</artifactId>
- <version>${webbeans.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-spi</artifactId>
- <version>${webbeans.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-porting-package</artifactId>
- <version>${webbeans.version}</version>
- </dependency>
-
</dependencies>
</dependencyManagement>
15 years, 7 months
Seam SVN: r10541 - modules/trunk/security/src/main/java/org/jboss/seam/security.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-21 04:51:33 -0400 (Tue, 21 Apr 2009)
New Revision: 10541
Added:
modules/trunk/security/src/main/java/org/jboss/seam/security/RequestSecurityState.java
Modified:
modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
Log:
replace context variables with jsr-299 equivalent
Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java 2009-04-21 05:43:10 UTC (rev 10540)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java 2009-04-21 08:51:33 UTC (rev 10541)
@@ -57,10 +57,6 @@
public static final String ROLES_GROUP = "Roles";
- // Context variables
- private static final String LOGIN_TRIED = "org.jboss.seam.security.loginTried";
- private static final String SILENT_LOGIN = "org.jboss.seam.security.silentLogin";
-
private static final LogProvider log = Logging.getLogProvider(Identity.class);
private Principal principal;
@@ -124,26 +120,15 @@
*/
public boolean tryLogin()
{
- /*Context ctx = null;
- try
+ RequestSecurityState state = manager.getInstanceByType(RequestSecurityState.class);
+
+ if (!authenticating && getPrincipal() == null && credentials.isSet() && !state.isLoginTried())
{
- ctx = manager.getContext(RequestScoped.class);
+ state.setLoginTried(true);
+ quietLogin();
}
- catch (ContextNotActiveException ex)
- {
- // Ignore
- }*/
- // TODO work out some other way of implementing this, perhaps with a thread local?
- /*
- if (!authenticating && getPrincipal() == null && credentials.isSet() &&
- ctx != null && ctx.isActive() && !ctx.get(contextual)isSet(LOGIN_TRIED))
- {
- ctx.set(LOGIN_TRIED, true);
- quietLogin();
- } */
-
- return isLoggedIn();
+ return isLoggedIn();
}
public Principal getPrincipal()
@@ -208,8 +193,9 @@
{
// If authentication has already occurred during this request via a silent login,
// and login() is explicitly called then we still want to raise the LOGIN_SUCCESSFUL event,
- // and then return.
- if (Contexts.isEventContextActive() && Contexts.getEventContext().isSet(SILENT_LOGIN))
+ // and then return.
+ RequestSecurityState state = manager.getInstanceByType(RequestSecurityState.class);
+ if (state.isSilentLogin())
{
manager.fireEvent(new LoggedInEvent(principal));
return "loggedIn";
@@ -266,9 +252,11 @@
if (credentials.isSet())
{
authenticate();
- if (isLoggedIn() && Contexts.isEventContextActive())
+
+ RequestSecurityState state = manager.getInstanceByType(RequestSecurityState.class);
+ if (isLoggedIn())
{
- Contexts.getEventContext().set(SILENT_LOGIN, true);
+ state.setSilentLogin(true);
}
}
}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/RequestSecurityState.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/RequestSecurityState.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/RequestSecurityState.java 2009-04-21 08:51:33 UTC (rev 10541)
@@ -0,0 +1,35 @@
+package org.jboss.seam.security;
+
+import javax.context.RequestScoped;
+
+/**
+ * Contains the authentication state of the current request
+ *
+ * @author Shane Bryzak
+ */
+@RequestScoped
+public class RequestSecurityState
+{
+ private boolean silentLogin;
+ private boolean loginTried;
+
+ public boolean isSilentLogin()
+ {
+ return silentLogin;
+ }
+
+ public void setSilentLogin(boolean silentLogin)
+ {
+ this.silentLogin = silentLogin;
+ }
+
+ public boolean isLoginTried()
+ {
+ return loginTried;
+ }
+
+ public void setLoginTried(boolean loginTried)
+ {
+ this.loginTried = loginTried;
+ }
+}
15 years, 7 months
Seam SVN: r10540 - in modules/trunk/security: src/main/java/org/jboss/seam/security and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-04-21 01:43:10 -0400 (Tue, 21 Apr 2009)
New Revision: 10540
Added:
modules/trunk/security/pom.xml
modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java
modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/
modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java
modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java
Modified:
modules/trunk/security/
modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java
modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java
Log:
start porting security module to jsr-299
Property changes on: modules/trunk/security
___________________________________________________________________
Name: svn:ignore
+ target
Added: modules/trunk/security/pom.xml
===================================================================
--- modules/trunk/security/pom.xml (rev 0)
+++ modules/trunk/security/pom.xml 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-security</artifactId>
+ <packaging>jar</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+ <name>Seam Security</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security;
+
+/**
+ * Authenticator bean type
+ *
+ * @author Shane Bryzak
+ */
+public interface Authenticator
+{
+ void authenticate();
+}
Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java 2009-04-21 05:12:50 UTC (rev 10539)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -105,7 +105,13 @@
password = null;
}
+ @Override
+ public String toString()
+ {
+ return "Credentials[" + username + "]";
+ }
+
/**
* Creates a callback handler that can handle a standard username/password
* callback, using the username and password properties.
Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java 2009-04-21 05:12:50 UTC (rev 10539)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -1,8 +1,5 @@
package org.jboss.seam.security;
-import static org.jboss.seam.ScopeType.SESSION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
import java.io.Serializable;
import java.security.Principal;
import java.security.acl.Group;
@@ -11,39 +8,36 @@
import java.util.Enumeration;
import java.util.List;
+import javax.annotation.Named;
+import javax.context.Context;
+import javax.context.ContextNotActiveException;
+import javax.context.RequestScoped;
+import javax.context.SessionScoped;
+import javax.inject.Current;
+import javax.inject.Initializer;
+import javax.inject.manager.Manager;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginContext;
import javax.security.auth.login.LoginException;
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Create;
-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;
-import org.jboss.seam.core.Expressions;
-import org.jboss.seam.core.Expressions.MethodExpression;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
+import org.jboss.seam.security.events.AlreadyLoggedInEvent;
+import org.jboss.seam.security.events.LoggedInEvent;
+import org.jboss.seam.security.events.LoggedOutEvent;
+import org.jboss.seam.security.events.LoginFailedEvent;
+import org.jboss.seam.security.events.NotAuthorizedEvent;
+import org.jboss.seam.security.events.NotLoggedInEvent;
+import org.jboss.seam.security.events.PostAuthenticateEvent;
+import org.jboss.seam.security.events.PreAuthenticateEvent;
+import org.jboss.seam.security.events.QuietLoginEvent;
import org.jboss.seam.security.permission.PermissionMapper;
-import org.jboss.seam.web.Session;
/**
- * API for authorization and authentication via Seam security. This base
- * implementation supports role-based authorization only. Subclasses may add
- * more sophisticated permissioning mechanisms.
+ * API for authorization and authentication via Seam security.
*
* @author Shane Bryzak
*/
-@Name("org.jboss.seam.security.identity")
-@Scope(SESSION)
-@Install(precedence = BUILT_IN)
-@BypassInterceptors
-@Startup
+@Named
+@SessionScoped
public class Identity implements Serializable
{
private static final long serialVersionUID = 3751659008033189259L;
@@ -68,50 +62,30 @@
private static final String SILENT_LOGIN = "org.jboss.seam.security.silentLogin";
private static final LogProvider log = Logging.getLogProvider(Identity.class);
-
- private Credentials credentials;
-
- private MethodExpression authenticateMethod;
-
+
private Principal principal;
private Subject subject;
- private RememberMe rememberMe;
+ @Current private Manager manager;
+ @Current private Credentials credentials;
+ @Current private RememberMe rememberMe;
+ @Current private PermissionMapper permissionMapper;
private transient ThreadLocal<Boolean> systemOp;
private String jaasConfigName = null;
- private List<String> preAuthenticationRoles = new ArrayList<String>();
+ private List<String> preAuthenticationRoles = new ArrayList<String>();
- private PermissionMapper permissionMapper;
-
/**
* Flag that indicates we are in the process of authenticating
*/
private boolean authenticating = false;
- @Create
+ @Initializer
public void create()
{
subject = new Subject();
-
- if (Contexts.isApplicationContextActive())
- {
- permissionMapper = (PermissionMapper) Component.getInstance(PermissionMapper.class);
- }
-
- if (Contexts.isSessionContextActive())
- {
- rememberMe = (RememberMe) Component.getInstance(RememberMe.class, true);
- credentials = (Credentials) Component.getInstance(Credentials.class);
- }
-
- if (credentials == null)
- {
- // Must have credentials for unit tests
- credentials = new Credentials();
- }
}
public static boolean isSecurityEnabled()
@@ -126,19 +100,8 @@
public static Identity instance()
{
- if ( !Contexts.isSessionContextActive() )
- {
- throw new IllegalStateException("No active session context");
- }
-
- Identity instance = (Identity) Component.getInstance(Identity.class, ScopeType.SESSION);
-
- if (instance == null)
- {
- throw new IllegalStateException("No Identity could be created");
- }
-
- return instance;
+ // TODO - implement
+ return null;
}
/**
@@ -161,29 +124,28 @@
*/
public boolean tryLogin()
{
+ /*Context ctx = null;
+ try
+ {
+ ctx = manager.getContext(RequestScoped.class);
+ }
+ catch (ContextNotActiveException ex)
+ {
+ // Ignore
+ }*/
+
+ // TODO work out some other way of implementing this, perhaps with a thread local?
+ /*
if (!authenticating && getPrincipal() == null && credentials.isSet() &&
- Contexts.isEventContextActive() &&
- !Contexts.getEventContext().isSet(LOGIN_TRIED))
- {
- Contexts.getEventContext().set(LOGIN_TRIED, true);
+ ctx != null && ctx.isActive() && !ctx.get(contextual)isSet(LOGIN_TRIED))
+ {
+ ctx.set(LOGIN_TRIED, true);
quietLogin();
- }
+ } */
return isLoggedIn();
}
-
- @Deprecated
- public boolean isLoggedIn(boolean attemptLogin)
- {
- return attemptLogin ? tryLogin() : isLoggedIn();
- }
-
- public void acceptExternallyAuthenticatedPrincipal(Principal principal) {
- getSubject().getPrincipals().add(principal);
- this.principal = principal;
- }
-
public Principal getPrincipal()
{
return principal;
@@ -211,14 +173,15 @@
{
if ( !isLoggedIn() )
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
+ manager.fireEvent(new NotLoggedInEvent());
+
log.debug(String.format(
"Error evaluating expression [%s] - User not logged in", expr));
throw new NotLoggedInException();
}
else
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
+ manager.fireEvent(new NotAuthorizedEvent());
throw new AuthorizationException(String.format(
"Authorization check failed for expression [%s]", expr));
}
@@ -248,11 +211,11 @@
// and then return.
if (Contexts.isEventContextActive() && Contexts.getEventContext().isSet(SILENT_LOGIN))
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_SUCCESSFUL);
+ manager.fireEvent(new LoggedInEvent(principal));
return "loggedIn";
}
- if (Events.exists()) Events.instance().raiseEvent(EVENT_ALREADY_LOGGED_IN);
+ manager.fireEvent(new AlreadyLoggedInEvent());
return "loggedIn";
}
@@ -265,10 +228,10 @@
if ( log.isDebugEnabled() )
{
- log.debug("Login successful for: " + getCredentials().getUsername());
+ log.debug("Login successful for: " + credentials);
}
- if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_SUCCESSFUL);
+ manager.fireEvent(new LoggedInEvent(principal));
return "loggedIn";
}
catch (LoginException ex)
@@ -277,9 +240,10 @@
if ( log.isDebugEnabled() )
{
- log.debug("Login failed for: " + getCredentials().getUsername(), ex);
+ log.debug("Login failed for: " + credentials, ex);
}
- if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_FAILED, ex);
+
+ manager.fireEvent(new LoginFailedEvent());
}
return null;
@@ -294,7 +258,7 @@
{
try
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_QUIET_LOGIN);
+ manager.fireEvent(new QuietLoginEvent());
// Ensure that we haven't been authenticated as a result of the EVENT_QUIET_LOGIN event
if (!isLoggedIn())
@@ -314,9 +278,7 @@
credentials.invalidate();
}
}
-
-
/**
*
* @throws LoginException
@@ -360,7 +322,7 @@
protected void preAuthenticate()
{
preAuthenticationRoles.clear();
- if (Events.exists()) Events.instance().raiseEvent(EVENT_PRE_AUTHENTICATE);
+ manager.fireEvent(new PreAuthenticateEvent());
}
/**
@@ -394,7 +356,7 @@
credentials.setPassword(null);
- if (Events.exists()) Events.instance().raiseEvent(EVENT_POST_AUTHENTICATE, this);
+ manager.fireEvent(new PostAuthenticateEvent());
}
/**
@@ -424,9 +386,13 @@
{
if (isLoggedIn())
{
+ LoggedOutEvent loggedOutEvent = new LoggedOutEvent(principal);
unAuthenticate();
- Session.instance().invalidate();
- if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGGED_OUT);
+
+ // TODO - invalidate the session
+ // Session.instance().invalidate();
+
+ manager.fireEvent(loggedOutEvent);
}
}
@@ -498,7 +464,7 @@
{
if ( ROLES_GROUP.equals( sg.getName() ) )
{
- Enumeration e = sg.members();
+ Enumeration<?> e = sg.members();
while (e.hasMoreElements())
{
Principal member = (Principal) e.nextElement();
@@ -528,48 +494,17 @@
{
if ( !isLoggedIn() )
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
+ manager.fireEvent(new NotLoggedInEvent());
throw new NotLoggedInException();
}
else
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
+ manager.fireEvent(new NotAuthorizedEvent());
throw new AuthorizationException(String.format(
"Authorization check failed for role [%s]", role));
}
}
}
-
- /**
- * Checks that the current authenticated user has permission for
- * the specified name and action
- *
- * @param name String The permission name
- * @param action String The permission action
- * @param arg Object Optional object parameter used to make a permission decision
- * @throws AuthorizationException if the user does not have the specified permission
- */
- public void checkPermission(String name, String action, Object...arg)
- {
- if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return;
-
- tryLogin();
-
- if ( !hasPermission(name, action, arg) )
- {
- if ( !isLoggedIn() )
- {
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
- throw new NotLoggedInException();
- }
- else
- {
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
- throw new AuthorizationException(String.format(
- "Authorization check failed for permission [%s,%s]", name, action));
- }
- }
- }
public void checkPermission(Object target, String action)
{
@@ -581,41 +516,17 @@
{
if ( !isLoggedIn() )
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
+ manager.fireEvent(new NotLoggedInEvent());
throw new NotLoggedInException();
}
else
{
- if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
+ manager.fireEvent(new NotAuthorizedEvent());
throw new AuthorizationException(String.format(
"Authorization check failed for permission[%s,%s]", target, action));
}
}
}
-
- /**
- * Performs a permission check for the specified name and action
- *
- * @param name String The permission name
- * @param action String The permission action
- * @param arg Object Optional object parameter used to make a permission decision
- * @return boolean True if the user has the specified permission
- */
- public boolean hasPermission(String name, String action, Object...arg)
- {
- if (!securityEnabled) return true;
- if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return true;
- if (permissionMapper == null) return false;
-
- if (arg != null)
- {
- return permissionMapper.resolvePermission(arg[0], action);
- }
- else
- {
- return permissionMapper.resolvePermission(name, action);
- }
- }
public void filterByPermission(Collection collection, String action)
{
@@ -640,79 +551,12 @@
* @return boolean The result of the expression evaluation
*/
protected boolean evaluateExpression(String expr)
- {
- return Expressions.instance().createValueExpression(expr, Boolean.class).getValue();
+ {
+ // TODO - EL evaluation
+ // return Expressions.instance().createValueExpression(expr, Boolean.class).getValue();
+ return false;
}
- /**
- * @see org.jboss.seam.security.Credentials#getUsername()
- */
- @Deprecated
- public String getUsername()
- {
- return credentials.getUsername();
- }
-
- /**
- * @see org.jboss.seam.security.Credentials#setUsername(String)
- */
- @Deprecated
- public void setUsername(String username)
- {
- credentials.setUsername(username);
- }
-
- /**
- * @see org.jboss.seam.security.Credentials#getPassword()
- */
- @Deprecated
- public String getPassword()
- {
- return credentials.getPassword();
- }
-
- /**
- * @see org.jboss.seam.security.Credentials#setPassword(String)
- */
- @Deprecated
- public void setPassword(String password)
- {
- credentials.setPassword(password);
- }
-
- /**
- * @see org.jboss.seam.security.RememberMe#isEnabled()
- */
- @Deprecated
- public boolean isRememberMe()
- {
- return rememberMe != null ? rememberMe.isEnabled() : false;
- }
-
- /**
- * @see org.jboss.seam.security.RememberMe#setEnabled(boolean)
- */
- @Deprecated
- public void setRememberMe(boolean remember)
- {
- if (rememberMe != null) rememberMe.setEnabled(remember);
- }
-
- public Credentials getCredentials()
- {
- return credentials;
- }
-
- public MethodExpression getAuthenticateMethod()
- {
- return authenticateMethod;
- }
-
- public void setAuthenticateMethod(MethodExpression authMethod)
- {
- this.authenticateMethod = authMethod;
- }
-
public String getJaasConfigName()
{
return jaasConfigName;
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,25 @@
+package org.jboss.seam.security;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.interceptor.InterceptorBindingType;
+
+
+/**
+ *
+ * @author Shane Bryzak
+ */
+@Inherited
+@InterceptorBindingType
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface Secure
+{
+
+}
Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java 2009-04-21 05:12:50 UTC (rev 10539)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -8,16 +8,11 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.seam.annotations.intercept.AroundInvoke;
-import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.annotations.intercept.InterceptorType;
+import javax.interceptor.Interceptor;
+
import org.jboss.seam.annotations.security.PermissionCheck;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.annotations.security.RoleCheck;
-import org.jboss.seam.async.AsynchronousInterceptor;
-import org.jboss.seam.intercept.AbstractInterceptor;
-import org.jboss.seam.intercept.InvocationContext;
-import org.jboss.seam.transaction.RollbackInterceptor;
import org.jboss.seam.util.Strings;
/**
@@ -25,9 +20,8 @@
*
* @author Shane Bryzak
*/
-(a)Interceptor(type=InterceptorType.CLIENT,
- around=AsynchronousInterceptor.class, within = RollbackInterceptor.class)
-public class SecurityInterceptor extends AbstractInterceptor implements Serializable
+@Secure @Interceptor
+public class SecurityInterceptor implements Serializable
{
private static final long serialVersionUID = -6567750187000766925L;
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is fired when an already authenticated user attempts to authenticate again
+ *
+ * @author Shane Bryzak
+ */
+public class AlreadyLoggedInEvent
+{
+
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,23 @@
+package org.jboss.seam.security.events;
+
+import java.security.Principal;
+
+/**
+ * This event is raised when user successfully logs in.
+ *
+ * @author Shane Bryzak
+ */
+public class LoggedInEvent
+{
+ private Principal principal;
+
+ public LoggedInEvent(Principal principal)
+ {
+ this.principal = principal;
+ }
+
+ public Principal getPrincipal()
+ {
+ return principal;
+ }
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,23 @@
+package org.jboss.seam.security.events;
+
+import java.security.Principal;
+
+/**
+ * This event is raised just after the user unauthenticates
+ *
+ * @author Shane Bryzak
+ */
+public class LoggedOutEvent
+{
+ private Principal principal;
+
+ public LoggedOutEvent(Principal principal)
+ {
+ this.principal = principal;
+ }
+
+ public Principal getPrincipal()
+ {
+ return principal;
+ }
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is fired when an authentication attempt fails
+ *
+ * @author Shane Bryzak
+ */
+public class LoginFailedEvent
+{
+
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised when the user is not authorized to perform an operation
+ *
+ * @author Shane Bryzak
+ */
+public class NotAuthorizedEvent
+{
+
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised when an unauthenticated user attempts to performed a privileged operation
+ *
+ * @author Shane Bryzak
+ */
+public class NotLoggedInEvent
+{
+
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised just after authentication
+ *
+ * @author Shane Bryzak
+ */
+public class PostAuthenticateEvent
+{
+
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised just before authentication.
+ *
+ * @author Shane Bryzak
+ */
+public class PreAuthenticateEvent
+{
+
+}
Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java 2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised when the user performs a quiet login
+ *
+ * @author Shane Bryzak
+ */
+public class QuietLoginEvent
+{
+
+}
15 years, 7 months
Seam SVN: r10539 - modules/trunk/version-matrix.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-21 01:12:50 -0400 (Tue, 21 Apr 2009)
New Revision: 10539
Added:
modules/trunk/version-matrix/pom.xml
Log:
initial dependency matrix, still very rough
Added: modules/trunk/version-matrix/pom.xml
===================================================================
--- modules/trunk/version-matrix/pom.xml (rev 0)
+++ modules/trunk/version-matrix/pom.xml 2009-04-21 05:12:50 UTC (rev 10539)
@@ -0,0 +1,337 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-version-matrix</artifactId>
+ <packaging>pom</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+
+ <name>Seam Version Matrix</name>
+ <url>http://www.seamframework.org</url>
+
+ <description>
+ A version matrix for Seam modules and examples.
+ </description>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <properties>
+ <seam.version>3.0.0-SNAPSHOT</seam.version>
+ <webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <classifier>jdk15</classifier>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.8.1.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.0.1B</version>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_10</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>1.0_02.CR2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.15.B1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-spi</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-porting-package</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-8</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0-alpha-1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-6</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.0.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-alpha-1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>1.0-alpha-1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-alpha-4</version>
+ <executions>
+ <execution>
+ <id>enforce</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>2.0.9</version>
+ </requireMavenVersion>
+ <requirePluginVersions>
+ <unCheckedPlugins>
+ <unCheckedPlugin>org.apache.maven.plugins:maven-eclipse-plugin</unCheckedPlugin>
+ </unCheckedPlugins>
+ </requirePluginVersions>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam</url>
+ </scm>
+
+</project>
15 years, 7 months
Seam SVN: r10538 - in examples/trunk/booking: src/main and 10 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-21 01:12:15 -0400 (Tue, 21 Apr 2009)
New Revision: 10538
Added:
examples/trunk/booking/pom.xml
examples/trunk/booking/src/main/java/org/
examples/trunk/booking/src/main/java/org/jboss/
examples/trunk/booking/src/main/java/org/jboss/seam/
examples/trunk/booking/src/main/java/org/jboss/seam/example/
examples/trunk/booking/src/main/java/org/jboss/seam/example/booking/
examples/trunk/booking/src/main/resources/
examples/trunk/booking/src/main/webapp/
examples/trunk/booking/src/main/webapp/WEB-INF/
examples/trunk/booking/src/main/webapp/WEB-INF/faces-config.xml
examples/trunk/booking/src/main/webapp/WEB-INF/layout/
examples/trunk/booking/src/main/webapp/WEB-INF/layout/template.xhtml
examples/trunk/booking/src/main/webapp/WEB-INF/web.xml
examples/trunk/booking/src/main/webapp/css/
examples/trunk/booking/src/main/webapp/css/screen.css
examples/trunk/booking/src/main/webapp/home.xhtml
examples/trunk/booking/src/main/webapp/img/
examples/trunk/booking/src/main/webapp/img/bg.gif
examples/trunk/booking/src/main/webapp/img/btn.bg.gif
examples/trunk/booking/src/main/webapp/img/cal-next.png
examples/trunk/booking/src/main/webapp/img/cal-prev.png
examples/trunk/booking/src/main/webapp/img/cnt.bg.gif
examples/trunk/booking/src/main/webapp/img/dtpick.gif
examples/trunk/booking/src/main/webapp/img/hdr.ad.jpg
examples/trunk/booking/src/main/webapp/img/hdr.bar.jpg
examples/trunk/booking/src/main/webapp/img/hdr.bg.gif
examples/trunk/booking/src/main/webapp/img/hdr.title.gif
examples/trunk/booking/src/main/webapp/img/header_line.gif
examples/trunk/booking/src/main/webapp/img/input.bg.gif
examples/trunk/booking/src/main/webapp/img/sdb.bg.gif
examples/trunk/booking/src/main/webapp/img/spinner.gif
examples/trunk/booking/src/main/webapp/img/th.bg.gif
examples/trunk/booking/src/main/webapp/index.html
Modified:
examples/trunk/booking/
Log:
initial (and very sparse) structure for booking example
Property changes on: examples/trunk/booking
___________________________________________________________________
Name: svn:ignore
- build
test-output
dist
exploded-archives
test-build
+ target
Added: examples/trunk/booking/pom.xml
===================================================================
--- examples/trunk/booking/pom.xml (rev 0)
+++ examples/trunk/booking/pom.xml 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>parent</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>seam-booking</artifactId>
+ <packaging>war</packaging>
+ <name>Seam Booking Example</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>seam-booking</finalName>
+ </build>
+
+</project>
Added: examples/trunk/booking/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/booking/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ examples/trunk/booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added: examples/trunk/booking/src/main/webapp/WEB-INF/layout/template.xhtml
===================================================================
--- examples/trunk/booking/src/main/webapp/WEB-INF/layout/template.xhtml (rev 0)
+++ examples/trunk/booking/src/main/webapp/WEB-INF/layout/template.xhtml 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<f:view contentType="text/html"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>JBoss Suites: Seam Framework</title>
+ <link href="#{request.contextPath}/css/screen.css" rel="stylesheet" type="text/css"/>
+ </head>
+ <body>
+ <div id="document">
+ <div id="header">
+ <div id="title"><h:graphicImage value="/img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ <div id="status">
+ <ui:remove>
+ <!--
+ Welcome #{user.name}
+ | <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
+ | <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
+ | <s:link id="logout" action="#{identity.logout}" value="Logout"/>
+ -->
+ </ui:remove>
+ </div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <ui:insert name="sidebar"/>
+ </div>
+ <div id="content">
+ <ui:insert name="content"/>
+ </div>
+ </div>
+ <div id="footer">Created with Web Beans, EJB 3.1, JSF 2.0 and Seam 3.0</div>
+ </div>
+ </body>
+</html>
+</f:view>
Added: examples/trunk/booking/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/booking/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ examples/trunk/booking/src/main/webapp/WEB-INF/web.xml 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Seam Booking Example</display-name>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!--
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ -->
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: examples/trunk/booking/src/main/webapp/css/screen.css
===================================================================
--- examples/trunk/booking/src/main/webapp/css/screen.css (rev 0)
+++ examples/trunk/booking/src/main/webapp/css/screen.css 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1,278 @@
+/* Setup defaults since variable in browsers
+----------------------------------------------- */
+body, div, span, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
+ margin: 0;
+ padding: 0;
+}
+/* Element Defaults
+----------------------------------------------- */
+html {
+ height: 100%;
+ background-color: #DBD4C6;
+}
+img {
+ border: 0;
+}
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: small;
+ line-height: 1.25em;
+ color: #362F2D;
+ position: relative;
+ width: 760px;
+ height: 100%;
+ margin-left: auto;
+ margin-right: auto;
+}
+.label {
+ font-weight: bold;
+ color: #5E5147;
+}
+input {
+ border: 1px solid #C3BBB6;
+ padding: 4px;
+ margin: 5px 0;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+select {
+ border: 1px solid #C3BBB6;
+ padding: 4px;
+ margin: 5px 0;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+ol, ul {
+ margin: 10px 0px 10px 6px;
+}
+li {
+ margin: 10px 12px;
+}
+fieldset {
+ border: 0;
+}
+/* Layout
+----------------------------------------------- */
+#document {
+ padding: 0 1px;
+ background: #fff url(../img/bg.gif) 0 0 repeat-y;
+ float: left;
+ border-bottom: 1px solid #C3BBB6;
+}
+#header {
+ float: left;
+ width: 758px;
+ height: 46px;
+ background: url(../img/hdr.bg.gif) 0 0 repeat-x;
+}
+#container {
+ float: left;
+ width: 758px;
+ background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
+}
+#sidebar {
+ float: left;
+ width: 190px;
+ margin-top: 96px;
+ padding: 20px 10px 0 10px;
+ background: url(../img/sdb.bg.gif) 0 0 no-repeat;
+}
+#content {
+ float: left;
+ width: 548px;
+ margin-top: 75px;
+ padding-top: 5px;
+ background: #fff url(../img/cnt.bg.gif) 0 0 repeat-x;
+}
+#footer {
+ clear: both;
+ margin-top: 40px;
+ float: left;
+ padding: 20px;
+ border-top: 1px solid #C3BBB6;
+ background-color: #fff;
+ width: 718px;
+ text-align: right;
+}
+/* General
+----------------------------------------------- */
+input[type="submit"], input[type="button"] {
+ font-weight: bold;
+ color: #fff;
+ border: 1px solid #5D1414;
+ height: 26px;
+ background: #fff url(../img/btn.bg.gif) 0 0 repeat-x;
+ border-style: none;
+}
+.center {
+ text-align: center;
+}
+.entry {
+ clear: both;
+ padding-top: 10px;
+}
+.entry .label {
+ float: left;
+ padding-right: 5px;
+ font-weight: bold;
+ width: 150px;
+ text-align: right;
+}
+.entry .output {
+ float: right;
+ width: 360px;
+ padding-top: 10px;
+ text-align: left;
+}
+.entry .input {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
+.entry .error {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
+/* Sidebar
+----------------------------------------------- */
+.notes {
+ text-align: center;
+ font-size: small;
+}
+.subnotes {
+ margin-top: 1em;
+ font-size: small;
+}
+.errors {
+ font-size: small;
+ font-weight: bold;
+ text-align: center;
+ color: #600;
+}
+.errors div {
+ text-align: left;
+}
+.errors span {
+ text-align: left;
+}
+.errors input {
+ border: 1px solid #600;
+}
+.errors ul {
+ list-style: none;
+}
+.buttonBox {
+ text-align: center;
+ padding: 5px 0;
+ clear: both;
+}
+#sidebar p {
+ font-size: small;
+ color: #8B7869;
+ line-height: 150%;
+ padding-bottom: 10px;
+}
+#sidebar li {
+ font-size: small;
+ color: #8B7869;
+}
+#sidebar h1 {
+ line-height: normal;
+ font-weight: bold;
+ font-size: small;
+}
+/*
+#sidebar p:hover {
+ color: #362F2D;
+}
+*/
+/* Content
+----------------------------------------------- */
+#content .section {
+ float: left;
+ width: 518px;
+ padding: 15px 15px 0 15px;
+}
+#content .section h1 {
+ font-family: "Trebuchet MS", Arial, sans-serif;
+ line-height: normal;
+ font-weight: normal;
+ font-size: large;
+}
+#content .section p {
+ line-height: 150%;
+ padding: 10px 0;
+ font-size: small;
+}
+#content table {
+ width: 100%;
+ border: 1px solid #D2C9C4;
+ border-collapse: collapse;
+}
+#content table caption {
+ padding-bottom: 6px;
+ text-align: left;
+ font-weight: bold;
+}
+#content table thead th {
+ border-left: 1px solid #D2C9C4;
+ background: #fff url(../img/th.bg.gif) 0 100% repeat-x;
+ border-bottom: 1px solid #D2C9C4;
+ padding: 6px;
+ text-align: left;
+ font-size: small;
+}
+#content table tbody td {
+ border-left: 1px solid #E4DBD5;
+ padding: 4px;
+ border-bottom: 1px solid #D2C9C4;
+ font-size: small;
+}
+#content dt {
+ font-weight: bold;
+ float: left;
+ width: 33%;
+}
+#content dd {
+ padding-left: 10px;
+ float: left;
+ width: 66%;
+}
+#content table.radio {
+ border: 0px;
+}
+#content table.radio tbody tr td {
+ border: 0px;
+ border-left: 0px;
+ border-bottom: 0px;
+}
+/* Header
+----------------------------------------------- */
+#title {
+ float: left;
+ padding: 1px 0 6px 15px;
+}
+#status {
+ color: #C7B299;
+ float: right;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: x-small;
+ text-align: right;
+ padding-top: 14px;
+ padding-right: 15px;
+}
+#status a {
+ color: #C7B299;
+ text-decoration: none;
+}
+/* Homepage Modifications
+----------------------------------------------- */
+#pgHome #container {
+ background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
+}
+#pgHome #sidebar {
+ margin-top: 207px;
+}
+#pgHome #content {
+ margin-top: 183px;
+}
Added: examples/trunk/booking/src/main/webapp/home.xhtml
===================================================================
--- examples/trunk/booking/src/main/webapp/home.xhtml (rev 0)
+++ examples/trunk/booking/src/main/webapp/home.xhtml 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+ <title>JBoss Suites: Seam Framework</title>
+ <link href="css/screen.css" rel="stylesheet" type="text/css"/>
+ </head>
+ <body id="pgHome">
+ <f:view>
+ <div id="document">
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <ui:remove>
+ <h:form id="login">
+ <fieldset>
+ <div>
+ <h:outputLabel id="UsernameLabel" for="username">Login Name</h:outputLabel>
+ <h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
+ <div class="errors"><h:message id="UsernameMessage" for="username"/></div>
+ </div>
+ <div>
+ <h:outputLabel id="PasswordLabel" for="password">Password</h:outputLabel>
+ <h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
+ </div>
+ <div class="errors"><h:messages id="messages" globalOnly="true"/></div>
+ <div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
+ <div class="notes"><!--<h:link id="register" outcome="/register.xhtml" value="Register New User"/>--></div>
+ <div class="subnotes">
+ Or use a demo account:
+ <ul>
+ <li>gavin/foobar</li>
+ <li>demo/demo</li>
+ </ul>
+ </div>
+ </fieldset>
+ </h:form>
+ </ui:remove>
+ </div>
+ <div id="content">
+ <div class="section">
+
+ <h1>About this example application</h1>
+
+ <p>
+ This sample application demonstrates how easy it is to develop stateful web
+ applications using JBoss Seam. Just register, login, and book a room to see
+ Seam in action. Throughout the application you'll see popup links like
+ the ones at the bottom of this page. Click them to see how the application
+ works under the hood.
+ </p>
+
+ <p>
+ Note: Please do NOT enter personal information or your credit card number in
+ this sample application.
+ </p>
+
+ <p>
+ <a href="#" onclick="window.open('exp/introExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What is JBoss Seam?
+ </a>
+ </p>
+
+ <p>
+ <a href="#" onclick="window.open('exp/loginExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when I login?
+ </a>
+ </p>
+
+ </div>
+ </div>
+ </div>
+ <div id="footer">Created with Web Beans, Seam 3 and JSF 2</div>
+ </div>
+ </f:view>
+ </body>
+</html>
Added: examples/trunk/booking/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/cal-next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/header_line.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/spinner.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/src/main/webapp/index.html
===================================================================
--- examples/trunk/booking/src/main/webapp/index.html (rev 0)
+++ examples/trunk/booking/src/main/webapp/index.html 2009-04-21 05:12:15 UTC (rev 10538)
@@ -0,0 +1 @@
+<html><head><meta http-equiv="Refresh" content="0; URL=home.seam"/></head></html>
15 years, 7 months
Seam SVN: r10537 - branches/community/Seam_2_1/seam-gen.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-20 16:44:17 -0400 (Mon, 20 Apr 2009)
New Revision: 10537
Modified:
branches/community/Seam_2_1/seam-gen/build.xml
Log:
add a Seam version reporting command (useful when seam is on PATH)
Modified: branches/community/Seam_2_1/seam-gen/build.xml
===================================================================
--- branches/community/Seam_2_1/seam-gen/build.xml 2009-04-20 20:43:53 UTC (rev 10536)
+++ branches/community/Seam_2_1/seam-gen/build.xml 2009-04-20 20:44:17 UTC (rev 10537)
@@ -1710,6 +1710,10 @@
<echo message="Database password: ${hibernate.connection.password}"/>
</target>
+ <target name="version" depends="init">
+ <echo>Seam version: ${complete.version}</echo>
+ </target>
+
<target name="help" depends="init">
<print file="${seam-gen.dir}/README"/>
</target>
15 years, 7 months
Seam SVN: r10536 - in branches/community/Seam_2_1/seam-gen: resources and 1 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-04-20 16:43:53 -0400 (Mon, 20 Apr 2009)
New Revision: 10536
Modified:
branches/community/Seam_2_1/seam-gen/build.xml
branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev-war.xml
branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev.xml
branches/community/Seam_2_1/seam-gen/resources/datasource-ds.xml
Log:
JBIDE-4183 unbreak tests in JBDS
Modified: branches/community/Seam_2_1/seam-gen/build.xml
===================================================================
--- branches/community/Seam_2_1/seam-gen/build.xml 2009-04-20 12:41:11 UTC (rev 10535)
+++ branches/community/Seam_2_1/seam-gen/build.xml 2009-04-20 20:43:53 UTC (rev 10536)
@@ -875,6 +875,7 @@
</copy>
<replace file="${project.home}/resources/META-INF/persistence-dev.xml">
<replacefilter token="org.hibernate.transaction.JBossTransactionManagerLookup" value="@transactionManagerLookupClass@"/>
+ <replacefilter token="<jta-data-source>java:/" value="<jta-data-source>"/>
</replace>
<copy tofile="${project.home}/resources/WEB-INF/components.xml"
file="${templates.dir}/resources/WEB-INF/components-war-tokenized.xml">
@@ -1068,6 +1069,12 @@
<filterset refid="jdbc"/>
</copy>
+ <replace dir="${project.home}/resources">
+ <include name="*-ds.xml"/>
+ <replacetoken><![CDATA[<use-java-context>true</use-java-context>]]></replacetoken>
+ <replacevalue><![CDATA[<use-java-context>false</use-java-context>]]></replacevalue>
+ </replace>
+
<copy tofile="${project.home}/resources/glassfish-resources-dev.xml"
file="${templates.dir}/resources/glassfish-resources.xml">
<filterset refid="project"/>
Modified: branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev-war.xml
===================================================================
--- branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev-war.xml 2009-04-20 12:41:11 UTC (rev 10535)
+++ branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev-war.xml 2009-04-20 20:43:53 UTC (rev 10536)
@@ -7,7 +7,7 @@
<persistence-unit name="@projectName@" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>@projectName@Datasource</jta-data-source>
+ <jta-data-source>java:/@projectName@Datasource</jta-data-source>
<properties>
<property name="hibernate.dialect" value="@hibernate.dialect@"/>
<property name="hibernate.hbm2ddl.auto" value="@hbm2ddl@"/>
Modified: branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev.xml
===================================================================
--- branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev.xml 2009-04-20 12:41:11 UTC (rev 10535)
+++ branches/community/Seam_2_1/seam-gen/resources/META-INF/persistence-dev.xml 2009-04-20 20:43:53 UTC (rev 10536)
@@ -7,7 +7,7 @@
<persistence-unit name="@projectName@">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <jta-data-source>@projectName@Datasource</jta-data-source>
+ <jta-data-source>java:/@projectName@Datasource</jta-data-source>
<!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
<!--
<jar-file>../../vehicles.jar</jar-file>
Modified: branches/community/Seam_2_1/seam-gen/resources/datasource-ds.xml
===================================================================
--- branches/community/Seam_2_1/seam-gen/resources/datasource-ds.xml 2009-04-20 12:41:11 UTC (rev 10535)
+++ branches/community/Seam_2_1/seam-gen/resources/datasource-ds.xml 2009-04-20 20:43:53 UTC (rev 10536)
@@ -6,7 +6,7 @@
<local-tx-datasource>
<jndi-name>@projectName@Datasource</jndi-name>
- <use-java-context>false</use-java-context>
+ <use-java-context>true</use-java-context>
<connection-url>@jdbcUrl@</connection-url>
<driver-class>@driverClass@</driver-class>
<user-name>@username@</user-name>
15 years, 7 months
Seam SVN: r10535 - branches/community/Seam_2_1/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: titou09
Date: 2009-04-20 08:41:11 -0400 (Mon, 20 Apr 2009)
New Revision: 10535
Modified:
branches/community/Seam_2_1/src/main/org/jboss/seam/persistence/PersistenceProvider.java
Log:
Replaced "javax.annotation.PostConstruct" by "org.jboss.seam.annotations.intercept.PostConstruct"
JBSEAM-4093
Modified: branches/community/Seam_2_1/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- branches/community/Seam_2_1/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2009-04-20 12:34:53 UTC (rev 10534)
+++ branches/community/Seam_2_1/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2009-04-20 12:41:11 UTC (rev 10535)
@@ -1,4 +1,5 @@
package org.jboss.seam.persistence;
+
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.lang.reflect.Method;
@@ -6,7 +7,6 @@
import java.util.HashSet;
import java.util.Set;
-import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;
import javax.persistence.OptimisticLockException;
import javax.transaction.Synchronization;
@@ -18,67 +18,89 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.annotations.intercept.PostConstruct;
+
/**
- * Abstraction layer for persistence providers (JPA implementations).
- * This class provides a working base implementation that can be
- * optimized for performance and non-standardized features by extending
- * and overriding the methods.
+ * Abstraction layer for persistence providers (JPA implementations). This class
+ * provides a working base implementation that can be optimized for performance
+ * and non-standardized features by extending and overriding the methods.
*
- * The methods on this class are a great todo list for the next rev
- * of the JPA spec ;-)
+ * The methods on this class are a great todo list for the next rev of the JPA
+ * spec ;-)
*
* @author Gavin King
* @author Pete Muir
- *
+ *
*/
@Name("org.jboss.seam.persistence.persistenceProvider")
@Scope(ScopeType.STATELESS)
@BypassInterceptors
-@Install(precedence=BUILT_IN, classDependencies="javax.persistence.EntityManager")
+@Install(precedence = BUILT_IN, classDependencies = "javax.persistence.EntityManager")
public class PersistenceProvider
{
- public enum Feature {
+ public enum Feature
+ {
/**
- * Identifies whether this JPA provider supports using a wildcard as the subject of a count query.
- *
- * <p>Here's a count query that uses a wildcard as the subject.</p>
- * <pre>select count(*) from Vehicle v</pre>
- * <p>Per the JPA 1.0 spec, using a wildcard as a subject of a count query is not permitted. Instead,
- * the subject must be the entity or the alias, as in this count query:</p>
- * <pre>select count(v) from Vehicle v</pre>
- * <p>Hibernate supports the wildcard syntax as an vendor extension. Furthermore, Hibernate produces
- * an invalid SQL query when using the compliant subject if the entity has a composite primary key.
- * Therefore, we prefer to use the wildcard syntax if it is supported.</p>
+ * Identifies whether this JPA provider supports using a wildcard as the
+ * subject of a count query.
+ *
+ * <p>
+ * Here's a count query that uses a wildcard as the subject.
+ * </p>
+ *
+ * <pre>
+ * select count(*) from Vehicle v
+ * </pre>
+ * <p>
+ * Per the JPA 1.0 spec, using a wildcard as a subject of a count query is
+ * not permitted. Instead, the subject must be the entity or the alias, as
+ * in this count query:
+ * </p>
+ *
+ * <pre>
+ * select count(v) from Vehicle v
+ * </pre>
+ * <p>
+ * Hibernate supports the wildcard syntax as an vendor extension.
+ * Furthermore, Hibernate produces an invalid SQL query when using the
+ * compliant subject if the entity has a composite primary key. Therefore,
+ * we prefer to use the wildcard syntax if it is supported.
+ * </p>
*/
WILDCARD_AS_COUNT_QUERY_SUBJECT
}
-
+
protected Set<Feature> featureSet = new HashSet<Feature>();
-
- @PostConstruct // @Create method not called on stateless components
- public void init() {}
+ @PostConstruct
+ // @Create method not called on stateless components
+ public void init()
+ {
+ }
+
/**
- * Indicate whether this JPA provider supports the feature defined by the provided Feature enum value.
+ * Indicate whether this JPA provider supports the feature defined by the
+ * provided Feature enum value.
*/
- public boolean supportsFeature(Feature feature) {
- return featureSet.contains(feature);
+ public boolean supportsFeature(Feature feature)
+ {
+ return featureSet.contains(feature);
}
-
+
/**
- * Set the flush mode to manual-only flushing. Called when
- * an atomic persistence context is required.
+ * Set the flush mode to manual-only flushing. Called when an atomic
+ * persistence context is required.
*/
public void setFlushModeManual(EntityManager entityManager)
{
throw new UnsupportedOperationException("Use of FlushMode.MANUAL requires Hibernate as the persistence provider. Please use Hibernate, a custom persistenceProvider, or remove the MANUAL flush mode setting.");
}
-
+
/**
* <p>
* Set the FlushMode the persistence contexts should use during rendering by
- * calling {@link PersistenceContexts#changeFlushMode(FlushModeType, true)}. The
- * actual changing of the flush mode is handled by the
+ * calling {@link PersistenceContexts#changeFlushMode(FlushModeType, true)}.
+ * The actual changing of the flush mode is handled by the
* {@link PersistenceContexts} instance. The boolean argument should be true
* to indicate that this is a temporary change and that the old flush mode
* should be restored after render.
@@ -90,30 +112,31 @@
* specification, the default implementation will perform no operation.
* </p>
*/
- public void setRenderFlushMode() {
+ public void setRenderFlushMode()
+ {
// no-op in default implementation
}
/**
- * Does the persistence context have unflushed changes? If
- * it does not, persistence context replication can be
- * optimized.
+ * Does the persistence context have unflushed changes? If it does not,
+ * persistence context replication can be optimized.
*
* @return true to indicate that there are unflushed changes
*/
public boolean isDirty(EntityManager entityManager)
{
- return true; //best we can do!
+ return true; // best we can do!
}
/**
* Get the value of the entity identifier attribute.
*
- * @param bean a managed entity instance
+ * @param bean
+ * a managed entity instance
*/
public Object getId(Object bean, EntityManager entityManager)
{
- return Entity.forBean( bean ).getIdentifier(bean);
+ return Entity.forBean(bean).getIdentifier(bean);
}
/**
@@ -122,21 +145,23 @@
* @param bean
* @param entityManager
*
- * @throws IllegalArgumentException if the passed object is not an entity
+ * @throws IllegalArgumentException
+ * if the passed object is not an entity
*/
public String getName(Object bean, EntityManager entityManager) throws IllegalArgumentException
{
- return Entity.forBean( bean ).getName();
+ return Entity.forBean(bean).getName();
}
/**
* Get the value of the entity version attribute.
*
- * @param bean a managed entity instance
+ * @param bean
+ * a managed entity instance
*/
public Object getVersion(Object bean, EntityManager entityManager)
{
- return Entity.forBean( bean ).getVersion(bean);
+ return Entity.forBean(bean).getVersion(bean);
}
public void checkVersion(Object bean, EntityManager entityManager, Object oldVersion, Object version)
@@ -144,21 +169,21 @@
boolean equal;
if (oldVersion instanceof Date)
{
- equal = ( (Date) oldVersion ).getTime() == ( (Date) version ).getTime();
+ equal = ((Date) oldVersion).getTime() == ((Date) version).getTime();
}
else
{
equal = oldVersion.equals(version);
}
- if ( !equal )
+ if (!equal)
{
throw new OptimisticLockException("Current database version number does not match passivated version number");
}
}
+
/**
- * Enable a Filter. This is here just especially for Hibernate,
- * since we well know that other products don't have such cool
- * features.
+ * Enable a Filter. This is here just especially for Hibernate, since we well
+ * know that other products don't have such cool features.
*/
public void enableFilter(Filter filter, EntityManager entityManager)
{
@@ -170,14 +195,14 @@
*/
public boolean registerSynchronization(Synchronization sync, EntityManager entityManager)
{
- return false; //best we can do!
+ return false; // best we can do!
}
public static PersistenceProvider instance()
{
return (PersistenceProvider) Component.getInstance(PersistenceProvider.class, ScopeType.STATELESS);
}
-
+
/**
* Wrap the delegate before returning it to the application
*/
@@ -185,17 +210,20 @@
{
return delegate;
}
+
/**
* Wrap the entityManager before returning it to the application
*/
- public EntityManager proxyEntityManager(EntityManager entityManager) {
+ public EntityManager proxyEntityManager(EntityManager entityManager)
+ {
return new EntityManagerProxy(entityManager);
}
/**
* Returns the class of an entity bean instance
*
- * @param bean The entity bean instance
+ * @param bean
+ * The entity bean instance
* @return The class of the entity bean
*/
public Class getBeanClass(Object bean)
@@ -232,7 +260,7 @@
@Deprecated
public Method getPostLoadMethod(Class beanClass)
{
- return Entity.forClass(beanClass).getPostLoadMethod();
+ return Entity.forClass(beanClass).getPostLoadMethod();
}
@Deprecated
@@ -247,6 +275,4 @@
return Entity.forClass(beanClass).getPreUpdateMethod();
}
-
-
}
15 years, 7 months