Seam SVN: r12650 - modules/faces/trunk/docs/reference.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-04-26 17:52:37 -0400 (Mon, 26 Apr 2010)
New Revision: 12650
Modified:
modules/faces/trunk/docs/reference/pom.xml
Log:
override source directory to use src/main/docbook structure
Modified: modules/faces/trunk/docs/reference/pom.xml
===================================================================
--- modules/faces/trunk/docs/reference/pom.xml 2010-04-26 21:04:54 UTC (rev 12649)
+++ modules/faces/trunk/docs/reference/pom.xml 2010-04-26 21:52:37 UTC (rev 12650)
@@ -43,6 +43,7 @@
</dependency>
</dependencies>
<configuration>
+ <sourceDirectory>${project.basedir}/src/main/docbook</sourceDirectory>
<sourceDocumentName>master.xml</sourceDocumentName>
<masterTranslation>en-US</masterTranslation>
<imageResource>
14 years, 8 months
Seam SVN: r12649 - modules/faces/trunk/docs/reference.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-26 17:04:54 -0400 (Mon, 26 Apr 2010)
New Revision: 12649
Modified:
modules/faces/trunk/docs/reference/pom.xml
Log:
* Added distributionManagement, removed dependency on faces-parent
Modified: modules/faces/trunk/docs/reference/pom.xml
===================================================================
--- modules/faces/trunk/docs/reference/pom.xml 2010-04-26 19:29:49 UTC (rev 12648)
+++ modules/faces/trunk/docs/reference/pom.xml 2010-04-26 21:04:54 UTC (rev 12649)
@@ -1,99 +1,105 @@
<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/xsd/maven-4.0.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.seam.faces</groupId>
- <artifactId>seam-faces-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam.faces</groupId>
+ <artifactId>seam-faces-reference-guide</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>Seam Faces Module Reference Guide</name>
- <groupId>org.jboss.seam.faces</groupId>
- <artifactId>seam-faces-reference-guide</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <packaging>jdocbook</packaging>
- <name>Seam Faces Module Reference Guide</name>
+ <properties>
+ <mpjdocbook.version>2.2.0</mpjdocbook.version>
+ <pdf.name>${project.artifactId}.pdf</pdf.name>
+ </properties>
- <properties>
- <mpjdocbook.version>2.2.0</mpjdocbook.version>
- <pdf.name>${project.artifactId}.pdf</pdf.name>
- </properties>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- </pluginRepository>
- </pluginRepositories>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>${mpjdocbook.version}</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <masterTranslation>en-US</masterTranslation>
+ <imageResource>
+ <directory>${project.basedir}/src/main/docbook/en-US</directory>
+ <includes>
+ <include>images/*.png</include>
+ <include>images/*.jpg</include>
+ </includes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath://xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${pdf.name}</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath://xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath://xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <transformerParameters>
+ <property>
+ <name>javax.xml.parsers.DocumentBuilderFactory</name>
+ <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.parsers.SAXParserFactory</name>
+ <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
+ </property>
+ </transformerParameters>
+ <localeSeparator>-</localeSeparator>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>${mpjdocbook.version}</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <masterTranslation>en-US</masterTranslation>
- <imageResource>
- <directory>${project.basedir}/src/main/docbook/en-US</directory>
- <includes>
- <include>images/*.png</include>
- <include>images/*.jpg</include>
- </includes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath://xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${pdf.name}</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath://xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath://xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <transformerParameters>
- <property>
- <name>javax.xml.parsers.DocumentBuilderFactory</name>
- <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
- </property>
- <property>
- <name>javax.xml.parsers.SAXParserFactory</name>
- <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
- </property>
- </transformerParameters>
- <localeSeparator>-</localeSeparator>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <distributionManagement>
+ <repository>
+ <id>oss.sonatype.org/jboss-staging</id>
+ <name>Sonatype Nexus Maven Repository</name>
+ <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
+ </repository>
+ <snapshotRepository>
+ <id>oss.sonatype.org/jboss-snapshots</id>
+ <name>Sonatype Nexus Snapshot Repository</name>
+ <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
</project>
14 years, 8 months
Seam SVN: r12648 - branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-26 15:29:49 -0400 (Mon, 26 Apr 2010)
New Revision: 12648
Modified:
branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/InterpolatorTest.java
Log:
JBPAPP-4006 - fixed the InterpolatorTest
Modified: branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/InterpolatorTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/InterpolatorTest.java 2010-04-26 13:32:53 UTC (rev 12647)
+++ branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/InterpolatorTest.java 2010-04-26 19:29:49 UTC (rev 12648)
@@ -57,9 +57,10 @@
try
{
interpolator.interpolate("hello #{", (Object) null);
+ Assert.fail("interpolator not raised an exception");
} catch (Throwable t)
{
- Assert.fail("interpolator raised an exception");
+
}
}
14 years, 8 months
Seam SVN: r12647 - in branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam: log and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-26 09:32:53 -0400 (Mon, 26 Apr 2010)
New Revision: 12647
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/log/LogImpl.java
Log:
JBPAPP-4006
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java 2010-04-26 13:07:26 UTC (rev 12646)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java 2010-04-26 13:32:53 UTC (rev 12647)
@@ -73,125 +73,119 @@
{
StringTokenizer tokens = new StringTokenizer(string, "#{}", true);
StringBuilder builder = new StringBuilder(string.length());
- try
+
+ while (tokens.hasMoreTokens())
{
- while (tokens.hasMoreTokens())
+ String tok = tokens.nextToken();
+
+ if ("#".equals(tok) && tokens.hasMoreTokens())
{
- String tok = tokens.nextToken();
+ String nextTok = tokens.nextToken();
- if ("#".equals(tok) && tokens.hasMoreTokens())
+ while (nextTok.equals("#") && tokens.hasMoreTokens())
{
- String nextTok = tokens.nextToken();
-
- while (nextTok.equals("#") && tokens.hasMoreTokens())
+ builder.append(tok);
+ nextTok = tokens.nextToken();
+ }
+
+ if ("{".equals(nextTok))
+ {
+ String expression = "#{" + tokens.nextToken() + "}";
+ try
{
- builder.append(tok);
- nextTok = tokens.nextToken();
+ Object value = Expressions.instance().createValueExpression(expression).getValue();
+ if (value != null)
+ builder.append(value);
}
+ catch (Exception e)
+ {
+ log.debug("exception interpolating string: " + string, e);
+ }
+ tokens.nextToken(); // the trailing "}"
- if ("{".equals(nextTok))
+ }
+ else if (nextTok.equals("#"))
+ {
+ // could be trailing #
+ builder.append("#");
+
+ }
+ else
+ {
+ int index;
+ try
{
- String expression = "#{" + tokens.nextToken() + "}";
- try
+ index = Integer.parseInt(nextTok.substring(0, 1));
+ if (index >= params.length)
{
- Object value = Expressions.instance().createValueExpression(expression).getValue();
- if (value != null)
- builder.append(value);
+ // log.warn("parameter index out of bounds: " + index +
+ // " in: " + string);
+ builder.append("#").append(nextTok);
}
- catch (Exception e)
+ else
{
- log.debug("exception interpolating string: " + string, e);
+ builder.append(params[index]).append(nextTok.substring(1));
}
- tokens.nextToken(); // the trailing "}"
-
}
- else if (nextTok.equals("#"))
+ catch (NumberFormatException nfe)
{
- // could be trailing #
- builder.append("#");
-
+ builder.append("#").append(nextTok);
}
- else
- {
- int index;
- try
- {
- index = Integer.parseInt(nextTok.substring(0, 1));
- if (index >= params.length)
- {
- // log.warn("parameter index out of bounds: " + index +
- // " in: " + string);
- builder.append("#").append(nextTok);
- }
- else
- {
- builder.append(params[index]).append(nextTok.substring(1));
- }
- }
- catch (NumberFormatException nfe)
- {
- builder.append("#").append(nextTok);
- }
- }
}
- else if ("{".equals(tok))
+ }
+ else if ("{".equals(tok))
+ {
+ StringBuilder expr = new StringBuilder();
+
+ expr.append(tok);
+ int level = 1;
+
+ while (tokens.hasMoreTokens())
{
- StringBuilder expr = new StringBuilder();
+ String nextTok = tokens.nextToken();
+ expr.append(nextTok);
- expr.append(tok);
- int level = 1;
-
- while (tokens.hasMoreTokens())
+ if (nextTok.equals("{"))
{
- String nextTok = tokens.nextToken();
- expr.append(nextTok);
-
- if (nextTok.equals("{"))
+ ++level;
+ }
+ else if (nextTok.equals("}"))
+ {
+ if (--level == 0)
{
- ++level;
- }
- else if (nextTok.equals("}"))
- {
- if (--level == 0)
+ try
{
- try
+ if (params.length == 0)
{
- if (params.length == 0)
- {
- builder.append(expr.toString());
- }
- else
- {
- String value = new MessageFormat(expr.toString(), Locale.instance()).format(params);
- builder.append(value);
- }
+ builder.append(expr.toString());
}
- catch (Exception e)
+ else
{
- // if it is a bad message, use the expression itself
- builder.append(expr);
+ String value = new MessageFormat(expr.toString(), Locale.instance()).format(params);
+ builder.append(value);
}
- expr = null;
- break;
}
+ catch (Exception e)
+ {
+ // if it is a bad message, use the expression itself
+ builder.append(expr);
+ }
+ expr = null;
+ break;
}
}
-
- if (expr != null)
- {
- builder.append(expr);
- }
}
- else
+
+ if (expr != null)
{
- builder.append(tok);
+ builder.append(expr);
}
}
+ else
+ {
+ builder.append(tok);
+ }
}
- catch (Exception e)
- {
- log.debug("exception interpolating string: " + string, e);
- }
return builder.toString();
}
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/log/LogImpl.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/log/LogImpl.java 2010-04-26 13:07:26 UTC (rev 12646)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/log/LogImpl.java 2010-04-26 13:32:53 UTC (rev 12647)
@@ -136,11 +136,23 @@
}
}
+ @SuppressWarnings("finally")
private Object interpolate(Object object, Object... params)
{
if (object instanceof String)
{
- return Interpolator.instance().interpolate( (String) object, params );
+ try
+ {
+ object = Interpolator.instance().interpolate((String) object, params);
+ }
+ catch (Exception e)
+ {
+ log.error("exception interpolating string: " + object, e);
+ }
+ finally
+ {
+ return object;
+ }
}
else
{
14 years, 8 months
Seam SVN: r12646 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-26 09:07:26 -0400 (Mon, 26 Apr 2010)
New Revision: 12646
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java
Log:
fixed formatting
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java 2010-04-26 12:51:01 UTC (rev 12645)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/core/Interpolator.java 2010-04-26 13:07:26 UTC (rev 12646)
@@ -24,135 +24,176 @@
@BypassInterceptors
@Scope(STATELESS)
@Name("org.jboss.seam.core.interpolator")
-@Install(precedence=BUILT_IN)
-public class Interpolator
+@Install(precedence = BUILT_IN)
+public class Interpolator
{
-
- private static final LogProvider log = Logging.getLogProvider(Interpolator.class);
-
- public static Interpolator instance()
- {
- if (Contexts.isApplicationContextActive()) {
- return (Interpolator) Component.getInstance(Interpolator.class, ScopeType.APPLICATION);
- } else {
- return new Interpolator(); //for unit testing
- }
- }
-
- /**
- * Replace all EL expressions in the form #{...} with their evaluated
- * values.
- *
- * @param string a template
- * @return the interpolated string
- */
- public String interpolate(String string, Object... params)
- {
- if (params == null) {
- params = new Object[0];
- }
-
- if (params.length>10) {
- throw new IllegalArgumentException("more than 10 parameters");
- }
-
- if (string.indexOf('#')>=0 || string.indexOf('{')>=0) {
- string = interpolateExpressions(string, params);
- }
-
- return string;
- }
-
- private String interpolateExpressions(String string, Object... params)
- {
- StringTokenizer tokens = new StringTokenizer(string, "#{}", true);
- StringBuilder builder = new StringBuilder(string.length());
- try {
- while (tokens.hasMoreTokens()) {
- String tok = tokens.nextToken();
-
- if ("#".equals(tok) && tokens.hasMoreTokens()) {
- String nextTok = tokens.nextToken();
-
- while (nextTok.equals("#") && tokens.hasMoreTokens()) {
- builder.append(tok);
- nextTok = tokens.nextToken();
- }
-
- if ("{".equals(nextTok)) {
- String expression = "#{" + tokens.nextToken() + "}";
- try {
- Object value = Expressions.instance().createValueExpression(expression).getValue();
- if (value!=null) builder.append(value);
- } catch (Exception e) {
- log.debug("exception interpolating string: " + string, e);
+
+ private static final LogProvider log = Logging.getLogProvider(Interpolator.class);
+
+ public static Interpolator instance()
+ {
+ if (Contexts.isApplicationContextActive())
+ {
+ return (Interpolator) Component.getInstance(Interpolator.class, ScopeType.APPLICATION);
+ }
+ else
+ {
+ return new Interpolator(); // for unit testing
+ }
+ }
+
+ /**
+ * Replace all EL expressions in the form #{...} with their evaluated values.
+ *
+ * @param string
+ * a template
+ * @return the interpolated string
+ */
+ public String interpolate(String string, Object... params)
+ {
+ if (params == null)
+ {
+ params = new Object[0];
+ }
+
+ if (params.length > 10)
+ {
+ throw new IllegalArgumentException("more than 10 parameters");
+ }
+
+ if (string.indexOf('#') >= 0 || string.indexOf('{') >= 0)
+ {
+ string = interpolateExpressions(string, params);
+ }
+
+ return string;
+ }
+
+ private String interpolateExpressions(String string, Object... params)
+ {
+ StringTokenizer tokens = new StringTokenizer(string, "#{}", true);
+ StringBuilder builder = new StringBuilder(string.length());
+ try
+ {
+ while (tokens.hasMoreTokens())
+ {
+ String tok = tokens.nextToken();
+
+ if ("#".equals(tok) && tokens.hasMoreTokens())
+ {
+ String nextTok = tokens.nextToken();
+
+ while (nextTok.equals("#") && tokens.hasMoreTokens())
+ {
+ builder.append(tok);
+ nextTok = tokens.nextToken();
+ }
+
+ if ("{".equals(nextTok))
+ {
+ String expression = "#{" + tokens.nextToken() + "}";
+ try
+ {
+ Object value = Expressions.instance().createValueExpression(expression).getValue();
+ if (value != null)
+ builder.append(value);
+ }
+ catch (Exception e)
+ {
+ log.debug("exception interpolating string: " + string, e);
+ }
+ tokens.nextToken(); // the trailing "}"
+
+ }
+ else if (nextTok.equals("#"))
+ {
+ // could be trailing #
+ builder.append("#");
+
+ }
+ else
+ {
+ int index;
+ try
+ {
+ index = Integer.parseInt(nextTok.substring(0, 1));
+ if (index >= params.length)
+ {
+ // log.warn("parameter index out of bounds: " + index +
+ // " in: " + string);
+ builder.append("#").append(nextTok);
+ }
+ else
+ {
+ builder.append(params[index]).append(nextTok.substring(1));
+ }
+ }
+ catch (NumberFormatException nfe)
+ {
+ builder.append("#").append(nextTok);
+ }
+ }
+ }
+ else if ("{".equals(tok))
+ {
+ StringBuilder expr = new StringBuilder();
+
+ expr.append(tok);
+ int level = 1;
+
+ while (tokens.hasMoreTokens())
+ {
+ String nextTok = tokens.nextToken();
+ expr.append(nextTok);
+
+ if (nextTok.equals("{"))
+ {
+ ++level;
+ }
+ else if (nextTok.equals("}"))
+ {
+ if (--level == 0)
+ {
+ try
+ {
+ if (params.length == 0)
+ {
+ builder.append(expr.toString());
+ }
+ else
+ {
+ String value = new MessageFormat(expr.toString(), Locale.instance()).format(params);
+ builder.append(value);
+ }
}
- tokens.nextToken(); // the trailing "}"
-
- } else if (nextTok.equals("#")) {
- // could be trailing #
- builder.append("#");
-
- } else {
- int index;
- try {
- index = Integer.parseInt(nextTok.substring(0, 1));
- if (index>=params.length) {
- //log.warn("parameter index out of bounds: " + index + " in: " + string);
- builder.append("#").append(nextTok);
- } else {
- builder.append(params[index]).append(nextTok.substring(1));
- }
- } catch (NumberFormatException nfe) {
- builder.append("#").append(nextTok);
+ catch (Exception e)
+ {
+ // if it is a bad message, use the expression itself
+ builder.append(expr);
}
- }
- } else if ("{".equals(tok)) {
- StringBuilder expr = new StringBuilder();
-
- expr.append(tok);
- int level = 1;
-
- while (tokens.hasMoreTokens()) {
- String nextTok = tokens.nextToken();
- expr.append(nextTok);
-
- if (nextTok.equals("{")) {
- ++level;
- } else if (nextTok.equals("}")) {
- if (--level == 0) {
- try {
- if (params.length == 0)
- {
- builder.append(expr.toString());
- }
- else
- {
- String value = new MessageFormat(expr.toString(), Locale.instance()).format(params);
- builder.append(value);
- }
- } catch (Exception e) {
- // if it is a bad message, use the expression itself
- builder.append(expr);
- }
- expr = null;
- break;
- }
- }
- }
-
- if (expr != null) {
- builder.append(expr);
- }
- } else {
- builder.append(tok);
- }
+ expr = null;
+ break;
+ }
+ }
+ }
+
+ if (expr != null)
+ {
+ builder.append(expr);
+ }
}
- } catch (Exception e) {
- log.debug("exception interpolating string: " + string, e);
- }
-
- return builder.toString();
- }
-
+ else
+ {
+ builder.append(tok);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.debug("exception interpolating string: " + string, e);
+ }
+
+ return builder.toString();
+ }
+
}
14 years, 8 months
Seam SVN: r12645 - modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-26 08:51:01 -0400 (Mon, 26 Apr 2010)
New Revision: 12645
Added:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/AbstractListener.java
Modified:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
Log:
cleanup to abstract listener superclass
Added: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/AbstractListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/AbstractListener.java (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/AbstractListener.java 2010-04-26 12:51:01 UTC (rev 12645)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.faces.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.weld.extensions.beanManager.BeanManagerAware;
+
+/**
+ * Superclass for event listeners
+ *
+ * @author Nicklas Karlsson
+ *
+ * @param <T> Listener class
+ */
+public class AbstractListener<T> extends BeanManagerAware
+{
+ @SuppressWarnings("unchecked")
+ protected List<T> getListeners(Class<? extends T>... classes)
+ {
+ List<T> listeners = new ArrayList<T>();
+ for (Class<? extends T> clazz : classes) {
+ Bean<? extends T> bean = (Bean<? extends T>) getBeanManager().getBeans(clazz).iterator().next();
+ CreationalContext<? extends T> context = getBeanManager().createCreationalContext(bean);
+ T listener = (T) getBeanManager().getReference(bean, clazz, context);
+ listeners.add(listener);
+ }
+ return listeners;
+ }
+
+}
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java 2010-04-26 11:35:27 UTC (rev 12644)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingPhaseListener.java 2010-04-26 12:51:01 UTC (rev 12645)
@@ -21,18 +21,12 @@
*/
package org.jboss.seam.faces.event;
-import java.util.ArrayList;
import java.util.List;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
-import org.jboss.weld.extensions.beanManager.BeanManagerAware;
-
/**
* Provide CDI injection to PhaseListener artifacts by delegating through this
* class.
@@ -40,7 +34,7 @@
* @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
*
*/
-public class DelegatingPhaseListener extends BeanManagerAware implements PhaseListener
+public class DelegatingPhaseListener extends AbstractListener<PhaseListener> implements PhaseListener
{
private static final long serialVersionUID = 8454616175394888259L;
@@ -83,16 +77,7 @@
@SuppressWarnings("unchecked")
private List<PhaseListener> getPhaseListeners()
{
- BeanManager manager = getBeanManager();
- List<PhaseListener> result = new ArrayList<PhaseListener>();
-
- Bean<PhaseEventBridge> bean = (Bean<PhaseEventBridge>) manager.getBeans(PhaseEventBridge.class).iterator().next();
- CreationalContext<PhaseEventBridge> context = manager.createCreationalContext(bean);
- PhaseEventBridge listener = (PhaseEventBridge) manager.getReference(bean, PhaseEventBridge.class, context);
-
- result.add(listener);
-
- return result;
+ return getListeners(PhaseEventBridge.class);
}
}
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java 2010-04-26 11:35:27 UTC (rev 12644)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/DelegatingSystemEventListener.java 2010-04-26 12:51:01 UTC (rev 12645)
@@ -21,18 +21,12 @@
*/
package org.jboss.seam.faces.event;
-import java.util.ArrayList;
import java.util.List;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
-import org.jboss.weld.extensions.beanManager.BeanManagerAware;
-
/**
* Provide CDI injection to SystemEventListener artifacts by delegating through
* this class.
@@ -40,7 +34,7 @@
* @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
*
*/
-public class DelegatingSystemEventListener extends BeanManagerAware implements SystemEventListener
+public class DelegatingSystemEventListener extends AbstractListener<SystemEventListener> implements SystemEventListener
{
public boolean isListenerForSource(final Object source)
@@ -62,20 +56,7 @@
@SuppressWarnings("unchecked")
private List<SystemEventListener> getEventListeners()
{
- List<SystemEventListener> result = new ArrayList<SystemEventListener>();
- BeanManager manager = getBeanManager();
- if (manager == null)
- {
- return result;
- }
-
- Bean<SystemEventBridge> bean = (Bean<SystemEventBridge>) manager.getBeans(SystemEventBridge.class).iterator().next();
- CreationalContext<SystemEventBridge> context = manager.createCreationalContext(bean);
- SystemEventBridge listener = (SystemEventBridge) manager.getReference(bean, SystemEventBridge.class, context);
-
- result.add(listener);
-
- return result;
+ return getListeners(SystemEventBridge.class);
}
}
14 years, 8 months
Seam SVN: r12644 - in modules: faces/branches and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-26 07:35:27 -0400 (Mon, 26 Apr 2010)
New Revision: 12644
Added:
modules/faces/branches/lincolnthree/
Removed:
modules/branches/lincolnthree/
Log:
move to faces module
Copied: modules/faces/branches/lincolnthree (from rev 12643, modules/branches/lincolnthree)
14 years, 8 months
Seam SVN: r12643 - modules/xml/trunk/docs/en-US.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-04-26 07:30:33 -0400 (Mon, 26 Apr 2010)
New Revision: 12643
Modified:
modules/xml/trunk/docs/en-US/master.xml
modules/xml/trunk/docs/en-US/xml-general.xml
modules/xml/trunk/docs/en-US/xml-introduction.xml
Log:
minor doc update
Modified: modules/xml/trunk/docs/en-US/master.xml
===================================================================
--- modules/xml/trunk/docs/en-US/master.xml 2010-04-26 10:39:46 UTC (rev 12642)
+++ modules/xml/trunk/docs/en-US/master.xml 2010-04-26 11:30:33 UTC (rev 12643)
@@ -6,7 +6,6 @@
<toc/>
<title>Seam XML Configuration</title>
- <xi:include href="xml-introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="xml-general.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
\ No newline at end of file
Modified: modules/xml/trunk/docs/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/en-US/xml-general.xml 2010-04-26 10:39:46 UTC (rev 12642)
+++ modules/xml/trunk/docs/en-US/xml-general.xml 2010-04-26 11:30:33 UTC (rev 12643)
@@ -39,12 +39,12 @@
<s:Qualifier/>
</test:ProducerQualifier>
- <test:ProducerBean>
- <test:value>
+ <test:ProducerBean someOtherField="45" >
+ <test:someField>
<s:Produces/>
<test:ProducerQualifier/>
<s:value>hello world</s:value>
- </test:value>
+ </test:someField>
</test:ProducerBean>
<test:ReceiverBean>
@@ -80,12 +80,12 @@
<programlisting>
<![CDATA[
-<test:ProducerBean>
- <test:value>
+<test:ProducerBean someOtherField="45" >
+ <test:someField>
<s:Produces/>
<test:ProducerQualifier/>
<s:value>hello world</s:value>
- </test:value>
+ </test:someField>
</test:ProducerBean>
]]>
</programlisting>
@@ -96,10 +96,13 @@
<literal>ProducerBean</literal>, instead it installs a new bean. In
this instance there will be two <literal>ProducerBean</literal> CDI beans.</para>
- <para>This bean has a field called <literal>value</literal>, this field is configured to be a producer field using XML (it is also possible to configure producer
+ <para>This bean has a field called <literal>someField</literal>, this field is configured to be a producer field using XML (it is also possible to configure producer
methods, more on this later). The <literal><test:value/></literal> declaration has several child elements. The <literal><s:Produces/></literal>
element tells the container that this is a producer field. <literal><test:ProducerQualifier/></literal> element defines a qualifier for the producer
field. The <literal><s:value></literal> element defines an initial value for the field.</para>
+
+ <para>This bean also has another field called <literal>someOtherField</literal> this field has it's value to to 45 using a shorthand syntax. A field may not be specified
+ twice, trying to set the value using the shorthand syntax and the normal syntax will result in an error.</para>
<para>Child elements of fields, methods and classes that resolve to Annotation types are considered to be annotations on the corresponding element,
so the corresponding Java declaration for the XML above would be:</para>
@@ -108,7 +111,10 @@
public class ProducerBean {
@Produces
@ProducerQualifier
- public String value = "hello world";
+ public String someField = "hello world";
+
+ int someOtherField = 45;
+
}
]]></programlisting>
@@ -325,8 +331,8 @@
public int method(@Qualifier2 MethodValueBean[][] param) {//method body}
]]>
</programlisting>
- <para>Array parameters can be represented using the <literal><s:array></literal> element, with a child element to
- represent the type of the array. E.g.</para>
+ <para>Array parameters can be represented using the <literal><s:array></literal> element,
+ with a child element to represent the type of the array. E.g.</para>
<programlisting>
int method(MethodValueBean[] param);
</programlisting>
@@ -364,14 +370,14 @@
</test:SomeBean>
]]>
</programlisting>
-<para>In the example above only beans that are assinable to InjectedBean will be eligable for injection into the field.
+<para>In the example above only beans that are assignable to InjectedBean will be eligable for injection into the field.
This also works for parameter injection points.</para>
</section>
<section>
<title>Annotation Members</title>
- <para>It is also possible to set the value of annotation members. For example:</para>
+ <para>It is possible to set the value of annotation members using attributes in xml. For example:</para>
<programlisting>
<![CDATA[
public @interface OtherQualifier {
@@ -392,6 +398,35 @@
</programlisting>
<para>The value member can be set using the inner text of the node, as seen in the first example.</para>
</section>
+
+ <section>
+ <title>Generic Beans</title>
+ <para>Gereric beans allow for multiple beans to be created from a single bean definition. They are
+ designed for use by framework writers. From the users perspective there is no
+ special configuration required, if you configure a bean that a framework writer has marked as a generic
+ bean then you will end up with multiple beans instead.</para>
+ <para>Generic beans are configured using the syntax described above. For every bean that the user
+ configures, a corresponding bean from the generic bean declaration is created. For example in the
+ framework xml configuration:</para>
+<programlisting>
+ <![CDATA[
+<s:genericBean class="org.jboss.seam.xml.test.generic.GenericMain" >
+ <test:GenericDependant>
+ <s:ApplyQualifiers/>
+ <s:specializes/>
+ <test:instance>
+ <s:ApplyQualifiers/>
+ </test:instance>
+ </test:GenericDependant>
+</s:genericBean>
+]]>
+ </programlisting>
+ <para>The declaration above means that for every <literal>GenericMain</literal> that a user configures via xml
+ a corresponding <literal>GenericDependant</literal> is created as well. The
+ <literal><s:ApplyQualifiers\></literal> is replaced with the qualifiers that are present on the user
+ configured bean.</para>
+ </section>
+
<section>
<title>More Information</title>
Modified: modules/xml/trunk/docs/en-US/xml-introduction.xml
===================================================================
--- modules/xml/trunk/docs/en-US/xml-introduction.xml 2010-04-26 10:39:46 UTC (rev 12642)
+++ modules/xml/trunk/docs/en-US/xml-introduction.xml 2010-04-26 11:30:33 UTC (rev 12643)
@@ -36,7 +36,7 @@
public class RobotArm
{
- String attchment = "welder";
+ String attachment = "welder";
public void doStuff()
{
@@ -51,7 +51,7 @@
public @Interface RightArm{}
]]>
</programlisting>
- <para>This is all well and good, however at some point in the future we decide that our robot is no longer needed for welding, instead it needs a plasma cutter in it's left hand and a
+ <para>So we have a robot class that injects a left arm and a right arm, with both arms having a welder attachment. At some point in the future we decide that our robot is no longer needed for welding, instead it needs a plasma cutter in it's left hand and a
vice in its right hand. Rather than modifying the class files, we decide to configure this up with xml:</para>
<programlistingco>
<areaspec>
@@ -83,13 +83,13 @@
<r:RobotArm>
<s:overrides/>
<r:LeftArm/>
- <r:attchment>Plasma Cutter</r:attchment>
+ <r:attachment>Plasma Cutter</r:attachment>
</r:RobotArm>
<r:RobotArm>
<s:overrides/>
<r:RightArm/>
- <r:attchment>Vice</r:attchment>
+ <r:attachment>Vice</r:attachment>
</r:RobotArm>
<r:Robot>
14 years, 8 months
Seam SVN: r12642 - in modules/faces/trunk/impl/src/main: java/org/jboss/seam/faces/event and 1 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-26 06:39:46 -0400 (Mon, 26 Apr 2010)
New Revision: 12642
Added:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/BeanManagerServletContextListener.java
Removed:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/BeanManagerServletContextListener.java
Modified:
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java
modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
Log:
Move the listener
Copied: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/BeanManagerServletContextListener.java (from rev 12637, modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/BeanManagerServletContextListener.java)
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/BeanManagerServletContextListener.java (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/BeanManagerServletContextListener.java 2010-04-26 10:39:46 UTC (rev 12642)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.faces.beanManager;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * A Servlet Context Listener that places the BeanManager under a known attribute key
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class BeanManagerServletContextListener implements ServletContextListener
+{
+ public static final String BEANMANAGER_SERVLETCONTEXT_KEY = "org.jboss.seam.faces.javax.enterprise.spi.BeanManager";
+
+ @Inject
+ private BeanManager beanManager;
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ }
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ sce.getServletContext().setAttribute(BEANMANAGER_SERVLETCONTEXT_KEY, beanManager);
+ }
+
+
+}
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java 2010-04-26 09:50:17 UTC (rev 12641)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/beanManager/FacesServletContextBeanManagerProvider.java 2010-04-26 10:39:46 UTC (rev 12642)
@@ -28,7 +28,6 @@
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
-import org.jboss.seam.faces.event.BeanManagerServletContextListener;
import org.jboss.weld.extensions.beanManager.BeanManagerProvider;
/**
Deleted: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/BeanManagerServletContextListener.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/BeanManagerServletContextListener.java 2010-04-26 09:50:17 UTC (rev 12641)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/event/BeanManagerServletContextListener.java 2010-04-26 10:39:46 UTC (rev 12642)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.faces.event;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-/**
- * A Servlet Context Listener that places the BeanManager under a known attribute key
- *
- * @author Nicklas Karlsson
- *
- */
-public class BeanManagerServletContextListener implements ServletContextListener
-{
- public static final String BEANMANAGER_SERVLETCONTEXT_KEY = "org.jboss.seam.faces.javax.enterprise.spi.BeanManager";
-
- @Inject
- private BeanManager beanManager;
-
- public void contextDestroyed(ServletContextEvent sce)
- {
- }
-
- public void contextInitialized(ServletContextEvent sce)
- {
- sce.getServletContext().setAttribute(BEANMANAGER_SERVLETCONTEXT_KEY, beanManager);
- }
-
-
-}
Modified: modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml 2010-04-26 09:50:17 UTC (rev 12641)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml 2010-04-26 10:39:46 UTC (rev 12642)
@@ -5,7 +5,7 @@
<name>seamfaces</name>
<listener>
- <listener-class>org.jboss.seam.faces.event.BeanManagerServletContextListener</listener-class>
+ <listener-class>org.jboss.seam.faces.beanManager.BeanManagerServletContextListener</listener-class>
</listener>
</web-fragment>
\ No newline at end of file
14 years, 8 months
Seam SVN: r12641 - modules/faces/trunk.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-26 05:50:17 -0400 (Mon, 26 Apr 2010)
New Revision: 12641
Modified:
modules/faces/trunk/pom.xml
Log:
weld-extensions to snapshot
Modified: modules/faces/trunk/pom.xml
===================================================================
--- modules/faces/trunk/pom.xml 2010-04-26 09:50:01 UTC (rev 12640)
+++ modules/faces/trunk/pom.xml 2010-04-26 09:50:17 UTC (rev 12641)
@@ -33,7 +33,7 @@
<arquillian.version>1.0.0.Alpha1</arquillian.version>
<jsfmock.version>1.0.0</jsfmock.version>
<jsfunit.version>1.2.0.Final</jsfunit.version>
- <weldx.version>1.0.0.Alpha1</weldx.version>
+ <weldx.version>1.0.0-SNAPSHOT</weldx.version>
<weld.api.version>1.0-SP1</weld.api.version>
<junit.version>4.8.1</junit.version>
<slf4j.version>1.5.9.RC1</slf4j.version>
14 years, 8 months