Seam SVN: r11939 - branches/community/Seam_2_2.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-01-08 08:10:23 -0500 (Fri, 08 Jan 2010)
New Revision: 11939
Modified:
branches/community/Seam_2_2/release-process.txt
Log:
JBSEAM-3714 added description of functional testing
Modified: branches/community/Seam_2_2/release-process.txt
===================================================================
--- branches/community/Seam_2_2/release-process.txt 2010-01-08 11:44:44 UTC (rev 11938)
+++ branches/community/Seam_2_2/release-process.txt 2010-01-08 13:10:23 UTC (rev 11939)
@@ -178,7 +178,8 @@
- Delete or rename to original dist.
- Rename the "*.orig" back to the original name
-
+
+
Example verification
--------------------
* The list of examples below is extensive, and testing may not touch each.
@@ -199,8 +200,8 @@
- document should be validated as well
- including tomcat deployments
* Edit the $dist/build.properties and set the jboss.home and tomcat.home
- - JBoss AS 4.2.3.GA and Tomcat 6.X
-* JBoss 4.2.3 examples
+ - JBoss AS 5.1.0.GA and Tomcat 6.X
+* JBoss 5.1.0 examples
- blog (tutorial)
- booking (tutorial)
- contactlist
@@ -248,7 +249,103 @@
- jee5
- jpa
- hibernate
-
+
+
+Functional tests of Seam examples
+---------------------------------
+The functionality of most examples can be verified by automated tests. There are also jobs
+at Hudson system which run the testsuites periodically.
+
+* JBoss 5.1.0 examples
+ The following examples are tested automatically:
+
+ * blog (tutorial)
+ * booking (tutorial)
+ * contactlist
+ * drools
+ * dvdstore (tutorial)
+ * groovybooking
+ * hibernate (tutorial)
+ * jee5/booking
+ * jpa
+ * messages (tutorial)
+ * nestedbooking
+ * numberguess (tutorial)
+ * openid (need to set properties openid.account and openid.password in ftest.properties file)
+ * quartz
+ * registration (tutorial)
+ * remoting/helloworld
+ * remoting/gwt
+ * remoting/chatroom
+ * seambay
+ * seamdiscs
+ * seampay
+ * seamspace
+ * spring
+ * toto (tutorial)
+ * ui (except the s:resource/download link)
+
+ The testsuite also verifies ability to deploy of the following examples:
+
+ * excel
+ * itext
+ * mail
+ * ui
+
+ The following sample applications have to be verified manually:
+
+ * excel
+ * itext
+ * mail
+ * nestedbooking (only nested conversation part)
+ * ui (only s:resource/download link)
+
+ All automated tests are executed from src/test/ftest directory.
+ * To run the automated tests:
+ ant testall.jboss5
+ * To test examples manually:
+ ant deploy (in SEAM_DIR/examples/<example_name>/)
+ ...test manually
+ ant undeploy
+
+* Tomcat 6 examples (with JBoss embedded)
+ The following examples are tested (automatically):
+
+ * blog (tutorial)
+ * booking (tutorial)
+ * dvdstore (tutorial)
+ * hibernate (tutorial)
+ * jpa
+ * messages (tutorial)
+ * numberguess (tutorial)
+ * registration (tutorial)
+ * seambay
+ * seampay
+ * todo (tutorial)
+
+ All automated tests are executed from src/test/ftest directory.
+ * To run the automated tests:
+ ant testall.jboss-embedded
+
+* Tomcat 6 examples (without JBoss embedded)
+ The following examples are tested (automatically):
+
+ * hibernate (tutorial)
+ * jpa
+
+All automated tests are executed from src/test/ftest directory.
+ * To run the automated tests:
+ ant testall.tomcat6
+
+Most of the examples can be tested automatically also with JBoss 4.x. However there are exceptions
+(the newest functional test were tested only on JBoss 5.x and later). The automated test can
+be executed with JBoss 4.x if there is a file jboss4.xml at src/test/ftest/examples/<example_name>/
+directory)
+
+ * To run the automated tests with JBoss 4.x:
+ ant testall.jboss4
+
+
Testing of Cluster
------------------
Currently testing of cluster environment is done through one automated test of booking example.
14 years, 11 months
Seam SVN: r11938 - branches/community/Seam_2_2.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-01-08 06:44:44 -0500 (Fri, 08 Jan 2010)
New Revision: 11938
Modified:
branches/community/Seam_2_2/release-process.txt
Log:
JBSEAM-3776 added steps for testing seam with cluster
Modified: branches/community/Seam_2_2/release-process.txt
===================================================================
--- branches/community/Seam_2_2/release-process.txt 2010-01-08 09:17:32 UTC (rev 11937)
+++ branches/community/Seam_2_2/release-process.txt 2010-01-08 11:44:44 UTC (rev 11938)
@@ -249,6 +249,26 @@
- jpa
- hibernate
+Testing of Cluster
+------------------
+Currently testing of cluster environment is done through one automated test of booking example.
+The main goal of this test is to simulate recovery from breakdown.
+This test should be executed autonomously (not as a part of test bundle).
+To run the test follow these steps:
+1) Specify jboss5.home property in src/test/ftest/ftest.properties to point to your JBoss server folder
+2) Create second "all" configuration of your JBossAS instance (name it for instance "all2")
+3) Start first (master) instance of JBossAS:
+ JBOSS_HOME/bin/run.sh -c all -g DocsPartition -u 239.255.101.101 -b localhost -Djboss.messaging.ServerPeerID=1
+ -Djboss.service.binding.set=ports-default
+4) Start second (slave) instance of JBossAS:
+ JBOSS_HOME/bin/run.sh -c all2 -g DocsPartition -u 239.255.101.101 -b localhost -Djboss.messaging.ServerPeerID=2
+ -Djboss.service.binding.set=ports-01
+5) Go to src/test/ftest directory and run:
+ ant test -Dtest=booking -Dcluster=true
+
+** A booking example is configured to run in cluster only on JBoss server. **
+
+
JBDS and seam-gen verification
------------------------------
These tests use a stable version of MySQL and the latest release of JBDS. Be sure
14 years, 11 months
Seam SVN: r11937 - in branches/enterprise/JBPAPP_5_0: examples/itext/view and 3 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-01-08 04:17:32 -0500 (Fri, 08 Jan 2010)
New Revision: 11937
Added:
branches/enterprise/JBPAPP_5_0/examples/itext/view/columns.xhtml
branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ui/UIMultiColumnText.java
Modified:
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Itext.xml
branches/enterprise/JBPAPP_5_0/examples/itext/view/index.xhtml
branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/faces-config.xml
branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/seam-pdf.taglib.xml
branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ITextUtils.java
Log:
JBPAPP-3202
Modified: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Itext.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Itext.xml 2010-01-08 08:26:37 UTC (rev 11936)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Itext.xml 2010-01-08 09:17:32 UTC (rev 11937)
@@ -388,6 +388,50 @@
</entry>
</row>
+<row>
+ <entry valign="top">
+ <para>
+ <literal><p:textcolumn></literal>
+ </para>
+ </entry>
+ <entry valign="top">
+ <para>
+ <emphasis>Description</emphasis>
+ </para>
+ <para><literal>p:textcolumn</literal> inserts a text column that can
+ be used to control the flow of text. The most common case is to
+ support right to left direction fonts.</para>
+ <para>
+ <emphasis>Attributes</emphasis>
+ <itemizedlist>
+ <listitem>
+ <para><literal>left</literal> — The left bounds of
+ the text column</para>
+ </listitem>
+ <listitem>
+ <para><literal>right</literal> — The right bounds
+ of the text column</para>
+ </listitem>
+ <listitem>
+ <para><literal>direction</literal> — The run direction
+ of the text in the column: <literal>RTL</literal>,
+ <literal>LTR</literal>, <literal
+ >NO-BIDI</literal>, <literal>DEFAULT</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <emphasis>Usage</emphasis>
+ </para>
+ <programlisting role="XHTML"><![CDATA[
+<p:textcolumn left="400" right="600" direction="rtl">
+ <p:font name="/Library/Fonts/Arial Unicode.ttf"
+ encoding="Identity-H"
+ embedded="true">#{phrases.arabic}</p:font>
+</p:textcolumn>]]></programlisting>
+ </entry>
+ </row>
<row>
<entry valign="top">
<para>
Added: branches/enterprise/JBPAPP_5_0/examples/itext/view/columns.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/itext/view/columns.xhtml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/examples/itext/view/columns.xhtml 2010-01-08 09:17:32 UTC (rev 11937)
@@ -0,0 +1,26 @@
+<p:document xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+
+
+ <p:newPage />
+ <p:image alignment="right" value="/jboss.jpg" />
+
+ <p:font family="Helvetica" size="36">
+ <p:paragraph alignment="center">Multiple columns example</p:paragraph>
+ </p:font>
+
+ <p:font family="Helvetica">
+
+ <p:textcolumn left="300" right="500">
+ JBoss Seam is a powerful new application framework for building next generation Web 2.0 applications by unifying and integrating technologies such as Asynchronous JavaScript and XML (AJAX), Java Server Faces (JSF), Enterprise Java Beans (EJB3), Java Portlets and Business Process Management (BPM).
+ </p:textcolumn>
+
+ <p:textcolumn left="100" right="250" direction="rtl">
+ Seam has been designed from the ground up to eliminate complexity at the architecture and the API level. It enables developers to assemble complex web applications with simple annotated Plain Old Java Objects (POJOs), componentized UI widgets and very little XML. The simplicity of Seam 1.0 will enable easy integration with the JBoss Enterprise Service Bus (ESB) and Java Business Integration (JBI) in the future.
+ </p:textcolumn>
+ </p:font>
+
+
+</p:document>
+
Property changes on: branches/enterprise/JBPAPP_5_0/examples/itext/view/columns.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Modified: branches/enterprise/JBPAPP_5_0/examples/itext/view/index.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/itext/view/index.xhtml 2010-01-08 08:26:37 UTC (rev 11936)
+++ branches/enterprise/JBPAPP_5_0/examples/itext/view/index.xhtml 2010-01-08 09:17:32 UTC (rev 11937)
@@ -29,6 +29,7 @@
<li><s:link view="/lists.xhtml" value="PDF Lists" /></li>
<li><s:link view="/font.xhtml" value="Font Selection" /></li>
<li><s:link view="/pages.xhtml" value="Multiple Pages" /></li>
+ <li><s:link view="/columns.xhtml" value="Multicolumns" /></li>
<li><s:link view="/chapters.xhtml" value="Chapters" /></li>
<li><s:link view="/sections.xhtml" value="Sections" /></li>
<li><s:link view="/table.xhtml" value="Tables" /></li>
Modified: branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/faces-config.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/faces-config.xml 2010-01-08 08:26:37 UTC (rev 11936)
+++ branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/faces-config.xml 2010-01-08 09:17:32 UTC (rev 11937)
@@ -168,7 +168,11 @@
<component-class>org.jboss.seam.pdf.ui.UIForm</component-class>
</component>
-
+ <component>
+ <component-type>org.jboss.seam.pdf.ui.UIMultiColumnText</component-type>
+ <component-class>org.jboss.seam.pdf.ui.UIMultiColumnText</component-class>
+ </component>
+
<!--
<render-kit>
<render-kit-id>PDF</render-kit-id>
Modified: branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/seam-pdf.taglib.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/seam-pdf.taglib.xml 2010-01-08 08:26:37 UTC (rev 11936)
+++ branches/enterprise/JBPAPP_5_0/src/pdf/META-INF/seam-pdf.taglib.xml 2010-01-08 09:17:32 UTC (rev 11937)
@@ -237,4 +237,11 @@
</component>
</tag>
+ <tag>
+ <tag-name>textcolumn</tag-name>
+ <component>
+ <component-type>org.jboss.seam.pdf.ui.UIMultiColumnText</component-type>
+ </component>
+ </tag>
+
</facelet-taglib>
Modified: branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ITextUtils.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ITextUtils.java 2010-01-08 08:26:37 UTC (rev 11936)
+++ branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ITextUtils.java 2010-01-08 09:17:32 UTC (rev 11937)
@@ -7,6 +7,7 @@
import com.lowagie.text.ElementTags;
import com.lowagie.text.PageSize;
import com.lowagie.text.Rectangle;
+import com.lowagie.text.pdf.PdfWriter;
public class ITextUtils
{
@@ -129,4 +130,19 @@
return values;
}
+
+ public static int runDirection(String direction)
+ {
+ if (direction == null || direction.equalsIgnoreCase("default")) {
+ return PdfWriter.RUN_DIRECTION_DEFAULT;
+ } else if (direction.equalsIgnoreCase("rtl")) {
+ return PdfWriter.RUN_DIRECTION_RTL;
+ } else if (direction.equalsIgnoreCase("ltr")) {
+ return PdfWriter.RUN_DIRECTION_LTR;
+ } else if (direction.equalsIgnoreCase("no-bidi")) {
+ return PdfWriter.RUN_DIRECTION_NO_BIDI;
+ } else {
+ throw new RuntimeException("unknown run direction " + direction);
+ }
+ }
}
Added: branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ui/UIMultiColumnText.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ui/UIMultiColumnText.java (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/pdf/org/jboss/seam/pdf/ui/UIMultiColumnText.java 2010-01-08 09:17:32 UTC (rev 11937)
@@ -0,0 +1,92 @@
+package org.jboss.seam.pdf.ui;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.pdf.ITextUtils;
+
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.Element;
+import com.lowagie.text.PageSize;
+import com.lowagie.text.pdf.MultiColumnText;
+
+
+public class UIMultiColumnText
+ extends ITextComponent
+{
+
+ float left = 36;
+ float right = PageSize.LETTER.getWidth()-36;
+ String direction = "default";
+
+ MultiColumnText multiColumnText = null;
+
+
+ public float getLeft()
+ {
+ return (Float) valueBinding("left", left);
+ }
+
+ public void setLeft(float left)
+ {
+ this.left = left;
+ }
+
+ public float getRight()
+ {
+ return (Float) valueBinding("right", right);
+ }
+
+ public void setRight(float right)
+ {
+ this.right = right;
+ }
+
+ public String getDirection()
+ {
+ return (String) valueBinding("direction", direction);
+ }
+
+ public void setDirection(String direction)
+ {
+ this.direction = direction;
+ }
+
+ @Override
+ public void createITextObject(FacesContext context) throws IOException, DocumentException
+ {
+ multiColumnText = new MultiColumnText();
+
+ multiColumnText.addSimpleColumn(getLeft(), getRight());
+ multiColumnText.setRunDirection(ITextUtils.runDirection(getDirection()));
+ }
+
+ @Override
+ public Object getITextObject()
+ {
+ return multiColumnText;
+ }
+
+ @Override
+ public void handleAdd(Object other)
+ {
+ if (other instanceof Element) {
+ try {
+ multiColumnText.addElement((Element)other);
+ } catch (DocumentException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ throw new RuntimeException("UIMultiColumnText only supports Element children");
+ }
+
+ }
+
+ @Override
+ public void removeITextObject()
+ {
+ multiColumnText = null;
+ }
+
+}
14 years, 11 months
Seam SVN: r11936 - in branches/community/Seam_2_2/examples: hibernate/view and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-01-08 03:26:37 -0500 (Fri, 08 Jan 2010)
New Revision: 11936
Modified:
branches/community/Seam_2_2/examples/booking/view/template.xhtml
branches/community/Seam_2_2/examples/hibernate/view/template.xhtml
branches/community/Seam_2_2/examples/jee5/booking/view/template.xhtml
branches/community/Seam_2_2/examples/jpa/view/template.xhtml
Log:
JBSEAM-4462 - removed version from footer for JBoss Seam
Modified: branches/community/Seam_2_2/examples/booking/view/template.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/booking/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
+++ branches/community/Seam_2_2/examples/booking/view/template.xhtml 2010-01-08 08:26:37 UTC (rev 11936)
@@ -33,7 +33,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JBoss EJB 3.0, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam, EJB 3, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
</body>
</html>
Modified: branches/community/Seam_2_2/examples/hibernate/view/template.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/hibernate/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
+++ branches/community/Seam_2_2/examples/hibernate/view/template.xhtml 2010-01-08 08:26:37 UTC (rev 11936)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
</body>
</html>
Modified: branches/community/Seam_2_2/examples/jee5/booking/view/template.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
+++ branches/community/Seam_2_2/examples/jee5/booking/view/template.xhtml 2010-01-08 08:26:37 UTC (rev 11936)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JSF 1.2, EJB 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam, JSF 1.2, EJB 3 and Facelets</div>
</div>
</body>
</html>
Modified: branches/community/Seam_2_2/examples/jpa/view/template.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/jpa/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
+++ branches/community/Seam_2_2/examples/jpa/view/template.xhtml 2010-01-08 08:26:37 UTC (rev 11936)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
</body>
</html>
14 years, 11 months
Seam SVN: r11935 - in branches/enterprise/JBPAPP_5_0/examples: hibernate/view and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-01-08 02:57:16 -0500 (Fri, 08 Jan 2010)
New Revision: 11935
Modified:
branches/enterprise/JBPAPP_5_0/examples/booking/view/template.xhtml
branches/enterprise/JBPAPP_5_0/examples/hibernate/view/template.xhtml
branches/enterprise/JBPAPP_5_0/examples/jee5/booking/view/template.xhtml
branches/enterprise/JBPAPP_5_0/examples/jpa/view/template.xhtml
Log:
JBPAPP-3048
Modified: branches/enterprise/JBPAPP_5_0/examples/booking/view/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/booking/view/template.xhtml 2010-01-08 06:22:38 UTC (rev 11934)
+++ branches/enterprise/JBPAPP_5_0/examples/booking/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
@@ -33,7 +33,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JBoss EJB 3.0, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam 2.2, JBoss EJB 3.0, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
</body>
</html>
Modified: branches/enterprise/JBPAPP_5_0/examples/hibernate/view/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/hibernate/view/template.xhtml 2010-01-08 06:22:38 UTC (rev 11934)
+++ branches/enterprise/JBPAPP_5_0/examples/hibernate/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam 2.2, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
</body>
</html>
Modified: branches/enterprise/JBPAPP_5_0/examples/jee5/booking/view/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/jee5/booking/view/template.xhtml 2010-01-08 06:22:38 UTC (rev 11934)
+++ branches/enterprise/JBPAPP_5_0/examples/jee5/booking/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JSF 1.2, EJB 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam 2.2, JSF 1.2, EJB 3 and Facelets</div>
</div>
</body>
</html>
Modified: branches/enterprise/JBPAPP_5_0/examples/jpa/view/template.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/jpa/view/template.xhtml 2010-01-08 06:22:38 UTC (rev 11934)
+++ branches/enterprise/JBPAPP_5_0/examples/jpa/view/template.xhtml 2010-01-08 07:57:16 UTC (rev 11935)
@@ -29,7 +29,7 @@
<ui:include src="conversations.xhtml" />
</div>
</div>
- <div id="footer">Created with JBoss Seam 2.0, JSF 1.2, Hibernate 3 and Facelets</div>
+ <div id="footer">Created with JBoss Seam 2.2, JSF 1.2, Hibernate 3 and Facelets</div>
</div>
</body>
</html>
14 years, 11 months
Seam SVN: r11934 - in modules/drools/trunk/src/main/java/org/jboss/seam/drools: events and 1 other directory.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-01-08 01:22:38 -0500 (Fri, 08 Jan 2010)
New Revision: 11934
Added:
modules/drools/trunk/src/main/java/org/jboss/seam/drools/FactProvider.java
modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManagerConfig.java
modules/drools/trunk/src/main/java/org/jboss/seam/drools/events/KnowledgeSessionCreatedEvent.java
Modified:
modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java
modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java
modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManager.java
Log:
Drools 5 integration.
Added: modules/drools/trunk/src/main/java/org/jboss/seam/drools/FactProvider.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/FactProvider.java (rev 0)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/FactProvider.java 2010-01-08 06:22:38 UTC (rev 11934)
@@ -0,0 +1,20 @@
+package org.jboss.seam.drools;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Interface for fact providers.
+ *
+ * @author Tihomir Surdilovic
+ *
+ */
+public interface FactProvider
+{
+ public List<Object> getFacts();
+ public void setFacts(List<Object> facts);
+
+ public Map<String, Object> getGlobals();
+ public void setGlobals(Map<String, Object> globals);
+
+}
\ No newline at end of file
Modified: modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java 2010-01-08 02:48:00 UTC (rev 11933)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java 2010-01-08 06:22:38 UTC (rev 11934)
@@ -5,7 +5,6 @@
import java.io.StringReader;
import java.util.Properties;
-import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
@@ -41,7 +40,6 @@
private static final Logger log = LoggerFactory.getLogger(KnowledgeBaseManager.class);
private KnowledgeBaseManagerConfig kbaseManagerConfig;
- private KnowledgeBase kbase;
@Inject
BeanManager manager;
@@ -53,19 +51,9 @@
@Produces
@ApplicationScoped
- public KnowledgeBase getKBase()
+ public KnowledgeBase createKBase() throws Exception
{
- return kbase;
- }
-
- public void disposeKBase(@Disposes KnowledgeBase kbase)
- {
- kbase = null;
- }
-
- @PostConstruct
- private void createKBase() throws Exception
- {
+ KnowledgeBase kbase;
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(getKnowledgeBuilderConfiguration());
for (String nextResource : kbaseManagerConfig.getRuleResources())
@@ -93,8 +81,14 @@
addEventListener(kbase, eventListener);
}
}
- }
+ return kbase;
+ }
+ public void disposeKBase(@Disposes KnowledgeBase kbase)
+ {
+ kbase = null;
+ }
+
private void addEventListener(org.drools.KnowledgeBase kbase, String eventListener) {
try {
@SuppressWarnings("unchecked")
@@ -163,19 +157,24 @@
public KnowledgeBuilderConfiguration getKnowledgeBuilderConfiguration() throws Exception
{
KnowledgeBuilderConfiguration kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
- // Only allow resource for .properties files
- if (kbaseManagerConfig.getKnowledgeBuilderConfig() != null && kbaseManagerConfig.getKnowledgeBuilderConfig().endsWith(".properties"))
- {
- Properties kbuilderProp = new Properties();
- InputStream in = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getKnowledgeBuilderConfig());
- if (in == null)
+ if(kbaseManagerConfig.getKnowledgeBuilderConfigProp() != null) {
+ kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(kbaseManagerConfig.getKnowledgeBuilderConfigProp(), null);
+ log.debug("KnowledgeBuilderConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBuilderConfigProp());
+ } else {
+ // Only allow resource for .properties files
+ if (kbaseManagerConfig.getKnowledgeBuilderConfig() != null && kbaseManagerConfig.getKnowledgeBuilderConfig().endsWith(".properties"))
{
- throw new IllegalStateException("Could not locate knowledgeBuilderConfig: " + kbaseManagerConfig.getKnowledgeBuilderConfig());
+ Properties kbuilderProp = new Properties();
+ InputStream in = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getKnowledgeBuilderConfig());
+ if (in == null)
+ {
+ throw new IllegalStateException("Could not locate knowledgeBuilderConfig: " + kbaseManagerConfig.getKnowledgeBuilderConfig());
+ }
+ kbuilderProp.load(in);
+ in.close();
+ kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(kbuilderProp, null);
+ log.debug("KnowledgeBuilderConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBuilderConfig());
}
- kbuilderProp.load(in);
- in.close();
- kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(kbuilderProp, null);
- log.debug("KnowledgeBuilderConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBuilderConfig());
}
return kbuilderconfig;
}
@@ -184,19 +183,24 @@
{
KnowledgeBaseConfiguration kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
- // Only allow resource for .properties files
- if (kbaseManagerConfig.getKnowledgeBaseConfig() != null && kbaseManagerConfig.getKnowledgeBaseConfig().endsWith(".properties"))
- {
- Properties kbaseProp = new Properties();
- InputStream in = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getKnowledgeBaseConfig());
- if (in == null)
+ if(kbaseManagerConfig.getKnowledgeBaseConfigProp() != null) {
+ kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(kbaseManagerConfig.getKnowledgeBaseConfigProp(), null);
+ log.debug("KnowledgeBaseConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBaseConfigProp());
+ } else {
+ // Only allow resource for .properties files
+ if (kbaseManagerConfig.getKnowledgeBaseConfig() != null && kbaseManagerConfig.getKnowledgeBaseConfig().endsWith(".properties"))
{
- throw new IllegalStateException("Could not locate knowledgeBaseConfig: " + kbaseManagerConfig.getKnowledgeBaseConfig());
+ Properties kbaseProp = new Properties();
+ InputStream in = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getKnowledgeBaseConfig());
+ if (in == null)
+ {
+ throw new IllegalStateException("Could not locate knowledgeBaseConfig: " + kbaseManagerConfig.getKnowledgeBaseConfig());
+ }
+ kbaseProp.load(in);
+ in.close();
+ kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(kbaseProp, null);
+ log.debug("KnowledgeBaseConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBaseConfig());
}
- kbaseProp.load(in);
- in.close();
- kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(kbaseProp, null);
- log.debug("KnowledgeBaseConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBaseConfig());
}
return kbaseconfig;
}
Modified: modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java 2010-01-08 02:48:00 UTC (rev 11933)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java 2010-01-08 06:22:38 UTC (rev 11934)
@@ -1,25 +1,15 @@
package org.jboss.seam.drools;
-import java.io.InputStream;
import java.util.Properties;
import java.util.regex.Pattern;
-import org.drools.KnowledgeBaseConfiguration;
-import org.drools.KnowledgeBaseFactory;
-import org.drools.builder.KnowledgeBuilderConfiguration;
-import org.drools.builder.KnowledgeBuilderFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
- * Drools KnowledgeBaseManager Configuration.
+ * KnowledgeBaseManager Configuration.
*
* @author Tihomir Surdilovic
*/
public class KnowledgeBaseManagerConfig
{
- private static final Logger log = LoggerFactory.getLogger(KnowledgeBaseManagerConfig.class);
-
private static final Pattern DIVIDER = Pattern.compile(";");
private static final int RESOURCE_PATH = 0;
private static final int RESOURCE = 1;
@@ -32,6 +22,8 @@
private String knowledgeBuilderConfig;
private String knowledgeBaseConfig;
+ private Properties knowledgeBuilderConfigProp;
+ private Properties knowledgeBaseConfigProp;
private String[] ruleResources;
private String[] eventListeners;
@@ -99,4 +91,26 @@
this.eventListeners = eventListeners;
}
+ public Properties getKnowledgeBuilderConfigProp()
+ {
+ return knowledgeBuilderConfigProp;
+ }
+
+ public void setKnowledgeBuilderConfigProp(Properties knowledgeBuilderConfigProp)
+ {
+ this.knowledgeBuilderConfigProp = knowledgeBuilderConfigProp;
+ }
+
+ public Properties getKnowledgeBaseConfigProp()
+ {
+ return knowledgeBaseConfigProp;
+ }
+
+ public void setKnowledgeBaseConfigProp(Properties knowledgeBaseConfigProp)
+ {
+ this.knowledgeBaseConfigProp = knowledgeBaseConfigProp;
+ }
+
+
+
}
Modified: modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManager.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManager.java 2010-01-08 02:48:00 UTC (rev 11933)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManager.java 2010-01-08 06:22:38 UTC (rev 11934)
@@ -1,13 +1,29 @@
package org.jboss.seam.drools;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.annotation.PreDestroy;
import javax.enterprise.context.Dependent;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Inject;
+import javax.inject.Named;
import org.drools.KnowledgeBase;
+import org.drools.KnowledgeBaseFactory;
+import org.drools.builder.KnowledgeBuilderFactory;
+import org.drools.logger.KnowledgeRuntimeLogger;
+import org.drools.runtime.KnowledgeSessionConfiguration;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;
+import org.jboss.seam.drools.events.KnowledgeSessionCreatedEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -20,19 +36,84 @@
{
private static final Logger log = LoggerFactory.getLogger(KnowledgeSessionManager.class);
+ private KnowledgeSessionManagerConfig ksessionManagerConfig;
+ private KnowledgeRuntimeLogger statelessKLogger;
+ private Map<Integer, KnowledgeRuntimeLogger> statefulKnowledgeLoggers = new Hashtable<Integer, KnowledgeRuntimeLogger>();
+
@Inject
BeanManager manager;
-
- @Inject
+
+ @Inject
KnowledgeBase kbase;
-
+
+ @Inject
+ public KnowledgeSessionManager(KnowledgeSessionManagerConfig ksessionManagerConfig)
+ {
+ this.ksessionManagerConfig = ksessionManagerConfig;
+ }
+
@Produces
- public StatefulKnowledgeSession getStatefulSession() {
- return null; // for now
+ @Named
+ public StatefulKnowledgeSession getStatefulSession(InjectionPoint injectionPoint) throws Exception
+ {
+ StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(getKSessionConfig(), null);
+ //addEventListeners(ksession);
+ //addWorkItemHandlers(ksession);
+ //addAuditLog(ksession);
+ manager.fireEvent(new KnowledgeSessionCreatedEvent(ksession.getId()));
+ return ksession;
}
-
+
+ public void disposeStatefulSession(@Disposes StatefulKnowledgeSession statefulSession)
+ {
+ if (statefulKnowledgeLoggers.get(statefulSession.getId()) != null)
+ {
+ statefulKnowledgeLoggers.get(statefulSession.getId()).close();
+ }
+ statefulSession.dispose();
+ }
+
@Produces
- public StatelessKnowledgeSession getStatelessSession() {
- return null; // for now
+ @Named
+ public StatelessKnowledgeSession getStatelessSession(InjectionPoint injectionPoint) throws Exception
+ {
+ StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(getKSessionConfig());
+ //addEventListeners(ksession);
+ //addAuditLog(ksession);
+ manager.fireEvent(new KnowledgeSessionCreatedEvent(-1));
+ return ksession;
}
+
+ public void disposeStatelessSession(@Disposes StatelessKnowledgeSession statelessSession)
+ {
+ if (statelessKLogger != null)
+ {
+ statelessKLogger.close();
+ }
+ }
+
+ private KnowledgeSessionConfiguration getKSessionConfig() throws Exception
+ {
+ KnowledgeSessionConfiguration ksessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
+ if(ksessionManagerConfig.getKnowledgeSessionConfigProp() != null) {
+ ksessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(ksessionManagerConfig.getKnowledgeSessionConfigProp());
+ } else {
+ // Only allow resource for .properties files
+ if (ksessionManagerConfig.getKnowledgeSessionConfig() != null && ksessionManagerConfig.getKnowledgeSessionConfig().endsWith(".properties"))
+ {
+ Properties ksessionProp = new Properties();
+ InputStream in = this.getClass().getClassLoader().getResourceAsStream(ksessionManagerConfig.getKnowledgeSessionConfig());
+ if (in == null)
+ {
+ throw new IllegalStateException("Could not locate knowledgeSessionrConfig: " + ksessionManagerConfig.getKnowledgeSessionConfig());
+ }
+ ksessionProp.load(in);
+ in.close();
+ ksessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(ksessionProp);
+ log.debug("KnowledgeSessionConfiguration loaded: " + ksessionManagerConfig.getKnowledgeSessionConfig());
+ }
+ }
+ return ksessionConfig;
+ }
+
}
Added: modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManagerConfig.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManagerConfig.java (rev 0)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeSessionManagerConfig.java 2010-01-08 06:22:38 UTC (rev 11934)
@@ -0,0 +1,63 @@
+package org.jboss.seam.drools;
+
+import java.util.Properties;
+import java.util.regex.Pattern;
+
+/**
+ * KnowledgeSessionManager Configuration.
+ *
+ * @author Tihomir Surdilovic
+ */
+public class KnowledgeSessionManagerConfig
+{
+ private static final Pattern DIVIDER = Pattern.compile(";");
+ private static final int WORKITEMHANDLER_NAME = 0;
+ private static final int WORKITEMHANDLER_TYPE = 1;
+
+ private String[] eventListeners;
+ private String[] workItemHandlers;
+ private String knowledgeSessionConfig;
+ private Properties knowledgeSessionConfigProp;
+ private String auditLog;
+ public String[] getEventListeners()
+ {
+ return eventListeners;
+ }
+ public void setEventListeners(String[] eventListeners)
+ {
+ this.eventListeners = eventListeners;
+ }
+ public String[] getWorkItemHandlers()
+ {
+ return workItemHandlers;
+ }
+ public void setWorkItemHandlers(String[] workItemHandlers)
+ {
+ this.workItemHandlers = workItemHandlers;
+ }
+ public String getKnowledgeSessionConfig()
+ {
+ return knowledgeSessionConfig;
+ }
+ public void setKnowledgeSessionConfig(String knowledgeSessionConfig)
+ {
+ this.knowledgeSessionConfig = knowledgeSessionConfig;
+ }
+ public String getAuditLog()
+ {
+ return auditLog;
+ }
+ public void setAuditLog(String auditLog)
+ {
+ this.auditLog = auditLog;
+ }
+ public Properties getKnowledgeSessionConfigProp()
+ {
+ return knowledgeSessionConfigProp;
+ }
+ public void setKnowledgeSessionConfigProp(Properties knowledgeSessionConfigProp)
+ {
+ this.knowledgeSessionConfigProp = knowledgeSessionConfigProp;
+ }
+
+}
Added: modules/drools/trunk/src/main/java/org/jboss/seam/drools/events/KnowledgeSessionCreatedEvent.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/events/KnowledgeSessionCreatedEvent.java (rev 0)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/events/KnowledgeSessionCreatedEvent.java 2010-01-08 06:22:38 UTC (rev 11934)
@@ -0,0 +1,26 @@
+package org.jboss.seam.drools.events;
+
+/**
+ * This event is fires when Stateful or Stateless KnowledgeSession is created.
+ *
+ * @author Tihomir Surdilovic
+ */
+public class KnowledgeSessionCreatedEvent
+{
+ private int sessionId;
+
+ public KnowledgeSessionCreatedEvent(int sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ public int getSessionId()
+ {
+ return sessionId;
+ }
+
+ public void setSessionId(int sessionId)
+ {
+ this.sessionId = sessionId;
+ }
+
+}
14 years, 11 months
Seam SVN: r11933 - modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-01-07 21:48:00 -0500 (Thu, 07 Jan 2010)
New Revision: 11933
Modified:
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/Model.java
Log:
imports
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/Model.java
===================================================================
--- modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/Model.java 2010-01-07 18:07:42 UTC (rev 11932)
+++ modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/model/Model.java 2010-01-08 02:48:00 UTC (rev 11933)
@@ -3,7 +3,6 @@
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
@@ -17,9 +16,6 @@
import org.jboss.seam.remoting.AnnotationsParser;
import org.jboss.seam.remoting.Call;
import org.jboss.seam.remoting.CallContext;
-import org.jboss.seam.remoting.wrapper.BeanWrapper;
-import org.jboss.seam.remoting.wrapper.ConversionException;
-import org.jboss.seam.remoting.wrapper.Wrapper;
/**
* Manages a model request
14 years, 11 months
Seam SVN: r11932 - branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2010-01-07 13:07:42 -0500 (Thu, 07 Jan 2010)
New Revision: 11932
Modified:
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Itext.xml
Log:
JBSEAM-4493
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Itext.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Itext.xml 2010-01-07 15:11:13 UTC (rev 11931)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Itext.xml 2010-01-07 18:07:42 UTC (rev 11932)
@@ -388,6 +388,50 @@
</entry>
</row>
+<row>
+ <entry valign="top">
+ <para>
+ <literal><p:textcolumn></literal>
+ </para>
+ </entry>
+ <entry valign="top">
+ <para>
+ <emphasis>Description</emphasis>
+ </para>
+ <para><literal>p:textcolumn</literal> inserts a text column that can
+ be used to control the flow of text. The most common case is to
+ support right to left direction fonts.</para>
+ <para>
+ <emphasis>Attributes</emphasis>
+ <itemizedlist>
+ <listitem>
+ <para><literal>left</literal> — The left bounds of
+ the text column</para>
+ </listitem>
+ <listitem>
+ <para><literal>right</literal> — The right bounds
+ of the text column</para>
+ </listitem>
+ <listitem>
+ <para><literal>direction</literal> — The run direction
+ of the text in the column: <literal>RTL</literal>,
+ <literal>LTR</literal>, <literal
+ >NO-BIDI</literal>, <literal>DEFAULT</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <emphasis>Usage</emphasis>
+ </para>
+ <programlisting role="XHTML"><![CDATA[
+<p:textcolumn left="400" right="600" direction="rtl">
+ <p:font name="/Library/Fonts/Arial Unicode.ttf"
+ encoding="Identity-H"
+ embedded="true">#{phrases.arabic}</p:font>
+</p:textcolumn>]]></programlisting>
+ </entry>
+ </row>
<row>
<entry valign="top">
<para>
14 years, 11 months
Seam SVN: r11931 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/bpm.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-01-07 10:11:13 -0500 (Thu, 07 Jan 2010)
New Revision: 11931
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/bpm/JbpmELResolver.java
Log:
JBPAPP-3334
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/bpm/JbpmELResolver.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/bpm/JbpmELResolver.java 2010-01-07 14:34:04 UTC (rev 11930)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/bpm/JbpmELResolver.java 2010-01-07 15:11:13 UTC (rev 11931)
@@ -28,7 +28,8 @@
{
if ( base==null && property!=null )
{
- return resolver.resolveVariable( (String) base );
+ context.setPropertyResolved(true);
+ return resolver.resolveVariable( (String) property );
}
else
{
14 years, 11 months
Seam SVN: r11930 - modules/drools/trunk/src/main/java/org/jboss/seam/drools.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-01-07 09:34:04 -0500 (Thu, 07 Jan 2010)
New Revision: 11930
Modified:
modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java
modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java
Log:
Drools 5 integration.
Modified: modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java 2010-01-07 13:05:26 UTC (rev 11929)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManager.java 2010-01-07 14:34:04 UTC (rev 11930)
@@ -3,6 +3,7 @@
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
+import java.util.Properties;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
@@ -14,8 +15,10 @@
import javax.security.auth.login.Configuration;
import org.drools.KnowledgeBase;
+import org.drools.KnowledgeBaseConfiguration;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
+import org.drools.builder.KnowledgeBuilderConfiguration;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderErrors;
import org.drools.builder.KnowledgeBuilderFactory;
@@ -36,9 +39,6 @@
public class KnowledgeBaseManager
{
private static final Logger log = LoggerFactory.getLogger(KnowledgeBaseManager.class);
- private static final String RESOURCE_TYPE_URL = "url";
- private static final String RESOURCE_TYPE_FILE = "file";
- private static final String RESOURCE_TYPE_CLASSPATH = "classpath";
private KnowledgeBaseManagerConfig kbaseManagerConfig;
private KnowledgeBase kbase;
@@ -66,7 +66,7 @@
@PostConstruct
private void createKBase() throws Exception
{
- KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbaseManagerConfig.getKnowledgeBuilderConfiguration());
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(getKnowledgeBuilderConfiguration());
for (String nextResource : kbaseManagerConfig.getRuleResources())
{
@@ -83,7 +83,7 @@
manager.fireEvent(new KnowledgeBuilderErrorsEvent(kbuildererrors));
}
- kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseManagerConfig.getKnowledgeBaseConfiguration());
+ kbase = KnowledgeBaseFactory.newKnowledgeBase(getKnowledgeBaseConfiguration());
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
if (kbaseManagerConfig.getEventListeners() != null)
@@ -113,18 +113,18 @@
protected void addResource(KnowledgeBuilder kbuilder, String resource) throws Exception
{
- if(kbaseManagerConfig.isValidResource(resource)) {
- ResourceType resourceType = ResourceType.getResourceType(kbaseManagerConfig.getResourceType(resource));
- if(kbaseManagerConfig.isRuleTemplate(resource)) {
+ if(KnowledgeBaseManagerConfig.isValidResource(resource)) {
+ ResourceType resourceType = ResourceType.getResourceType(KnowledgeBaseManagerConfig.getResourceType(resource));
+ if(KnowledgeBaseManagerConfig.isRuleTemplate(resource)) {
@SuppressWarnings("unchecked")
- Bean<TemplateDataProvider> templateDataProviderBean = (Bean<TemplateDataProvider>) manager.getBeans(kbaseManagerConfig.getTemplateData(resource)).iterator().next();
+ Bean<TemplateDataProvider> templateDataProviderBean = (Bean<TemplateDataProvider>) manager.getBeans(KnowledgeBaseManagerConfig.getTemplateData(resource)).iterator().next();
TemplateDataProvider templateDataProvider = (TemplateDataProvider) manager.getReference(templateDataProviderBean, Configuration.class, manager.createCreationalContext(templateDataProviderBean));
- InputStream templateStream = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getRuleResource(resource));
+ InputStream templateStream = this.getClass().getClassLoader().getResourceAsStream(KnowledgeBaseManagerConfig.getRuleResource(resource));
if (templateStream == null)
{
- throw new IllegalStateException("Could not locate rule resource: " + kbaseManagerConfig.getRuleResource(resource));
+ throw new IllegalStateException("Could not locate rule resource: " + KnowledgeBaseManagerConfig.getRuleResource(resource));
}
ObjectDataCompiler converter = new ObjectDataCompiler();
@@ -135,28 +135,69 @@
kbuilder.add(ResourceFactory.newReaderResource(rdr), resourceType);
} else {
- if (kbaseManagerConfig.getResourcePath(resource).equals(RESOURCE_TYPE_URL))
+ if (KnowledgeBaseManagerConfig.getResourcePath(resource).equals(KnowledgeBaseManagerConfig.RESOURCE_TYPE_URL))
{
- kbuilder.add(ResourceFactory.newUrlResource(kbaseManagerConfig.getRuleResource(resource)), resourceType);
- manager.fireEvent(new RuleResourceAddedEvent(kbaseManagerConfig.getRuleResource(resource)));
+ kbuilder.add(ResourceFactory.newUrlResource(KnowledgeBaseManagerConfig.getRuleResource(resource)), resourceType);
+ manager.fireEvent(new RuleResourceAddedEvent(KnowledgeBaseManagerConfig.getRuleResource(resource)));
}
- else if (kbaseManagerConfig.getResourcePath(resource).equals(RESOURCE_TYPE_FILE))
+ else if (KnowledgeBaseManagerConfig.getResourcePath(resource).equals(KnowledgeBaseManagerConfig.RESOURCE_TYPE_FILE))
{
- kbuilder.add(ResourceFactory.newFileResource(kbaseManagerConfig.getRuleResource(resource)), resourceType);
- manager.fireEvent(new RuleResourceAddedEvent(kbaseManagerConfig.getRuleResource(resource)));
+ kbuilder.add(ResourceFactory.newFileResource(KnowledgeBaseManagerConfig.getRuleResource(resource)), resourceType);
+ manager.fireEvent(new RuleResourceAddedEvent(KnowledgeBaseManagerConfig.getRuleResource(resource)));
}
- else if (kbaseManagerConfig.getResourcePath(resource).equals(RESOURCE_TYPE_CLASSPATH))
+ else if (KnowledgeBaseManagerConfig.getResourcePath(resource).equals(KnowledgeBaseManagerConfig.RESOURCE_TYPE_CLASSPATH))
{
- kbuilder.add(ResourceFactory.newClassPathResource(kbaseManagerConfig.getRuleResource(resource)), resourceType);
- manager.fireEvent(new RuleResourceAddedEvent(kbaseManagerConfig.getRuleResource(resource)));
+ kbuilder.add(ResourceFactory.newClassPathResource(KnowledgeBaseManagerConfig.getRuleResource(resource)), resourceType);
+ manager.fireEvent(new RuleResourceAddedEvent(KnowledgeBaseManagerConfig.getRuleResource(resource)));
}
else
{
- log.error("Invalid resource path: " + kbaseManagerConfig.getResourcePath(resource));
+ log.error("Invalid resource path: " + KnowledgeBaseManagerConfig.getResourcePath(resource));
}
}
} else {
log.error("Invalid resource definition: " + resource);
}
}
+
+ public KnowledgeBuilderConfiguration getKnowledgeBuilderConfiguration() throws Exception
+ {
+ KnowledgeBuilderConfiguration kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
+ // Only allow resource for .properties files
+ if (kbaseManagerConfig.getKnowledgeBuilderConfig() != null && kbaseManagerConfig.getKnowledgeBuilderConfig().endsWith(".properties"))
+ {
+ Properties kbuilderProp = new Properties();
+ InputStream in = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getKnowledgeBuilderConfig());
+ if (in == null)
+ {
+ throw new IllegalStateException("Could not locate knowledgeBuilderConfig: " + kbaseManagerConfig.getKnowledgeBuilderConfig());
+ }
+ kbuilderProp.load(in);
+ in.close();
+ kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(kbuilderProp, null);
+ log.debug("KnowledgeBuilderConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBuilderConfig());
+ }
+ return kbuilderconfig;
+ }
+
+ public KnowledgeBaseConfiguration getKnowledgeBaseConfiguration() throws Exception
+ {
+ KnowledgeBaseConfiguration kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
+
+ // Only allow resource for .properties files
+ if (kbaseManagerConfig.getKnowledgeBaseConfig() != null && kbaseManagerConfig.getKnowledgeBaseConfig().endsWith(".properties"))
+ {
+ Properties kbaseProp = new Properties();
+ InputStream in = this.getClass().getClassLoader().getResourceAsStream(kbaseManagerConfig.getKnowledgeBaseConfig());
+ if (in == null)
+ {
+ throw new IllegalStateException("Could not locate knowledgeBaseConfig: " + kbaseManagerConfig.getKnowledgeBaseConfig());
+ }
+ kbaseProp.load(in);
+ in.close();
+ kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(kbaseProp, null);
+ log.debug("KnowledgeBaseConfiguration loaded: " + kbaseManagerConfig.getKnowledgeBaseConfig());
+ }
+ return kbaseconfig;
+ }
}
\ No newline at end of file
Modified: modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java
===================================================================
--- modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java 2010-01-07 13:05:26 UTC (rev 11929)
+++ modules/drools/trunk/src/main/java/org/jboss/seam/drools/KnowledgeBaseManagerConfig.java 2010-01-07 14:34:04 UTC (rev 11930)
@@ -25,74 +25,37 @@
private static final int RESOURCE = 1;
private static final int RESOURCE_TYPE = 2;
private static final int RESOURCE_TEMPLATE_DATA = 3;
+
+ public static final String RESOURCE_TYPE_URL = "url";
+ public static final String RESOURCE_TYPE_FILE = "file";
+ public static final String RESOURCE_TYPE_CLASSPATH = "classpath";
private String knowledgeBuilderConfig;
private String knowledgeBaseConfig;
private String[] ruleResources;
private String[] eventListeners;
-
- public KnowledgeBuilderConfiguration getKnowledgeBuilderConfiguration() throws Exception
- {
- KnowledgeBuilderConfiguration kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
- // Only allow resource for .properties files
- if (knowledgeBuilderConfig != null && knowledgeBuilderConfig.endsWith(".properties"))
- {
- Properties kbuilderProp = new Properties();
- InputStream in = this.getClass().getClassLoader().getResourceAsStream(knowledgeBuilderConfig);
- if (in == null)
- {
- throw new IllegalStateException("Could not locate knowledgeBuilderConfig: " + knowledgeBuilderConfig);
- }
- kbuilderProp.load(in);
- in.close();
- kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(kbuilderProp, null);
- log.debug("KnowledgeBuilderConfiguration loaded: " + knowledgeBuilderConfig);
- }
- return kbuilderconfig;
- }
-
- public KnowledgeBaseConfiguration getKnowledgeBaseConfiguration() throws Exception
- {
- KnowledgeBaseConfiguration kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
-
- // Only allow resource for .properties files
- if (knowledgeBaseConfig != null && knowledgeBaseConfig.endsWith(".properties"))
- {
- Properties kbaseProp = new Properties();
- InputStream in = this.getClass().getClassLoader().getResourceAsStream(knowledgeBaseConfig);
- if (in == null)
- {
- throw new IllegalStateException("Could not locate knowledgeBaseConfig: " + knowledgeBaseConfig);
- }
- kbaseProp.load(in);
- in.close();
- kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(kbaseProp, null);
- log.debug("KnowledgeBaseConfiguration loaded: " + knowledgeBaseConfig);
- }
- return kbaseconfig;
- }
- public boolean isValidResource(String resource) {
+ public static boolean isValidResource(String resource) {
return DIVIDER.split(resource.trim()).length >= 3;
}
- public boolean isRuleTemplate(String resource) {
+ public static boolean isRuleTemplate(String resource) {
return DIVIDER.split(resource.trim()).length == 4;
}
- public String getResourceType(String resource) {
+ public static String getResourceType(String resource) {
return DIVIDER.split(resource.trim())[RESOURCE_TYPE];
}
- public String getRuleResource(String resource) {
+ public static String getRuleResource(String resource) {
return DIVIDER.split(resource.trim())[RESOURCE];
}
- public String getTemplateData(String resource) {
+ public static String getTemplateData(String resource) {
return DIVIDER.split(resource.trim())[RESOURCE_TEMPLATE_DATA];
}
- public String getResourcePath(String resource) {
+ public static String getResourcePath(String resource) {
return DIVIDER.split(resource.trim())[RESOURCE_PATH];
}
14 years, 11 months