JBoss Rich Faces SVN: r12583 - trunk/ui/beanValidator/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-02-05 17:43:46 -0500 (Thu, 05 Feb 2009)
New Revision: 12583
Modified:
trunk/ui/beanValidator/src/main/config/component/beanValidator.xml
Log:
https://jira.jboss.org/jira/browse/RF-4962
Modified: trunk/ui/beanValidator/src/main/config/component/beanValidator.xml
===================================================================
--- trunk/ui/beanValidator/src/main/config/component/beanValidator.xml 2009-02-05 19:18:11 UTC (rev 12582)
+++ trunk/ui/beanValidator/src/main/config/component/beanValidator.xml 2009-02-05 22:43:46 UTC (rev 12583)
@@ -52,6 +52,11 @@
event
</description>
</property>
+
+ <property>
+ <name>disableDefault</name>
+ </property>
+
<property disabled="true">
<name>ajaxSingle</name>
<classname>boolean</classname>
15 years, 10 months
JBoss Rich Faces SVN: r12582 - trunk/ui/inplaceSelect/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-02-05 14:18:11 -0500 (Thu, 05 Feb 2009)
New Revision: 12582
Modified:
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
RF-5757
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2009-02-05 15:23:51 UTC (rev 12581)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2009-02-05 19:18:11 UTC (rev 12582)
@@ -33,9 +33,9 @@
<![CDATA[
Object value = component.getAttributes().get("value");
+ String selectedItemLabel = getItemLabel(context, component, value);
value = getConvertedStringValue(context, component,value);
-
- String selectedItemLabel = getItemLabel(context, component, value);
+
String fieldValue = null;
String fieldLabel = null;
15 years, 10 months
JBoss Rich Faces SVN: r12581 - Plan and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-02-05 10:23:51 -0500 (Thu, 05 Feb 2009)
New Revision: 12581
Modified:
trunk/test-applications/qa/Test Plan/TestPlan-RF.doc
Log:
Modified: trunk/test-applications/qa/Test Plan/TestPlan-RF.doc
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12580 - in trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd: mojo and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-02-05 10:19:28 -0500 (Thu, 05 Feb 2009)
New Revision: 12580
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
Log:
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java 2009-02-05 14:53:01 UTC (rev 12579)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java 2009-02-05 15:19:28 UTC (rev 12580)
@@ -96,6 +96,7 @@
try {
if(builder.length() > 0 && velocityComponent != null) {
+
VelocityContext context = new VelocityContext();
context.put("content", builder);
VelocityEngine engine = velocityComponent.getEngine();
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-02-05 14:53:01 UTC (rev 12579)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-02-05 15:19:28 UTC (rev 12580)
@@ -362,8 +362,8 @@
handler.setStyleExcludes(styleExcludes);
handler.setComponentIncludes(componentIncludes);
handler.setComponentExcludes(componentExcludes);
+ handler.setNamespaceIncludes(namespaceIncludes);
handler.setNamespaceExcludes(namespaceExcludes);
- handler.setNamespaceIncludes(namespaceIncludes);
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setNamespaceAware(true);
@@ -373,13 +373,16 @@
File file = new File(webSourceDir,processFile);
if(file.exists()) {
+
getLog().info("process file: " + file.getName());
try {
saxParser.parse(file, handler);
} catch (Exception e) {
getLog().error("Error process file: " + file.getAbsolutePath() + "\n" + e.getMessage(), e);
}
+
}
+
}
return handler;
}
@@ -405,7 +408,8 @@
jarFileObjects = manager.resolveFile("jar://" + file.getAbsolutePath());
} catch (FileSystemException e) {
getLog().error("Error during processing file: " + file.getAbsolutePath()+ "\n" + e.getMessage(), e);
- }
+ }
+
}
return jarFileObjects;
@@ -472,11 +476,13 @@
if (formatted != null) {
File file = new File(formatted);
+
try {
url = file.toURI().toURL();
} catch (MalformedURLException e) {
getLog().error("Resource url " + file.getPath() + " is invalid");
}
+
realm.addConstituent(url);
}
}
15 years, 10 months
JBoss Rich Faces SVN: r12579 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/WEB-INF and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-02-05 09:53:01 -0500 (Thu, 05 Feb 2009)
New Revision: 12579
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataListBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataList.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataListAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataListTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
Log:
RF-5684
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataListBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataListBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataListBean.java 2009-02-05 14:53:01 UTC (rev 12579)
@@ -0,0 +1,143 @@
+package org.ajax4jsf.bean;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.event.ActionEvent;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+public class DataListBean implements Validator{
+
+ public class Row {
+
+ private String cell1;
+ private String cell2;
+ private String cell3;
+
+ public Row(String index) {
+ this.cell1 = index + "A";
+ this.cell2 = index + "B";
+ this.cell3 = index + "C";
+ }
+
+ public String getCell1() {
+ return cell1;
+ }
+
+ public void setCell1(String cell1) {
+ this.cell1 = cell1;
+ }
+
+ public String getCell2() {
+ return cell2;
+ }
+
+ public void setCell2(String cell2) {
+ this.cell2 = cell2;
+ }
+
+ public String getCell3() {
+ return cell3;
+ }
+
+ public void setCell3(String cell3) {
+ this.cell3 = cell3;
+ }
+ }
+
+ private List<Row> model;
+ private int rows;
+ private String trace;
+ private Set<Integer> ajaxKeys;
+
+ public DataListBean() {
+ init();
+ }
+
+ public void init() {
+ model = new ArrayList<Row>(10);
+ for (int i = 0; i < 10; i++) {
+ model.add(new Row(Integer.toString(i)));
+ }
+ rows = 0;
+ trace = "";
+ ajaxKeys = new HashSet<Integer>(10);
+ for (int i = 0; i < 10; i++) {
+ if (i != 2 && i != 6) {
+ ajaxKeys.add(i);
+ }
+ }
+ }
+
+ public void submit(ActionEvent event) {
+ trace = event.getComponent().getClientId(FacesContext.getCurrentInstance());
+ }
+
+ public void reRender(ActionEvent event) {
+ for (Row element : model) {
+ element.setCell2("XXX");
+ }
+ }
+
+ public void setModel(List<Row> model) {
+ this.model = model;
+ }
+
+ public List<Row> getModel() {
+ return model;
+ }
+
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
+ public int getRows() {
+ return rows;
+ }
+
+ public void setTrace(String trace) {
+ this.trace = trace;
+ }
+
+ public String getTrace() {
+ return trace;
+ }
+
+ public void validate(FacesContext context, UIComponent component,
+ Object value) throws ValidatorException {
+ if ("fail".equals(value)) {
+ throw new ValidatorException(new FacesMessage("validation failure"));
+ }
+ }
+
+ public void setAjaxKeys(Set<Integer> ajaxKeys) {
+ this.ajaxKeys = ajaxKeys;
+ }
+
+ public Set<Integer> getAjaxKeys() {
+ return ajaxKeys;
+ }
+
+ public Converter getRowKeyConverter() {
+ return new Converter(){
+
+ public Object getAsObject(FacesContext context,
+ UIComponent component, String value) {
+ return new Integer(value.substring(2));
+ }
+
+ public String getAsString(FacesContext context,
+ UIComponent component, Object value) {
+ return "c_" + value.toString();
+ }
+
+ };
+ }
+}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-02-05 14:23:57 UTC (rev 12578)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-02-05 14:53:01 UTC (rev 12579)
@@ -174,6 +174,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>dataList</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.DataListBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>sliderBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.InputNumberSliderBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataList.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataList.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataList.xhtml 2009-02-05 14:53:01 UTC (rev 12579)
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <h:form id="attrForm">
+ <h:outputText value="rows" />
+ <h:inputText id="rows" value="#{dataList.rows}">
+ <a4j:support event="onchange" reRender="panelGroup"/>
+ </h:inputText>
+ </h:form>
+ <h:form id="mainForm">
+ <h:panelGroup id="panelGroup">
+ <rich:dataList id="dataList" value="#{dataList.model}" var="rows"
+ rows="#{dataList.rows}" ajaxKeys="#{dataList.ajaxKeys}"
+ stateVar="stateVar" rowKeyVar="rowKeyVar"
+ componentState="#{componentState}"
+ rowKeyConverter="#{dataList.rowKeyConverter}">
+ <h:outputText id="rowKeyVar" value="#{rowKeyVar} "></h:outputText>
+ <h:outputText id="first" value="#{stateVar.range.firstRow} "></h:outputText>
+ <h:outputText id="rows" value="#{stateVar.range.rows} "></h:outputText>
+ <h:outputText id="firstState" value="#{componentState.range.firstRow} "></h:outputText>
+ <h:outputText id="rowsState" value="#{componentState.range.rows} "></h:outputText>
+ <h:outputText value="#{rows.cell1}"></h:outputText>
+ <h:inputText id="inputText" value="#{rows.cell2}" validator="#{dataList.validate}"></h:inputText>
+ <h:outputText value="#{rows.cell3}"></h:outputText>
+ <h:commandButton id="submit" value="submit" actionListener="#{dataList.submit}"></h:commandButton>
+ <a4j:commandButton id="ajaxSubmit" value="ajaxSubmit" actionListener="#{dataList.submit}"></a4j:commandButton>
+ <a4j:commandButton id="ajaxSingleSubmit" value="ajaxSingleSubmit" actionListener="#{dataList.submit}" ajaxSingle="true"></a4j:commandButton>
+ </rich:dataList>
+ <a4j:commandButton id="reRender" value="reRender" reRender="inputText" actionListener="#{dataList.reRender}"></a4j:commandButton>
+ </h:panelGroup>
+ </h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText id="outputText" value="#{dataList.trace}"></h:outputText>
+ <h:dataTable id="dataTable" value="#{dataList.model}" var="row" rows="#{dataList.rows}">
+ <h:column>
+ <h:outputText value="#{row.cell2}"></h:outputText>
+ </h:column>
+ </h:dataTable>
+ </a4j:outputPanel>
+ <rich:messages></rich:messages>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataListAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataListAutoTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataList/dataListAutoTest.xhtml 2009-02-05 14:53:01 UTC (rev 12579)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <rich:dataList id="componentId" value="#{dataGrid.model}" var="row"
+ rendered="#{autoTestBean.rendered}"
+ style="width: 100%; color: yellow"
+ styleClass="noname"
+ onclick="EventQueue.fire('onclick')"
+ onmousedown="EventQueue.fire('onmousedown')"
+ onmousemove="EventQueue.fire('onmousemove')"
+ onmouseup="EventQueue.fire('onmouseup')"
+ onmouseout="EventQueue.fire('onmouseout')"
+ onmouseover="EventQueue.fire('onmouseover')"
+ onkeydown="EventQueue.fire('onkeydown')"
+ onkeypress="EventQueue.fire('onkeypress')"
+ onkeyup="EventQueue.fire('onkeyup')"
+ >
+ <h:panelGroup>
+ <h:inputText id="inputText" value="#{row.cell2}"></h:inputText>
+ </h:panelGroup>
+ </rich:dataList>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataListTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataListTest.java 2009-02-05 14:53:01 UTC (rev 12579)
@@ -0,0 +1,164 @@
+package org.richfaces.testng;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class DataListTest extends SeleniumTestBase {
+
+ private String rows;
+
+ private String dataList;
+
+ private String reRender;
+
+ private String outputText;
+
+ private String dataTable;
+
+ private void init(Template template) {
+ renderPage(null, template, "#{dataList.init}");
+ String attrForm = getParentId() + "attrForm";
+ rows = attrForm + ":rows";
+ String mainForm = getParentId() + "mainForm";
+ dataList = mainForm + ":dataList";
+ reRender = mainForm + ":reRender";
+ outputText = getParentId() + "outputText";
+ dataTable = getParentId() + "dataTable";
+ }
+
+ /**
+ * items from collection defined as value attribute are output to the client;
+ * number of items is limited using elements attribute and not
+ */
+ @Test
+ public void testStructure(Template template) {
+ init(template);
+ chekStructure();
+ selenium.type(rows, "3");
+ waitForAjaxCompletion();
+ Assert.assertEquals(selenium.getXpathCount("id('"+ dataList + "')/li"), 3);
+ chekStructure();
+ }
+
+ /**
+ * nested input and command components work correctly
+ * for the cases of validation failure or not
+ */
+ @Test
+ public void testComponentsProcessingWithValidation(Template template) {
+ init(template);
+ String liLocator = "xpath=id('"+ dataList + "')/li[";
+ String inputLocator = liLocator + "6]/input[";
+ Assert.assertEquals(selenium.getText(outputText), "");
+ selenium.click(inputLocator + "2]");
+ waitForPageToLoad();
+ Assert.assertTrue(selenium.getText(outputText).endsWith("5:submit"));
+ selenium.click(inputLocator + "3]");
+ waitForAjaxCompletion();
+ Assert.assertTrue(selenium.getText(outputText).endsWith("5:ajaxSubmit"));
+ selenium.click(inputLocator + "4]");
+ waitForAjaxCompletion();
+ Assert.assertTrue(selenium.getText(outputText).endsWith("5:ajaxSingleSubmit"));
+ selenium.type(inputLocator + "1]", "abc5");
+ selenium.click(inputLocator + "3]");
+ waitForAjaxCompletion();
+ chekStructure();
+ selenium.type(inputLocator + "1]", "fail");
+ selenium.type(liLocator + "3]/input[1]", "fail");
+ selenium.click(inputLocator + "3]");
+ waitForAjaxCompletion();
+ chekStructure(3, 6);
+ }
+
+ /**
+ * rows defined by ajaxKeys attribute are re-rendered correctly
+ */
+ @Test
+ public void testAjaxKeys(Template template) {
+ init(template);
+ chekStructure();
+ clickAjaxCommandAndWait(reRender);
+ chekStructure(3, 7);
+ }
+
+ /**
+ * components using rowKeyVar and stateVar variables are correctly output to the client
+ */
+ @Test
+ public void testVars(Template template) {
+ init(template);
+ Assert.assertEquals(selenium.getText(dataList + ":c_2:first"), "0", "Attribute 'stateVar' works wrong.");
+ Assert.assertEquals(selenium.getText(dataList + ":c_2:rows"), "0", "Attribute 'stateVar' works wrong.");
+ int rows = selenium.getXpathCount("id('"+ dataList + "')/tbody/tr").intValue();
+ for (int i = 0; i < rows; i++) {
+ Assert.assertEquals(selenium.getText(dataList + ":c_" + i + ":rowKeyVar"), Integer.toString(i));
+ }
+ }
+
+ /**
+ * componentState attribute stores nested components state across requests
+ */
+ @Test
+ public void testComponentState(Template template) {
+ init(template);
+ Assert.assertEquals(selenium.getText(dataList + ":c_2:firstState"), "0", "Attribute 'componentState' works wrong.");
+ Assert.assertEquals(selenium.getText(dataList + ":c_2:rowsState"), "0", "Attribute 'componentState' works wrong.");
+ }
+
+ /**
+ * component with rendered = false is not present on the page,
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testStandardAttributes(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, "#{dataGrid.init}");
+ autoTester.testRendered();
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("width", "100%");
+ styleAttributes.put("color", "yellow");
+ autoTester.testStyleAndClasses(new String[]{"noname"}, styleAttributes);
+ autoTester.testHTMLEvents();
+ }
+
+ /**
+ * rowKeyConverter outputs correct client ids
+ */
+ @Test
+ public void testRowKeyConverter(Template template) {
+ init(template);
+ Assert.assertTrue(selenium.getAttribute("xpath=id('"+ dataList + "')/li[3]@id").endsWith(":c_2"), "Attribute 'rowKeyConverter' works wrong.");
+ }
+
+ private void chekStructure(int ... notEqualRows) {
+ String dataTableRowLocator = "id('"+ dataTable + "')/li";
+ int count = selenium.getXpathCount(dataTableRowLocator).intValue();
+ for (int i = 1; i <= count; i++) {
+ if (Arrays.binarySearch(notEqualRows, i) < 0) {
+ Assert.assertEquals(selenium.getValue("xpath=id('"+ dataList + "')/li[" + i + "]/input"),
+ selenium.getText("xpath=" + dataTableRowLocator + "[" + i + "]"));
+ } else {
+ Assert.assertFalse(selenium.
+ getValue("xpath=id('"+ dataList + "')/li[" + i + "]/input").
+ equals(selenium.getText("xpath=" + dataTableRowLocator + "[" + i + "]")));
+ }
+ }
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/dataList/dataList.xhtml";
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/dataList/dataListAutoTest.xhtml";
+ }
+}
15 years, 10 months
JBoss Rich Faces SVN: r12578 - in trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd: generator and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-02-05 09:23:57 -0500 (Thu, 05 Feb 2009)
New Revision: 12578
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourceAssembler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourcesGenerator.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/utils/PluginUtils.java
Log:
format code, rename script/stylePackName to script/styleFileName parameter
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -64,19 +64,20 @@
return true;
}
}
+
return false;
}
protected void walk(FileObject file) throws IOException{
FileObject [] children = file.getChildren();
for(FileObject child : children) {
+
if(child.getType() != FileType.FILE) {
walk(child);
- } else {
- if(isAcceptable(child)) {
- result.add(child);
- }
+ } else if(isAcceptable(child)) {
+ result.add(child);
}
+
}
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourceAssembler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourceAssembler.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourceAssembler.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -32,4 +32,5 @@
public void assembly(URL resource);
public void writeToFile(File file);
+
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourcesGenerator.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourcesGenerator.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ResourcesGenerator.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -67,12 +67,14 @@
private void iterate(Collection<String> resources) {
for (String resourceName: resources) {
+
URL resource = getResourceURL(resourceName);
if(resource != null) {
if (assembler != null) {
assembler.assembly(resource);
}
- }
+ }
+
}
}
@@ -86,6 +88,7 @@
Class clazz = classLoader.loadClass(resourceName);
Object obj = clazz.newInstance();
Method method = clazz.getMethod("getPath", new Class [0]);
+
String path = (String) method.invoke(obj, new Object[0]);
resource = classLoader.getResource(path);
}
@@ -98,14 +101,17 @@
public void writeToFile() {
if(assemblyFile != null) {
+
if(assemblyFile.exists()) {
assemblyFile.delete();
- }
+ }
+
try {
assemblyFile.createNewFile();
} catch (IOException e) {
log.error("Error create assembly File: " + assemblyFile.getAbsolutePath(),e);
}
+
assembler.writeToFile(assemblyFile);
}
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/ScriptAssembler.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -36,32 +36,39 @@
*/
public class ScriptAssembler implements ResourceAssembler {
- Log log = new SystemStreamLog();
+ protected Log log = new SystemStreamLog();
private StringBuilder builder = new StringBuilder();
+
public void assembly(URL resource) {
log.info("process resource : " + resource.getFile());
+
try {
builder.append(IOUtil.toString(resource.openStream()));
builder.append("\n");
} catch (IOException e) {
log.error("Error read resource: " + resource.getFile());
}
+
}
public void writeToFile(File file) {
if(builder.length() > 0) {
+
try {
FileWriter fileWriter = new FileWriter(file);
+
try {
IOUtil.copy(builder.toString(), fileWriter);
} finally {
fileWriter.close();
}
+
} catch (IOException e) {
log.error("Error write file: " + file.getAbsolutePath(),e);
}
+
}
}
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -44,9 +44,8 @@
public class StyleAssembler implements ResourceAssembler {
+ protected Log log = new SystemStreamLog();
- private Log log = new SystemStreamLog();
-
private VelocityComponent velocityComponent;
private StringBuilder builder = new StringBuilder();
@@ -56,20 +55,26 @@
String file = resource.getFile();
log.info("process resource: " + file);
+
try {
InputStream resourceInputStream = resource.openStream();
+
try {
+
if(file.endsWith(".xcss")) {
XMLBody xmlBody = new XMLBody();
+
try {
xmlBody.loadXML(resourceInputStream,true);
builder.append(xmlBody.getContent());
} catch (ParsingException e) {
log.error("Error process xcss: " + e.getMessage(), e);
- }
+ }
+
} else {
builder.append(IOUtil.toString(resourceInputStream));
}
+
} finally {
resourceInputStream.close();
}
@@ -89,11 +94,13 @@
public void writeToFile(File file) {
try {
+
if(builder.length() > 0 && velocityComponent != null) {
VelocityContext context = new VelocityContext();
context.put("content", builder);
VelocityEngine engine = velocityComponent.getEngine();
FileWriter fileWriter = new FileWriter(file);
+
try {
Template velocityTemplate = engine.getTemplate("templates12/xcss.vm");
velocityTemplate.merge(context, fileWriter);
@@ -101,7 +108,9 @@
} finally {
fileWriter.close();
}
+
}
+
} catch (Exception e) {
log.error("Error write file: " + file.getAbsolutePath(),e);
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ComponentsHandler.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -85,7 +85,6 @@
for(Component component : components ){
String componentName = component.getComponentName();
-
if(localName.equals(componentName)) {
if(doMatch(componentIncludes, componentName,false)) {
@@ -117,9 +116,11 @@
for(String style : component.getStyles()) {
if(doMatch(styleIncludes, style, true)) {
+
if(!doMatch(styleExcludes, style, true)) {
this.styles.add(style);
}
+
}
}
@@ -155,9 +156,11 @@
for(String script : component.getScripts()) {
if(doMatch(scriptIncludes, script, true)) {
+
if(!doMatch(scriptExcludes, script, true)) {
this.scripts.add(script);
}
+
}
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -39,11 +39,13 @@
import org.apache.commons.vfs.FileSystemManager;
import org.apache.commons.vfs.VFS;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
@@ -84,16 +86,27 @@
*
* @component
*/
- private org.apache.maven.artifact.factory.ArtifactFactory factory;
+ private ArtifactFactory factory;
/**
* Used to look up Artifacts in the remote repository.
*
* @component
*/
- private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+ private ArtifactResolver resolver;
/**
+ *
+ * @component
+ */
+ private ArtifactMetadataSource metadataSource;
+
+ /**
+ * @component
+ */
+ protected VelocityComponent velocity;
+
+ /**
* The local repository.
*
* @parameter expression="${localRepository}"
@@ -102,25 +115,19 @@
/**
* webSourceDirectory
+ *
* @parameter expression="${basedir}/src/main/webapp"
*/
private File webSourceDirectory;
/**
- *
- * @component
- */
- private ArtifactMetadataSource metadataSource;
-
- /**
* outputScriptDirectory
* @parameter expression = "${basedir}/src/main/webapp/WEB-INF/classes"
*/
private File outputScriptDirectory ;
/**
- *
- * scriptPackName
+ * scriptFileName
* @parameter expression="custom-dependencies"
*/
private String scriptFileName;
@@ -132,7 +139,7 @@
private File outputStyleDirectory;
/**
- * stylePackName
+ * styleFileName
* @parameter expression="custom-dependencies"
*/
private String styleFileName;
@@ -227,17 +234,12 @@
*/
private String [] xhtmlExcludes;
- /**
- * @component
- */
- protected VelocityComponent velocity;
-
-
-
-
+
public void execute() throws MojoExecutionException, MojoFailureException {
+
try {
Set <Artifact> artifacts = resolveDependenciesArtifacts();
+
Digester defaultDigester = createDigester();
Map <String, Components> components = new HashMap<String, Components>();
@@ -251,9 +253,11 @@
FileObject [] configs = PluginUtils.resolveConfigsFromJar(jar, xmlConfigPatterns);
components.putAll(PluginUtils.processConfigs(configs, defaultDigester));
}
+
if(!webSourceDirectory.exists()) {
webSourceDirectory.mkdirs();
}
+
ComponentsHandler handler = findComponents(webSourceDirectory, components, xhtmlIncludes, xhtmlExcludes);
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
@@ -267,21 +271,24 @@
File scriptFile = new File(outputScriptDirectory, scriptFileName + ".js");
if(!scripts.isEmpty()) {
+
if(!outputScriptDirectory.exists()) {
outputScriptDirectory.mkdirs();
}
+
ScriptAssembler scriptAssembler = new ScriptAssembler();
mergeResources(scriptFile, scriptAssembler, beforeScriptIncludes, afterScriptIncludes, scripts);
- } else {
- if(scriptFile.exists()) {
- scriptFile.delete();
- }
+
+ } else if(scriptFile.exists()) {
+ scriptFile.delete();
}
Set <String> styles = handler.getStyles();
+
File styleFile = new File(outputStyleDirectory, styleFileName + ".xcss");
if(!styles.isEmpty()) {
+
if(!outputStyleDirectory.exists()) {
outputStyleDirectory.mkdirs();
}
@@ -289,15 +296,18 @@
StyleAssembler styleAssembler = new StyleAssembler();
styleAssembler.setVelocityComponent(velocity);
mergeResources(styleFile, styleAssembler, beforeStyleIncludes, afterStyleIncludes, styles);
+
} else if(styleFile.exists()) {
styleFile.delete();
}
}
+
Thread.currentThread().setContextClassLoader(oldClassLoader);
} catch (Exception e) {
throw new MojoExecutionException(e.getMessage(),e);
}
+
}
public void mergeResources(File assembly, ResourceAssembler assembler, List <String> beforeIncludes, List <String> afterIncludes, Collection<String> resources) {
@@ -312,10 +322,14 @@
}
protected Set <Artifact> resolveDependenciesArtifacts() throws Exception {
+
ArtifactResolutionResult result = null;
+
List <Dependency> dependencies = project.getDependencies();
+
Set <Artifact> artifacts = MavenMetadataSource.createArtifacts(factory, dependencies, null, null, project);
artifacts.add(project.getArtifact());
+
result = resolver.resolveTransitively(artifacts, project.getArtifact(), Collections.EMPTY_LIST, localRepository, metadataSource);
return result.getArtifacts();
}
@@ -337,6 +351,7 @@
scanner.setExcludes(excludes);
scanner.addDefaultExcludes();
scanner.scan();
+
String [] collectedFiles = scanner.getIncludedFiles();
ComponentsHandler handler = new ComponentsHandler();
@@ -355,6 +370,7 @@
SAXParser saxParser = saxParserFactory.newSAXParser();
for(String processFile : collectedFiles) {
+
File file = new File(webSourceDir,processFile);
if(file.exists()) {
getLog().info("process file: " + file.getName());
@@ -370,7 +386,9 @@
protected FileObject resolveArtifact(Artifact artifact) {
FileObject jarFileObjects = null;
+
if(artifact != null) {
+
try {
resolver.resolve(artifact, Collections.EMPTY_LIST, localRepository);
getLog().info("artifact " + artifact.getFile().getAbsolutePath() + " is resolved");
@@ -381,6 +399,7 @@
}
File file = artifact.getFile();
+
try {
FileSystemManager manager = VFS.getManager();
jarFileObjects = manager.resolveFile("jar://" + file.getAbsolutePath());
@@ -388,6 +407,7 @@
getLog().error("Error during processing file: " + file.getAbsolutePath()+ "\n" + e.getMessage(), e);
}
}
+
return jarFileObjects;
}
@@ -417,7 +437,6 @@
} catch (MalformedURLException e) {
getLog().error("Artifact url " + jar.getFile() + " is invalid");
}
-
}
// add project classes, scripts, styles etc ...
@@ -438,7 +457,9 @@
}
private void addResources(ClassRealm realm, List resources) {
+
if(realm != null && resources != null) {
+
for(Object path: resources) {
URL url = null;
String formatted = null;
@@ -459,6 +480,9 @@
realm.addConstituent(url);
}
}
+
}
+
}
+
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/utils/PluginUtils.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/utils/PluginUtils.java 2009-02-05 14:19:20 UTC (rev 12577)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/utils/PluginUtils.java 2009-02-05 14:23:57 UTC (rev 12578)
@@ -41,25 +41,31 @@
public static FileObject [] resolveConfigsFromJar(FileObject jarFileObject, String [] patterns) throws IOException{
FileObject [] result = new FileObject[0];
+
JarResourceScanner jarScanner = new JarResourceScanner();
jarScanner.setBaseFile(jarFileObject);
jarScanner.setPatterns(patterns);
jarScanner.doScan();
+
result = (FileObject [])jarScanner.getResult().toArray(new FileObject[jarScanner.getResult().size()]);
return result;
}
public static Map <String,Components> processConfigs(FileObject [] configs, Digester digester) throws SAXException, IOException {
Map <String, Components>collector = new HashMap <String, Components>();
+
for (FileObject config: configs) {
InputStream configInputStream = config.getContent().getInputStream();
+
try {
Components components = (Components)digester.parse(configInputStream);
collector.put(components.getNamespace(), components);
} finally {
configInputStream.close();
}
+
}
+
return collector;
}
@@ -72,6 +78,7 @@
digester.addCallMethod("components/component/scripts/script", "addScript",0);
digester.addCallMethod("components/component/styles/style", "addStyle",0);
digester.addSetNext("components/component", "addComponent");
+
return digester;
}
}
15 years, 11 months
JBoss Rich Faces SVN: r12577 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-02-05 09:19:20 -0500 (Thu, 05 Feb 2009)
New Revision: 12577
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
Heap size option for Surefire plugin added
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2009-02-05 13:43:39 UTC (rev 12576)
+++ trunk/test-applications/seleniumTest/pom.xml 2009-02-05 14:19:20 UTC (rev 12577)
@@ -50,6 +50,12 @@
<build>
<plugins>
<plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>-Xmx256m</argLine>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3.1</version>
15 years, 11 months
JBoss Rich Faces SVN: r12576 - in trunk: ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-02-05 08:43:39 -0500 (Thu, 05 Feb 2009)
New Revision: 12576
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
https://jira.jboss.org/jira/browse/RF-4354
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2009-02-05 13:32:55 UTC (rev 12575)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2009-02-05 13:43:39 UTC (rev 12576)
@@ -487,4 +487,33 @@
}
if (result!=false) result = true;
return result;
-};
\ No newline at end of file
+};
+
+Richfaces.setupScrollEventHandlers = function(element, handler) {
+
+ var elements = []
+
+ element = element.parentNode;
+ while (element && element!=window.document)
+ {
+ if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
+ {
+ elements.push(element);
+ Event.observe(element, "scroll", handler, false);
+ }
+ element = element.parentNode;
+ }
+
+ return elements;
+};
+
+Richfaces.removeScrollEventHandlers = function(elements, handler) {
+ if (elements)
+ {
+ for (var i=0;i<elements.length;i++)
+ {
+ Event.stopObserving(elements[i], "scroll", handler, false);
+ }
+ elements = null;
+ }
+};
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2009-02-05 13:32:55 UTC (rev 12575)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2009-02-05 13:43:39 UTC (rev 12576)
@@ -784,6 +784,8 @@
}
}
+ this.scrollElements = null;
+
//alert(new Date().getTime()-_d.getTime());
},
@@ -792,6 +794,7 @@
{
if (this.params.popup && this.isVisible)
{
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
Event.stopObserving(window.document, "click", this.eventOnCollapse, false);
}
},
@@ -1117,6 +1120,10 @@
this.timeHoursDigits = digits;
},
+ eventOnScroll: function (e) {
+ this.doCollapse();
+ },
+
doCollapse: function() {
if (!this.params.popup || !this.isVisible) return;
@@ -1127,6 +1134,7 @@
if (this.invokeEvent("collapse", element))
{
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
Event.stopObserving(window.document, "click", this.eventOnCollapse, false);
var iframe=null;
@@ -1152,7 +1160,6 @@
if (this.invokeEvent("expand", element, e))
{
-
var iframe=null;
if (Richfaces.browser.isIE6) iframe = $(this.IFRAME_ID);
@@ -1203,6 +1210,9 @@
this.isVisible = true;
Event.observe(window.document, "click", this.eventOnCollapse, false);
+
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
+ this.scrollElements = Richfaces.setupScrollEventHandlers(element, this.eventOnScroll);
}
},
@@ -1298,6 +1308,7 @@
prepareEvents: function() {
this.eventOnCollapse = this.eventOnCollapse.bindAsEventListener(this);
+ this.eventOnScroll = this.eventOnScroll.bindAsEventListener(this);
},
invokeEvent: function(eventName, element, event, date) {
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2009-02-05 13:32:55 UTC (rev 12575)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2009-02-05 13:43:39 UTC (rev 12576)
@@ -34,6 +34,8 @@
this.width = width;
this.height = height;
this.initDimensions();
+ this.scrollElements = null;
+ this.eventOnScroll = this.eventOnScroll.bindAsEventListener(this);
},
@@ -111,7 +113,8 @@
}
this.listParent.fire("rich:onlistcall", {});
-
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
+ this.scrollElements = Richfaces.setupScrollEventHandlers(this.listParentContainer.parentNode, this.eventOnScroll);
},
injectListToBody: function(listElement) {
@@ -143,6 +146,7 @@
},
hide : function() {
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
this.outjectListFromBody(this.listParentContainer, this.listParent);
this.resetState();
if (this.iframe) {
@@ -159,6 +163,10 @@
},
+ eventOnScroll: function (e) {
+ this.hideWithDelay();
+ },
+
visible : function() {
return this.listParent.visible();
},
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2009-02-05 13:32:55 UTC (rev 12575)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2009-02-05 13:43:39 UTC (rev 12576)
@@ -160,6 +160,9 @@
}
this.onNothingLabelClick = this.hideNLabel.bindAsEventListener(this);
+
+ this.scrollElements = null;
+ this.eventOnScroll = this.eventOnScroll.bindAsEventListener(this);
},
cancelSubmit: function(event) {
@@ -238,9 +241,13 @@
if (Element.getStyle(this.update, 'display')
== 'none') this.options.onShow(this.element, this.update, this.options);
this.disableSubmit();
+
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
+ this.scrollElements = Richfaces.setupScrollEventHandlers($(this.options.selection), this.eventOnScroll);
},
hide: function() {
+ Richfaces.removeScrollEventHandlers(this.scrollElements, this.eventOnScroll);
if (RichFaces.SAFARI == RichFaces.navigatorType()) {
if (this.wasScroll) {
this.wasScroll = false;
@@ -255,6 +262,10 @@
this.hasFocus = false;
this.active = false;
},
+
+ eventOnScroll: function (e) {
+ this.hide();
+ },
hideNLabel: function(event) {
var nothingLabel = $(this.update.id + "NothingLabel");
15 years, 11 months
JBoss Rich Faces SVN: r12575 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/panelMenuItem and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-05 08:32:55 -0500 (Thu, 05 Feb 2009)
New Revision: 12575
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuGroup/styleAndClasseStandardHTMLAttributesTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/panelMenuItemAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/styleAndClasseStandardHTMLAttributesTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5902
https://jira.jboss.org/jira/browse/RF-5911
https://jira.jboss.org/jira/browse/RF-5909
+ refactoring
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuGroup/styleAndClasseStandardHTMLAttributesTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuGroup/styleAndClasseStandardHTMLAttributesTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/panelMenuItemAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/styleAndClasseStandardHTMLAttributesTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java 2009-02-05 13:26:16 UTC (rev 12574)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuGroupTest.java 2009-02-05 13:32:55 UTC (rev 12575)
@@ -1,116 +1,65 @@
package org.richfaces.testng;
-import java.util.HashMap;
-import java.util.Map;
-
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
-import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
import org.testng.annotations.Test;
-public class PanelMenuGroupTest extends SeleniumTestBase {
+public class PanelMenuGroupTest extends PanelMenuItemTest {
- private static Map<String, String> params = new HashMap<String, String>();
+ @Test
+ public void testIconsAttributesApply(Template template) {
+ renderPage(LOOK_AND_FEEL_TEST_URL, template, null);
- static {
- params.put("parameter1", "value1");
- params.put("parameter2", "value2");
- params.put("parameter3", "value3");
- }
+ writeStatus("Check icons attributes apply: are output to client and images are accessible");
+ String itemId = getParentId() + FORM_ID + "componentId";
+ String iconImgXpath = "//*[@id='" + itemId + "']/table/tbody/tr/td[1]/img";
- @Test
- public void testRenderedAttribute(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test component with rendered = false is not present on the page");
- tester.testRendered();
- }
+ writeStatus("Check iconDisabled attribute");
+ disable(true);
- @Test
- public void testReRenderAttribute(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test component re-renders another components");
- tester.testReRender();
- }
+ Assert.assertTrue(isPresent(iconImgXpath), "Icon is not rendered");
+ testIcon(iconImgXpath, "Disc");
- @Test
- public void testOncomplete(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test oncomplete attribute");
- tester.testOncomplete();
- }
+ disable(false);
- @Test
- public void testAjaxSingle(Template template) {
- AutoTester autoTester = getAutoTester(this);
- autoTester.renderPage(template, null);
- writeStatus("Test ajaxSingle attribute in case of external validation failure");
- autoTester.testAjaxSingle();
- }
+ writeStatus("Check iconCollapsed attribute");
+ Assert.assertTrue(isPresent(iconImgXpath), "Icon is not rendered");
+ testIcon(iconImgXpath, "TriangleUp");
- @Test
- public void testLimitToListAttribute(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test component with limitToList = true skips ajaxRendered areas update");
- tester.testLimitToList();
+ writeStatus("Check iconExpanded attribute");
+ clickAjaxCommandAndWait("icon" + itemId);
+ Assert.assertTrue(isPresent(iconImgXpath), "Icon is not rendered");
+ testIcon(iconImgXpath, "TriangleDown");
}
@Test
- public void testNestedParams(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test component encodes nested f:param tags and their values are present as request parameters");
- tester.testRequestParameters(params);
- }
+ public void testOncollapseOnexpandEventsFired(Template template) {
+ renderPage(LOOK_AND_FEEL_TEST_URL, template, null);
- @Test
- public void testImmediate(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test immediate attribute");
- tester.testImmediate();
- }
+ writeStatus("Check oncollapse/onexpand events are fired ");
- @Test
- public void testImmediateWithExternalValidationFailed(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test immediate attribute with external validation failed");
- tester.testImmediateWithExternalValidationFailed();
- }
+ String componentId = "icon" + getParentId() + FORM_ID + "componentId";
- @Test
- public void testWithExternalValidationFailure(Template template) {
- AutoTester autoTester = getAutoTester(this);
- autoTester.renderPage(template, null);
- writeStatus("Check component in case of external validation failure: listeners are not invoked, model is not updated");
- autoTester.testExtrenalValidationFailure();
+ clickAjaxCommandAndWait(componentId);
+ assertEvent("onexpand");
+ clickAjaxCommandAndWait(componentId);
+ assertEvent("oncollapse");
}
- @Test
- public void testBypassUpdatesAttribute(Template template) {
- AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
- writeStatus("Test component with bypassUpdates = true skips update model values phase");
- tester.testBypassUpdate();
- }
-
@Override
public void sendAjax() {
clickAjaxCommandAndWait("icon" + getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
}
@Override
- public String getAutoTestUrl() {
- return "pages/panelMenuGroup/panelMenuGroupAutoTest.xhtml";
+ public String getTestBase() {
+ return "pages/panelMenuGroup/";
}
@Override
- public String getTestUrl() {
- return null;
+ public String getAutoTestUrl() {
+ return "panelMenuGroupAutoTest.xhtml";
}
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java 2009-02-05 13:26:16 UTC (rev 12574)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java 2009-02-05 13:32:55 UTC (rev 12575)
@@ -12,13 +12,12 @@
public class PanelMenuItemTest extends SeleniumTestBase {
- private final static String LOOK_AND_FEEL_TEST_URL = "pages/panelMenuItem/styleAndClasseStandardHTMLAttributesTest.xhtml";
+ protected final static String LOOK_AND_FEEL_TEST_URL = "styleAndClasseStandardHTMLAttributesTest.xhtml";
- private static final String FORM_ID = "form:";
+ protected static final String FORM_ID = "form:";
- private static final String CONTROL_FORM_ID = "control:";
+ protected static final String CONTROL_FORM_ID = "control:";
-
private static Map<String, String> params = new HashMap<String, String>();
static {
@@ -114,7 +113,7 @@
writeStatus("Check standard HTML attributes are output to client");
String parentId = getParentId();
- String menuItemId = "icon" + parentId + FORM_ID + "item";
+ String menuItemId = "icon" + parentId + FORM_ID + "componentId";
disable(false);
@@ -129,12 +128,12 @@
writeStatus("Check styles and classes are output to client");
String parentId = getParentId();
- String itemId = parentId + FORM_ID + "item";
+ String itemId = parentId + FORM_ID + "componentId";
writeStatus("Check enabled component at first");
disable(false);
- String styleElementId = "tablehide" + parentId + FORM_ID + "item";
+ String styleElementId = "tablehide" + parentId + FORM_ID + "componentId";
assertStyleAttribute(styleElementId, "font-size: 16px", "Style attribute was not output to client");
assertClassNames(styleElementId, new String[] { "noclass" }, "Class attribute was not output to client", true);
@@ -162,23 +161,30 @@
renderPage(LOOK_AND_FEEL_TEST_URL, template, null);
writeStatus("Check icons attributes apply: are output to client and images are accessible");
+ String itemId = getParentId() + FORM_ID + "componentId";
+ String iconImgXpath = "//*[@id='" + itemId + "']/table/tbody/tr/td[1]/img";
+ writeStatus("Check iconDisabled attribute");
+ disable(true);
+
+ Assert.assertTrue(isPresent(iconImgXpath), "Icon is not rendered");
+ testIcon(iconImgXpath, "Disc");
+
+ writeStatus("Check icon attribute");
disable(false);
- String itemId = getParentId() + FORM_ID + "item";
- String iconImgXpath = "//*[@id='" + itemId + "']/table/tbody/tr/td[1]/img";
Assert.assertTrue(isPresent(iconImgXpath), "Icon is not rendered");
testIcon(iconImgXpath, "Chevron");
}
@Override
public void sendAjax() {
- clickAjaxCommandAndWait("icon" + getAutoTester(this).getClientId("") + "item");
+ clickAjaxCommandAndWait("icon" + getAutoTester(this).getClientId("") + "componentId");
}
@Override
public String getAutoTestUrl() {
- return "pages/panelMenuItem/panelMenuItemAutoTest.xhtml";
+ return "panelMenuItemAutoTest.xhtml";
}
@Override
@@ -186,7 +192,12 @@
return null;
}
- private boolean disable(boolean isDisabled) {
+ @Override
+ public String getTestBase() {
+ return "pages/panelMenuItem/";
+ }
+
+ protected boolean disable(boolean isDisabled) {
String parentId = getParentId();
String isDisabledId = parentId + CONTROL_FORM_ID + "isDisabled";
String disablingControlId = parentId + CONTROL_FORM_ID + "disable";
@@ -204,7 +215,7 @@
* @param location location of image representing icon to be tested
* @param iconName substring that icon uri has to contain
*/
- private void testIcon(String location, String iconSubstring) {
+ protected void testIcon(String location, String iconSubstring) {
String iconSrc = selenium.getAttribute(location + "/@src");
if (null == iconSrc || !iconSrc.matches(".*" + iconSubstring + ".*")) {
Assert.fail("It looks as if the icon is not proper. Uri of icon is being tested must contain ["
15 years, 11 months
JBoss Rich Faces SVN: r12574 - trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-02-05 08:26:16 -0500 (Thu, 05 Feb 2009)
New Revision: 12574
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
Log:
fix parameter names
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-02-05 13:23:43 UTC (rev 12573)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/ResourceDependencyMojo.java 2009-02-05 13:26:16 UTC (rev 12574)
@@ -201,7 +201,6 @@
* componentIncludes
* @parameter
*/
-
private String [] componentIncludes;
/**
@@ -211,22 +210,23 @@
private String [] componentExcludes;
/**
- * xml_config_patterns
+ * xmlConfigPatterns
* @parameter
*/
private String [] xmlConfigPatterns;
/**
- * xhtml_includes
+ * xhtmlIncludes
* @parameter
*/
private String [] xhtmlIncludes;
/**
- * xhtml_excludes
+ * xhtmlExcludes
* @parameter
*/
private String [] xhtmlExcludes;
+
/**
* @component
*/
15 years, 11 months