Seam SVN: r12326 - branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-03-30 07:05:52 -0400 (Tue, 30 Mar 2010)
New Revision: 12326
Added:
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/InternetExplorerAjaxDriver.java
Modified:
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverFactory.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverTest.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebElement.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/DelegatedWebElement.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java
Log:
JBSEAM-4610 added iexlorer driver and licensing
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java 2010-03-30 10:32:50 UTC (rev 12325)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
import org.openqa.selenium.By;
@@ -11,10 +32,8 @@
*/
public interface AjaxWebDriver extends WebDriver
{
-
- //@Override
public AjaxWebElement findElement(By by);
-
+
public void setWaitTime(int millis);
public boolean isElementPresent(By by);
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverFactory.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverFactory.java 2010-03-30 10:32:50 UTC (rev 12325)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverFactory.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
/**
@@ -17,6 +38,13 @@
{
return new FirefoxAjaxDriver();
}
+ },
+ iexplorer
+ {
+ public AjaxWebDriver getDriver()
+ {
+ return new InternetExplorerAjaxDriver();
+ }
};
public abstract AjaxWebDriver getDriver();
@@ -28,9 +56,13 @@
return Browser.firefox.getDriver();
}
+ if(browser.contains("explore")) {
+ return Browser.iexplorer.getDriver();
+ }
+
return Browser.valueOf(browser).getDriver();
}
-
+
public static final String availableBrowsers()
{
StringBuilder sb = new StringBuilder();
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverTest.java 2010-03-30 10:32:50 UTC (rev 12325)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriverTest.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
import static org.testng.Assert.fail;
@@ -19,11 +40,9 @@
protected String serverURL;
protected String contextPath;
protected String browser;
-
+
@BeforeMethod
- @Parameters(value = {
- "browser", "server.url", "context.path"
- })
+ @Parameters(value = { "browser", "server.url", "context.path" })
public void createDriver(String browser, String serverURL, String contextPath)
{
try
@@ -38,16 +57,16 @@
{
fail("Unable to instantiate browser of type: " + browser + ", available browsers are: " + AjaxWebDriverFactory.availableBrowsers());
}
-
+
this.serverURL = serverURL;
this.contextPath = contextPath;
this.browser = browser;
}
-
+
@AfterMethod
public void closeDriver()
{
driver.close();
}
-
+
}
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebElement.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebElement.java 2010-03-30 10:32:50 UTC (rev 12325)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebElement.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
import org.openqa.selenium.By;
@@ -11,17 +32,17 @@
*/
public interface AjaxWebElement extends WebElement
{
-
+
public static final int DEFAULT_WAIT_TIME = 3000;
-
- //@Override
+
+ // @Override
public AjaxWebElement findElement(By by);
-
+
public void setWaitTime(int millis);
-
+
public void clickAndWait();
public void clickAndWait(int millis);
-
+
public void clearAndSendKeys(CharSequence... keysToSend);
}
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/DelegatedWebElement.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/DelegatedWebElement.java 2010-03-30 10:32:50 UTC (rev 12325)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/DelegatedWebElement.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
import java.util.ArrayList;
@@ -3,5 +24,4 @@
import java.util.Collections;
import java.util.List;
-
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
@@ -13,130 +33,158 @@
* @author kpiwko
*
*/
-public class DelegatedWebElement implements AjaxWebElement {
-
- private int waitTime;
- private WebElement element;
-
- public DelegatedWebElement(WebElement element) {
- this(element, DEFAULT_WAIT_TIME);
- }
-
- public DelegatedWebElement(WebElement element, int waitTime) {
- this.element = element;
- this.waitTime = waitTime;
- }
-
- //@Override
- public void clear() {
- element.clear();
- }
-
- //@Override
- public void clearAndSendKeys(CharSequence...keysToSend) {
- element.clear();
- element.sendKeys(keysToSend);
- }
-
- //@Override
- public void click() {
- element.click();
- }
-
- //@Override
- public void clickAndWait() {
- element.click();
- try {
- Thread.sleep(waitTime);
- } catch (InterruptedException e) {
- }
- }
-
- public void clickAndWait(int millis) {
- element.click();
- try {
- Thread.sleep(millis);
- } catch (InterruptedException e) {
- }
- }
-
- //@Override
- public AjaxWebElement findElement(By by) {
- return new DelegatedWebElement(element.findElement(by));
- }
-
- //@Override
- public List<WebElement> findElements(By by) {
- List<WebElement> elements = new ArrayList<WebElement>();
- List<WebElement> original = element.findElements(by);
- if (original == null || original.size() == 0)
- return Collections.emptyList();
-
- for (WebElement e : original)
- elements.add(new DelegatedWebElement(e));
-
- return elements;
- }
-
- //@Override
- public String getAttribute(String name) {
- return element.getAttribute(name);
- }
-
- @Deprecated
- //@Override
- public String getElementName() {
- return element.getElementName();
- }
-
- //@Override
- public String getTagName() {
- return element.getTagName();
- }
-
- //@Override
- public String getText() {
- return element.getText();
- }
-
- //@Override
- public String getValue() {
- return element.getValue();
- }
-
- //@Override
- public boolean isEnabled() {
- return element.isEnabled();
- }
-
- //@Override
- public boolean isSelected() {
- return element.isSelected();
- }
-
- //@Override
- public void sendKeys(CharSequence... keysToSend) {
- element.sendKeys(keysToSend);
- }
-
- //@Override
- public void setSelected() {
- element.setSelected();
- }
-
- //@Override
- public void setWaitTime(int millis) {
- this.waitTime = millis;
- }
-
- //@Override
- public void submit() {
- element.submit();
- }
-
- //@Override
- public boolean toggle() {
- return element.toggle();
- }
-
+public class DelegatedWebElement implements AjaxWebElement
+{
+
+ private int waitTime;
+ private WebElement element;
+
+ public DelegatedWebElement(WebElement element)
+ {
+ this(element, DEFAULT_WAIT_TIME);
+ }
+
+ public DelegatedWebElement(WebElement element, int waitTime)
+ {
+ this.element = element;
+ this.waitTime = waitTime;
+ }
+
+ // @Override
+ public void clear()
+ {
+ element.clear();
+ }
+
+ // @Override
+ public void clearAndSendKeys(CharSequence... keysToSend)
+ {
+ element.clear();
+ element.sendKeys(keysToSend);
+ }
+
+ // @Override
+ public void click()
+ {
+ element.click();
+ }
+
+ // @Override
+ public void clickAndWait()
+ {
+ element.click();
+ try
+ {
+ Thread.sleep(waitTime);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ public void clickAndWait(int millis)
+ {
+ element.click();
+ try
+ {
+ Thread.sleep(millis);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ // @Override
+ public AjaxWebElement findElement(By by)
+ {
+ return new DelegatedWebElement(element.findElement(by));
+ }
+
+ // @Override
+ public List<WebElement> findElements(By by)
+ {
+ List<WebElement> elements = new ArrayList<WebElement>();
+ List<WebElement> original = element.findElements(by);
+ if (original == null || original.size() == 0)
+ return Collections.emptyList();
+
+ for (WebElement e : original)
+ elements.add(new DelegatedWebElement(e));
+
+ return elements;
+ }
+
+ // @Override
+ public String getAttribute(String name)
+ {
+ return element.getAttribute(name);
+ }
+
+ @Deprecated
+ // @Override
+ public String getElementName()
+ {
+ return element.getElementName();
+ }
+
+ // @Override
+ public String getTagName()
+ {
+ return element.getTagName();
+ }
+
+ // @Override
+ public String getText()
+ {
+ return element.getText();
+ }
+
+ // @Override
+ public String getValue()
+ {
+ return element.getValue();
+ }
+
+ // @Override
+ public boolean isEnabled()
+ {
+ return element.isEnabled();
+ }
+
+ // @Override
+ public boolean isSelected()
+ {
+ return element.isSelected();
+ }
+
+ // @Override
+ public void sendKeys(CharSequence... keysToSend)
+ {
+ element.sendKeys(keysToSend);
+ }
+
+ // @Override
+ public void setSelected()
+ {
+ element.setSelected();
+ }
+
+ // @Override
+ public void setWaitTime(int millis)
+ {
+ this.waitTime = millis;
+ }
+
+ // @Override
+ public void submit()
+ {
+ element.submit();
+ }
+
+ // @Override
+ public boolean toggle()
+ {
+ return element.toggle();
+ }
+
}
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java 2010-03-30 10:32:50 UTC (rev 12325)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
import org.openqa.selenium.By;
@@ -6,26 +27,26 @@
public class FirefoxAjaxDriver extends FirefoxDriver implements AjaxWebDriver
{
-
+
private int waitTime;
-
+
public FirefoxAjaxDriver()
{
this(AjaxWebElement.DEFAULT_WAIT_TIME);
}
-
+
public FirefoxAjaxDriver(int waitTime)
{
this.waitTime = waitTime;
}
-
- //@Override
+
+ // @Override
public AjaxWebElement findElement(By by)
{
return new DelegatedWebElement(super.findElement(by), waitTime);
}
-
- //@Override
+
+ // @Override
public void setWaitTime(int millis)
{
this.waitTime = millis;
Added: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/InternetExplorerAjaxDriver.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/InternetExplorerAjaxDriver.java (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/InternetExplorerAjaxDriver.java 2010-03-30 11:05:52 UTC (rev 12326)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.webdriver;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.NoSuchElementException;
+import org.openqa.selenium.ie.InternetExplorerDriver;
+
+public class InternetExplorerAjaxDriver extends InternetExplorerDriver implements AjaxWebDriver
+{
+
+ private int waitTime;
+
+ public InternetExplorerAjaxDriver()
+ {
+ this(AjaxWebElement.DEFAULT_WAIT_TIME);
+ }
+
+ public InternetExplorerAjaxDriver(int waitTime)
+ {
+ this.waitTime = waitTime;
+ }
+
+ public AjaxWebElement findElement(By by)
+ {
+ return new DelegatedWebElement(super.findElement(by), waitTime);
+ }
+
+ public void setWaitTime(int millis)
+ {
+ this.waitTime = millis;
+ }
+
+ public boolean isElementPresent(By by)
+ {
+ try
+ {
+ findElement(by);
+ return true;
+ }
+ catch (NoSuchElementException e)
+ {
+ return false;
+ }
+ }
+}
14 years, 9 months
Seam SVN: r12325 - modules/xml/trunk/docs/en-US.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 06:32:50 -0400 (Tue, 30 Mar 2010)
New Revision: 12325
Modified:
modules/xml/trunk/docs/en-US/xml-general.xml
Log:
documented <type> element
Modified: modules/xml/trunk/docs/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/en-US/xml-general.xml 2010-03-30 10:24:05 UTC (rev 12324)
+++ modules/xml/trunk/docs/en-US/xml-general.xml 2010-03-30 10:32:50 UTC (rev 12325)
@@ -343,6 +343,33 @@
</section>
<section>
+ <title>Overriding the type of an injection point</title>
+
+ <para>It is possible to limit which bean types are availible to inject int a given injection point:</para>
+ <programlisting>
+ <![CDATA[
+
+public class SomeBean
+{
+ public Object someField;
+}
+
+<test:SomeBean>
+ <test:someField>
+ <s:Inject/>
+ <s:type>
+ <test:InjectedBean/>
+ </s:type>
+ </test:someField>
+</test:SomeBean>
+]]>
+</programlisting>
+<para>In the example above only beans that are assinable 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>
<programlisting>
14 years, 9 months
Seam SVN: r12324 - in modules/xml/trunk/core/src: test/java/org/jboss/seam/xml/test/types and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 06:24:05 -0400 (Tue, 30 Mar 2010)
New Revision: 12324
Modified:
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml
Log:
override parameter injection point types using XML
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-03-30 10:22:06 UTC (rev 12323)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-03-30 10:24:05 UTC (rev 12324)
@@ -321,6 +321,22 @@
Annotation a = createAnnotation(pan);
type.addToMethodParameter(item.getMethod(), param, a);
}
+ List<TypeXmlItem> types = fi.getChildrenOfType(TypeXmlItem.class);
+ if (types.size() > 1)
+ {
+ throw new XmlConfigurationException("Only one <type> element may be present on a parameter", rb.getDocument(), rb.getLineno());
+ }
+ if (!types.isEmpty())
+ {
+ Set<Type> fieldTypes = new HashSet<Type>();
+ List<ClassXmlItem> overridenTypes = types.get(0).getChildrenOfType(ClassXmlItem.class);
+ if (overridenTypes.size() != 1)
+ {
+ throw new XmlConfigurationException("<type> must have a single child element", rb.getDocument(), rb.getLineno());
+ }
+
+ type.overrideMethodParameterType(item.getMethod(), overridenTypes.get(0).getJavaClass(), param);
+ }
}
}
@@ -342,6 +358,22 @@
Annotation a = createAnnotation(pan);
type.addToConstructorParameter((Constructor) c, param, a);
}
+ List<TypeXmlItem> types = fi.getChildrenOfType(TypeXmlItem.class);
+ if (types.size() > 1)
+ {
+ throw new XmlConfigurationException("Only one <type> element may be present on a parameter", rb.getDocument(), rb.getLineno());
+ }
+ if (!types.isEmpty())
+ {
+ Set<Type> fieldTypes = new HashSet<Type>();
+ List<ClassXmlItem> overridenTypes = types.get(0).getChildrenOfType(ClassXmlItem.class);
+ if (overridenTypes.size() != 1)
+ {
+ throw new XmlConfigurationException("<type> must have a single child element", rb.getDocument(), rb.getLineno());
+ }
+
+ type.overrideConstructorParameterType(c, overridenTypes.get(0).getJavaClass(), param);
+ }
}
}
return result;
Modified: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java 2010-03-30 10:22:06 UTC (rev 12323)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java 2010-03-30 10:24:05 UTC (rev 12324)
@@ -1,6 +1,15 @@
package org.jboss.seam.xml.test.types;
+
public class TypeInjectedClass
{
+ SomeInterface createValue;
+
+ public void create(SomeInterface value)
+ {
+ this.createValue = value;
+ }
+
public SomeInterface value;
+
}
Modified: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java 2010-03-30 10:22:06 UTC (rev 12323)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java 2010-03-30 10:24:05 UTC (rev 12324)
@@ -26,6 +26,7 @@
TypeInjectedClass x = WeldManagerUtils.getInstanceByType(manager, TypeInjectedClass.class);
assert x.value instanceof AllowedType;
+ assert x.createValue instanceof RestrictedType;
}
}
Modified: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml 2010-03-30 10:22:06 UTC (rev 12323)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml 2010-03-30 10:24:05 UTC (rev 12324)
@@ -11,6 +11,16 @@
<test:AllowedType/>
</type>
</test:value>
+ <test:create>
+ <Inject/>
+ <parameters>
+ <test:SomeInterface>
+ <type>
+ <test:RestrictedType/>
+ </type>
+ </test:SomeInterface>
+ </parameters>
+ </test:create>
</test:TypeInjectedClass>
</beans>
\ No newline at end of file
14 years, 9 months
Seam SVN: r12323 - in modules/security/trunk: examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-03-30 06:22:06 -0400 (Tue, 30 Mar 2010)
New Revision: 12323
Removed:
modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityStoreEntityClasses.java
modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java
Modified:
modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml
Log:
can now authenticate.. yeah baby!
Deleted: modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityStoreEntityClasses.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityStoreEntityClasses.java 2010-03-30 09:57:11 UTC (rev 12322)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityStoreEntityClasses.java 2010-03-30 10:22:06 UTC (rev 12323)
@@ -1,16 +0,0 @@
-package org.jboss.seam.security.management;
-
-import javax.enterprise.context.ApplicationScoped;
-
-/**
- * FIXME a hack until we get some proper bean configuration
- *
- * @author Shane Bryzak
- *
- */
-@ApplicationScoped
-public interface IdentityStoreEntityClasses
-{
- Class<?> getUserEntityClass();
- Class<?> getRoleEntityClass();
-}
Modified: modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-03-30 09:57:11 UTC (rev 12322)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-03-30 10:22:06 UTC (rev 12323)
@@ -11,6 +11,7 @@
import java.util.List;
import java.util.Set;
+import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.enterprise.inject.Instance;
@@ -21,11 +22,23 @@
import org.jboss.seam.security.Role;
import org.jboss.seam.security.SimplePrincipal;
+import org.jboss.seam.security.annotations.management.PasswordSalt;
+import org.jboss.seam.security.annotations.management.RoleConditional;
+import org.jboss.seam.security.annotations.management.RoleGroups;
+import org.jboss.seam.security.annotations.management.RoleName;
+import org.jboss.seam.security.annotations.management.UserEnabled;
+import org.jboss.seam.security.annotations.management.UserFirstName;
+import org.jboss.seam.security.annotations.management.UserLastName;
+import org.jboss.seam.security.annotations.management.UserPassword;
+import org.jboss.seam.security.annotations.management.UserPrincipal;
+import org.jboss.seam.security.annotations.management.UserRoles;
import org.jboss.seam.security.crypto.BinTools;
import org.jboss.seam.security.events.PrePersistUserEvent;
import org.jboss.seam.security.events.PrePersistUserRoleEvent;
import org.jboss.seam.security.events.UserAuthenticatedEvent;
import org.jboss.seam.security.events.UserCreatedEvent;
+import org.jboss.seam.security.util.AnnotatedBeanProperty;
+import org.jboss.seam.security.util.TypedBeanProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,7 +48,7 @@
*
* @author Shane Bryzak
*/
-@RequestScoped
+@ApplicationScoped
public class JpaIdentityStore implements IdentityStore, Serializable
{
private static final long serialVersionUID = 1171875389743972646L;
@@ -44,13 +57,29 @@
private Logger log = LoggerFactory.getLogger(JpaIdentityStore.class);
- @PersistenceContext EntityManager entityManager;
+ @Inject EntityManager entityManager;
@Inject Instance<PasswordHash> passwordHashInstance;
+
+ @Inject BeanManager manager;
- private JpaIdentityStoreConfig config;
- private BeanManager manager;
+ private Class<?> userEntityClass;
+ private Class<?> roleEntityClass;
+ private Class<?> xrefEntityClass;
+ private TypedBeanProperty xrefUserProperty;
+ private TypedBeanProperty xrefRoleProperty;
+ private AnnotatedBeanProperty<UserPrincipal> userPrincipalProperty;
+ private AnnotatedBeanProperty<UserPassword> userPasswordProperty;
+ private AnnotatedBeanProperty<PasswordSalt> passwordSaltProperty;
+ private AnnotatedBeanProperty<UserRoles> userRolesProperty;
+ private AnnotatedBeanProperty<UserEnabled> userEnabledProperty;
+ private AnnotatedBeanProperty<UserFirstName> userFirstNameProperty;
+ private AnnotatedBeanProperty<UserLastName> userLastNameProperty;
+ private AnnotatedBeanProperty<RoleName> roleNameProperty;
+ private AnnotatedBeanProperty<RoleGroups> roleGroupsProperty;
+ private AnnotatedBeanProperty<RoleConditional> roleConditionalProperty;
+
public Set<Feature> getFeatures()
{
return featureSet.getFeatures();
@@ -67,29 +96,87 @@
}
@Inject
- public void init(JpaIdentityStoreConfig config, BeanManager manager)
- {
- this.config = config;
- this.manager = manager;
-
+ public void init()
+ {
if (featureSet == null)
{
featureSet = new FeatureSet();
featureSet.enableAll();
}
- if (config.getUserEntityClass() == null)
+ userPrincipalProperty = new AnnotatedBeanProperty<UserPrincipal>(getUserEntityClass(), UserPrincipal.class);
+ userPasswordProperty = new AnnotatedBeanProperty<UserPassword>(getUserEntityClass(), UserPassword.class);
+ passwordSaltProperty = new AnnotatedBeanProperty<PasswordSalt>(getUserEntityClass(), PasswordSalt.class);
+ userRolesProperty = new AnnotatedBeanProperty<UserRoles>(getUserEntityClass(), UserRoles.class);
+ userEnabledProperty = new AnnotatedBeanProperty<UserEnabled>(getUserEntityClass(), UserEnabled.class);
+ userFirstNameProperty = new AnnotatedBeanProperty<UserFirstName>(getUserEntityClass(), UserFirstName.class);
+ userLastNameProperty = new AnnotatedBeanProperty<UserLastName>(getUserEntityClass(), UserLastName.class);
+
+ if (!userPrincipalProperty.isSet())
{
- log.error("Error in JpaIdentityStore configuration - userClass must be configured.");
- return;
+ throw new IdentityManagementException("Invalid userClass " + getUserEntityClass().getName() +
+ " - required annotation @UserPrincipal not found on any Field or Method.");
}
+
+ if (!userRolesProperty.isSet())
+ {
+ throw new IdentityManagementException("Invalid userClass " + getUserEntityClass().getName() +
+ " - required annotation @UserRoles not found on any Field or Method.");
+ }
+
+ if (getRoleEntityClass() != null)
+ {
+ roleNameProperty = new AnnotatedBeanProperty<RoleName>(getRoleEntityClass(), RoleName.class);
+ roleGroupsProperty = new AnnotatedBeanProperty<RoleGroups>(getRoleEntityClass(), RoleGroups.class);
+ roleConditionalProperty = new AnnotatedBeanProperty<RoleConditional>(getRoleEntityClass(), RoleConditional.class);
+
+ if (!roleNameProperty.isSet())
+ {
+ throw new IdentityManagementException("Invalid roleClass " + getRoleEntityClass().getName() +
+ " - required annotation @RoleName not found on any Field or Method.");
+ }
+
+ Type type = userRolesProperty.getPropertyType();
+ if (type instanceof ParameterizedType &&
+ Collection.class.isAssignableFrom((Class<?>) ((ParameterizedType) type).getRawType()))
+ {
+ Type genType = Object.class;
+
+ for (Type t : ((ParameterizedType) type).getActualTypeArguments())
+ {
+ genType = t;
+ break;
+ }
+
+ // If the @UserRoles property isn't a collection of <roleClass>, then assume the relationship
+ // is going through a cross-reference table
+ if (!genType.equals(getRoleEntityClass()))
+ {
+ xrefEntityClass = (Class<?>) genType;
+ xrefUserProperty = new TypedBeanProperty(xrefEntityClass, getUserEntityClass());
+ xrefRoleProperty = new TypedBeanProperty(xrefEntityClass, getRoleEntityClass());
+
+ if (!xrefUserProperty.isSet())
+ {
+ throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
+ "you're using a cross-reference table, however the user property cannot be determined.");
+ }
+
+ if (!xrefRoleProperty.isSet())
+ {
+ throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
+ "you're using a cross-reference table, however the role property cannot be determined.");
+ }
+ }
+ }
+ }
}
public boolean createUser(String username, String password, String firstname, String lastname)
{
try
{
- if (config.getUserEntityClass() == null)
+ if (getUserEntityClass() == null)
{
throw new IdentityManagementException("Could not create account, userClass not set");
}
@@ -99,21 +186,21 @@
throw new IdentityManagementException("Could not create account, already exists");
}
- Object user = config.getUserEntityClass().newInstance();
+ Object user = getUserEntityClass().newInstance();
- config.getUserPrincipalProperty().setValue(user, username);
+ getUserPrincipalProperty().setValue(user, username);
- if (config.getUserFirstNameProperty().isSet()) config.getUserFirstNameProperty().setValue(user, firstname);
- if (config.getUserLastNameProperty().isSet()) config.getUserLastNameProperty().setValue(user, lastname);
+ if (getUserFirstNameProperty().isSet()) getUserFirstNameProperty().setValue(user, firstname);
+ if (getUserLastNameProperty().isSet()) getUserLastNameProperty().setValue(user, lastname);
if (password == null)
{
- if (config.getUserEnabledProperty().isSet()) config.getUserEnabledProperty().setValue(user, false);
+ if (getUserEnabledProperty().isSet()) getUserEnabledProperty().setValue(user, false);
}
else
{
setUserPassword(user, password);
- if (config.getUserEnabledProperty().isSet()) config.getUserEnabledProperty().setValue(user, true);
+ if (getUserEnabledProperty().isSet()) getUserEnabledProperty().setValue(user, true);
}
manager.fireEvent(new PrePersistUserEvent(user));
@@ -139,15 +226,15 @@
protected void setUserPassword(Object user, String password)
{
- if (config.getPasswordSaltProperty().isSet())
+ if (getPasswordSaltProperty().isSet())
{
byte[] salt = generateUserSalt(user);
- config.getPasswordSaltProperty().setValue(user, BinTools.bin2hex(salt));
- config.getUserPasswordProperty().setValue(user, generatePasswordHash(password, salt));
+ getPasswordSaltProperty().setValue(user, BinTools.bin2hex(salt));
+ getUserPasswordProperty().setValue(user, generatePasswordHash(password, salt));
}
else
{
- config.getUserPasswordProperty().setValue(user, generatePasswordHash(password, getUserAccountSalt(user)));
+ getUserPasswordProperty().setValue(user, generatePasswordHash(password, getUserAccountSalt(user)));
}
}
@@ -158,7 +245,7 @@
protected String getUserAccountSalt(Object user)
{
// By default, we'll use the user's username as the password salt
- return config.getUserPrincipalProperty().getValue(user).toString();
+ return getUserPrincipalProperty().getValue(user).toString();
}
/**
@@ -189,12 +276,12 @@
@SuppressWarnings("unchecked")
public boolean grantRole(String username, String role)
{
- if (config.getRoleEntityClass() == null) return false;
+ if (getRoleEntityClass() == null) return false;
Object user = lookupUser(username);
if (user == null)
{
- if (config.getUserPasswordProperty().isSet())
+ if (getUserPasswordProperty().isSet())
{
// If no userPasswordProperty is set, it means that authentication is being performed
// by another identity store and this one is just managing roles
@@ -221,10 +308,10 @@
throw new NoSuchRoleException("Could not grant role, role '" + role + "' does not exist");
}
- Collection<?> userRoles = (Collection<?>) config.getUserRolesProperty().getValue(user);
+ Collection<?> userRoles = (Collection<?>) getUserRolesProperty().getValue(user);
if (userRoles == null)
{
- Type propType = config.getUserRolesProperty().getPropertyType();
+ Type propType = getUserRolesProperty().getPropertyType();
Class<?> collectionType;
if (propType instanceof Class && Collection.class.isAssignableFrom((Class<?>) propType))
@@ -251,30 +338,30 @@
userRoles = new ArrayList<Object>();
}
- config.getUserRolesProperty().setValue(user, userRoles);
+ getUserRolesProperty().setValue(user, userRoles);
}
- else if (((Collection<?>) config.getUserRolesProperty().getValue(user)).contains(roleToGrant))
+ else if (((Collection<?>) getUserRolesProperty().getValue(user)).contains(roleToGrant))
{
return false;
}
- if (config.getXrefEntityClass() == null)
+ if (getXrefEntityClass() == null)
{
// If this is a Many-To-Many relationship, simply add the role
- ((Collection<Object>) config.getUserRolesProperty().getValue(user)).add(roleToGrant);
+ ((Collection<Object>) getUserRolesProperty().getValue(user)).add(roleToGrant);
}
else
{
// Otherwise we need to insert a cross-reference entity instance
try
{
- Object xref = config.getXrefEntityClass().newInstance();
- config.getXrefUserProperty().setValue(xref, user);
- config.getXrefRoleProperty().setValue(xref, roleToGrant);
+ Object xref = getXrefEntityClass().newInstance();
+ getXrefUserProperty().setValue(xref, user);
+ getXrefRoleProperty().setValue(xref, roleToGrant);
manager.fireEvent(new PrePersistUserRoleEvent(xref));
- ((Collection<Object>) config.getUserRolesProperty().getValue(user)).add(entityManager.merge(xref));
+ ((Collection<Object>) getUserRolesProperty().getValue(user)).add(entityManager.merge(xref));
}
catch (Exception ex)
{
@@ -301,17 +388,17 @@
boolean success = false;
- if (config.getXrefEntityClass() == null)
+ if (getXrefEntityClass() == null)
{
- success = ((Collection<?>) config.getUserRolesProperty().getValue(user)).remove(roleToRevoke);
+ success = ((Collection<?>) getUserRolesProperty().getValue(user)).remove(roleToRevoke);
}
else
{
- Collection<?> roles = ((Collection<?>) config.getUserRolesProperty().getValue(user));
+ Collection<?> roles = ((Collection<?>) getUserRolesProperty().getValue(user));
for (Object xref : roles)
{
- if (config.getXrefRoleProperty().getValue(xref).equals(roleToRevoke))
+ if (getXrefRoleProperty().getValue(xref).equals(roleToRevoke))
{
success = roles.remove(xref);
break;
@@ -325,7 +412,7 @@
@SuppressWarnings("unchecked")
public boolean addRoleToGroup(String role, String group)
{
- if (!config.getRoleGroupsProperty().isSet()) return false;
+ if (!getRoleGroupsProperty().isSet()) return false;
Object targetRole = lookupRole(role);
if (targetRole == null)
@@ -339,14 +426,14 @@
throw new NoSuchRoleException("Could not grant role, group '" + group + "' does not exist");
}
- Collection<?> roleGroups = (Collection<?>) config.getRoleGroupsProperty().getValue(targetRole);
+ Collection<?> roleGroups = (Collection<?>) getRoleGroupsProperty().getValue(targetRole);
if (roleGroups == null)
{
// This should either be a Set, or a List...
Class<?> rawType = null;
- if (config.getRoleGroupsProperty().getPropertyType() instanceof ParameterizedType)
+ if (getRoleGroupsProperty().getPropertyType() instanceof ParameterizedType)
{
- rawType = (Class<?>) ((ParameterizedType) config.getRoleGroupsProperty().getPropertyType()).getRawType();
+ rawType = (Class<?>) ((ParameterizedType) getRoleGroupsProperty().getPropertyType()).getRawType();
}
else
{
@@ -362,21 +449,21 @@
roleGroups = new ArrayList<Object>();
}
- config.getRoleGroupsProperty().setValue(targetRole, roleGroups);
+ getRoleGroupsProperty().setValue(targetRole, roleGroups);
}
- else if (((Collection<?>) config.getRoleGroupsProperty().getValue(targetRole)).contains(targetGroup))
+ else if (((Collection<?>) getRoleGroupsProperty().getValue(targetRole)).contains(targetGroup))
{
return false;
}
- ((Collection<Object>) config.getRoleGroupsProperty().getValue(targetRole)).add(targetGroup);
+ ((Collection<Object>) getRoleGroupsProperty().getValue(targetRole)).add(targetGroup);
return true;
}
public boolean removeRoleFromGroup(String role, String group)
{
- if (!config.getRoleGroupsProperty().isSet()) return false;
+ if (!getRoleGroupsProperty().isSet()) return false;
Object roleToRemove = lookupRole(role);
if (role == null)
@@ -390,7 +477,7 @@
throw new NoSuchRoleException("Could not remove role from group, no such group '" + group + "'");
}
- boolean success = ((Collection<?>) config.getRoleGroupsProperty().getValue(roleToRemove)).remove(targetGroup);
+ boolean success = ((Collection<?>) getRoleGroupsProperty().getValue(roleToRemove)).remove(targetGroup);
return success;
}
@@ -399,7 +486,7 @@
{
try
{
- if (config.getRoleEntityClass() == null)
+ if (getRoleEntityClass() == null)
{
throw new IdentityManagementException("Could not create role, roleClass not set");
}
@@ -409,8 +496,8 @@
throw new IdentityManagementException("Could not create role, already exists");
}
- Object instance = config.getRoleEntityClass().newInstance();
- config.getRoleNameProperty().setValue(instance, role);
+ Object instance = getRoleEntityClass().newInstance();
+ getRoleNameProperty().setValue(instance, role);
entityManager.persist(instance);
return true;
@@ -436,9 +523,9 @@
throw new NoSuchRoleException("Could not delete role, role '" + role + "' does not exist");
}
- if (config.getXrefEntityClass() != null)
+ if (getXrefEntityClass() != null)
{
- entityManager.createQuery("delete " + config.getXrefEntityClass().getName() + " where role = :role")
+ entityManager.createQuery("delete " + getXrefEntityClass().getName() + " where role = :role")
.setParameter("role", roleToDelete)
.executeUpdate();
}
@@ -463,10 +550,10 @@
public boolean enableUser(String name)
{
- if (!config.getUserEnabledProperty().isSet())
+ if (!getUserEnabledProperty().isSet())
{
log.debug("Can not enable user, no @UserEnabled property configured in userClass " +
- config.getUserEntityClass().getName());
+ getUserEntityClass().getName());
return false;
}
@@ -477,21 +564,21 @@
}
// Can't enable an already-enabled user, return false
- if (((Boolean) config.getUserEnabledProperty().getValue(user)) == true)
+ if (((Boolean) getUserEnabledProperty().getValue(user)) == true)
{
return false;
}
- config.getUserEnabledProperty().setValue(user, true);
+ getUserEnabledProperty().setValue(user, true);
return true;
}
public boolean disableUser(String name)
{
- if (!config.getUserEnabledProperty().isSet())
+ if (!getUserEnabledProperty().isSet())
{
log.debug("Can not disable user, no @UserEnabled property configured in userClass " +
- config.getUserEntityClass().getName());
+ getUserEntityClass().getName());
return false;
}
@@ -502,12 +589,12 @@
}
// Can't disable an already-disabled user, return false
- if (((Boolean) config.getUserEnabledProperty().getValue(user)) == false)
+ if (((Boolean) getUserEnabledProperty().getValue(user)) == false)
{
return false;
}
- config.getUserEnabledProperty().setValue(user, false);
+ getUserEnabledProperty().setValue(user, false);
return true;
}
@@ -537,8 +624,8 @@
public boolean isUserEnabled(String name)
{
Object user = lookupUser(name);
- return user != null && (!config.getUserEnabledProperty().isSet() ||
- (((Boolean) config.getUserEnabledProperty().getValue(user))) == true);
+ return user != null && (!getUserEnabledProperty().isSet() ||
+ (((Boolean) getUserEnabledProperty().getValue(user))) == true);
}
public List<String> getGrantedRoles(String name)
@@ -551,20 +638,20 @@
List<String> roles = new ArrayList<String>();
- Collection<?> userRoles = (Collection<?>) config.getUserRolesProperty().getValue(user);
+ Collection<?> userRoles = (Collection<?>) getUserRolesProperty().getValue(user);
if (userRoles != null)
{
for (Object role : userRoles)
{
- if (config.getXrefEntityClass() == null)
+ if (getXrefEntityClass() == null)
{
- roles.add((String) config.getRoleNameProperty().getValue(role));
+ roles.add((String) getRoleNameProperty().getValue(role));
}
else
{
- Object xref = config.getRoleNameProperty().getValue(role);
- Object userRole = config.getXrefRoleProperty().getValue(xref);
- roles.add((String) config.getRoleNameProperty().getValue(userRole));
+ Object xref = getRoleNameProperty().getValue(role);
+ Object userRole = getXrefRoleProperty().getValue(xref);
+ roles.add((String) getRoleNameProperty().getValue(userRole));
}
}
}
@@ -582,14 +669,14 @@
List<String> groups = new ArrayList<String>();
- if (config.getRoleGroupsProperty().isSet())
+ if (getRoleGroupsProperty().isSet())
{
- Collection<?> roleGroups = (Collection<?>) config.getRoleGroupsProperty().getValue(role);
+ Collection<?> roleGroups = (Collection<?>) getRoleGroupsProperty().getValue(role);
if (roleGroups != null)
{
for (Object group : roleGroups)
{
- groups.add((String) config.getRoleNameProperty().getValue(group));
+ groups.add((String) getRoleNameProperty().getValue(group));
}
}
}
@@ -606,12 +693,12 @@
}
Set<String> roles = new HashSet<String>();
- Collection<?> userRoles = (Collection<?>) config.getUserRolesProperty().getValue(user);
+ Collection<?> userRoles = (Collection<?>) getUserRolesProperty().getValue(user);
if (userRoles != null)
{
for (Object role : userRoles)
{
- addRoleAndMemberships((String) config.getRoleNameProperty().getValue(role), roles);
+ addRoleAndMemberships((String) getRoleNameProperty().getValue(role), roles);
}
}
@@ -624,15 +711,15 @@
{
Object instance = lookupRole(role);
- if (config.getRoleGroupsProperty().isSet())
+ if (getRoleGroupsProperty().isSet())
{
- Collection<?> groups = (Collection<?>) config.getRoleGroupsProperty().getValue(instance);
+ Collection<?> groups = (Collection<?>) getRoleGroupsProperty().getValue(instance);
if (groups != null)
{
for (Object group : groups)
{
- addRoleAndMemberships((String) config.getRoleNameProperty().getValue(group), roles);
+ addRoleAndMemberships((String) getRoleNameProperty().getValue(group), roles);
}
}
}
@@ -641,12 +728,12 @@
public String generatePasswordHash(String password, byte[] salt)
{
- if (config.getPasswordSaltProperty().isSet())
+ if (getPasswordSaltProperty().isSet())
{
try
{
return getPasswordHash().createPasswordKey(password.toCharArray(), salt,
- config.getUserPasswordProperty().getAnnotation().iterations());
+ getUserPasswordProperty().getAnnotation().iterations());
}
catch (GeneralSecurityException ex)
{
@@ -666,7 +753,7 @@
@Deprecated
protected String generatePasswordHash(String password, String salt)
{
- String algorithm = config.getUserPasswordProperty().getAnnotation().hash();
+ String algorithm = getUserPasswordProperty().getAnnotation().hash();
if (algorithm == null || "".equals(algorithm))
{
@@ -699,17 +786,17 @@
public boolean authenticate(String username, String password)
{
Object user = lookupUser(username);
- if (user == null || (config.getUserEnabledProperty().isSet() &&
- ((Boolean) config.getUserEnabledProperty().getValue(user) == false)))
+ if (user == null || (getUserEnabledProperty().isSet() &&
+ ((Boolean) getUserEnabledProperty().getValue(user) == false)))
{
return false;
}
String passwordHash = null;
- if (config.getPasswordSaltProperty().isSet())
+ if (getPasswordSaltProperty().isSet())
{
- String encodedSalt = (String) config.getPasswordSaltProperty().getValue(user);
+ String encodedSalt = (String) getPasswordSaltProperty().getValue(user);
if (encodedSalt == null)
{
throw new IdentityManagementException("A @PasswordSalt property was found on entity " + user +
@@ -724,7 +811,7 @@
}
- boolean success = passwordHash.equals(config.getUserPasswordProperty().getValue(user));
+ boolean success = passwordHash.equals(getUserPasswordProperty().getValue(user));
if (success)
{
@@ -739,8 +826,8 @@
try
{
Object user = entityManager.createQuery(
- "select u from " + config.getUserEntityClass().getName() + " u where " +
- config.getUserPrincipalProperty().getName() + " = :username")
+ "select u from " + getUserEntityClass().getName() + " u where " +
+ getUserPrincipalProperty().getName() + " = :username")
.setParameter("username", username)
.getSingleResult();
@@ -754,17 +841,17 @@
public String getUserName(Object user)
{
- return (String) config.getUserPrincipalProperty().getValue(user);
+ return (String) getUserPrincipalProperty().getValue(user);
}
public String getRoleName(Object role)
{
- return (String) config.getRoleNameProperty().getValue(role);
+ return (String) getRoleNameProperty().getValue(role);
}
public boolean isRoleConditional(String role)
{
- return config.getRoleConditionalProperty().isSet() ? (Boolean) config.getRoleConditionalProperty().getValue(
+ return getRoleConditionalProperty().isSet() ? (Boolean) getRoleConditionalProperty().getValue(
lookupRole(role)) : false;
}
@@ -773,7 +860,7 @@
try
{
Object value = entityManager.createQuery(
- "select r from " + config.getRoleEntityClass().getName() + " r where " + config.getRoleNameProperty().getName() +
+ "select r from " + getRoleEntityClass().getName() + " r where " + getRoleNameProperty().getName() +
" = :role")
.setParameter("role", role)
.getSingleResult();
@@ -790,8 +877,8 @@
public List<String> listUsers()
{
return entityManager.createQuery(
- "select u." + config.getUserPrincipalProperty().getName() + " from " +
- config.getUserEntityClass().getName() + " u")
+ "select u." + getUserPrincipalProperty().getName() + " from " +
+ getUserEntityClass().getName() + " u")
.getResultList();
}
@@ -799,8 +886,8 @@
public List<String> listUsers(String filter)
{
return entityManager.createQuery(
- "select u." + config.getUserPrincipalProperty().getName() + " from " + config.getUserEntityClass().getName() +
- " u where lower(" + config.getUserPrincipalProperty().getName() + ") like :username")
+ "select u." + getUserPrincipalProperty().getName() + " from " + getUserEntityClass().getName() +
+ " u where lower(" + getUserPrincipalProperty().getName() + ") like :username")
.setParameter("username", "%" + (filter != null ? filter.toLowerCase() : "") +
"%")
.getResultList();
@@ -810,8 +897,8 @@
public List<String> listRoles()
{
return entityManager.createQuery(
- "select r." + config.getRoleNameProperty().getName() + " from " +
- config.getRoleEntityClass().getName() + " r").getResultList();
+ "select r." + getRoleNameProperty().getName() + " from " +
+ getRoleEntityClass().getName() + " r").getResultList();
}
public List<Principal> listMembers(String role)
@@ -836,20 +923,20 @@
{
Object roleEntity = lookupRole(role);
- if (config.getXrefEntityClass() == null)
+ if (getXrefEntityClass() == null)
{
return entityManager.createQuery("select u." +
- config.getUserPrincipalProperty().getName() +
- " from " + config.getUserEntityClass().getName() + " u where :role member of u." +
- config.getUserRolesProperty().getName())
+ getUserPrincipalProperty().getName() +
+ " from " + getUserEntityClass().getName() + " u where :role member of u." +
+ getUserRolesProperty().getName())
.setParameter("role", roleEntity)
.getResultList();
}
else
{
List<?> xrefs = entityManager.createQuery("select x from " +
- config.getXrefEntityClass().getName() + " x where x." +
- config.getXrefRoleProperty().getName() + " = :role")
+ getXrefEntityClass().getName() + " x where x." +
+ getXrefRoleProperty().getName() + " = :role")
.setParameter("role", roleEntity)
.getResultList();
@@ -857,8 +944,8 @@
for (Object xref : xrefs)
{
- Object user = config.getXrefUserProperty().getValue(xref);
- members.add(config.getUserPrincipalProperty().getValue(user).toString());
+ Object user = getXrefUserProperty().getValue(xref);
+ members.add(getUserPrincipalProperty().getValue(user).toString());
}
return members;
@@ -869,14 +956,14 @@
@SuppressWarnings("unchecked")
private List<String> listRoleMembers(String role)
{
- if (config.getRoleGroupsProperty().isSet())
+ if (getRoleGroupsProperty().isSet())
{
Object roleEntity = lookupRole(role);
return entityManager.createQuery("select r." +
- config.getRoleNameProperty().getName() +
- " from " + config.getRoleEntityClass().getName() + " r where :role member of r." +
- config.getRoleGroupsProperty().getName())
+ getRoleNameProperty().getName() +
+ " from " + getRoleEntityClass().getName() + " r where :role member of r." +
+ getRoleGroupsProperty().getName())
.setParameter("role", roleEntity)
.getResultList();
}
@@ -890,15 +977,15 @@
StringBuilder roleQuery = new StringBuilder();
roleQuery.append("select r.");
- roleQuery.append(config.getRoleNameProperty().getName());
+ roleQuery.append(getRoleNameProperty().getName());
roleQuery.append(" from ");
- roleQuery.append(config.getRoleEntityClass().getName());
+ roleQuery.append(getRoleEntityClass().getName());
roleQuery.append(" r");
- if (config.getRoleConditionalProperty().isSet())
+ if (getRoleConditionalProperty().isSet())
{
roleQuery.append(" where r.");
- roleQuery.append(config.getRoleConditionalProperty().getName());
+ roleQuery.append(getRoleConditionalProperty().getName());
roleQuery.append(" = false");
}
@@ -909,4 +996,81 @@
{
return passwordHashInstance.get();
}
+
+ public Class<?> getUserEntityClass()
+ {
+ return userEntityClass;
+ }
+
+ public void setUserEntityClass(Class<?> userEntityClass)
+ {
+ this.userEntityClass = userEntityClass;
+ }
+
+ public Class<?> getRoleEntityClass()
+ {
+ return roleEntityClass;
+ }
+
+ public void setRoleEntityClass(Class<?> roleEntityClass)
+ {
+ this.roleEntityClass = roleEntityClass;
+ }
+
+ public Class<?> getXrefEntityClass()
+ {
+ return xrefEntityClass;
+ }
+
+ public TypedBeanProperty getXrefUserProperty()
+ {
+ return xrefUserProperty;
+ }
+
+ public TypedBeanProperty getXrefRoleProperty()
+ {
+ return xrefRoleProperty;
+ }
+
+ public AnnotatedBeanProperty<UserPrincipal> getUserPrincipalProperty()
+ {
+ return userPrincipalProperty;
+ }
+
+ public AnnotatedBeanProperty<UserPassword> getUserPasswordProperty()
+ {
+ return userPasswordProperty;
+ }
+
+ public AnnotatedBeanProperty<PasswordSalt> getPasswordSaltProperty() {
+ return passwordSaltProperty;
+ }
+
+ public AnnotatedBeanProperty<UserRoles> getUserRolesProperty() {
+ return userRolesProperty;
+ }
+
+ public AnnotatedBeanProperty<UserEnabled> getUserEnabledProperty() {
+ return userEnabledProperty;
+ }
+
+ public AnnotatedBeanProperty<UserFirstName> getUserFirstNameProperty() {
+ return userFirstNameProperty;
+ }
+
+ public AnnotatedBeanProperty<UserLastName> getUserLastNameProperty() {
+ return userLastNameProperty;
+ }
+
+ public AnnotatedBeanProperty<RoleName> getRoleNameProperty() {
+ return roleNameProperty;
+ }
+
+ public AnnotatedBeanProperty<RoleGroups> getRoleGroupsProperty() {
+ return roleGroupsProperty;
+ }
+
+ public AnnotatedBeanProperty<RoleConditional> getRoleConditionalProperty() {
+ return roleConditionalProperty;
+ }
}
Deleted: modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java 2010-03-30 09:57:11 UTC (rev 12322)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/JpaIdentityStoreConfig.java 2010-03-30 10:22:06 UTC (rev 12323)
@@ -1,209 +0,0 @@
-package org.jboss.seam.security.management;
-
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Collection;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-import org.jboss.seam.security.annotations.management.PasswordSalt;
-import org.jboss.seam.security.annotations.management.RoleConditional;
-import org.jboss.seam.security.annotations.management.RoleGroups;
-import org.jboss.seam.security.annotations.management.RoleName;
-import org.jboss.seam.security.annotations.management.UserEnabled;
-import org.jboss.seam.security.annotations.management.UserFirstName;
-import org.jboss.seam.security.annotations.management.UserLastName;
-import org.jboss.seam.security.annotations.management.UserPassword;
-import org.jboss.seam.security.annotations.management.UserPrincipal;
-import org.jboss.seam.security.annotations.management.UserRoles;
-import org.jboss.seam.security.util.AnnotatedBeanProperty;
-import org.jboss.seam.security.util.TypedBeanProperty;
-
-/**
- * The configuration for JpaIdentityStore
- *
- * @author Shane Bryzak
- */
-@ApplicationScoped
-public class JpaIdentityStoreConfig
-{
- private Class<?> userEntityClass;
- private Class<?> roleEntityClass;
- private Class<?> xrefEntityClass;
- private TypedBeanProperty xrefUserProperty;
- private TypedBeanProperty xrefRoleProperty;
-
- private AnnotatedBeanProperty<UserPrincipal> userPrincipalProperty;
- private AnnotatedBeanProperty<UserPassword> userPasswordProperty;
- private AnnotatedBeanProperty<PasswordSalt> passwordSaltProperty;
- private AnnotatedBeanProperty<UserRoles> userRolesProperty;
- private AnnotatedBeanProperty<UserEnabled> userEnabledProperty;
- private AnnotatedBeanProperty<UserFirstName> userFirstNameProperty;
- private AnnotatedBeanProperty<UserLastName> userLastNameProperty;
- private AnnotatedBeanProperty<RoleName> roleNameProperty;
- private AnnotatedBeanProperty<RoleGroups> roleGroupsProperty;
- private AnnotatedBeanProperty<RoleConditional> roleConditionalProperty;
-
- //@Current // FIXME temporarily disable!!
- IdentityStoreEntityClasses entityClasses;
-
- @Inject
- public void initProperties()
- {
- userPrincipalProperty = new AnnotatedBeanProperty<UserPrincipal>(getUserEntityClass(), UserPrincipal.class);
- userPasswordProperty = new AnnotatedBeanProperty<UserPassword>(getUserEntityClass(), UserPassword.class);
- passwordSaltProperty = new AnnotatedBeanProperty<PasswordSalt>(getUserEntityClass(), PasswordSalt.class);
- userRolesProperty = new AnnotatedBeanProperty<UserRoles>(getUserEntityClass(), UserRoles.class);
- userEnabledProperty = new AnnotatedBeanProperty<UserEnabled>(getUserEntityClass(), UserEnabled.class);
- userFirstNameProperty = new AnnotatedBeanProperty<UserFirstName>(getUserEntityClass(), UserFirstName.class);
- userLastNameProperty = new AnnotatedBeanProperty<UserLastName>(getUserEntityClass(), UserLastName.class);
-
- if (!userPrincipalProperty.isSet())
- {
- throw new IdentityManagementException("Invalid userClass " + getUserEntityClass().getName() +
- " - required annotation @UserPrincipal not found on any Field or Method.");
- }
-
- if (!userRolesProperty.isSet())
- {
- throw new IdentityManagementException("Invalid userClass " + getUserEntityClass().getName() +
- " - required annotation @UserRoles not found on any Field or Method.");
- }
-
- if (getRoleEntityClass() != null)
- {
- roleNameProperty = new AnnotatedBeanProperty<RoleName>(getRoleEntityClass(), RoleName.class);
- roleGroupsProperty = new AnnotatedBeanProperty<RoleGroups>(getRoleEntityClass(), RoleGroups.class);
- roleConditionalProperty = new AnnotatedBeanProperty<RoleConditional>(getRoleEntityClass(), RoleConditional.class);
-
- if (!roleNameProperty.isSet())
- {
- throw new IdentityManagementException("Invalid roleClass " + getRoleEntityClass().getName() +
- " - required annotation @RoleName not found on any Field or Method.");
- }
-
- Type type = userRolesProperty.getPropertyType();
- if (type instanceof ParameterizedType &&
- Collection.class.isAssignableFrom((Class<?>) ((ParameterizedType) type).getRawType()))
- {
- Type genType = Object.class;
-
- for (Type t : ((ParameterizedType) type).getActualTypeArguments())
- {
- genType = t;
- break;
- }
-
- // If the @UserRoles property isn't a collection of <roleClass>, then assume the relationship
- // is going through a cross-reference table
- if (!genType.equals(getRoleEntityClass()))
- {
- xrefEntityClass = (Class<?>) genType;
- xrefUserProperty = new TypedBeanProperty(xrefEntityClass, getUserEntityClass());
- xrefRoleProperty = new TypedBeanProperty(xrefEntityClass, getRoleEntityClass());
-
- if (!xrefUserProperty.isSet())
- {
- throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
- "you're using a cross-reference table, however the user property cannot be determined.");
- }
-
- if (!xrefRoleProperty.isSet())
- {
- throw new IdentityManagementException("Error configuring JpaIdentityStore - it looks like " +
- "you're using a cross-reference table, however the role property cannot be determined.");
- }
- }
- }
- }
- }
-
- public Class<?> getUserEntityClass()
- {
- if (userEntityClass == null)
- {
- userEntityClass = entityClasses.getUserEntityClass();
- }
-
- return userEntityClass;
- }
-
- public void setUserEntityClass(Class<?> userEntityClass)
- {
- this.userEntityClass = userEntityClass;
- }
-
- public Class<?> getRoleEntityClass()
- {
- if (roleEntityClass == null)
- {
- roleEntityClass = entityClasses.getRoleEntityClass();
- }
-
- return roleEntityClass;
- }
-
- public void setRoleEntityClass(Class<?> roleEntityClass)
- {
- this.roleEntityClass = roleEntityClass;
- }
-
- public Class<?> getXrefEntityClass()
- {
- return xrefEntityClass;
- }
-
- public TypedBeanProperty getXrefUserProperty()
- {
- return xrefUserProperty;
- }
-
- public TypedBeanProperty getXrefRoleProperty()
- {
- return xrefRoleProperty;
- }
-
- public AnnotatedBeanProperty<UserPrincipal> getUserPrincipalProperty()
- {
- return userPrincipalProperty;
- }
-
- public AnnotatedBeanProperty<UserPassword> getUserPasswordProperty()
- {
- return userPasswordProperty;
- }
-
- public AnnotatedBeanProperty<PasswordSalt> getPasswordSaltProperty() {
- return passwordSaltProperty;
- }
-
- public AnnotatedBeanProperty<UserRoles> getUserRolesProperty() {
- return userRolesProperty;
- }
-
- public AnnotatedBeanProperty<UserEnabled> getUserEnabledProperty() {
- return userEnabledProperty;
- }
-
- public AnnotatedBeanProperty<UserFirstName> getUserFirstNameProperty() {
- return userFirstNameProperty;
- }
-
- public AnnotatedBeanProperty<UserLastName> getUserLastNameProperty() {
- return userLastNameProperty;
- }
-
- public AnnotatedBeanProperty<RoleName> getRoleNameProperty() {
- return roleNameProperty;
- }
-
- public AnnotatedBeanProperty<RoleGroups> getRoleGroupsProperty() {
- return roleGroupsProperty;
- }
-
- public AnnotatedBeanProperty<RoleConditional> getRoleConditionalProperty() {
- return roleConditionalProperty;
- }
-
-}
Modified: modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java 2010-03-30 09:57:11 UTC (rev 12322)
+++ modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java 2010-03-30 10:22:06 UTC (rev 12323)
@@ -5,14 +5,17 @@
import javax.enterprise.context.ConversationScoped;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
@ConversationScoped
public class EntityManagerProducer implements Serializable
{
private static final long serialVersionUID = 8654896806568473010L;
+
+ @PersistenceContext EntityManager entityManager;
public @Produces EntityManager getEntityManager()
{
- return null;
+ return entityManager;
}
}
Modified: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-03-30 09:57:11 UTC (rev 12322)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-03-30 10:22:06 UTC (rev 12323)
@@ -11,9 +11,17 @@
<idm:IdentityManager>
<s:extends/>
<idm:identityStore>
- <s:Inject/>
- <s:New>org.jboss.seam.security.management.JpaIdentityStore</s:New>
+ <s:Inject/>
+ <s:type>
+ <idm:JpaIdentityStore/>
+ </s:type>
</idm:identityStore>
</idm:IdentityManager>
+ <idm:JpaIdentityStore>
+ <s:extends/>
+ <idm:userEntityClass>org.jboss.seam.security.examples.seamspace.model.MemberAccount</idm:userEntityClass>
+ <idm:roleEntityClass>org.jboss.seam.security.examples.seamspace.model.MemberRole</idm:roleEntityClass>
+ </idm:JpaIdentityStore>
+
</beans>
\ No newline at end of file
14 years, 9 months
Seam SVN: r12322 - in modules/xml/trunk: core/src/main/java/org/jboss/seam/xml/model and 5 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 05:57:11 -0400 (Tue, 30 Mar 2010)
New Revision: 12322
Added:
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/TypeXmlItem.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/AllowedType.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/RestrictedType.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/SomeInterface.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java
modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/
modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml
Modified:
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/XmlItemType.java
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java
modules/xml/trunk/pom.xml
Log:
added ability to override field type
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-03-30 08:33:45 UTC (rev 12321)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -19,7 +19,7 @@
allowed.add(XmlItemType.FIELD);
allowed.add(XmlItemType.METHOD);
allowed.add(XmlItemType.PARAMETERS);
-
+ allowed.add(XmlItemType.TYPE);
}
public Set<XmlItemType> getAllowedItem()
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java 2010-03-30 08:33:45 UTC (rev 12321)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -42,6 +42,7 @@
}
allowed.add(XmlItemType.ANNOTATION);
allowed.add(XmlItemType.VALUE);
+ allowed.add(XmlItemType.TYPE);
}
public Field getField()
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-03-30 08:33:45 UTC (rev 12321)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -7,8 +7,10 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -277,6 +279,23 @@
Annotation a = createAnnotation(fi);
type.addToField(item.getField(), a);
}
+ List<TypeXmlItem> types = item.getChildrenOfType(TypeXmlItem.class);
+ if (types.size() > 1)
+ {
+ throw new XmlConfigurationException("Only one <type> element may be present on a field", rb.getDocument(), rb.getLineno());
+ }
+ if (!types.isEmpty())
+ {
+ Set<Type> fieldTypes = new HashSet<Type>();
+ List<ClassXmlItem> overridenTypes = types.get(0).getChildrenOfType(ClassXmlItem.class);
+ if (overridenTypes.size() != 1)
+ {
+ throw new XmlConfigurationException("<type> must have a single child element", rb.getDocument(), rb.getLineno());
+ }
+
+ type.overrideFieldType(item.getField(), overridenTypes.get(0).getJavaClass());
+ }
+
}
for (MethodXmlItem item : rb.getChildrenOfType(MethodXmlItem.class))
{
Added: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/TypeXmlItem.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/TypeXmlItem.java (rev 0)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/TypeXmlItem.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,30 @@
+/*
+ * Distributed under the LGPL License
+ *
+ */
+package org.jboss.seam.xml.model;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class TypeXmlItem extends AbstractXmlItem
+{
+
+ static final Set<XmlItemType> allowed = new HashSet<XmlItemType>();
+
+ static
+ {
+ allowed.add(XmlItemType.CLASS);
+ allowed.add(XmlItemType.ANNOTATION);
+ }
+
+ public TypeXmlItem(XmlItem parent, String document, int lineno)
+ {
+ super(XmlItemType.TYPE, parent, null, null, null, document, lineno);
+ }
+
+ public Set<XmlItemType> getAllowedItem()
+ {
+ return allowed;
+ }
+}
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/XmlItemType.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/XmlItemType.java 2010-03-30 08:33:45 UTC (rev 12321)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/model/XmlItemType.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -6,5 +6,5 @@
public enum XmlItemType
{
- CLASS, METHOD, FIELD, ANNOTATION, VALUE, VETO, ENTRY, KEY, DEPENDENCY, PARAMETERS, PARAMETER, ARRAY, OVERRIDE, EXTENDS;
+ CLASS, METHOD, FIELD, ANNOTATION, VALUE, VETO, ENTRY, KEY, DEPENDENCY, PARAMETERS, PARAMETER, ARRAY, OVERRIDE, EXTENDS, TYPE;
}
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java 2010-03-30 08:33:45 UTC (rev 12321)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -12,6 +12,7 @@
import org.jboss.seam.xml.model.OverrideXmlItem;
import org.jboss.seam.xml.model.ParameterXmlItem;
import org.jboss.seam.xml.model.ParametersXmlItem;
+import org.jboss.seam.xml.model.TypeXmlItem;
import org.jboss.seam.xml.model.ValueXmlItem;
import org.jboss.seam.xml.model.XmlItem;
import org.jboss.seam.xml.model.XmlItemType;
@@ -68,6 +69,10 @@
{
return new ParametersXmlItem(parent, node.getDocument(), node.getLineNo());
}
+ else if (item.equals("type"))
+ {
+ return new TypeXmlItem(parent, node.getDocument(), node.getLineNo());
+ }
// now deal with primitive types
Added: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/AllowedType.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/AllowedType.java (rev 0)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/AllowedType.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,6 @@
+package org.jboss.seam.xml.test.types;
+
+public class AllowedType implements SomeInterface
+{
+
+}
Added: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/RestrictedType.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/RestrictedType.java (rev 0)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/RestrictedType.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,6 @@
+package org.jboss.seam.xml.test.types;
+
+public class RestrictedType implements SomeInterface
+{
+
+}
Added: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/SomeInterface.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/SomeInterface.java (rev 0)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/SomeInterface.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,6 @@
+package org.jboss.seam.xml.test.types;
+
+public interface SomeInterface
+{
+
+}
Added: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java (rev 0)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypeInjectedClass.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,6 @@
+package org.jboss.seam.xml.test.types;
+
+public class TypeInjectedClass
+{
+ public SomeInterface value;
+}
Added: modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java
===================================================================
--- modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java (rev 0)
+++ modules/xml/trunk/core/src/test/java/org/jboss/seam/xml/test/types/TypesTest.java 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,31 @@
+/*
+ * Distributed under the LGPL License
+ *
+ */
+package org.jboss.seam.xml.test.types;
+
+import org.jboss.seam.xml.test.AbstractXMLTest;
+import org.jboss.weld.environment.se.util.WeldManagerUtils;
+import org.testng.annotations.Test;
+
+/**
+ * tests that <types> restricts the allowed types of an injection point
+ */
+public class TypesTest extends AbstractXMLTest
+{
+
+ @Override
+ protected String getXmlFileName()
+ {
+ return "types-test-beans.xml";
+ }
+
+ @Test(enabled = true)
+ public void testTypeRestriction()
+ {
+
+ TypeInjectedClass x = WeldManagerUtils.getInstanceByType(manager, TypeInjectedClass.class);
+ assert x.value instanceof AllowedType;
+
+ }
+}
Added: modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml
===================================================================
--- modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml (rev 0)
+++ modules/xml/trunk/core/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml 2010-03-30 09:57:11 UTC (rev 12322)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="urn:java:seam:core"
+ xmlns:test="urn:java:org.jboss.seam.xml.test.types">
+
+
+ <test:TypeInjectedClass>
+ <override/>
+ <test:value>
+ <Inject/>
+ <type>
+ <test:AllowedType/>
+ </type>
+ </test:value>
+ </test:TypeInjectedClass>
+
+</beans>
\ No newline at end of file
Modified: modules/xml/trunk/pom.xml
===================================================================
--- modules/xml/trunk/pom.xml 2010-03-30 08:33:45 UTC (rev 12321)
+++ modules/xml/trunk/pom.xml 2010-03-30 09:57:11 UTC (rev 12322)
@@ -58,7 +58,7 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
- <version>1.0.0.Alpha1</version>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
14 years, 9 months
Seam SVN: r12321 - in branches/community/Seam_2_2/src/test/ftest: src/main/org/jboss/seam/example/common/test/booking and 2 other directories.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-03-30 04:33:45 -0400 (Tue, 30 Mar 2010)
New Revision: 12321
Added:
branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5-webdriver.xml
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5.xml
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java
Log:
JBSEAM-4610 icefaces - testConversation test rewritten to webdriver and some enhancements to webdriver infrastructure
Added: branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5-webdriver.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5-webdriver.xml (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5-webdriver.xml 2010-03-30 08:33:45 UTC (rev 12321)
@@ -0,0 +1,25 @@
+
+ <!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, 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.
+ -->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Web Driver Icefaces example" verbose="2" parallel="false">
+ <test name="icefaces_jboss5_webdriver">
+ <classes>
+ <class name="org.jboss.seam.example.common.test.booking.webdriver.ConversationTest" />
+ </classes>
+ </test>
+</suite>
\ No newline at end of file
Modified: branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5.xml 2010-03-30 07:11:56 UTC (rev 12320)
+++ branches/community/Seam_2_2/src/test/ftest/examples/icefaces/jboss5.xml 2010-03-30 08:33:45 UTC (rev 12321)
@@ -33,8 +33,8 @@
</class>
<class
name="org.jboss.seam.example.common.test.booking.selenium.SimpleBookingTest" />
- <class
- name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest" />
+ <!-- this test is executed by web driver
+ <class name="org.jboss.seam.example.common.test.booking.selenium.ConversationTest" /> -->
</classes>
</test>
</suite>
\ No newline at end of file
Added: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/booking/webdriver/ConversationTest.java 2010-03-30 08:33:45 UTC (rev 12321)
@@ -0,0 +1,203 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.example.common.test.booking.webdriver;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.seam.example.common.test.webdriver.AjaxWebDriverTest;
+import org.jboss.seam.example.common.test.webdriver.AjaxWebDriver;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.testng.annotations.Test;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import com.thoughtworks.selenium.Wait;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
+/**
+ * This class tests functionality of conversations in booking-like examples.
+ *
+ * @author Martin Gencur
+ *
+ */
+public class ConversationTest extends AjaxWebDriverTest
+{
+ public int timeout = 16000;
+
+ private final String DEFAULT_USERNAME = "demo";
+ private final String DEFAULT_PASSWORD = "demo";
+
+ private final int W1 = 0; //first window
+ private final int W2 = 1; //second window
+
+ public final String MAIN_PAGE = "/main.seam";
+ public final String HOME_PAGE = "/home.seam";
+ public final String HOTEL1 = "Hotel Rouge";
+ public final String HOTEL2 = "Doubletree";
+ public final String PAGE_TITLE = "JBoss Suites: Seam Framework";
+ public final String WORKSPACE_BOOKING_TEXT_HOTEL1 = "Book hotel: " + HOTEL1;
+ public final String WORKSPACE_VIEW_TEXT_HOTEL2 = "View hotel: " + HOTEL2;
+ public final By LOGIN_USERNAME_FIELD = By.id("login:username");
+ public final By LOGIN_PASSWORD_FIELD = By.id("login:password");
+ public final By LOGIN_SUBMIT = By.id("login:login");
+ public final By SEARCH_STRING_FIELD = By.id("searchCriteria:searchString");
+ public final By SPINNER = By.id("searchCriteria:Spinner:connection-working");
+ public final By SEARCH_RESULT_TABLE = By.xpath("//table[@id = 'searchResults:hotels']/tbody");
+ public final By NO_HOTELS_FOUND = By.id("searchResults:NoHotelsFoundMessage");
+ public final By WORKSPACE_LINK_0 = By.id("ConversationListForm:ConversationListDataTable:0:EntryDescriptionLink");
+ public final By WORKSPACE_LINK_1 = By.id("ConversationListForm:ConversationListDataTable:1:EntryDescriptionLink");
+ public final By SEARCH_RESULT_TABLE_FIRST_ROW_LINK = By.id("searchResults:hotels:0:viewHotel");
+ public final By BOOKING_BOOK = By.id("hotel:bookHotel");
+ public final By BOOKING_CANCEL = By.id("hotel:cancel");
+ public final By LOGOUT = By.id("logout");
+ public final By WORKSPACE_TABLE_ROW_COUNT = By.xpath("//table[@id='ConversationListForm:ConversationListDataTable']/tbody/tr");
+
+ public List<String> windows = new ArrayList();
+
+ @BeforeMethod
+ public void setUp()
+ {
+ //first window is opened automatically so just choose a page to display
+ driver.get(serverURL + contextPath + MAIN_PAGE);
+ //manually open second window with javascript
+ openWindow(driver, serverURL + contextPath + MAIN_PAGE, "window2");
+ //get window handles so that we are able to access them by index
+ for (String h: driver.getWindowHandles())
+ {
+ windows.add(h);
+ }
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ closeWindows();
+ }
+
+ @Test
+ public void testConversations()
+ {
+ driver.switchTo().window(windows.get(W1));
+
+ if (!isLoggedIn(driver))
+ {
+ login(driver);
+ }
+
+ enterSearchQueryUsingAJAX(driver, HOTEL1);
+ driver.findElement(SEARCH_RESULT_TABLE_FIRST_ROW_LINK).clickAndWait();
+ driver.findElement(BOOKING_BOOK).click();
+
+ driver.switchTo().window(windows.get(W2));
+ driver.navigate().refresh();
+
+ if (!isLoggedIn(driver))
+ {
+ login(driver);
+ }
+
+ enterSearchQueryUsingAJAX(driver, HOTEL2);
+ driver.findElement(SEARCH_RESULT_TABLE_FIRST_ROW_LINK).clickAndWait();
+
+ driver.switchTo().window(windows.get(W1));
+ driver.navigate().refresh();
+
+ assertEquals("#1 workspace not present in workspace table", WORKSPACE_BOOKING_TEXT_HOTEL1, driver.findElement(WORKSPACE_LINK_0).getText());
+ assertEquals("#2 workspace not present in workspace table", WORKSPACE_VIEW_TEXT_HOTEL2, driver.findElement(WORKSPACE_LINK_1).getText());
+
+ //Switch window 1 to second workspace
+ driver.findElement(WORKSPACE_LINK_1).clickAndWait();
+ // Switch window 1 back to first workspace
+ driver.findElement(WORKSPACE_LINK_1).clickAndWait();
+ driver.switchTo().window(windows.get(W2));
+ // End conversation in window 2
+ driver.findElement(BOOKING_CANCEL).clickAndWait();
+
+ assertTrue("Workspace failure.", driver.findElements(WORKSPACE_TABLE_ROW_COUNT).size() == 1);
+ }
+
+ public void enterSearchQueryUsingAJAX(final AjaxWebDriver driver, String query) {
+ driver.findElement(SEARCH_STRING_FIELD).clearAndSendKeys(query.substring(0, query.length() - 1));
+ driver.findElement(SEARCH_STRING_FIELD).sendKeys(query.substring(query.length() - 1));
+
+ // wait for javascript to show spinner
+ try
+ {
+ Thread.sleep(3000);
+ }
+ catch (InterruptedException e)
+ {
+ }
+
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return (driver.isElementPresent(SEARCH_RESULT_TABLE) || driver.isElementPresent(NO_HOTELS_FOUND));
+ }
+ }.wait("Search results not found.");
+ }
+
+ public boolean login(AjaxWebDriver driver)
+ {
+ return login(driver, DEFAULT_USERNAME, DEFAULT_PASSWORD);
+ }
+
+ public boolean login(AjaxWebDriver driver, String username, String password)
+ {
+ if (isLoggedIn(driver)) {
+ fail("User already logged in.");
+ }
+ driver.get(serverURL + contextPath + HOME_PAGE);
+
+ if (!driver.getTitle().equals(PAGE_TITLE))
+ {
+ return false;
+ }
+ driver.findElement(LOGIN_USERNAME_FIELD).sendKeys(username);
+ driver.findElement(LOGIN_PASSWORD_FIELD).sendKeys(password);
+ driver.findElement(LOGIN_SUBMIT).clickAndWait();
+ return isLoggedIn(driver);
+ }
+
+ public boolean isLoggedIn(AjaxWebDriver driver)
+ {
+ return driver.isElementPresent(LOGOUT);
+ }
+
+ public void openWindow(AjaxWebDriver driver, String url, String windowName)
+ {
+ ((JavascriptExecutor) driver).executeScript("window.open('"+ url +"','" + windowName +"')");
+ }
+
+ public void closeWindows()
+ {
+ for (String h: windows)
+ {
+ driver.switchTo().window(h);
+ driver.close();
+ }
+ }
+}
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java 2010-03-30 07:11:56 UTC (rev 12320)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/AjaxWebDriver.java 2010-03-30 08:33:45 UTC (rev 12321)
@@ -16,4 +16,6 @@
public AjaxWebElement findElement(By by);
public void setWaitTime(int millis);
+
+ public boolean isElementPresent(By by);
}
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java 2010-03-30 07:11:56 UTC (rev 12320)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/webdriver/FirefoxAjaxDriver.java 2010-03-30 08:33:45 UTC (rev 12321)
@@ -1,6 +1,7 @@
package org.jboss.seam.example.common.test.webdriver;
import org.openqa.selenium.By;
+import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FirefoxAjaxDriver extends FirefoxDriver implements AjaxWebDriver
@@ -29,4 +30,17 @@
{
this.waitTime = millis;
}
+
+ public boolean isElementPresent(By by)
+ {
+ try
+ {
+ findElement(by);
+ return true;
+ }
+ catch (NoSuchElementException e)
+ {
+ return false;
+ }
+ }
}
14 years, 9 months
Seam SVN: r12320 - in modules/security/trunk: core/src/main/java/org/jboss/seam/security/management and 3 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-03-30 03:11:56 -0400 (Tue, 30 Mar 2010)
New Revision: 12320
Added:
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml
Modified:
modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java
modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java
modules/security/trunk/examples/seamspace/pom.xml
modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml
Log:
added xml configuration to example
Modified: modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java 2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java 2010-03-30 07:11:56 UTC (rev 12320)
@@ -125,9 +125,8 @@
}
else
{
- log.error("No authentication method defined - " +
- "please define authenticate-method for <security:identity/> in components.xml");
- throw new LoginException("No authentication method defined");
+ log.error("No Authenticator bean found.");
+ throw new LoginException("No Authenticator bean found");
}
}
catch (Exception ex)
Modified: modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java 2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java 2010-03-30 07:11:56 UTC (rev 12320)
@@ -6,9 +6,11 @@
import java.util.Comparator;
import java.util.List;
-import javax.enterprise.inject.Model;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
+import javax.inject.Named;
import org.jboss.seam.security.Identity;
import org.jboss.seam.security.util.Strings;
@@ -20,7 +22,7 @@
*
* @author Shane Bryzak
*/
-@Model
+@Named @ApplicationScoped
public class IdentityManager implements Serializable
{
private static final long serialVersionUID = 6864253169970552893L;
@@ -41,7 +43,7 @@
private IdentityStore identityStore;
private IdentityStore roleIdentityStore;
- @Inject
+ @PostConstruct
public void create()
{
if (roleIdentityStore == null && identityStore != null)
@@ -49,11 +51,17 @@
roleIdentityStore = identityStore;
}
- if (identityStore == null || roleIdentityStore == null)
+ if (identityStore == null)
{
log.warn("No identity store available - please configure an identityStore if identity " +
"management is required.");
}
+
+ if (roleIdentityStore == null)
+ {
+ log.warn("No role identity store available - please configure a roleIdentityStore if identity " +
+ "management is required.");
+ }
}
public boolean createUser(String name, String password)
Modified: modules/security/trunk/examples/seamspace/pom.xml
===================================================================
--- modules/security/trunk/examples/seamspace/pom.xml 2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/examples/seamspace/pom.xml 2010-03-30 07:11:56 UTC (rev 12320)
@@ -50,6 +50,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-bean-config</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
Modified: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml 2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml 2010-03-30 07:11:56 UTC (rev 12320)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:security="urn:java:org.jboss.seam.security"
+ xmlns:idm="urn:java:org.jboss.seam.security.management"
+ xmlns:seamspace="urn:java:org.jboss.seam.security.examples.seamspace"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <!--idm:IdentityManager>
+ <s:extends/>
+ <idm:identityStore>
+ <s:Inject/>
+ <s:New>org.jboss.seam.security.management.JpaIdentityStore</s:New>
+ </idm:identityStore>
+ </idm:IdentityManager-->
+
+</beans>
\ No newline at end of file
Added: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml (rev 0)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-03-30 07:11:56 UTC (rev 12320)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:security="urn:java:org.jboss.seam.security"
+ xmlns:idm="urn:java:org.jboss.seam.security.management"
+ xmlns:seamspace="urn:java:org.jboss.seam.security.examples.seamspace"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <idm:IdentityManager>
+ <s:extends/>
+ <idm:identityStore>
+ <s:Inject/>
+ <s:New>org.jboss.seam.security.management.JpaIdentityStore</s:New>
+ </idm:identityStore>
+ </idm:IdentityManager>
+
+</beans>
\ No newline at end of file
14 years, 9 months
Seam SVN: r12319 - modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-03-30 02:54:25 -0400 (Tue, 30 Mar 2010)
New Revision: 12319
Modified:
modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
Log:
added logging to XMLExtension
Modified: modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
===================================================================
--- modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-03-30 06:24:15 UTC (rev 12318)
+++ modules/xml/trunk/core/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-03-30 06:54:25 UTC (rev 12319)
@@ -33,6 +33,8 @@
import org.jboss.seam.xml.parser.SaxNode;
import org.jboss.seam.xml.util.FileDataReader;
import org.jboss.weld.extensions.util.AnnotationInstanceProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class XmlExtension implements Extension
{
@@ -49,6 +51,8 @@
int count = 0;
+ private static final Logger log = LoggerFactory.getLogger(XmlExtension.class);
+
/**
* map of syntetic bean id to a list of field value objects
*/
@@ -61,6 +65,7 @@
*/
public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event)
{
+ log.info("Seam XML Bean Config Starting");
List<Class<? extends XmlDocumentProvider>> providers = getDocumentProviders();
for (Class<? extends XmlDocumentProvider> cl : providers)
{
@@ -71,6 +76,7 @@
XmlDocument d;
while ((d = provider.getNextDocument()) != null)
{
+ log.info("Reading XML file: " + d.getFileUrl());
ParserMain parser = new ParserMain();
ModelBuilder builder = new ModelBuilder();
SaxNode parentNode = parser.parse(d.getInputSource(), d.getFileUrl(), errors);
@@ -105,19 +111,24 @@
for (Class<? extends Annotation> b : r.getQualifiers())
{
+ log.info("Adding XML Defined Qualifier: " + b.getName());
event.addQualifier(b);
}
for (Class<? extends Annotation> b : r.getInterceptorBindings())
{
+ log.info("Adding XML Defined Interceptor Binding: " + b.getName());
event.addInterceptorBinding(b);
}
for (Entry<Class<? extends Annotation>, Annotation[]> b : r.getStereotypes().entrySet())
{
+ log.info("Adding XML Defined Stereotype: " + b.getKey().getName());
event.addStereotype(b.getKey(), b.getValue());
}
for (BeanResult<?> bb : r.getBeans())
{
+
AnnotatedType<?> tp = bb.getBuilder().create();
+ log.info("Adding XML definied bean: " + tp.getJavaClass().getName());
event.addAnnotatedType(tp);
types.put(tp.getJavaClass(), tp);
}
@@ -132,6 +143,7 @@
// veto implementation
if (veto.contains(event.getAnnotatedType().getJavaClass()))
{
+ log.info("Preventing installation of default bean: " + event.getAnnotatedType().getJavaClass().getName());
event.veto();
}
@@ -144,6 +156,7 @@
XmlId xid = at.getAnnotation(XmlId.class);
if (xid != null)
{
+ log.info("Wrapping InjectionTarget to set field values: " + event.getAnnotatedType().getJavaClass().getName());
List<FieldValueObject> fvs = fieldValues.get(xid.value());
event.setInjectionTarget(new InjectionTargetWrapper<T>(event.getInjectionTarget(), fvs));
}
@@ -172,6 +185,7 @@
String[] providers = data.split("\\s");
for (String provider : providers)
{
+ log.info("Loading XmlDocumentProvider: " + provider);
Class res = null;
try
{
14 years, 9 months
Seam SVN: r12318 - modules/drools/trunk/docs/en-US.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-03-30 02:24:15 -0400 (Tue, 30 Mar 2010)
New Revision: 12318
Removed:
modules/drools/trunk/docs/en-US/drools-model.xml
Modified:
modules/drools/trunk/docs/en-US/drools-general.xml
modules/drools/trunk/docs/en-US/master.xml
Log:
minor doc update
Modified: modules/drools/trunk/docs/en-US/drools-general.xml
===================================================================
--- modules/drools/trunk/docs/en-US/drools-general.xml 2010-03-30 06:16:10 UTC (rev 12317)
+++ modules/drools/trunk/docs/en-US/drools-general.xml 2010-03-30 06:24:15 UTC (rev 12318)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-<chapter id="remoting-general">
- <title>Seam Remoting</title>
+<chapter id="drools-general">
+ <title>Seam Drools</title>
<para>Seam provides a convenient method of remotely accessing CDI beans from a web page, using AJAX (Asynchronous
Javascript and XML). The framework for this functionality is provided with almost no up-front development effort -
Deleted: modules/drools/trunk/docs/en-US/drools-model.xml
===================================================================
--- modules/drools/trunk/docs/en-US/drools-model.xml 2010-03-30 06:16:10 UTC (rev 12317)
+++ modules/drools/trunk/docs/en-US/drools-model.xml 2010-03-30 06:24:15 UTC (rev 12318)
@@ -1,652 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-
-<chapter id="remoting-model">
- <title>Seam Remoting - Model API</title>
-
- <section>
- <title>Introduction</title>
- <para>
- The Model API builds on top of Seam Remoting's object serialization features to provide a
- <emphasis>component-based</emphasis> approach to working with a server-side object model, as
- opposed to the <emphasis>RPC-based</emphasis> approach provided by the standard Remoting API.
- This allows a client-side representation of a server-side object graph to be modified ad hoc
- by the client, after which the changes made to the objects in the graph can be
- <emphasis>applied</emphasis> to the corresponding server-side objects. When applying the
- changes the client determines exactly which objects have been modified by recursively walking
- the client-side object tree and generating a delta by comparing the original property values
- of the objects with their new property values.
- </para>
-
- <para>
- This approach, when used in conjunction with the extended persistence context provided by Seam
- elegantly solves a number of problems faced by AJAX developers when working remotely with
- persistent objects. A persistent, managed object graph can be loaded at the start of
- a new conversation, and then across multiple requests (and within the same transaction) the client
- can fetch the objects, make changes to them and apply those changes to the same managed objects after
- which the long-running transaction can be committed when the conversation ends.
- </para>
-
- <para>
- One other useful feature of the Model API is its ability to <emphasis>expand</emphasis> a model.
- For example, if you are working with entities with lazy-loaded associations it is usually not a good idea
- to blindly fetch the associated objects (which may in turn themselves contain associations
- to other entities, ad nauseum), as you may inadvertently end up fetching the bulk of your database.
- Seam Remoting already knows how to deal with lazy-loaded associations by automatically excluding
- them when marshalling instances of entity beans, and assigning them a client-side value of
- <literal>undefined</literal> (which is a special JavaScript value, distinct from <literal>null</literal>).
- The Model API goes one step further by giving the client the option of manipulating the associated objects
- also. By providing an <emphasis>expand</emphasis> operation, it allows for the initialization of a
- previously-uninitialized object property (such as a lazy-loaded collection), by dynamically "grafting"
- the initialized value onto the object graph. By <emphasis>expanding</emphasis> the model in this way,
- we have at our disposal a powerful tool for building dynamic client interfaces.
- </para>
- </section>
-
- <section>
- <title>Model Operations</title>
-
- <para>
- For the methods of the Model API that accept action parameters, an instance of
- <literal>Seam.Action</literal> should be used. The constructor for
- <literal>Seam.Action</literal> takes no parameters:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var action = new Seam.Action();]]></programlisting>
-
- <para>
- The following table lists the methods used to define the action. Each of the following methods
- return a reference to the <literal>Seam.Action</literal> object, so methods can be chained.
- </para>
-
- <table>
- <title>Seam.Action method reference</title>
-
- <tgroup cols="2">
- <colspec colnum="1" colwidth="2*" />
- <colspec colnum="2" colwidth="3*" />
-
- <thead>
- <row>
- <entry align="center">
- <para>Method</para>
- </entry>
- <entry align="center">
- <para>Description</para>
- </entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>
- <para>
- <literal>setBeanType(beanType)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Sets the class name of the bean to be invoked.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>beanType</literal> - the fully qualified class name of the bean type to be invoked.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>setQualifiers(qualifiers)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Sets the qualifiers for the bean to be invoked.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>qualifiers</literal> - a comma-separated list of bean qualifier names.
- The names may either be the simple or fully qualified names of the qualifier classes.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>setMethod(method)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Sets the name of the bean method.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>method</literal> - the name of the bean method to invoke.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>addParam(param)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Adds a parameter value for the action method. This method should be called once for
- each parameter value to be added, in the correct parameter order.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>param</literal> - the parameter value to add.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- The following table describes the methods provided by the <literal>Seam.Model</literal> object. To work with
- the Model API in JavaScript you must first create a new Model object:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var model = new Seam.Model();]]></programlisting>
-
- <table>
- <title>Seam.Model method reference</title>
-
- <tgroup cols="2">
- <colspec colnum="1" colwidth="2*" />
- <colspec colnum="2" colwidth="3*" />
-
- <thead>
- <row>
- <entry align="center">
- <para>Method</para>
- </entry>
- <entry align="center">
- <para>Description</para>
- </entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>
- <para>
- <literal>addBean(alias, bean, qualifiers)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Adds a bean value to the model. When the model is fetched, the value of the specified bean
- will be read and placed into the model, where it may be accessed by using the
- <literal>getValue()</literal> method with the specified alias.
- </para>
-
- <para>
- Can only be used before the model is fetched.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>alias</literal> - the local alias for the bean value.
- </listitem>
- <listitem>
- <literal>bean</literal> - the name of the bean, either specified by the <literal>@Named</literal>
- annotation or the fully qualified class name.
- </listitem>
- <listitem>
- <literal>qualifiers</literal> (optional) - a list of bean qualifiers.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>addBeanProperty(alias, bean, property, qualifiers)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Adds a bean property value to the model. When the model is fetched, the value of the specified
- property on the specified bean will be read and placed into the model, where it may be accessed
- by using the <literal>getValue()</literal> method with the specified alias.
- </para>
-
- <para>
- Can only be used before the model is fetched.
- </para>
-
- <para>
- Example:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ addBeanProperty("account", "AccountAction", "account", "@Qualifier1", "@Qualifier2");]]></programlisting>
-
- <itemizedlist>
- <listitem>
- <literal>alias</literal> - the local alias for the bean value.
- </listitem>
- <listitem>
- <literal>bean</literal> - the name of the bean, either specified by the <literal>@Named</literal>
- annotation or the fully qualified class name.
- </listitem>
- <listitem>
- <literal>property</literal> - the name of the bean property.
- </listitem>
- <listitem>
- <literal>qualifiers</literal> (optional) - a list of bean qualifiers. This parameter (and any
- after it) are treated as bean qualifiers.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
- <row>
- <entry>
- <para>
- <literal>fetch(action, callback)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Fetches the model - this operation causes an asynchronous request to be sent to the server.
- The request contains a list of the beans and bean properties (set by calling the
- <literal>addBean()</literal> and <literal>addBeanProperty()</literal> methods) for which values
- will be returned. Once the response is received, the callback method (if specified) will be
- invoked, passing in a reference to the model as a parameter.
- </para>
-
- <para>
- A model should only be fetched once.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>action</literal> (optional) - a <literal>Seam.Action</literal> instance representing
- the bean action to invoke before the model values are read and stored in the model.
- </listitem>
- <listitem>
- <literal>callback</literal> (optional) - a reference to a JavaScript function that will be
- invoked after the model has been fetched. A reference to the model instance is passed to
- the callback method as a parameter.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>getValue(alias)</literal>
- </para>
- </entry>
- <entry>
- <para>
- This method returns the value of the object with the specified alias.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>alias</literal> - the alias of the value to return.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>expand(value, property, callback)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Expands the model by initializing a property value that was previously uninitialized. This
- operation causes an asynchronous request to be sent to the server, where the uninitialized
- property value (such as a lazy-loaded collection within an entity bean association) is
- initialized and the resulting value is returned to the client. Once the response is received,
- the callback method (if specified) will be invoked, passing in a reference to the model as a
- parameter.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>value</literal> - a reference to the value containing the uninitialized property
- to fetch. This can be any value within the model, and does not need to be a "root" value
- (i.e. it doesn't need to be a value specified by <literal>addBean()</literal> or
- <literal>addBeanProperty()</literal>, it can exist anywhere within the object graph.
- </listitem>
- <listitem>
- <literal>property</literal> - the name of the uninitialized property to be initialized.
- </listitem>
- <listitem>
- <literal>callback</literal> (optional) - a reference to a JavaScript function that will be
- invoked after the model has been expanded. A reference to the model instance is passed to
- the callback method as a parameter.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
-
- <row>
- <entry>
- <para>
- <literal>applyUpdates(action, callback)</literal>
- </para>
- </entry>
- <entry>
- <para>
- Applies the changes made to the objects contained in the model. This method causes an
- asynchronous request to be sent to the server containing a delta consisting of
- a list of the changes made to the client-side objects.
- </para>
-
- <itemizedlist>
- <listitem>
- <literal>action</literal> (optional) - a <literal>Seam.Action</literal> instance representing
- a bean method to be invoked after the client-side model changes have been applied to their
- corresponding server-side objects.
- </listitem>
- <listitem>
- <literal>callback</literal> (optional) - a reference to a JavaScript function that will be
- invoked after the updates have been applied. A reference to the model instance is passed to
- the callback method as a parameter.
- </listitem>
- </itemizedlist>
- </entry>
- </row>
- </tbody>
- </tgroup>
-
- </table>
-
- <para>
-
- </para>
- </section>
-
- <section>
- <title>Fetching a model</title>
-
- <para>
- To fetch a model, one or more values must first be specified using <literal>addBean()</literal> or
- <literal>addBeanProperty()</literal> before invoking the <literal>fetch()</literal> operation.
- Let's work through an example - here we have an entity bean called <literal>Customer</literal>:
- </para>
-
- <programlisting role="JAVA"><![CDATA[@Entity Customer implements Serializable {
- private Integer customerId;
- private String firstName;
- private String lastName;
-
- @Id @GeneratedValue public Integer getCustomerId() { return customerId; }
- public void setCustomerId(Integer customerId) { this.customerId = customerId; }
-
- public String getFirstName() { return firstName; }
- public void setFirstName(String firstName) { this.firstName = firstName; }
-
- public String getLastName() { return lastName; }
- public void setLastName(String lastName) { this.lastName = lastName; }
-}]]></programlisting>
-
- <para>
- We also have a bean called <literal>CustomerAction</literal>, which is responsible for creating and editing
- <literal>Customer</literal> instances. Since we're only interested in editing a customer right now, the
- following code only shows the <literal>editCustomer()</literal> method:
- </para>
-
-
- <programlisting role="JAVA"><![CDATA[@ConversationScoped @Named
-public class CustomerAction {
- @Inject Conversation conversation;
- @PersistenceContext EntityManager entityManager;
- public Customer customer;
-
- public void editCustomer(Integer customerId) {
- conversation.begin();
- customer = entityManager.find(Customer.class, customerId);
- }
-
- public void saveCustomer() {
- entityManager.merge(customer);
- conversation.end();
- }
-}]]></programlisting>
-
- <para>
- In the client section of this example, we wish to make changes to an existing <literal>Customer</literal>
- instance, so we need to use the <literal>editCustomer()</literal> method of <literal>CustomerAction</literal>
- to first load the customer entity, after which we can access it via the public <literal>customer</literal>
- field. Our model object must therefore be configured to fetch the <literal>CustomerAction.customer</literal>
- property, and to invoke the <literal>editCustomer()</literal> method when the model is fetched. We start
- by using the <literal>addBeanProperty()</literal> method to add a bean property to the model:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var model = new Seam.Model();
- model.addBeanProperty("customer", "CustomerAction", "customer");]]></programlisting>
-
- <para>
- The first parameter of <literal>addBeanProperty()</literal> is the <emphasis>alias</emphasis> (in this case
- <literal>customer</literal>), which is used to access the value via the <literal>getValue()</literal> method.
- The <literal>addBeanProperty()</literal> and <literal>addBean()</literal> methods can be called multiple times
- to bind multiple values to the model. An important thing to note is that the values may come from multiple
- server-side beans, they aren't all required to come from the same bean.
- </para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/remoting-model-customer-uml-1.png" format="PNG"/>
- </imageobject>
- </mediaobject>
-
- <para>
- We also specify the action that we wish to invoke (i.e. the <literal>editCustomer()</literal> method).
- In this example we know the value of the <literal>customerId</literal> that we wish to edit, so we can
- specify this value as an action method parameter:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var action = new Seam.Action()
- .setBeanType("CustomerAction")
- .setMethod("editCustomer")
- .addParam(123);]]></programlisting>
-
- <para>
- Once we've specified the bean properties we wish to fetch and the action to invoke, we can then fetch the
- model. We pass in a reference to the action object as the first parameter of the <literal>fetch()</literal>
- method. Also, since this is an asynchronous request we need to provide a callback method to deal with the
- response. The callback method is passed a reference to the model object as a parameter.
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var callback = function(model) { alert("Fetched customer: " model.getValue("customer").firstName +
- " " + model.getValue("customer").lastName); };
- model.fetch(action, callback);]]></programlisting>
-
- <para>
- When the server receives a model fetch request, it first invokes the action (if one is specified) before
- reading the requested property values and returning them to the client.
- </para>
-
- <section>
- <title>Fetching a bean value</title>
-
- <para>
- Alternatively, if you don't wish to fetch a bean <emphasis>property</emphasis> but rather a bean itself
- (such as a value created by a producer method) then the <literal>addBean()</literal> method is used instead.
- Let's say we have a producer method that returns a qualified <literal>UserSettings</literal> value:
- </para>
-
- <programlisting role="JAVA"><![CDATA[ @Produces @ConversationScoped @Settings UserSettings getUserSettings() {
- /* snip code */
- }]]></programlisting>
-
- <para>
- We would add this value to our model with the following code:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ model.addBean("settings", "UserSettings", "@Settings");]]></programlisting>
-
- <para>
- The first parameter is the local alias for the value, the second parameter is the fully qualified
- class of the bean, and the third (and subsequent) parameter/s are optional bean qualifiers.
- </para>
-
- </section>
- </section>
-
- <section>
- <title>Modifying model values</title>
-
- <para>
- Once a model has been fetched its values may be read using the <literal>getValue()</literal> method.
- Continuing on with the previous example, we would retrieve the <literal>Customer</literal> object via
- it's local alias (<literal>customer</literal>) like this:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var customer = model.getValue("customer");]]></programlisting>
-
- <para>
- We are then free to read or modify the properties of the value (or any of the other values within its
- object graph).
- </para>
-
- <programlisting role="XHTML"><![CDATA[ alert("Customer name is: " + customer.firstName + " " + customer.lastName);
- customer.setLastName("Jones"); // was Smith, but Peggy got married on the weekend]]></programlisting>
-
- </section>
-
- <section>
- <title>Expanding a model</title>
-
- <para>
- We can use the Model API's ability to expand a model to load uninitialized branches of the objects in
- the model's object graph. To understand how this works exactly, let's flesh out our example a little
- more by adding an <literal>Address</literal> entity class, and creating a one-to-many relationship
- between <literal>Customer</literal> and <literal>Address</literal>.
- </para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/remoting-model-customer-address-uml.png" format="PNG"/>
- </imageobject>
- </mediaobject>
-
- <programlisting role="JAVA"><![CDATA[@Entity Address implements Serializable {
- private Integer addressId;
- private Customer customer;
- private String unitNumber;
- private String streetNumber;
- private String streetName;
- private String suburb;
- private String zip;
- private String state;
- private String country;
-
- @Id @GeneratedValue public Integer getAddressId() { return addressId; }
- public void setAddressId(Integer addressId) { this.addressId = addressId; }
-
- @ManyToOne public Customer getCustomer() { return customer; }
- public void setCustomer(Customer customer) { this.customer = customer; }
-
- /* Snipped other getter/setter methods */
-
-}]]></programlisting>
-
- <para>
- Here's the new field and methods that we also need to add to the <literal>Customer</literal> class:
- </para>
-
- <programlisting role="JAVA"><![CDATA[ private Collection<Address> addresses;
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "customer", cascade = CascadeType.ALL)
- public Collection<Address> getAddresses() { return addresses; }
- public void setAddresses(Collection<Address> addresses) { this.addresses = addresses; }]]></programlisting>
-
- <para>
- As we can see, the <literal>@OneToMany</literal> annotation on the <literal>getAddresses()</literal>
- method specifies a <literal>fetch</literal> attribute of <literal>LAZY</literal>, meaning that by
- default the customer's addresses won't be loaded automatically when the customer is. When reading the
- <emphasis>uninitialized</emphasis> <literal>addresses</literal> property value from a newly-fetched
- <literal>Customer</literal> object in JavaScript, a value of <literal>undefined</literal> will be returned.
- </para>
-
- <programlisting role="XHTML"><![CDATA[ getValue("customer").addresses == undefined; // returns true]]></programlisting>
-
- <para>
- We can <emphasis>expand</emphasis> the model by making a special request to initialize this uninitialized
- property value. The <literal>expand()</literal> operation takes three parameters - the value containing
- the property to be initialized, the name of the property and an optional callback method. The following
- example shows us how the customer's <literal>addresses</literal> property can be initialized:
- </para>
-
- <programlisting role="XHTML"><![CDATA[ model.expand(model.getValue("customer"), "addresses");]]></programlisting>
-
- <para>
- The <literal>expand()</literal> operation makes an asynchronous request to the server, where the
- property value is initialized and the value returned to the client. When the client receives the
- response, it reads the initialized value and appends it to the model.
- </para>
-
- <programlisting role="XHTML"><![CDATA[ // The addresses property now contains an array of address objects
- alert(model.getValue("customer").addresses.length + " addresses loaded");]]></programlisting>
-
- </section>
-
- <section>
- <title>Applying Changes</title>
-
- <para>
- Once you have finished making changes to the values in the model, you can apply them with the
- <literal>applyUpdates()</literal> method. This method scans all of the objects in the model, compares
- them with their original values and generates a delta which may contain one or more changesets to
- send to the server. A changeset is simply a list of property value changes for a single object.
- </para>
-
- <para>
- Like the <literal>fetch()</literal> command you can also specify an action to invoke when applying updates,
- although the action is invoked <emphasis>after</emphasis> the model updates have been applied. In a
- typical situation the invoked action would do things like commit a database transaction, end the current
- conversation, etc.
- </para>
-
- <para>
- Since the <literal>applyUpdates()</literal> method sends an asynchronous request like the
- <literal>fetch()</literal> and <literal>expand()</literal> methods, we also need to specify a callback
- function if we wish to do something when the operation completes.
- </para>
-
- <programlisting role="XHTML"><![CDATA[ var action = new Seam.Action();
- .setBeanType("CustomerAction")
- .setMethod("saveCustomer");
-
- var callback = function() { alert("Customer saved."); };
-
- model.applyUpdates(action, callback);]]></programlisting>
-
- <para>
- The <literal>applyUpdates()</literal> method performs a refresh of the model, retrieving the latest
- state of the objects contained in the model after all updates have been applied and the action method
- (if specified) invoked.
- </para>
- </section>
-
-
-</chapter>
-
Modified: modules/drools/trunk/docs/en-US/master.xml
===================================================================
--- modules/drools/trunk/docs/en-US/master.xml 2010-03-30 06:16:10 UTC (rev 12317)
+++ modules/drools/trunk/docs/en-US/master.xml 2010-03-30 06:24:15 UTC (rev 12318)
@@ -7,6 +7,4 @@
<title>Seam Drools</title>
<xi:include href="drools-general.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="drools-model.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
</book>
14 years, 9 months
Seam SVN: r12317 - in modules/drools/trunk: core/src/main/java/org/jboss/seam/drools and 17 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-03-30 02:16:10 -0400 (Tue, 30 Mar 2010)
New Revision: 12317
Added:
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/InsertFact.java
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/Abort.java
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/SignalEvent.java
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/StartProcess.java
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/interceptor/
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/interceptor/flow/
modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/util/
modules/drools/trunk/core/src/test/java/org/
modules/drools/trunk/core/src/test/java/org/jboss/
modules/drools/trunk/core/src/test/java/org/jboss/seam/
modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/
modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/
modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertInterceptorTest.java
modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertionBean.java
modules/drools/trunk/core/src/test/resources/
modules/drools/trunk/core/src/test/resources/org/
modules/drools/trunk/core/src/test/resources/org/jboss/
modules/drools/trunk/core/src/test/resources/org/jboss/seam/
modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/
modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/insertion/
modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/insertion/InsertInterceptorTest-beans.xml
Modified:
modules/drools/trunk/docs/drools-reference.pdf
modules/drools/trunk/pom.xml
Log:
added test
Added: modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/InsertFact.java
===================================================================
--- modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/InsertFact.java (rev 0)
+++ modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/InsertFact.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,32 @@
+package org.jboss.seam.drools.annotation;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Insert fact into WM or EntryPoint. Also determine firing rules decisions.
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Documented
+@Retention(RUNTIME)
+@Inherited
+public @interface InsertFact
+{
+ @Nonbinding int ksessionId() default -1;
+ @Nonbinding boolean fireAllRules() default false;
+ @Nonbinding int fireCount() default -1;
+ @Nonbinding boolean fireUntilHalt() default false;
+ @Nonbinding String entryPointName() default "";
+}
Added: modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/Abort.java
===================================================================
--- modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/Abort.java (rev 0)
+++ modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/Abort.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,28 @@
+package org.jboss.seam.drools.annotation.flow;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Abort the process instace.
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Documented
+@Retention(RUNTIME)
+@Inherited
+public @interface Abort
+{
+ @Nonbinding long processid();
+}
Added: modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/SignalEvent.java
===================================================================
--- modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/SignalEvent.java (rev 0)
+++ modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/SignalEvent.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,31 @@
+package org.jboss.seam.drools.annotation.flow;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Event to be signalled to the process instance or process engine directly.
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Documented
+@Retention(RUNTIME)
+@Inherited
+public @interface SignalEvent
+{
+ @Nonbinding String type() default "";
+ @Nonbinding String event() default "";
+ @Nonbinding String processId() default "";
+ @Nonbinding String sessionId() default "";
+}
Added: modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/StartProcess.java
===================================================================
--- modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/StartProcess.java (rev 0)
+++ modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/annotation/flow/StartProcess.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,27 @@
+package org.jboss.seam.drools.annotation.flow;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * Starts a Rule Flow process.
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Documented
+@Retention(RUNTIME)
+public @interface StartProcess
+{
+ @Nonbinding String processId() default "";
+ @Nonbinding String sessionId() default "";
+}
Added: modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java
===================================================================
--- modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java (rev 0)
+++ modules/drools/trunk/core/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,19 @@
+package org.jboss.seam.drools.interceptor;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.jboss.seam.drools.annotation.InsertFact;
+
+@InsertFact @Interceptor
+public class InsertInterceptor
+{
+ @AroundInvoke
+ public Object manageTransaction(InvocationContext ctx) throws Exception {
+ InsertFact insertFactAnnotation = ctx.getMethod().getAnnotation(InsertFact.class);
+ System.out.println("ksession id: " +insertFactAnnotation.ksessionId());
+
+ return ctx.proceed();
+ }
+}
Added: modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertInterceptorTest.java
===================================================================
--- modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertInterceptorTest.java (rev 0)
+++ modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertInterceptorTest.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,33 @@
+package org.jboss.seam.drools.insertion;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.drools.interceptor.InsertInterceptor;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class InsertInterceptorTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return Archives.create("test.jar", JavaArchive.class).addClasses(InsertInterceptor.class, InsertionBean.class).addManifestResource(InsertInterceptorTest.class.getPackage().getName().replaceAll("\\.", "/") + "/InsertInterceptorTest-beans.xml", ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject InsertionBean insertionBean;
+
+ @Test
+ public void testInsertFactHappens() {
+ String result = insertionBean.insertResultAsFact();
+ assertTrue(result.equals("abc")); //TODO finish this test
+ }
+}
Added: modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertionBean.java
===================================================================
--- modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertionBean.java (rev 0)
+++ modules/drools/trunk/core/src/test/java/org/jboss/seam/drools/insertion/InsertionBean.java 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,11 @@
+package org.jboss.seam.drools.insertion;
+
+import org.jboss.seam.drools.annotation.InsertFact;
+
+public class InsertionBean
+{
+ @InsertFact(ksessionId=123)
+ public String insertResultAsFact() {
+ return "abc";
+ }
+}
Added: modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/insertion/InsertInterceptorTest-beans.xml
===================================================================
--- modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/insertion/InsertInterceptorTest-beans.xml (rev 0)
+++ modules/drools/trunk/core/src/test/resources/org/jboss/seam/drools/insertion/InsertInterceptorTest-beans.xml 2010-03-30 06:16:10 UTC (rev 12317)
@@ -0,0 +1,10 @@
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+ <interceptors>
+ <class>org.jboss.seam.drools.interceptor.InsertInterceptor</class>
+ </interceptors>
+
+</beans>
\ No newline at end of file
Modified: modules/drools/trunk/docs/drools-reference.pdf
===================================================================
(Binary files differ)
Modified: modules/drools/trunk/pom.xml
===================================================================
--- modules/drools/trunk/pom.xml 2010-03-30 04:29:25 UTC (rev 12316)
+++ modules/drools/trunk/pom.xml 2010-03-30 06:16:10 UTC (rev 12317)
@@ -29,7 +29,7 @@
<organizationUrl>http://jboss.org</organizationUrl>
<timezone>EST</timezone>
<roles>
- <role>Project Lead</role>
+ <role>Module Lead</role>
</roles>
</developer>
</developers>
14 years, 9 months