Author: adubovsky
Date: 2009-07-10 08:44:24 -0400 (Fri, 10 Jul 2009)
New Revision: 14881
Added:
branches/community/3.3.X/test-applications/test-jsp/
branches/community/3.3.X/test-applications/test-jsp/pom.xml
branches/community/3.3.X/test-applications/test-jsp/src/
branches/community/3.3.X/test-applications/test-jsp/src/main/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/ComponentsSkinsBuffers.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/DrawGrids.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/PageContent.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/TestType.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoEventHandlers.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoGeneral.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoStylesClasses.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Convertion.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/UtilListeners.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Validation.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/ImmediateComponentBean.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/RequiredComponentBean.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/comboBox/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/comboBox/ComboBox.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/dropDownMenu/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/dropDownMenu/DropDownMenu.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/extendedDataTable/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/extendedDataTable/ExtendedDataTable.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/pickList/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/pickList/PickList.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/suggestionBox/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/suggestionBox/SuggestionBox.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/BeanManager.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/Car.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/CarProvider.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Attribute.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/AttributesList.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Status.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/TLDParser.java
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/phaseTracker/
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/phaseTracker/PhaseTracker.java
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/messages.properties
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/util/
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/util/data/
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/util/data/cars.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/META-INF/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/META-INF/MANIFEST.MF
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/auto/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/auto/auto-config.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/comboBox.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/dropDownMenu.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/extendedDataTable.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/pickList.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/suggestionBox.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/faces-config.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/web.xml
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/combiModalPanel.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/header.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/main.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoEventHandlers.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoGeneral.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoStylesClasses.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blank.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blankTestPage.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBox.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBoxManualGeneral.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenu.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenuManualGeneral.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTable.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTableManualGeneral.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickList.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickListManualGeneral.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBox.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBoxManualGeneral.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/index.jsp
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/javascript/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/javascript/jsTools.js
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/styles/
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/styles/layout.css
Log:
+ test-jsp project
Added: branches/community/3.3.X/test-applications/test-jsp/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/test-jsp/pom.xml
(rev 0)
+++ branches/community/3.3.X/test-applications/test-jsp/pom.xml 2009-07-10 12:44:24 UTC
(rev 14881)
@@ -0,0 +1,30 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>test-applications</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.3.2-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.test-applications</groupId>
+ <artifactId>test-jsp</artifactId>
+ <packaging>war</packaging>
+ <name>RichFaces Test Application (JSP + MyFaces)</name>
+ <build>
+ <finalName>richfaces-test-jsp</finalName>
+ </build>
+<dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk</artifactId>
+ <version>1.1.7</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+</dependencies>
+</project>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/ComponentsSkinsBuffers.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/ComponentsSkinsBuffers.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/ComponentsSkinsBuffers.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,41 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package applicationStructure;
+
+/**
+ * The Class ComponentsSkinsBuffers contains RichFaces skins' and components'
+ * names.
+ */
+public class ComponentsSkinsBuffers {
+
+ /**
+ * The Constant componentsBuffer contains RichFaces components which exist
+ * in this application.
+ */
+ protected static final String[] componentsBuffer = { "comboBox",
+ "extendedDataTable", "dropDownMenu", "pickList",
"suggestionBox" };
+
+ /** The Constant skinsBuffer contains available RichFaces skins. */
+ protected static final String[] skinsBuffer = { "blueSky",
"classic",
+ "deepMarine", "DEFAULT", "emeraldTown",
"japanCherry", "ruby",
+ "wine", "plain" };
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/DrawGrids.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/DrawGrids.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/DrawGrids.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,262 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package applicationStructure;
+
+import java.util.ArrayList;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.faces.component.html.HtmlCommandButton;
+import javax.faces.component.html.HtmlInputText;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.component.html.HtmlPanelGroup;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.MethodExpressionActionListener;
+
+import util.parser.Attribute;
+
+/**
+ * The Class DrawGrids provides methods for dynamic generating of the results'
+ * grids for events' handlers, styles, classes and common attributes.
+ */
+public class DrawGrids {
+
+ /**
+ * Draw event handlers grid.
+ *
+ * @param panelGrid
+ * the panel grid in which event handlers are drawn
+ * @param events
+ * the events attributes which are drawn in the panel grid
+ */
+ public void drawEventHandlersGrid(final HtmlPanelGrid panelGrid,
+ final ArrayList<Attribute> events) {
+ panelGrid.getChildren().clear();
+
+ HtmlOutputText attrNameHeader = new HtmlOutputText();
+ attrNameHeader.setId("attrEventsHeaderID");
+ attrNameHeader.setValue("EventHandlers");
+ attrNameHeader.setStyle("font-weight: bold; font-size: large");
+
+ HtmlOutputText attrStatusHeader = new HtmlOutputText();
+ attrStatusHeader.setId("attrEventsStatusID");
+ attrStatusHeader.setValue("Status");
+ attrStatusHeader.setStyle("font-weight: bold; font-size: large");
+
+ panelGrid.getChildren().add(attrNameHeader);
+ panelGrid.getChildren().add(attrStatusHeader);
+
+ for (Attribute a : events) {
+ HtmlOutputText attrName = new HtmlOutputText();
+ attrName.setId(a.getName() + "NameID");
+ attrName.setValue(a.getName());
+ attrName.setTitle(a.getDescription());
+ HtmlInputText attrStatus = new HtmlInputText();
+ attrStatus.setValue(a.getStatus());
+ // id should not be changed in order that test execution is correct
+ attrStatus.setId(a.getName() + "ID");
+ attrStatus.setReadonly(true);
+
+ switch (a.getStatus()) {
+ case FAILED:
+ attrStatus.setStyle("color: red");
+ break;
+ case PASSED:
+ attrStatus.setStyle("color: green");
+ break;
+ case NOT_TESTED:
+ attrStatus.setStyle("color: grey");
+ break;
+ }
+
+ panelGrid.getChildren().add(attrName);
+ panelGrid.getChildren().add(attrStatus);
+ }
+ }
+
+ /**
+ * Draw styles and classes grid.
+ *
+ * @param panelGrid
+ * the panel grid in which styles and classes are drawn
+ * @param styles
+ * the styles and classes which are drawn in the panel grid
+ */
+ public void drawStylesClassesGrid(HtmlPanelGrid panelGrid,
+ ArrayList<Attribute> styles) {
+ panelGrid.getChildren().clear();
+
+ HtmlOutputText attrNameHeader = new HtmlOutputText();
+ attrNameHeader.setId("attrStylesHeaderID");
+ attrNameHeader.setValue("StylesClasses");
+ attrNameHeader.setStyle("font-weight: bold; font-size: large");
+
+ HtmlOutputText attrStatusHeader = new HtmlOutputText();
+ attrStatusHeader.setId("attrStylesStatusID");
+ attrStatusHeader.setValue("Status");
+ attrStatusHeader.setStyle("font-weight: bold; font-size: large");
+
+ panelGrid.getChildren().add(attrNameHeader);
+ panelGrid.getChildren().add(attrStatusHeader);
+
+ String onclickFunctions = "";
+ for (Attribute a : styles) {
+ HtmlOutputText attrName = new HtmlOutputText();
+ attrName.setId(a.getName() + "NameID");
+ attrName.setValue(a.getName());
+ attrName.setTitle(a.getDescription());
+ HtmlInputText attrStatus = new HtmlInputText();
+ attrStatus.setValue(a.getStatus());
+ // id should not be changed in order that test execution is correct
+ attrStatus.setId(a.getName() + "ID");
+ attrStatus.setReadonly(true);
+
+ // we should have a button which calls test function for each style
+ // and class. Function is placed in jsTool.js file
+ onclickFunctions += "markClassAsWorkable('" + a.getName() +
"');";
+
+ switch (a.getStatus()) {
+ case FAILED:
+ attrStatus.setStyle("color: red");
+ break;
+ case PASSED:
+ attrStatus.setStyle("color: green");
+ break;
+ case NOT_TESTED:
+ attrStatus.setStyle("color: grey");
+ break;
+ }
+
+ panelGrid.getChildren().add(attrName);
+ panelGrid.getChildren().add(attrStatus);
+ }
+
+ onclickFunctions += "return false;";
+ HtmlCommandButton testButton = new HtmlCommandButton();
+ testButton.setId("testButtonID");
+ testButton.setValue("Test Classes");
+
+ // pass all calls of the functions into onclick attribute of the button
+ testButton.setOnclick(onclickFunctions);
+
+ panelGrid.getChildren().add(testButton);
+ panelGrid.getChildren().add(new HtmlPanelGroup());
+ }
+
+ /**
+ * Draw automated general attributes' grid.
+ *
+ * @param panelGrid
+ * the panel grid in which automated general attributes are drawn
+ * @param attrs
+ * the attributes which are drawn in the panel grid
+ */
+ public void drawAutoGeneralGrid(HtmlPanelGrid panelGrid,
+ ArrayList<Attribute> attrs) {
+ panelGrid.getChildren().clear();
+
+ HtmlOutputText attrNameHeader = new HtmlOutputText();
+ attrNameHeader.setId("attrHeaderID");
+ attrNameHeader.setValue("AutoAttribute");
+ attrNameHeader.setStyle("font-weight: bold; font-size: large");
+
+ HtmlOutputText attrStatusHeader = new HtmlOutputText();
+ attrStatusHeader.setId("attrStatusID");
+ attrStatusHeader.setValue("Status");
+ attrStatusHeader.setStyle("font-weight: bold; font-size: large");
+
+ panelGrid.getChildren().add(attrNameHeader);
+ panelGrid.getChildren().add(attrStatusHeader);
+
+ for (Attribute a : attrs) {
+ HtmlOutputText attrName = new HtmlOutputText();
+ attrName.setValue(a.getName());
+ attrName.setId(a.getName() + "NameID");
+ attrName.setTitle(a.getDescription());
+ HtmlInputText attrStatus = new HtmlInputText();
+ attrStatus.setValue(a.getStatus());
+ // id should not be changed in order that test execution is correct
+ attrStatus.setId(a.getName() + "ID");
+ attrStatus.setReadonly(true);
+
+ switch (a.getStatus()) {
+ case FAILED:
+ attrStatus.setStyle("color: red");
+ break;
+ case PASSED:
+ attrStatus.setStyle("color: green");
+ break;
+ case NOT_TESTED:
+ attrStatus.setStyle("color: grey");
+ break;
+ }
+
+ panelGrid.getChildren().add(attrName);
+
+ // we should have a possibility to change immediate and required
+ // attributes for their testing
+ if (a.getName().equalsIgnoreCase("immediate")
+ || a.getName().equalsIgnoreCase("required")) {
+ HtmlCommandButton button = new HtmlCommandButton();
+ button.setId(a.getName() + "ButtonID");
+
+ MethodExpression actionExpression;
+ if (a.getName().equalsIgnoreCase("immediate")) {
+ button.setValue("Change Immediate");
+ actionExpression =
getMethodExpression("#{utilListeners.immediateAction}");
+ } else {
+ button.setValue("Change Required");
+ actionExpression =
getMethodExpression("#{utilListeners.requiredAction}");
+ }
+ MethodExpressionActionListener meActionListener = new
MethodExpressionActionListener(
+ actionExpression);
+
+ button.addActionListener(meActionListener);
+ HtmlPanelGroup pg = new HtmlPanelGroup();
+ pg.setId(a.getName() + "PanelGroupID");
+ pg.getChildren().add(attrStatus);
+ pg.getChildren().add(button);
+ panelGrid.getChildren().add(pg);
+ } else
+ panelGrid.getChildren().add(attrStatus);
+ }
+ }
+
+ /**
+ * Gets the method expression.
+ *
+ * @param name
+ * the name of EL expression
+ *
+ * @return the method expression
+ */
+ private MethodExpression getMethodExpression(String name) {
+ Class[] argtypes = new Class[1];
+ argtypes[0] = ActionEvent.class;
+ FacesContext facesCtx = FacesContext.getCurrentInstance();
+ ELContext elContext = facesCtx.getELContext();
+ return facesCtx.getApplication().getExpressionFactory()
+ .createMethodExpression(elContext, name, null, argtypes);
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/PageContent.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/PageContent.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/PageContent.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,223 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package applicationStructure;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import org.richfaces.VersionBean;
+
+import util.BeanManager;
+
+import automateCommon.AutoEventHandlers;
+import automateCommon.AutoGeneral;
+import automateCommon.AutoStylesClasses;
+
+/**
+ * The PageContent bean contains information about test page content.
+ */
+public class PageContent {
+
+ /** The Constant page extension. */
+ private static final String EXT = ".jsp";
+
+ /** The all RichFaces components which exist in this application. */
+ private List<SelectItem> allComponents;
+
+ /** The all available RichFaces skins. */
+ private List<SelectItem> allSkins;
+
+ /** The RichFaces version. */
+ private final String version = VersionBean.Version._versionInfo;
+
+ /** The current component. */
+ private String component = "_blank";
+
+ /** The current skin. */
+ private String skin = "blueSky";
+
+ /** The current test type. */
+ private TestType testType = TestType.MANUAL_GENERAL_ATTRIBUTES;
+
+ /**
+ * Instantiates a new page content.
+ */
+ public PageContent() {
+ allComponents = new ArrayList<SelectItem>();
+ allComponents.add(new SelectItem("_blank"));
+ for (String component : ComponentsSkinsBuffers.componentsBuffer) {
+ allComponents.add(new SelectItem(component));
+ }
+
+ allSkins = new ArrayList<SelectItem>();
+ for (String skin : ComponentsSkinsBuffers.skinsBuffer) {
+ allSkins.add(new SelectItem(skin));
+ }
+ }
+
+ /**
+ * Call Reset methods in all auto test beans.
+ */
+ public void reset() {
+ testType = TestType.MANUAL_GENERAL_ATTRIBUTES;
+ AutoEventHandlers autoEventHandlersBean = (AutoEventHandlers) BeanManager
+ .getManagedBeanFromSession("autoEventHandlers");
+ autoEventHandlersBean.reset();
+
+ AutoStylesClasses autoStylesClassesBean = (AutoStylesClasses) BeanManager
+ .getManagedBeanFromSession("autoStylesClasses");
+ autoStylesClassesBean.reset();
+
+ AutoGeneral autoGeneralBean = (AutoGeneral) BeanManager
+ .getManagedBeanFromSession("autoGeneral");
+ autoGeneralBean.reset();
+ }
+
+ /**
+ * Gets the current component.
+ *
+ * @return the component
+ */
+ public String getComponent() {
+ return component;
+ }
+
+ /**
+ * Sets the current component.
+ *
+ * @param component
+ * the new component
+ */
+ public void setComponent(String component) {
+ // if different component is selected reset all data from automated
+ // beans: panel grids, statuses etc...
+ if (!component.equals(this.component))
+ this.reset();
+ this.component = component;
+ }
+
+ /**
+ * Gets the current test type.
+ *
+ * @return the test type
+ */
+ public TestType getTestType() {
+ return testType;
+ }
+
+ /**
+ * Sets the current test type.
+ *
+ * @param testType
+ * the new test type
+ */
+ public void setTestType(TestType testType) {
+ this.testType = testType;
+ }
+
+ /**
+ * Gets the current component's path.
+ *
+ * @return the current component 's path
+ */
+ public String getCurrentComponent() {
+ if (component.equals("_blank"))
+ return "/components/_blank/_blank" + EXT;
+ else
+ return "/components/" + component + "/" + component + EXT;
+ }
+
+ /**
+ * Gets the current test page's path.
+ *
+ * @return the current test page's path
+ *
+ * @throws Exception
+ * the exception
+ */
+ public String getCurrentTestPage() throws Exception {
+ if (component.equals("_blank"))
+ return "/components/_blank/_blankTestPage" + EXT;
+ switch (testType) {
+ case MANUAL_GENERAL_ATTRIBUTES:
+ return "/components/" + component + "/" + component
+ + "ManualGeneral" + EXT;
+ case AUTO_GENERAL_ATTRIBUTES:
+ return "/auto/autoGeneral" + EXT;
+ case AUTO_EVENTHANDLERS:
+ return "/auto/autoEventHandlers" + EXT;
+ case AUTO_STYLES_CLASSES:
+ return "/auto/autoStylesClasses" + EXT;
+ default: {
+ throw new Exception("Incorrect testType");
+ }
+ }
+ }
+
+ /**
+ * Gets the RichFaces version.
+ *
+ * @return the RichFaces version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the all RiceFaces components.
+ *
+ * @return the all RichFaces components
+ */
+ public List<SelectItem> getAllComponents() {
+ return allComponents;
+ }
+
+ /**
+ * Gets the current skin.
+ *
+ * @return the current skin
+ */
+ public String getSkin() {
+ return skin;
+ }
+
+ /**
+ * Sets the current skin.
+ *
+ * @param skin
+ * the new skin
+ */
+ public void setSkin(String skin) {
+ this.skin = skin;
+ }
+
+ /**
+ * Gets the all skins.
+ *
+ * @return the all skins
+ */
+ public List<SelectItem> getAllSkins() {
+ return allSkins;
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/TestType.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/TestType.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/applicationStructure/TestType.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package applicationStructure;
+
+/**
+ * The Enum TestType contains all test types.
+ */
+public enum TestType {
+ MANUAL_GENERAL_ATTRIBUTES, AUTO_GENERAL_ATTRIBUTES, AUTO_EVENTHANDLERS,
AUTO_STYLES_CLASSES
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoEventHandlers.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoEventHandlers.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoEventHandlers.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,96 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package automateCommon;
+
+import java.util.ArrayList;
+
+import javax.faces.component.html.HtmlPanelGrid;
+
+import applicationStructure.DrawGrids;
+import applicationStructure.PageContent;
+
+import util.BeanManager;
+import util.parser.Attribute;
+import util.parser.TLDParser;
+
+/**
+ * The AutoEventHandlers bean is used for automated test of the events'
+ * handlers.
+ */
+public class AutoEventHandlers {
+
+ /** The result event handlers grid. */
+ private HtmlPanelGrid resultEventHandlersGrid = null;
+
+ /** The all event handlers for selected component. */
+ private ArrayList<Attribute> allEventHandlers;
+
+ /**
+ * The drawGrids object generates the results panel grid using DrawGrids
+ * class methods.
+ */
+ DrawGrids drawGrids = new DrawGrids();
+
+ /**
+ * Draw event handlers grid for current component.
+ */
+ public void drawEventHandlersGrid() {
+ PageContent pageContentBean = (PageContent) BeanManager
+ .getManagedBeanFromSession("pageContent");
+
+ String component = pageContentBean.getComponent();
+
+ TLDParser parser = new TLDParser(component);
+ allEventHandlers = parser.getAllAttributes().getHandlers();
+
+ drawGrids.drawEventHandlersGrid(resultEventHandlersGrid,
+ allEventHandlers);
+ }
+
+ /**
+ * Reset results panel grid when different component is selected.
+ */
+ public void reset() {
+ if (null != resultEventHandlersGrid)
+ resultEventHandlersGrid.getChildren().clear();
+ allEventHandlers = null;
+ }
+
+ /**
+ * Gets the result event handlers grid.
+ *
+ * @return the result event handlers grid
+ */
+ public HtmlPanelGrid getResultEventHandlersGrid() {
+ return resultEventHandlersGrid;
+ }
+
+ /**
+ * Sets the result event handlers grid.
+ *
+ * @param resultEventHandlersGrid
+ * the new result event handlers grid
+ */
+ public void setResultEventHandlersGrid(HtmlPanelGrid resultEventHandlersGrid) {
+ this.resultEventHandlersGrid = resultEventHandlersGrid;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoGeneral.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoGeneral.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoGeneral.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,213 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package automateCommon;
+
+import java.util.ArrayList;
+
+import javax.faces.component.UIInput;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.context.FacesContext;
+
+import components.ImmediateComponentBean;
+
+import util.BeanManager;
+import util.parser.Attribute;
+import util.parser.TLDParser;
+import applicationStructure.DrawGrids;
+import applicationStructure.PageContent;
+
+/**
+ * The AutoGeneral bean is used for automated test of the general attributes.
+ */
+public class AutoGeneral {
+
+ /**
+ * The Constant autoGeneralAttrs keeps names of the attributes which can be
+ * tested automatically.
+ */
+ private static final String[] autoGeneralAttrs = { "immediate",
+ "validator", "validatorMessage", "required",
"requiredMessage",
+ "converter", "converterMessage" };
+
+ /** The result auto general grid. */
+ private HtmlPanelGrid resultAutoGeneralGrid = null;
+
+ /** The all automated general attributes for selected component. */
+ private ArrayList<Attribute> allAutoGeneral = new ArrayList<Attribute>();
+
+ /** The current component. */
+ private String component = "";
+
+ /**
+ * The drawGrids object generates the results panel grid using DrawGrids
+ * class methods.
+ */
+ DrawGrids drawGrids = new DrawGrids();
+
+ /**
+ * Draw automated general attributes grid for current component.
+ */
+ public void drawAutoGeneralGrid() {
+ PageContent pageContentBean = (PageContent) BeanManager
+ .getManagedBeanFromSession("pageContent");
+
+ component = pageContentBean.getComponent();
+
+ TLDParser parser = new TLDParser(component);
+ ArrayList<Attribute> allGeneral = parser.getAllAttributes()
+ .getCommonAttributes();
+
+ allAutoGeneral.clear();
+ for (String attr : autoGeneralAttrs) {
+ int index = allGeneral.indexOf(new Attribute(attr));
+ if (index > -1) {
+ allAutoGeneral.add(allGeneral.get(index));
+ }
+ }
+
+ drawGrids.drawAutoGeneralGrid(resultAutoGeneralGrid, allAutoGeneral);
+ }
+
+ /**
+ * Runs the automated tests for current component.
+ */
+ public void testAutoGeneral() {
+ if (!allAutoGeneral.isEmpty()) {
+ for (Attribute attr : allAutoGeneral) {
+ if (attr.getName().equalsIgnoreCase("validator")
+ || attr.getName().equalsIgnoreCase("validatorMessage")
+ || attr.getName().equalsIgnoreCase("required")
+ || attr.getName().equalsIgnoreCase("requiredMessage")
+ || attr.getName().equalsIgnoreCase("immediate")) {
+
+ Validation validationBean = (Validation) BeanManager
+ .getManagedBeanFromSession("validation");
+ ImmediateComponentBean compInt = (ImmediateComponentBean) BeanManager
+ .getManagedBeanFromSession(component);
+
+ if (attr.getName().equalsIgnoreCase("validator"))
+ // run test for "validator" attribute
+ validationBean.validatorCheck(attr, compInt
+ .isImmediate());
+ else if (attr.getName()
+ .equalsIgnoreCase("validatorMessage"))
+ // run test for "validatorMessage" attribute
+ validationBean.validatorMessageCheck(attr);
+ else if (attr.getName().equalsIgnoreCase("required"))
+ // run test for "required" attribute
+ validationBean.requiredCheck(attr);
+ else if (attr.getName().equalsIgnoreCase("requiredMessage"))
+ // run test for "requiredMessage" attribute
+ validationBean.requiredMessageCheck(attr);
+ else if (attr.getName().equalsIgnoreCase("immediate"))
+ // run test for "immediate" attribute
+ validationBean.immediateCheck(attr, compInt
+ .isImmediate());
+ } else if (attr.getName().equalsIgnoreCase("converter")
+ || attr.getName().equalsIgnoreCase("converterMessage")) {
+
+ Convertion convertionBean = (Convertion) BeanManager
+ .getManagedBeanFromSession("convertion");
+ ImmediateComponentBean compInt = (ImmediateComponentBean) BeanManager
+ .getManagedBeanFromSession(component);
+
+ if (attr.getName().equalsIgnoreCase("converter"))
+ // run test for "converter" attribute
+ convertionBean.converterCheck(attr, compInt
+ .isImmediate());
+ else if (attr.getName()
+ .equalsIgnoreCase("converterMessage"))
+ // run test for "converterMessage" attribute
+ convertionBean.converterMessageCheck(attr);
+ }
+ }
+ // redraw the results grid with the last test results
+ drawGrids
+ .drawAutoGeneralGrid(resultAutoGeneralGrid, allAutoGeneral);
+ }
+ }
+
+ /**
+ * Reset the following when different component is selected:
+ * 1. results panel grid
+ * 2. selected component
+ * 3. submitted and local values of the hidden inputs which are used
+ * for messages testing
+ * 4. validation bean
+ * 5. convertion bean
+ */
+ public void reset() {
+ if (null != resultAutoGeneralGrid)
+ resultAutoGeneralGrid.getChildren().clear();
+ allAutoGeneral.clear();
+ component = "";
+ Validation validationBean = (Validation) BeanManager
+ .getManagedBeanFromSession("validation");
+ if (null != validationBean)
+ validationBean.reset();
+
+ Convertion convertionBean = (Convertion) BeanManager
+ .getManagedBeanFromSession("convertion");
+ if (null != convertionBean)
+ convertionBean.reset();
+
+ UIViewRoot vr = FacesContext.getCurrentInstance().getViewRoot();
+ UIInput inp = (UIInput) vr
+ .findComponent("formID:autoGeneralSubviewID:hiddenValidatorInput");
+ if (null != inp) {
+ inp.setSubmittedValue(null);
+ inp.setLocalValueSet(false);
+ }
+ inp = (UIInput) vr
+ .findComponent("formID:autoGeneralSubviewID:hiddenConverterInput");
+ if (null != inp) {
+ inp.setSubmittedValue(null);
+ inp.setLocalValueSet(false);
+ }
+ inp = (UIInput) vr
+ .findComponent("formID:autoGeneralSubviewID:hiddenRequiredInput");
+ if (null != inp) {
+ inp.setSubmittedValue(null);
+ inp.setLocalValueSet(false);
+ }
+ }
+
+ /**
+ * Gets the result automated general attributes grid.
+ *
+ * @return the result auto general grid
+ */
+ public HtmlPanelGrid getResultAutoGeneralGrid() {
+ return resultAutoGeneralGrid;
+ }
+
+ /**
+ * Sets the result automated general attributes grid.
+ *
+ * @param resultAutoGeneralGrid
+ * the new result auto general grid
+ */
+ public void setResultAutoGeneralGrid(HtmlPanelGrid resultAutoGeneralGrid) {
+ this.resultAutoGeneralGrid = resultAutoGeneralGrid;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoStylesClasses.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoStylesClasses.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/AutoStylesClasses.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,95 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package automateCommon;
+
+import java.util.ArrayList;
+
+import javax.faces.component.html.HtmlPanelGrid;
+
+import util.BeanManager;
+import util.parser.Attribute;
+import util.parser.TLDParser;
+import applicationStructure.DrawGrids;
+import applicationStructure.PageContent;
+
+/**
+ * The AutoStylesClasses bean is used for automated test of the styles and
+ * classes.
+ */
+public class AutoStylesClasses {
+
+ /** The result styles classes grid. */
+ private HtmlPanelGrid resultStylesClassesGrid = null;
+
+ /** The all styles and classes for selected component. */
+ private ArrayList<Attribute> allStylesClasses;
+
+ /**
+ * The drawGrids object generates the results panel grid using DrawGrids
+ * class methods.
+ */
+ DrawGrids drawGrids = new DrawGrids();
+
+ /**
+ * Draw styles and classes grid for current component.
+ */
+ public void drawStylesClassesGrid() {
+ PageContent pageContentBean = (PageContent) BeanManager
+ .getManagedBeanFromSession("pageContent");
+
+ String component = pageContentBean.getComponent();
+
+ TLDParser parser = new TLDParser(component);
+ allStylesClasses = parser.getAllAttributes().getStyles();
+
+ drawGrids.drawStylesClassesGrid(resultStylesClassesGrid,
+ allStylesClasses);
+ }
+
+ /**
+ * Reset results panel grid when different component is selected.
+ */
+ public void reset() {
+ if (null != resultStylesClassesGrid)
+ resultStylesClassesGrid.getChildren().clear();
+ allStylesClasses = null;
+ }
+
+ /**
+ * Gets the result styles classes grid.
+ *
+ * @return the result styles classes grid
+ */
+ public HtmlPanelGrid getResultStylesClassesGrid() {
+ return resultStylesClassesGrid;
+ }
+
+ /**
+ * Sets the result styles classes grid.
+ *
+ * @param resultStylesClassesGrid
+ * the new result styles classes grid
+ */
+ public void setResultStylesClassesGrid(HtmlPanelGrid resultStylesClassesGrid) {
+ this.resultStylesClassesGrid = resultStylesClassesGrid;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Convertion.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Convertion.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Convertion.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,268 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package automateCommon;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+import util.data.Car;
+import util.parser.Attribute;
+import util.parser.Status;
+import util.phaseTracker.PhaseTracker;
+
+/**
+ * The Convertion bean provides methods for "converter" and
"converterMessage"
+ * attributes testing.
+ */
+public class Convertion {
+
+ /**
+ * The status converter get as object indicates whether getAsObject is
+ * called or not.
+ */
+ private boolean statusConverterGetAsObject = false;
+
+ /**
+ * The status converter get as string indicates whether getAsString is
+ * called or not.
+ */
+ private boolean statusConverterGetAsString = false;
+
+ /**
+ * The phase converter get as object keeps the JSF phase on which
+ * getAsObject is triggered.
+ */
+ private String phaseConverterGetAsObject = "UNDEFINED";
+
+ /**
+ * The phase converter get as string keeps the JSF phase on which
+ * getAsString is triggered.
+ */
+ private String phaseConverterGetAsString = "UNDEFINED";
+
+ /** The converter message test which is actual displayed on the page. */
+ private String converterMessageTest = "";
+
+ /** The converter message which is defined in "converterMessage" attribute.
*/
+ private String converterMessage;
+
+ /**
+ * Instantiates a new convertion.
+ */
+ public Convertion() {
+ // message should not be changed in order that test execution is
+ // correct
+ this.converterMessage = "test converter error!";
+ }
+
+ /**
+ * Resets test variables.
+ */
+ public void reset() {
+ converterMessageTest = "";
+ statusConverterGetAsObject = false;
+ statusConverterGetAsString = false;
+ }
+
+ /**
+ * Gets the converter.
+ *
+ * @return the converter
+ */
+ public Converter getConvert() {
+ return new Converter() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent, java.lang.String)
+ */
+ public Object getAsObject(FacesContext context,
+ UIComponent component, String newValue)
+ throws ConverterException {
+ // getAsObject is called
+ statusConverterGetAsObject = true;
+ // keep phase
+ phaseConverterGetAsObject = PhaseTracker.currentPhase
+ .toString();
+ if (newValue.equals("converter"))
+ throw new ConverterException(new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, "Converter error",
+ "converter to Object error"));
+
+ return newValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent, java.lang.Object)
+ */
+ public String getAsString(FacesContext context,
+ UIComponent component, Object value)
+ throws ConverterException {
+ // getAsString is called
+ statusConverterGetAsString = true;
+ // keep phase
+ phaseConverterGetAsString = PhaseTracker.currentPhase
+ .toString();
+
+ return (null == value) ? null : value.toString();
+ }
+ };
+ }
+
+ /**
+ * Gets the car converter.
+ *
+ * @return the car converter
+ */
+ public Converter getCarConvert() {
+ return new Converter() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent, java.lang.String)
+ */
+ public Object getAsObject(FacesContext context,
+ UIComponent component, String newValue)
+ throws ConverterException {
+ // getAsObject is called
+ statusConverterGetAsObject = true;
+ // keep phase
+ phaseConverterGetAsObject = PhaseTracker.currentPhase
+ .toString();
+ if (newValue.indexOf("converter") > -1)
+ throw new ConverterException(new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, "Converter error",
+ "converter to Object error"));
+
+ String[] str = newValue.split(":");
+ return new Car(str[0], str[1], Integer.parseInt(str[2]));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent, java.lang.Object)
+ */
+ public String getAsString(FacesContext context,
+ UIComponent component, Object value)
+ throws ConverterException {
+ // getAsString is called
+ statusConverterGetAsString = true;
+ // keep phase
+ phaseConverterGetAsString = PhaseTracker.currentPhase
+ .toString();
+
+ if (value instanceof Car) {
+ Car car = (Car) value;
+ return (null == car) ? null : car.toString();
+ } else
+ throw new ConverterException("is not a class util.data.Car");
+ }
+ };
+ }
+
+ /**
+ * Tests converter attribute.
+ *
+ * @param attr
+ * the tested attribute
+ * @param immediate
+ * the immediate attribute value of the current component
+ */
+ public void converterCheck(Attribute attr, boolean immediate) {
+ // converter should be called...
+ if ((statusConverterGetAsObject) && (statusConverterGetAsString)) {
+ // ... getAsObject on the 3th phase if component is not immediate...
+ if (((phaseConverterGetAsObject.equals("PROCESS_VALIDATIONS(3)"))
+ && (!immediate)
+ // ... getAsObject or on the 2th phase if component is immediate...
+ || (phaseConverterGetAsObject.equals("APPLY_REQUEST_VALUES(2)"))
+ && (immediate))
+ // ... and getAsString on the 6th phase
+ && (phaseConverterGetAsString.equals("RENDER_RESPONSE(6)"))) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ }
+
+ /**
+ * Tests converterMessage attribute.
+ *
+ * @param attr
+ * the tested attribute
+ */
+ public void converterMessageCheck(Attribute attr) {
+ // actual message should be given from page
+ if (converterMessageTest.equals("")) {
+ attr.setStatus(Status.NOT_TESTED);
+ } else {
+ if (converterMessageTest.indexOf(converterMessage) != -1) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ }
+ }
+
+ /**
+ * Gets the converter message test.
+ *
+ * @return the converter message test
+ */
+ public String getConverterMessageTest() {
+ return converterMessageTest;
+ }
+
+ /**
+ * Sets the converter message test.
+ *
+ * @param converterMessageTest
+ * the new converter message test
+ */
+ public void setConverterMessageTest(String converterMessageTest) {
+ this.converterMessageTest = converterMessageTest;
+ }
+
+ /**
+ * Gets the converter message.
+ *
+ * @return the converter message
+ */
+ public String getConverterMessage() {
+ return converterMessage;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/UtilListeners.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/UtilListeners.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/UtilListeners.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,90 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package automateCommon;
+
+import javax.faces.component.UICommand;
+import javax.faces.event.ActionEvent;
+
+import components.ImmediateComponentBean;
+import components.RequiredComponentBean;
+
+import util.BeanManager;
+
+import applicationStructure.PageContent;
+
+/**
+ * The Class UtilListeners is used for changing "required" and
"immediate"
+ * attributes. Listeners are added to the corresponding buttons when results
+ * grids are generated.
+ */
+public class UtilListeners {
+
+ /**
+ * Immediate action change "immediate" attribute of the current component.
+ *
+ * @param actionEvent
+ * the action event
+ */
+ public void immediateAction(ActionEvent actionEvent) {
+ PageContent pageContentBean = (PageContent) BeanManager
+ .getManagedBeanFromSession("pageContent");
+ // get current selected component
+ String component = pageContentBean.getComponent();
+
+ ImmediateComponentBean compInt = (ImmediateComponentBean) BeanManager
+ .getManagedBeanFromSession(component);
+ // change button name
+ UICommand c = (UICommand) actionEvent.getComponent();
+ if (compInt.isImmediate()) {
+ compInt.setImmediate(false);
+ c.setValue("Now NOT Immediate");
+ } else {
+ compInt.setImmediate(true);
+ c.setValue("Now Immediate");
+ }
+ }
+
+ /**
+ * Required action change "immediate" attribute of the current component.
+ *
+ * @param actionEvent
+ * the action event
+ */
+ public void requiredAction(ActionEvent actionEvent) {
+ PageContent pageContentBean = (PageContent) BeanManager
+ .getManagedBeanFromSession("pageContent");
+ // get current selected component
+ String component = pageContentBean.getComponent();
+
+ RequiredComponentBean compInt = (RequiredComponentBean) BeanManager
+ .getManagedBeanFromSession(component);
+ // change button name
+ UICommand c = (UICommand) actionEvent.getComponent();
+ if (compInt.isRequired()) {
+ compInt.setRequired(false);
+ c.setValue("Now NOT Required");
+ } else {
+ compInt.setRequired(true);
+ c.setValue("Now Required");
+ }
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Validation.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Validation.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/automateCommon/Validation.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,279 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package automateCommon;
+
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+
+import util.parser.Attribute;
+import util.parser.Status;
+import util.phaseTracker.PhaseTracker;
+
+/**
+ * The Validation bean provides methods for "validator",
"validatorMessage",
+ * "required", "requiredMessage" and "immediate" attributes
testing.
+ */
+public class Validation {
+
+ /** The validator message which is defined in "validatorMessage" attribute.
*/
+ private String validatorMessage;
+
+ /** The validator message test which is actual displayed on the page. */
+ private String validatorMessageTest = "";
+
+ /** The required message which is defined in "requiredMessage" attribute. */
+ private String requiredMessage;
+
+ /** The required message test which is actual displayed on the page. */
+ private String requiredMessageTest = "";
+
+ /** /** The status validator indicates whether validator is called or not. */
+ private boolean statusValidator = false;
+
+ /** The phase validator keeps the JSF phase on which validator is triggered. */
+ private String phaseValidator = "UNDEFINED";
+
+ /**
+ * Instantiates a new validation.
+ */
+ public Validation() {
+ // messages should not be changed in order that test execution is
+ // correct
+ this.validatorMessage = "validator test message!";
+ this.requiredMessage = "required test message!";
+ }
+
+ /**
+ * Resets test variables.
+ */
+ public void reset() {
+ validatorMessageTest = "";
+ requiredMessageTest = "";
+ statusValidator = false;
+ phaseValidator = "UNDEFINED";
+ }
+
+ /**
+ * Validates input value.
+ *
+ * @param context
+ * the context
+ * @param component
+ * the component
+ * @param value
+ * the value
+ *
+ * @throws ValidatorException
+ * the validator exception
+ */
+ @SuppressWarnings("unchecked")
+ public void validate(FacesContext context, UIComponent component,
+ Object value) throws ValidatorException {
+ // validator is called
+ statusValidator = true;
+ // keep phase
+ phaseValidator = PhaseTracker.currentPhase.toString();
+ if (value != null) {
+ if (value instanceof List) {
+ List<Object> arr_value = (List<Object>) value;
+ for (Object val : arr_value) {
+ // should not be changed in order that test execution is
+ // correct
+ if (val.toString().equals("validator")) {
+ throw new ValidatorException(new FacesMessage(
+ FacesMessage.SEVERITY_ERROR,
+ "Validation error", "Incorrect input"));
+ }
+ }
+ } else {
+ String st = value.toString();
+ // should not be changed in order that test execution
+ // is correct
+ if (st.equals("validator")) {
+ throw new ValidatorException(new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, "Validation error",
+ "Incorrect input"));
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests validator attribute.
+ *
+ * @param attr
+ * the tested attribute
+ * @param immediate
+ * the immediate attribute value of the current component
+ */
+ public void validatorCheck(Attribute attr, boolean immediate) {
+ // validator should be called...
+ if (statusValidator) {
+ // ... on the 3th phase if component is not immediate...
+ if ((phaseValidator.equals("PROCESS_VALIDATIONS(3)"))
+ && (!immediate)
+ // ... or on the 2th phase if component is immediate
+ || (phaseValidator.equals("APPLY_REQUEST_VALUES(2)"))
+ && (immediate)) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ }
+
+ /**
+ * Tests validatorMessage attribute.
+ *
+ * @param attr
+ * the tested attribute
+ */
+ public void validatorMessageCheck(Attribute attr) {
+ // actual message should be given from page
+ if (validatorMessageTest.equals("")) {
+ attr.setStatus(Status.NOT_TESTED);
+ } else {
+ if (validatorMessageTest.indexOf(validatorMessage) != -1) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ }
+ }
+
+ /**
+ * Tests immediate attribute.
+ *
+ * @param attr
+ * the tested attribute
+ * @param immediate
+ * the immediate attribute value of the current component
+ */
+ public void immediateCheck(Attribute attr, boolean immediate) {
+ // component should be immediate...
+ if ((statusValidator) && (immediate)) {
+ // ...and validator should be called on the 2th phase
+ if (phaseValidator.equals("APPLY_REQUEST_VALUES(2)")) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ } else
+ attr.setStatus(Status.NOT_TESTED);
+ }
+
+ /**
+ * Tests required attribute.
+ *
+ * @param attr
+ * the tested attribute
+ */
+ public void requiredCheck(Attribute attr) {
+ // actual message should be given from page
+ if (requiredMessageTest.equals("")) {
+ attr.setStatus(Status.NOT_TESTED);
+ } else {
+ attr.setStatus(Status.PASSED);
+ }
+ }
+
+ /**
+ * Tests requiredMessage attribute.
+ *
+ * @param attr
+ * the tested attribute
+ */
+ public void requiredMessageCheck(Attribute attr) {
+ // actual message should be given from page
+ if (requiredMessageTest.equals("")) {
+ attr.setStatus(Status.NOT_TESTED);
+ } else {
+ if (requiredMessageTest.indexOf(requiredMessage) != -1) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ }
+ }
+ }
+
+ /**
+ * Gets the validator message.
+ *
+ * @return the validator message
+ */
+ public String getValidatorMessage() {
+ return validatorMessage;
+ }
+
+ /**
+ * Gets the required message.
+ *
+ * @return the required message
+ */
+ public String getRequiredMessage() {
+ return requiredMessage;
+ }
+
+ /**
+ * Gets the validator message test.
+ *
+ * @return the validator message test
+ */
+ public String getValidatorMessageTest() {
+ return validatorMessageTest;
+ }
+
+ /**
+ * Sets the validator message test.
+ *
+ * @param validatorMessageTest
+ * the new validator message test
+ */
+ public void setValidatorMessageTest(String validatorMessageTest) {
+ this.validatorMessageTest = validatorMessageTest;
+ }
+
+ /**
+ * Gets the required message test.
+ *
+ * @return the required message test
+ */
+ public String getRequiredMessageTest() {
+ return requiredMessageTest;
+ }
+
+ /**
+ * Sets the required message test.
+ *
+ * @param requiredMessageTest
+ * the new required message test
+ */
+ public void setRequiredMessageTest(String requiredMessageTest) {
+ this.requiredMessageTest = requiredMessageTest;
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/ImmediateComponentBean.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/ImmediateComponentBean.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/ImmediateComponentBean.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,43 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components;
+
+/**
+ * The Interface ImmediateComponentBean.
+ */
+public interface ImmediateComponentBean {
+
+ /**
+ * Checks if is immediate.
+ *
+ * @return true, if is immediate
+ */
+ public boolean isImmediate();
+
+ /**
+ * Sets the immediate.
+ *
+ * @param immediate
+ * the new immediate
+ */
+ public void setImmediate(boolean immediate);
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/RequiredComponentBean.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/RequiredComponentBean.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/RequiredComponentBean.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,43 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components;
+
+/**
+ * The Interface RequiredComponentBean.
+ */
+public interface RequiredComponentBean {
+
+ /**
+ * Checks if is required.
+ *
+ * @return true, if is required
+ */
+ public boolean isRequired();
+
+ /**
+ * Sets the required.
+ *
+ * @param immediate
+ * the new required
+ */
+ public void setRequired(boolean immediate);
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/comboBox/ComboBox.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/comboBox/ComboBox.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/comboBox/ComboBox.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,127 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components.comboBox;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import components.ImmediateComponentBean;
+import components.RequiredComponentBean;
+
+import util.data.Car;
+import util.data.CarProvider;
+
+/**
+ * The ComboBox bean.
+ */
+public class ComboBox implements ImmediateComponentBean, RequiredComponentBean {
+
+ /** The items. */
+ private List<SelectItem> items;
+
+ /** The value. */
+ private String value;
+
+ /** The immediate. */
+ private boolean immediate = false;
+
+ /** The required. */
+ private boolean required = false;
+
+ /**
+ * Instantiates a new combo box.
+ */
+ public ComboBox() {
+ CarProvider cp = new CarProvider();
+ List<Car> listCars = cp.getAllCars();
+ items = new ArrayList<SelectItem>();
+ for (Car car : listCars) {
+ items.add(new SelectItem(car.toString()));
+ }
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the items.
+ *
+ * @return the items
+ */
+ public List<SelectItem> getItems() {
+ return items;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.ImmediateComponentBean#setImmediate(boolean)
+ */
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.ImmediateComponentBean#isImmediate()
+ */
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.RequiredComponentBean#isRequired()
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.RequiredComponentBean#setRequired(boolean)
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/dropDownMenu/DropDownMenu.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/dropDownMenu/DropDownMenu.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/dropDownMenu/DropDownMenu.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components.dropDownMenu;
+
+/**
+ * The DropDownMenu bean.
+ */
+public class DropDownMenu {
+
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/extendedDataTable/ExtendedDataTable.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/extendedDataTable/ExtendedDataTable.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/extendedDataTable/ExtendedDataTable.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,63 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components.extendedDataTable;
+
+import java.util.ArrayList;
+
+import util.data.Car;
+import util.data.CarProvider;
+
+/**
+ * The ExtendedDataTable bean.
+ */
+public class ExtendedDataTable {
+
+ /** The value. */
+ private ArrayList<Car> value = null;
+
+ /**
+ * Instantiates a new extended data table.
+ */
+ public ExtendedDataTable() {
+ CarProvider cpr = new CarProvider();
+ value = cpr.getAllCars();
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public ArrayList<Car> getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(ArrayList<Car> value) {
+ this.value = value;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/pickList/PickList.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/pickList/PickList.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/pickList/PickList.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,134 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components.pickList;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import components.ImmediateComponentBean;
+import components.RequiredComponentBean;
+
+/**
+ * The PickList bean.
+ */
+public class PickList implements ImmediateComponentBean, RequiredComponentBean {
+
+ /** The value. */
+ private List<String> value;
+
+ /** The select items. */
+ private ArrayList<SelectItem> selectItems;
+
+ /** The immediate. */
+ private boolean immediate = false;
+
+ /** The required. */
+ private boolean required = false;
+
+ /**
+ * Instantiates a new pick list.
+ */
+ public PickList() {
+ if (selectItems == null) {
+ selectItems = new ArrayList<SelectItem>();
+ for (int i = 0; i < 10; i++) {
+ selectItems.add(new SelectItem("Car-" + i, "lcar-" + i));
+ }
+ }
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public List<String> getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(List<String> value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the select items.
+ *
+ * @return the select items
+ */
+ public ArrayList<SelectItem> getSelectItems() {
+ return selectItems;
+ }
+
+ /**
+ * Sets the select items.
+ *
+ * @param selectItems
+ * the new select items
+ */
+ public void setSelectItems(ArrayList<SelectItem> selectItems) {
+ this.selectItems = selectItems;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.ImmediateComponentBean#setImmediate(boolean)
+ */
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.ImmediateComponentBean#isImmediate()
+ */
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.RequiredComponentBean#isRequired()
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.RequiredComponentBean#setRequired(boolean)
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/suggestionBox/SuggestionBox.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/suggestionBox/SuggestionBox.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/components/suggestionBox/SuggestionBox.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,127 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package components.suggestionBox;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import util.data.Car;
+import util.data.CarProvider;
+import components.ImmediateComponentBean;
+
+/**
+ * The SuggestionBox bean.
+ */
+public class SuggestionBox implements ImmediateComponentBean {
+
+ /** The data. */
+ private ArrayList<Car> data = null;
+
+ /** The value. */
+ private String value = "";
+
+ /** The immediate. */
+ private boolean immediate = false;
+
+ /**
+ * Instantiates a new suggestion box.
+ */
+ public SuggestionBox() {
+ CarProvider cPr = new CarProvider();
+ data = cPr.getAllCars();
+ data.add(new Car("validator", "", 0));
+ }
+
+ /**
+ * Suggestion action.
+ *
+ * @param obj
+ * the text which is typed by user
+ *
+ * @return the array list< car>
+ */
+ public ArrayList<Car> suggestionAction(Object obj) {
+ String str = (String) obj;
+ ArrayList<Car> result;
+ result = new ArrayList<Car>();
+ Car car;
+ for (Iterator<Car> itCar = this.data.iterator(); itCar.hasNext();) {
+ car = itCar.next();
+ if (null != car) {
+ // if car name or car model contains typed text then add car to
+ // the result list
+ if (car.getMake().toUpperCase().contains(str.toUpperCase())
+ || car.getModel().toUpperCase().contains(
+ str.toUpperCase())) {
+ result.add(car);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the data.
+ *
+ * @return the data
+ */
+ public ArrayList<Car> getData() {
+ return data;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.ImmediateComponentBean#setImmediate(boolean)
+ */
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see components.ImmediateComponentBean#isImmediate()
+ */
+ public boolean isImmediate() {
+ return immediate;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/BeanManager.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/BeanManager.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/BeanManager.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,67 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+/**
+ * The Class BeanManager provides jsf managed bean from http session.
+ */
+public class BeanManager {
+
+ /**
+ * Retrieves jsf managed bean from http session.
+ *
+ * @param managedBeanName
+ * name of bean.
+ *
+ * @return managed bean if founded.
+ */
+ public static Object getManagedBeanFromSession(String managedBeanName) {
+ ValueExpression preDestroyVe = getExpressionFactory()
+ .createValueExpression(getElContext(),
+ "#{" + managedBeanName + "}", Object.class);
+ return preDestroyVe.getValue(getElContext());
+ }
+
+ /**
+ * Returns ElContext object.
+ *
+ * @return el context.
+ */
+ protected static ELContext getElContext() {
+ return FacesContext.getCurrentInstance().getELContext();
+ }
+
+ /**
+ * Returns ExpressionFactory object.
+ *
+ * @return ExpressionFactory.
+ */
+ protected static ExpressionFactory getExpressionFactory() {
+ return FacesContext.getCurrentInstance().getApplication()
+ .getExpressionFactory();
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/Car.java
===================================================================
--- branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/Car.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/Car.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,164 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.data;
+
+/**
+ * The Class Car is used as class for test data.
+ */
+public class Car {
+
+ /** The make. */
+ private String make;
+
+ /** The model. */
+ private String model;
+
+ /** The price. */
+ private Integer price;
+
+ /**
+ * Instantiates a new car.
+ */
+ public Car() {
+ this.make = "";
+ this.model = "";
+ this.price = 0;
+ }
+
+ /**
+ * Instantiates a new car.
+ *
+ * @param mak
+ * the make
+ * @param mod
+ * the model
+ * @param pr
+ * the price
+ */
+ public Car(String mak, String mod, Integer pr) {
+ this.make = mak;
+ this.model = mod;
+ this.price = pr;
+ }
+
+ /**
+ * Gets the make.
+ *
+ * @return the make
+ */
+ public String getMake() {
+ return make;
+ }
+
+ /**
+ * Sets the make.
+ *
+ * @param make
+ * the new make
+ */
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ /**
+ * Gets the model.
+ *
+ * @return the model
+ */
+ public String getModel() {
+ return model;
+ }
+
+ /**
+ * Sets the model.
+ *
+ * @param model
+ * the new model
+ */
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ /**
+ * Gets the price.
+ *
+ * @return the price
+ */
+ public Integer getPrice() {
+ return price;
+ }
+
+ /**
+ * Sets the price.
+ *
+ * @param price
+ * the new price
+ */
+ public void setPrice(Integer price) {
+ this.price = price;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((make == null) ? 0 : make.hashCode());
+ result = prime * result + ((model == null) ? 0 : model.hashCode());
+ result = prime * result + ((price == null) ? 0 : price.hashCode());
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Car) {
+ Car car = (Car) obj;
+ if (this.make.equals(car.make) && (this.model.equals(car.model))
+ && (this.price.equals(car.price))) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return this.make + ":" + this.model + ":" + this.price;
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/CarProvider.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/CarProvider.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/data/CarProvider.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,176 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.data;
+
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * The Class CarProvider parses cars.xml resource file to provide list of Car
+ * objects which is used for test purposes.
+ */
+public class CarProvider extends DefaultHandler {
+
+ /** The all cars. */
+ private ArrayList<Car> allCars = null;
+
+ /**
+ * Instantiates a new car provider.
+ */
+ public CarProvider() {
+ if (allCars == null) {
+ allCars = new ArrayList<Car>();
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser sp = spf.newSAXParser();
+ sp.parse(new InputSource(getClass().getResourceAsStream(
+ "cars.xml")), this);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Gets the all cars.
+ *
+ * @return the all cars
+ */
+ public ArrayList<Car> getAllCars() {
+ return allCars;
+ }
+
+ /** The element. */
+ private String element = "";
+
+ /** The make. */
+ private String mak = "";
+
+ /** The model. */
+ private String mod = "";
+
+ /** The price. */
+ private Integer pr = 0;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#startDocument()
+ */
+ public void startDocument() {
+ System.out.println("*** > Parser starts its work");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String,
+ * java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ public void startElement(String namespaceURI, String localName,
+ String rawName, Attributes attrs) {
+ element = rawName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
+ */
+ public void characters(char ch[], int start, int length) {
+ String text = new String(ch, start, length);
+
+ if (element.equals("make")) {
+ element = "";
+ mak = text;
+ } else if (element.equals("model")) {
+ element = "";
+ mod = text;
+ } else if (element.equals("price")) {
+ try {
+ element = "";
+ Integer p = Integer.parseInt(text);
+ pr = p;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
+ * java.lang.String, java.lang.String)
+ */
+ public void endElement(String namespaceURI, String localName, String rawName) {
+
+ if (rawName.equals("car")) {
+ allCars.add(new Car(mak, mod, pr));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#endDocument()
+ */
+ public void endDocument() {
+ System.out.println("*** > Parser ends its work");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException)
+ */
+ public void warning(SAXParseException ex) {
+ System.err.println("[Warning] : " + ex.getMessage());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#error(org.xml.sax.SAXParseException)
+ */
+ public void error(SAXParseException ex) {
+ System.err.println("[Error] : " + ex.getMessage());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.helpers.DefaultHandler#fatalError(org.xml.sax.SAXParseException)
+ */
+ public void fatalError(SAXParseException ex) throws SAXException {
+ System.err.println("[Fatal Error] : " + ex.getMessage());
+ throw ex;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Attribute.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Attribute.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Attribute.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,181 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.parser;
+
+/**
+ * The Class Attribute represents component's attribute.
+ */
+public class Attribute {
+
+ /** The name. */
+ private String name;
+
+ /** The type. */
+ private String type;
+
+ /** The description. */
+ private String description;
+
+ /** The status (NOT_TESTED, FAILED, PASSED). */
+ private Status status;
+
+ /**
+ * Instantiates a new attribute.
+ */
+ public Attribute() {
+ this.name = "";
+ this.type = "";
+ this.description = "";
+ this.status = Status.NOT_TESTED;
+ }
+
+ /**
+ * Instantiates a new attribute.
+ *
+ * @param name
+ * the name
+ */
+ public Attribute(String name) {
+ this.type = "";
+ this.name = name;
+ this.description = "";
+ this.status = Status.NOT_TESTED;
+ }
+
+ /**
+ * Instantiates a new attribute.
+ *
+ * @param name
+ * the name
+ * @param type
+ * the type
+ * @param desc
+ * the description
+ * @param status
+ * the status
+ */
+ public Attribute(String name, String type, String desc, Status status) {
+ this.name = name;
+ this.type = type;
+ this.description = desc;
+ this.status = status;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name
+ * the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type
+ * the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description
+ * the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the status.
+ *
+ * @return the status
+ */
+ public Status getStatus() {
+ return status;
+ }
+
+ /**
+ * Sets the status.
+ *
+ * @param status
+ * the new status
+ */
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "[" + "Name: " + name + "\r\n" +
"Description: " + description
+ + "\r\n" + "Type: " + type + "\r\n" + "Status:
" + status + "]";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ Attribute attr = (Attribute) obj;
+
+ return (attr.getName().equals(this.name));
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/AttributesList.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/AttributesList.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/AttributesList.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,142 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.parser;
+
+import java.util.ArrayList;
+
+/**
+ * The Class AttributesList is used for keeping all attributes of some component
+ * and providing access to events' handlers, styles, classes and common
+ * attributes.
+ */
+public class AttributesList extends ArrayList<Attribute> {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 3245089852351607636L;
+
+ /**
+ * Instantiates a new attributes list.
+ */
+ public AttributesList() {
+ super();
+ }
+
+ /**
+ * Gets the names array.
+ *
+ * @return the names array
+ */
+ public ArrayList<String> getNamesArray() {
+ ArrayList<String> result = new ArrayList<String>();
+ for (Attribute attr : this) {
+ result.add(attr.getName());
+ }
+ return result;
+ }
+
+ /**
+ * Gets the descriptions array.
+ *
+ * @return the descriptions array
+ */
+ public ArrayList<String> getDescriptionArray() {
+ ArrayList<String> result = new ArrayList<String>();
+ for (Attribute attr : this) {
+ result.add(attr.getDescription());
+ }
+ return result;
+ }
+
+ /**
+ * Gets the types array.
+ *
+ * @return the types array
+ */
+ public ArrayList<String> getTypeArray() {
+ ArrayList<String> result = new ArrayList<String>();
+ for (Attribute attr : this) {
+ result.add(attr.getType());
+ }
+ return result;
+ }
+
+ /**
+ * Gets the statuses array.
+ *
+ * @return the statuses array
+ */
+ public ArrayList<Status> getStatusArray() {
+ ArrayList<Status> result = new ArrayList<Status>();
+ for (Attribute attr : this) {
+ result.add(attr.getStatus());
+ }
+ return result;
+ }
+
+ /**
+ * Gets the handlers.
+ *
+ * @return the handlers
+ */
+ public ArrayList<Attribute> getHandlers() {
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for (Attribute attr : this) {
+ if (attr.getName().startsWith("on")) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the styles.
+ *
+ * @return the styles
+ */
+ public ArrayList<Attribute> getStyles() {
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for (Attribute attr : this) {
+ if (attr.getName().indexOf("tyle") != -1
+ || attr.getName().indexOf("lass") != -1) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the common attributes.
+ *
+ * @return the common attributes
+ */
+ public ArrayList<Attribute> getCommonAttributes() {
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for (Attribute attr : this) {
+ if (!(attr.getName().startsWith("on")
+ || (attr.getName().indexOf("tyle") != -1) || (attr
+ .getName().indexOf("lass") != -1))) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Status.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Status.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/Status.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.parser;
+
+/**
+ * The Enum Status contains all test statuses of the attribute.
+ */
+public enum Status {
+ NOT_TESTED, FAILED, PASSED
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/TLDParser.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/TLDParser.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/parser/TLDParser.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,242 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.parser;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * The Class TLDParser parses richfaces.tld file to provide AttributeList object
+ * for selected component.
+ */
+public class TLDParser {
+
+ /** The component's name. */
+ protected String component;
+
+ /** The tld object represents a richfaces.tld file. */
+ protected JarEntry tld;
+
+ /** The richfacesUI object represents a richfaces-ui.jar file. */
+ protected JarFile richfacesUI;
+
+ /** The all attributes. */
+ protected AttributesList allAttributes;
+
+ /**
+ * Instantiates a new tLD parser.
+ *
+ * @param str
+ * the component's name
+ */
+ public TLDParser(String str) {
+ this.component = str;
+ allAttributes = new AttributesList();
+ }
+
+ /**
+ * Gets the all attributes from richfaces.tld file for selected component.
+ *
+ * @return the all attributes
+ */
+ public AttributesList getAllAttributes() {
+ allAttributes.clear();
+ tld = getRichfacesUI().getJarEntry("META-INF/richfaces.tld");
+ InputStream input = null;
+ try {
+ input = richfacesUI.getInputStream(tld);
+
+ InputStreamReader isr = new InputStreamReader(input);
+ BufferedReader reader = new BufferedReader(isr);
+ String line, attr;
+ Attribute attribute = new Attribute();
+ int position, end;
+ boolean insideTag = true;
+ StringBuilder sb = new StringBuilder("");
+ while (((line = reader.readLine()) != null) && insideTag) {
+ if ((position = line.indexOf("<name>")) != -1) {
+ end = line.indexOf("</name>");
+ attr = line.substring(position + 6, end).trim();
+ if (attr.equalsIgnoreCase(component)) {
+ while (!(line = reader.readLine()).contains("</tag>")) {
+ if (line.contains("<attribute>")) {
+ do {
+ // find attribute name
+ if ((position = line.indexOf("<name>")) != -1) {
+ end = line.indexOf("</name>");
+ attribute.setName(line.substring(
+ position + 6, end).trim());
+ }
+ // find attribute description
+ if ((position = line
+ .indexOf("<description>")) != -1) {
+
+ if ((end = line
+ .indexOf("</description>")) != -1) {
+ attribute
+ .setDescription(line
+ .substring(
+ position + 13,
+ line
+ .length() - 14));
+ } else {
+ sb.append(line.substring(
+ position + 13,
+ line.length()).trim()
+ .replaceAll("\t", ""));
+ line = reader.readLine();
+ while ((end = line
+ .indexOf("</description>")) == -1) {
+ sb.append(line.substring(0,
+ line.length())
+ .replaceAll("\t", ""));
+ line = reader.readLine();
+ }
+ sb.append(line.substring(0,
+ line.length() - 14).trim()
+ .replaceAll("\t", ""));
+
+ attribute.setDescription(sb
+ .toString());
+ sb.delete(0, sb.length());
+ }
+ }
+ // find attribute type
+ if ((position = line.indexOf("<type>")) != -1) {
+ end = line.indexOf("</type>");
+ attribute.setType(line.substring(
+ position + 6, end).trim());
+ }
+ // find attribute method-signature
+ if ((position = line
+ .indexOf("<method-signature>")) != -1) {
+ end = line
+ .indexOf("</method-signature>");
+ attribute.setType(line.substring(
+ position + 18, end).trim());
+ }
+ } while (!((line = reader.readLine())
+ .contains("</attribute>")));
+ // define initial attribute status
+ attribute.setStatus(Status.NOT_TESTED);
+ allAttributes.add(attribute);
+ attribute = new Attribute();
+ }
+ }
+ insideTag = false;
+ }
+ }
+ }
+ reader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return allAttributes;
+ }
+
+ /**
+ * Gets the richfaces.tld resource.
+ *
+ * @return the richfaces.tld resource
+ */
+ public String getExtPath() {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ String resource = "META-INF/richfaces.tld";
+ return loader.getResource(resource).toString();
+ }
+
+ /**
+ * Gets the component's name.
+ *
+ * @return the component's name
+ */
+ public String getComponent() {
+ return component;
+ }
+
+ /**
+ * Sets the component's name.
+ *
+ * @param component
+ * the new component's name
+ */
+ public void setComponent(String component) {
+ this.component = component;
+ }
+
+ /**
+ * Gets the richfacesUI object representing a richfaces-ui.jar file.
+ *
+ * @return the richfaces ui
+ */
+ public JarFile getRichfacesUI() {
+ String temp = null;
+ int position;
+ try {
+ if ((position = getExtPath().indexOf('!')) != -1) {
+ temp = getExtPath().substring("jar:file:\\".length(), position);
+ }
+ richfacesUI = new JarFile(temp);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return richfacesUI;
+ }
+
+ /**
+ * Gets the all possible handlers from richfaces.tld file.
+ *
+ * @return the all possible handlers
+ */
+ public ArrayList<String> getAllHandlers() {
+ tld = getRichfacesUI().getJarEntry("META-INF/richfaces.tld");
+ InputStream input = null;
+ ArrayList<String> handlers = new ArrayList<String>();
+
+ try {
+ input = richfacesUI.getInputStream(tld);
+ InputStreamReader isr = new InputStreamReader(input);
+ BufferedReader reader = new BufferedReader(isr);
+ String line, temp;
+ int start, end;
+ while ((line = reader.readLine()) != null) {
+ if ((start = line.indexOf("<name>")) != -1) {
+ end = line.indexOf("</name>");
+ temp = line.substring(start + 6, end).trim();
+ if (temp.startsWith("on") && !handlers.contains(temp)) {
+ handlers.add(temp);
+ }
+ }
+ }
+ return handlers;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/phaseTracker/PhaseTracker.java
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/phaseTracker/PhaseTracker.java
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/java/util/phaseTracker/PhaseTracker.java 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package util.phaseTracker;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+/**
+ * The Class PhaseTracker prints out the phases application passes.
+ */
+public class PhaseTracker implements PhaseListener {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 6533052212003582848L;
+
+ /** The Current JSF phase of the application. */
+ public static PhaseId currentPhase = PhaseId.ANY_PHASE;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
+ */
+ public void afterPhase(PhaseEvent arg0) {
+ System.out.println("PhaseTracker.afterPhase()" + arg0.getPhaseId());
+ if (arg0.getPhaseId().toString().equals("RENDER_RESPONSE(6)"))
+ System.out.println("********** end lifecycle *************");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
+ */
+ public void beforePhase(PhaseEvent arg0) {
+ if (arg0.getPhaseId().toString().equals("RESTORE_VIEW(1)"))
+ System.out.println("********** begin lifecycle *************");
+ currentPhase = arg0.getPhaseId();
+ System.out.println("PhaseTracker.beforePhase()" + arg0.getPhaseId());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.PhaseListener#getPhaseId()
+ */
+ public PhaseId getPhaseId() {
+ return PhaseId.ANY_PHASE;
+ }
+}
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/messages.properties
===================================================================
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/util/data/cars.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/util/data/cars.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/resources/util/data/cars.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shop>
+ <car>
+ <make>Audi</make>
+ <model>A6</model>
+ <price>40000</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q7</model>
+ <price>48500</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q5</model>
+ <price>36500</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q8</model>
+ <price>102500</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>760Li</model>
+ <price>115400</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>330i</model>
+ <price>38400</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>X6</model>
+ <price>55900</price>
+ </car>
+ <car>
+ <make>Bentley</make>
+ <model>Arnage</model>
+ <price>240000</price>
+ </car>
+ <car>
+ <make>Bugatti</make>
+ <model>Veyron</model>
+ <price>1340000</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>S63 AMG</model>
+ <price>154200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>SLR</model>
+ <price>854200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>E63AMG</model>
+ <price>120200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>R350</model>
+ <price>61200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>E300D</model>
+ <price>9800</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>3</model>
+ <price>17300</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>6</model>
+ <price>21300</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>CX7</model>
+ <price>24300</price>
+ </car>
+ <car>
+ <make>Fiat</make>
+ <model>Punto</model>
+ <price>8200</price>
+ </car>
+ <car>
+ <make>Fiat</make>
+ <model>Multipla</model>
+ <price>9100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>GT-40</model>
+ <price>325100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Mondeo</model>
+ <price>23100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Fiesta</model>
+ <price>5100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Scorpio</model>
+ <price>4800</price>
+ </car>
+ <car>
+ <make>Ferrari</make>
+ <model>Enzo</model>
+ <price>950000</price>
+ </car>
+ <car>
+ <make>Jaguar</make>
+ <model>XJ</model>
+ <price>75400</price>
+ </car>
+</shop>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/META-INF/MANIFEST.MF 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: rich-jsp.jar
+
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/auto/auto-config.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/auto/auto-config.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/auto/auto-config.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>utilListeners</managed-bean-name>
+ <managed-bean-class>
+ automateCommon.UtilListeners
+ </managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>convertion</managed-bean-name>
+ <managed-bean-class>
+ automateCommon.Convertion
+ </managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>validation</managed-bean-name>
+ <managed-bean-class>
+ automateCommon.Validation
+ </managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>autoEventHandlers</managed-bean-name>
+ <managed-bean-class>
+ automateCommon.AutoEventHandlers
+ </managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>autoStylesClasses</managed-bean-name>
+ <managed-bean-class>
+ automateCommon.AutoStylesClasses
+ </managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>autoGeneral</managed-bean-name>
+ <managed-bean-class>
+ automateCommon.AutoGeneral
+ </managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/comboBox.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/comboBox.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/comboBox.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>comboBox</managed-bean-name>
+ <managed-bean-class>components.comboBox.ComboBox</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/dropDownMenu.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/dropDownMenu.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/dropDownMenu.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>dropDownMenu</managed-bean-name>
+ <managed-bean-class>components.dropDownMenu.DropDownMenu</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/extendedDataTable.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/extendedDataTable.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/extendedDataTable.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>extendedDataTable</managed-bean-name>
+ <managed-bean-class>components.extendedDataTable.ExtendedDataTable</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/pickList.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/pickList.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/pickList.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>pickList</managed-bean-name>
+ <managed-bean-class>components.pickList.PickList</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/suggestionBox.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/suggestionBox.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/config/suggestionBox.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>suggestionBox</managed-bean-name>
+ <managed-bean-class>components.suggestionBox.SuggestionBox</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/faces-config.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <managed-bean>
+ <managed-bean-name>pageContent</managed-bean-name>
+ <managed-bean-class>applicationStructure.PageContent</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <lifecycle>
+ <phase-listener>util.phaseTracker.PhaseTracker</phase-listener>
+ </lifecycle>
+
+</faces-config>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/WEB-INF/web.xml 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,269 @@
+<?xml version="1.0"?>
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>RichFaces JSP Project web.xml</description>
+
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>#{pageContent.skin}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
+ <param-value>enable</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING</param-name>
+ <param-value>enable</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_LEVEL</param-name>
+ <param-value>extended</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.LoadScriptStrategy</param-name>
+ <param-value>ALL</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>
+ /WEB-INF/auto/auto-config.xml,/WEB-INF/config/pickList.xml,/WEB-INF/config/dropDownMenu.xml,/WEB-INF/config/suggestionBox.xml,/WEB-INF/config/comboBox.xml,/WEB-INF/config/extendedDataTable.xml
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ Only applicable if state saving method is "server" (=
+ default). Defines the amount (default = 20) of the latest
+ views are stored in session.
+ </description>
+ <param-name>
+ org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
+ </param-name>
+ <param-value>20</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ Only applicable if state saving method is "server" (=
+ default). If true (default) the state will be serialized to
+ a byte stream before it is written to the session. If false
+ the state will not be serialized to a byte stream.
+ </description>
+ <param-name>
+ org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
+ </param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ Only applicable if state saving method is "server" (=
+ default) and if
+ org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (=
+ default) If true (default) the serialized state will be
+ compressed before it is written to the session. If false the
+ state will not be compressed.
+ </description>
+ <param-name>
+ org.apache.myfaces.COMPRESS_STATE_IN_SESSION
+ </param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ This parameter tells MyFaces if javascript code should be
+ allowed in the rendered HTML output. If javascript is
+ allowed, command_link anchors will have javascript code that
+ submits the corresponding form. If javascript is not
+ allowed, the state saving info and nested parameters will be
+ added as url parameters. Default: "true"
+ </description>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ If true, rendered HTML code will be formatted, so that it is
+ "human readable". i.e. additional line separators and
+ whitespace will be written, that do not influence the HTML
+ code. Default: "true"
+ </description>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ If true, a javascript function will be rendered that is able
+ to restore the former vertical scroll on every request.
+ Convenient feature if you have pages with long lists and you
+ do not want the browser page to always jump to the top if
+ you trigger a link or button action that stays on the same
+ page. Default: "false"
+ </description>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Used for encrypting view state. Only relevant for client
+ side state saving. See MyFaces wiki/web site documentation
+ for instructions on how to configure an application for
+ diffenent encryption strengths.
+ </description>
+ <param-name>org.apache.myfaces.SECRET</param-name>
+ <param-value>NzY1NDMyMTA=</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Validate managed beans, navigation rules and ensure that
+ forms are not nested.
+ </description>
+ <param-name>org.apache.myfaces.VALIDATE</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Treat readonly same as if disabled attribute was set for
+ select elements.
+ </description>
+ <param-name>
+ org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS
+ </param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Use the defined class as the class which will be called when
+ a resource is added to the ExtensionFilter handling. Using
+ StreamingAddResource here helps with performance. If you
+ want to add custom components and want to use the
+ ExtensionFilter, you need to provide your custom
+ implementation here.
+ </description>
+ <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+ <param-value>
+ org.apache.myfaces.renderkit.html.util.DefaultAddResource
+ </param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Virtual path in the URL which triggers loading of resources
+ for the MyFaces extended components in the ExtensionFilter.
+ </description>
+ <param-name>
+ org.apache.myfaces.RESOURCE_VIRTUAL_PATH
+ </param-name>
+ <param-value>/faces/myFacesExtensionResource</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Check if the extensions-filter has been properly configured.
+ </description>
+ <param-name>
+ org.apache.myfaces.CHECK_EXTENSIONS_FILTER
+ </param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Define partial state saving as true/false.
+ </description>
+ <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <!-- RichFaces Filter -->
+ <filter>
+ <display-name>RichFaces Filter</display-name>
+ <filter-name>richfaces</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+
+ <!-- Extensions Filter -->
+ <filter>
+ <filter-name>MyFacesExtensionsFilter</filter-name>
+ <filter-class>
+ org.apache.myfaces.webapp.filter.ExtensionsFilter
+ </filter-class>
+ <init-param>
+ <param-name>uploadMaxFileSize</param-name>
+ <param-value>20m</param-value>
+ <description>
+ Set the size limit for uploaded files. Format: 10 - 10
+ bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
+ </description>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>richfaces</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+
+ <!-- extension mapping for adding <script/>, <link/>, and other resource
tags to JSF-pages -->
+ <filter-mapping>
+ <filter-name>MyFacesExtensionsFilter</filter-name>
+ <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry
-->
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+
+ <!-- extension mapping for serving page-independent resources (javascript,
stylesheets, images, etc.) -->
+ <filter-mapping>
+ <filter-name>MyFacesExtensionsFilter</filter-name>
+ <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Listener, to allow Jetty serving MyFaces apps -->
+ <listener>
+ <listener-class>
+ org.apache.myfaces.webapp.StartupServletContextListener
+ </listener-class>
+ </listener>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+</web-app>
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/combiModalPanel.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/combiModalPanel.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/combiModalPanel.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<%@page contentType="text/html; charset=UTF-8"%>
+<f:view>
+ <html>
+ <head>
+ <title>Current component inside MODAL PANEL</title>
+ <link href="/test-jsp/styles/layout.css" rel="stylesheet"
+ type="text/css" />
+ <script type="text/javascript"
src="/test-jsp/javascript/jsTools.js"></script>
+ </head>
+ <body>
+ <rich:modalPanel id="combiModalPanelID" showWhenRendered="true"
+ autosized="true">
+ <f:facet name="controls">
+ <f:verbatim>
+ <a href="#"
+ onclick="Richfaces.hideModalPanel('combiModalPanelID'); return
false;">hide</a>
+ </f:verbatim>
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="Combi Modal Panel" />
+ </f:facet>
+ <h:form>
+ <a4j:status startText="working" stopText="-------"
+ startStyle="color: red;"></a4j:status>
+ <a4j:outputPanel id="currentComponentInsideModalPanelID"
+ layout="block">
+ <jsp:include page="#{pageContent.currentComponent}" />
+ </a4j:outputPanel>
+ <a4j:commandButton reRender="currentComponentInsideModalPanelID"
+ value="reRender"></a4j:commandButton>
+ </h:form>
+ </rich:modalPanel>
+
+ <a onclick="Richfaces.showModalPanel('combiModalPanelID');"
href="#">show
+ ModalPanel with current component</a>
+ </body>
+ </html>
+</f:view>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/header.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/header.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/header.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,49 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="headerSubviewID">
+ <h:panelGrid columns="1">
+ <h:outputText value="RichFaces version: #{pageContent.version}" />
+ <hr />
+ <h:panelGrid columns="8">
+ <h:panelGrid columns="2">
+ <h:commandButton value="Submit" />
+ <a4j:commandButton reRender="componentID" value="A4j Submit"
/>
+ <h:commandButton immediate="true" value="Immediate Submit"
/>
+ <a4j:commandButton reRender="componentID" immediate="true"
+ value="Immediate A4j Submit" />
+ </h:panelGrid>
+ <a4j:status startText="working" stopText="-------"
+ startStyleClass="error"></a4j:status>
+ <h:panelGrid columns="2">
+ <h:panelGrid columns="2">
+ <h:outputText value="Component: " />
+ <h:selectOneMenu value="#{pageContent.component}">
+ <f:selectItems value="#{pageContent.allComponents}" />
+ </h:selectOneMenu>
+
+ <h:outputText value="Skin: " />
+ <h:selectOneMenu value="#{pageContent.skin}">
+ <f:selectItems value="#{pageContent.allSkins}" />
+ </h:selectOneMenu>
+ </h:panelGrid>
+ <h:panelGroup>
+ <h:commandButton value="Apply"/>
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:panelGroup></h:panelGroup>
+ <h:panelGroup></h:panelGroup>
+ <h:panelGroup></h:panelGroup>
+ <h:panelGroup></h:panelGroup>
+ <h:panelGroup>
+ <dl>
+ <li><a href="combiModalPanel.jsf"
target="newTab">current
+ component inside MODAL PANEL</a></li>
+ <li><a href="#" target="newTab">current component
inside
+ DATA TABLE</a></li>
+ </dl>
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/main.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/main.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/applicationStructure/main.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<%@page contentType="text/html; charset=UTF-8"%>
+<f:view>
+ <html>
+ <head>
+ <title>RichFaces JSP+MyFaces Project</title>
+ <link href="/test-jsp/styles/layout.css" rel="stylesheet"
+ type="text/css" />
+ <script type="text/javascript"
src="/test-jsp/javascript/jsTools.js"></script>
+ </head>
+ <body>
+ <h:form id="formID">
+ <a4j:outputPanel id="headerID"
layout="block"><jsp:include
+ page="header.jsp" />
+ </a4j:outputPanel>
+ <hr />
+ <rich:messages id="messagesID" showDetail="true"
styleClass="error" />
+
+ <a4j:outputPanel id="componentID" layout="block">
+ <jsp:include page="#{pageContent.currentComponent}"
/></a4j:outputPanel>
+
+ <h:panelGrid columns="4" border="1">
+ <a4j:commandLink value="ManualGeneralAttribute"
reRender="testPageID"
+ limitToList="true" immediate="true">
+ <a4j:actionparam name="testType"
value="MANUAL_GENERAL_ATTRIBUTES"
+ assignTo="#{pageContent.testType}"></a4j:actionparam>
+ </a4j:commandLink>
+ <a4j:commandLink value="AutoGeneralAttribute"
reRender="testPageID"
+ limitToList="true" immediate="true">
+ <a4j:actionparam name="testType"
value="AUTO_GENERAL_ATTRIBUTES"
+ assignTo="#{pageContent.testType}"></a4j:actionparam>
+ </a4j:commandLink>
+ <a4j:commandLink value="AutoEventHandlers"
reRender="testPageID"
+ limitToList="true" immediate="true">
+ <a4j:actionparam name="testType" value="AUTO_EVENTHANDLERS"
+ assignTo="#{pageContent.testType}"></a4j:actionparam>
+ </a4j:commandLink>
+ <a4j:commandLink value="AutoStylesClasses"
reRender="testPageID"
+ limitToList="true" immediate="true">
+ <a4j:actionparam name="testType" value="AUTO_STYLES_CLASSES"
+ assignTo="#{pageContent.testType}"></a4j:actionparam>
+ </a4j:commandLink>
+ </h:panelGrid>
+
+ <a4j:outputPanel id="testPageID"
layout="block"><jsp:include
+ page="#{pageContent.currentTestPage}" /></a4j:outputPanel>
+ </h:form>
+ </body>
+ </html>
+</f:view>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoEventHandlers.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoEventHandlers.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoEventHandlers.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,21 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="autoEventHandlersSubviewID">
+
+ <a4j:commandButton value="Get Event Handlers / Reset"
+ reRender="resultEventHandlersPanel"
+ action="#{autoEventHandlers.drawEventHandlersGrid}"
ajaxSingle="true">
+ </a4j:commandButton>
+
+ <a4j:outputPanel id="resultEventHandlersPanel">
+ <h:panelGrid id="resultEventHandlersGrid"
+ binding="#{autoEventHandlers.resultEventHandlersGrid}" columns="2"
/>
+ </a4j:outputPanel>
+
+ <%--
+ <a4j:commandButton process="resultEventHandlersGrid"
+ value="Submit Results"></a4j:commandButton>
+--%>
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoGeneral.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoGeneral.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoGeneral.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,39 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="autoGeneralSubviewID">
+
+ <a4j:commandButton value="Get Automated General Attrs / Reset"
+ reRender="resultAutoGeneralPanel"
+ action="#{autoGeneral.drawAutoGeneralGrid}" ajaxSingle="true">
+ </a4j:commandButton>
+
+ <a4j:outputPanel id="resultAutoGeneralPanel">
+ <h:panelGrid id="resultAutoGeneralGrid"
+ binding="#{autoGeneral.resultAutoGeneralGrid}" columns="2" />
+ </a4j:outputPanel>
+
+ <a4j:commandButton value="TEST" oncomplete="checkMessage()"
+ reRender="componentID, resultAutoGeneralPanel"
+ action="#{autoGeneral.testAutoGeneral}"></a4j:commandButton>
+
+ <div class="notes"><b>NOTE: </b> For testing validator and
+ validatorMessage perform following steps please:
+ <ul>
+ <li>select "validator" value</li>
+ <li>click TEST button</li>
+ <li>select correct value</li>
+ <li>click TEST button again</li>
+ </ul>
+ The same for converter and converterMessage, excepting: "converter"
+ value should be selected.</div>
+
+ <h:inputHidden id="hiddenValidatorInput"
+ value="#{validation.validatorMessageTest}" />
+ <h:inputHidden id="hiddenConverterInput"
+ value="#{convertion.converterMessageTest}" />
+ <h:inputHidden id="hiddenRequiredInput"
+ value="#{validation.requiredMessageTest}" />
+
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoStylesClasses.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoStylesClasses.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/auto/autoStylesClasses.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,24 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="autoStylesClassesSubviewID">
+
+ <a4j:commandButton value="Get Styles and Classes / Reset"
+ reRender="resultStylesClassesPanel"
+ action="#{autoStylesClasses.drawStylesClassesGrid}"
ajaxSingle="true">
+ </a4j:commandButton>
+
+ <a4j:outputPanel id="resultStylesClassesPanel">
+ <h:panelGrid id="resultStylesClassesGrid"
+ binding="#{autoStylesClasses.resultStylesClassesGrid}" columns="2"
/>
+ </a4j:outputPanel>
+
+ <div class="notes"><b>NOTE: </b>Tests for styles could
return
+ wrong FAILED result in Firefox and Internet Explorer!</div>
+
+ <%--
+ <a4j:commandButton process="resultStylesClassesGrid"
+ value="Submit Results"></a4j:commandButton>
+--%>
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blank.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blank.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blank.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,3 @@
+<f:subview id="blankID">
+
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blankTestPage.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blankTestPage.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/_blank/_blankTestPage.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,3 @@
+<f:subview id="blankTestPageID">
+
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBox.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBox.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBox.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,70 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="comboBoxSubviewID">
+ <div>The <rich:comboBox> is a component, that provides
+ editable combo box element on a page.</div>
+ <br />
+ <rich:comboBox id="comboBoxID" value="#{comboBox.value}"
+ validator="#{validation.validate}"
+ validatorMessage="#{validation.validatorMessage}"
+ converter="#{convertion.convert}"
+ converterMessage="#{convertion.converterMessage}"
+ onblur="markEventAsWorkable('onblur');"
+ onchange="markEventAsWorkable('onchange');"
+ onclick="markEventAsWorkable('onclick');"
+ ondblclick="markEventAsWorkable('ondblclick');"
+ onfocus="markEventAsWorkable('onfocus');"
+ onkeydown="markEventAsWorkable('onkeydown');"
+ onkeypress="markEventAsWorkable('onkeypress');"
+ onkeyup="markEventAsWorkable('onkeyup');"
+ onlistcall="markEventAsWorkable('onlistcall');"
+ onlistclose="markEventAsWorkable('onlistclose');"
+ onmousedown="markEventAsWorkable('onmousedown');"
+ onmousemove="markEventAsWorkable('onmousemove');"
+ onmouseout="markEventAsWorkable('onmouseout');"
+ onmouseover="markEventAsWorkable('onmouseover');"
+ onmouseup="markEventAsWorkable('onmouseup');"
+ onselect="markEventAsWorkable('onselect');"
style="style:style"
+ styleClass="styleClass-styleClass"
+ buttonClass="buttonClass-buttonClass"
+ buttonDisabledClass="buttonDisabledClass-buttonDisabledClass"
+ buttonDisabledStyle="buttonDisabledStyle:buttonDisabledStyle"
+ buttonInactiveClass="buttonInactiveClass-buttonInactiveClass"
+ buttonInactiveStyle="buttonInactiveStyle:buttonInactiveStyle"
+ buttonStyle="buttonStyle:buttonStyle"
+ inputClass="inputClass-inputClass"
+ inputDisabledClass="inputDisabledClass-inputDisabledClass"
+ inputDisabledStyle="inputDisabledStyle:inputDisabledStyle"
+ inputInactiveClass="inputInactiveClass-inputInactiveClass"
+ inputInactiveStyle="inputInactiveStyle:inputInactiveStyle"
+ inputStyle="inputStyle:inputStyle" itemClass="itemClass-itemClass"
+ itemSelectedClass="itemSelectedClass-itemSelectedClass"
+ listClass="listClass-listClass" listStyle="listStyle:listStyle"
+ required="#{comboBox.required}"
requiredMessage="#{validation.requiredMessage}"
+ immediate="#{comboBox.immediate}">
+ <f:selectItem itemValue="validator" />
+ <f:selectItem itemValue="converter" />
+ <f:selectItems value="#{comboBox.items}" />
+ </rich:comboBox>
+ <br />
+ <h:panelGrid columns="2">
+ <rich:spacer width="200"></rich:spacer>
+ <h:panelGrid columns="2">
+ <h:commandLink
+ onclick="document.getElementById('formID:comboBoxSubviewID:comboBoxID').component.showList();
return false;"
+ value="showList" />
+ <h:commandLink
+ onclick="document.getElementById('formID:comboBoxSubviewID:comboBoxID').component.hideList();
return false;"
+ value="hideList" />
+ <h:commandLink
+ onclick="document.getElementById('formID:comboBoxSubviewID:comboBoxID').component.enable();
return false;"
+ value="enable" />
+ <h:commandLink
+ onclick="document.getElementById('formID:comboBoxSubviewID:comboBoxID').component.disable();
return false;"
+ value="disable" />
+ </h:panelGrid>
+ </h:panelGrid>
+ <br />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBoxManualGeneral.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBoxManualGeneral.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/comboBox/comboBoxManualGeneral.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,7 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="comboBoxManualGeneralSubviewID">
+ <h:outputText value="MANUAL_GENERAL_ATTRIBUTES" />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenu.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenu.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenu.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,51 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="dropDownMenuSubviewID">
+ <div>The <rich:dropDownMenu> component is used for creating
+ multilevel drop-down menus.</div>
+ <br />
+ <rich:dropDownMenu id="dropDownMenuID"
+ value="Click HERE to call the menu" submitMode="ajax"
+ oncollapse="markEventAsWorkable('oncollapse');"
+ onexpand="markEventAsWorkable('onexpand');"
+ ongroupactivate="markEventAsWorkable('ongroupactivate');"
+ onitemselect="markEventAsWorkable('onitemselect');"
+ onmousemove="markEventAsWorkable('onmousemove');"
+ onmouseout="markEventAsWorkable('onmouseout');"
+ onmouseover="markEventAsWorkable('onmouseover');"
style="style:style"
+ styleClass="styleClass-styleClass"
+ disabledItemClass="disabledItemClass-disabledItemClass"
+ disabledItemStyle="disabledItemStyle:disabledItemStyle"
+ disabledLabelClass="disabledLabelClass-disabledLabelClass"
+ itemClass="itemClass-itemClass" itemStyle="itemStyle:itemStyle"
+ labelClass="labelClass-labelClass"
+ selectedLabelClass="selectedLabelClass-selectedLabelClass"
+ selectItemClass="selectItemClass-selectItemClass"
+ selectItemStyle="selectItemStyle:selectItemStyle">
+ <rich:menuItem value="it-1"></rich:menuItem>
+ <rich:menuItem disabled="true"
value="it-2"></rich:menuItem>
+ <rich:menuGroup value="gr-1">
+ <rich:menuItem value="it-1.1"></rich:menuItem>
+ <rich:menuItem value="it-1.2"></rich:menuItem>
+ </rich:menuGroup>
+ <rich:menuGroup disabled="true" value="gr-2">
+ <rich:menuItem value="it-2.1"></rich:menuItem>
+ <rich:menuItem value="it-2.2"></rich:menuItem>
+ </rich:menuGroup>
+ </rich:dropDownMenu>
+ <rich:dropDownMenu id="dropDownMenuDisabledID" value="Disabled
menu"
+ disabled="true"
+ disabledItemClass="disabledItemClass-disabledItemClass"
+ disabledItemStyle="disabledItemStyle:disabledItemStyle"
+ disabledLabelClass="disabledLabelClass-disabledLabelClass">
+ <rich:menuItem value="it-1"></rich:menuItem>
+ <rich:menuItem value="it-2"></rich:menuItem>
+ <rich:menuGroup value="gr-1">
+ <rich:menuItem value="it-1.1"></rich:menuItem>
+ <rich:menuItem value="it-1.2"></rich:menuItem>
+ </rich:menuGroup>
+ </rich:dropDownMenu>
+ <br />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenuManualGeneral.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenuManualGeneral.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/dropDownMenu/dropDownMenuManualGeneral.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,7 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="dropDownMenuManualGeneralSubviewID">
+ <h:outputText value="MANUAL_GENERAL_ATTRIBUTES dropDownMenu" />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTable.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTable.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTable.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,69 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="extendedDataTableSubviewID">
+ <div>The <rich:extendedDataTable> component is used for
+ tables extending standard component <rich:dataTable>.</div>
+ <br />
+ <rich:extendedDataTable id="extendedDataTableID"
+ value="#{extendedDataTable.value}" var="car"
+ onclick="markEventAsWorkable('onclick')"
+ ondblclick="markEventAsWorkable('ondblclick')"
+ onkeydown="markEventAsWorkable('onkeydown')"
+ onkeypress="markEventAsWorkable('onkeypress')"
+ onkeyup="markEventAsWorkable('onkeyup')"
+ onmousedown="markEventAsWorkable('onmousedown')"
+ onmousemove="markEventAsWorkable('onmousemove')"
+ onmouseout="markEventAsWorkable('onmouseout')"
+ onmouseover="markEventAsWorkable('onmouseover')"
+ onmouseup="markEventAsWorkable('onmouseup')"
+ onRowClick="markEventAsWorkable('onRowClick')"
+ onRowDblClick="markEventAsWorkable('onRowDblClick')"
+ onRowMouseDown="markEventAsWorkable('onRowMouseDown')"
+ onRowMouseMove="markEventAsWorkable('onRowMouseMove')"
+ onRowMouseOut="markEventAsWorkable('onRowMouseOut')"
+ onRowMouseOver="markEventAsWorkable('onRowMouseOver')"
+ onRowMouseUp="markEventAsWorkable('onRowMouseUp')"
+ onselectionchange="markEventAsWorkable('onselectionchange')"
+ activeClass="activeClass-activeClass"
+ captionClass="captionClass-captionClass"
+ captionStyle="captionStyle:captionStyle"
+ columnClasses="columnClasses-columnClasses"
+ footerClass="footerClass-footerClass"
+ headerClass="headerClass-headerClass"
+ rowClasses="rowClasses-rowClasses"
+ selectedClass="selectedClass-selectedClass"
+ styleClass="styleClass-styleClass" style="style:style">
+ <f:facet name="caption">
+ <h:outputText value="CAPTION" />
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="HEADER" />
+ </f:facet>
+ <rich:column id="makeID" label="Make"
sortBy="#{car.make}"
+ filterBy="#{car.make}">
+ <f:facet name="header">
+ <h:outputText value="Make" />
+ </f:facet>
+ <h:outputText value="#{car.make}" />
+ </rich:column>
+ <rich:column id="modelID" label="Model"
sortBy="#{car.model}"
+ filterBy="#{car.model}">
+ <f:facet name="header">
+ <h:outputText value="Model" />
+ </f:facet>
+ <h:outputText value="#{car.model}" />
+ </rich:column>
+ <rich:column id="priceID" label="Price"
sortBy="#{car.price}">
+ <f:facet name="header">
+ <h:outputText value="Price" />
+ </f:facet>
+ <h:outputText value="#{car.price}" />
+ </rich:column>
+ <f:facet name="footer">
+ <h:outputText value="Created by ADubovsky@" />
+ </f:facet>
+ </rich:extendedDataTable>
+ <br />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTableManualGeneral.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTableManualGeneral.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/extendedDataTable/extendedDataTableManualGeneral.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,7 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="extendedDataTableManualGeneralSubviewID">
+ <h:outputText value="extendedDataTable MANUAL_GENERAL_ATTRIBUTES" />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickList.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickList.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickList.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,49 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="pickListSubviewID">
+ <div>The <rich:pickList> component is used for moving
+ selected item(s) from one list into another.</div>
+ <rich:pickList id="pickListID" value="#{pickList.value}"
+ onblur="markEventAsWorkable('onblur');"
+ onclick="markEventAsWorkable('onclick');"
+ ondblclick="markEventAsWorkable('ondblclick');"
+ onfocus="markEventAsWorkable('onfocus');"
+ onkeydown="markEventAsWorkable('onkeydown');"
+ onkeypress="markEventAsWorkable('onkeypress');"
+ onkeyup="markEventAsWorkable('onkeyup');"
+ onlistchange="markEventAsWorkable('onlistchange');"
+ onlistchanged="markEventAsWorkable('onlistchanged');"
+ onmousedown="markEventAsWorkable('onmousedown');"
+ onmousemove="markEventAsWorkable('onmousemove');"
+ onmouseout="markEventAsWorkable('onmouseout');"
+ onmouseover="markEventAsWorkable('onmouseover');"
+ onmouseup="markEventAsWorkable('onmouseup');"
+ controlClass="controlClass-controlClass"
+ disabledStyle="disabledStyle:disabledStyle"
+ disabledStyleClass="disabledStyleClass-disabledStyleClass"
+ enabledStyle="enabledStyle:enabledStyle"
+ enabledStyleClass="enabledStyleClass-enabledStyleClass"
+ listClass="listClass-listClass" style="style:style"
+ styleClass="styleClass-styleClass"
validator="#{validation.validate}"
+ validatorMessage="#{validation.validatorMessage}"
+ converter="#{convertion.convert}"
+ converterMessage="#{convertion.converterMessage}"
+ required="#{pickList.required}"
+ requiredMessage="#{validation.requiredMessage}"
+ immediate="#{pickList.immediate}">
+ <f:selectItems value="#{pickList.selectItems}" />
+ <f:selectItem itemLabel="validator" itemValue="validator" />
+ <f:selectItem itemLabel="converter" itemValue="converter" />
+ </rich:pickList>
+ <%-- converter select item should be the last in the list
+ because of
https://jira.jboss.org/jira/browse/RF-7472 --%>
+
+ <rich:pickList id="pickListDisabledID" disabled="true"
+ value="#{pickList.value}"
disabledStyle="disabledStyle:disabledStyle"
+ disabledStyleClass="disabledStyleClass-disabledStyleClass">
+ <f:selectItems value="#{pickList.selectItems}" />
+ </rich:pickList>
+ <br />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickListManualGeneral.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickListManualGeneral.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/pickList/pickListManualGeneral.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,7 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="pickListManualGeneralSubviewID">
+ <h:outputText value="MANUAL_GENERAL_ATTRIBUTES pickList" />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBox.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBox.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBox.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,48 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="suggestionBoxSubviewID">
+ <div>This element adds "on-keypress" suggestions capabilites to
+ any input text component (like <h:inputText>). It creates a
+ pop-up window for a input field component pointed to by the "for"
+ attribute. For an ordinary request, render a hidden HTML <div>
+ element and the necessary JavaScript code. When input to the target
+ field exceeds the "minChars" property (default is 1), perform an AJAX
+ request with the value current entered. If the AJAX request is detected
+ and the request parameters map contains the client ID of this
+ component, call a method defined by suggestionAction, and use it to
+ return a value as data for render table, same as <h:dataTable>.
+ In this case, the component then works the same as an ordinary
+ dataTable. The rendered table is inserted in the pop-up area and is
+ used for suggestion prompts for input element. If a user clicks on such
+ a table row, its text (or value defined by fetchValue) is inserted as
+ the value of the input field.</div>
+
+ <h:inputText id="sbText" value="#{suggestionBox.value}" />
+ <rich:suggestionbox id="suggestionBoxID" height="300"
width="200"
+ for="sbText" suggestionAction="#{suggestionBox.suggestionAction}"
+ var="row" fetchValue="#{row.make}"
usingSuggestObjects="true"
+ onbeforedomupdate="markEventAsWorkable('onbeforedomupdate');"
+ oncomplete="markEventAsWorkable('oncomplete');"
+ onobjectchange="markEventAsWorkable('onobjectchange');"
+ onselect="markEventAsWorkable('onselect');"
+ onsubmit="markEventAsWorkable('onsubmit');"
+ entryClass="entryClass-entryClass"
popupClass="popupClass-popupClass"
+ popupStyle="popupStyle:popupStyle"
+ rowClasses="rowClasses-rowClasses1, rowClasses-rowClasses2"
+ selectedClass="selectedClass-selectedClass"
+ selectValueClass="selectValueClass-selectValueClass"
+ style="style:style" styleClass="styleClass-styleClass">
+ <rich:column>
+ <h:outputText value="#{row.make}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.model}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.price}" />
+ </rich:column>
+ </rich:suggestionbox>
+ <br />
+</f:subview>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBoxManualGeneral.jsp
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBoxManualGeneral.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/components/suggestionBox/suggestionBoxManualGeneral.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,7 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="suggestionBoxManualGeneralSubviewID">
+ <h:outputText value="MANUAL_GENERAL_ATTRIBUTES suggestionBox" />
+</f:subview>
\ No newline at end of file
Added: branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/index.jsp
===================================================================
--- branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/index.jsp
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/index.jsp 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,4 @@
+<%@ page session="false"%>
+<%
+ response.sendRedirect("applicationStructure/main.jsf");
+%>
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/javascript/jsTools.js
===================================================================
---
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/javascript/jsTools.js
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/javascript/jsTools.js 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,73 @@
+// Function for testing eventHandlers
+var count = 0;
+function markEventAsWorkable(eventName) {
+ var col = document.getElementById('formID:autoEventHandlersSubviewID:' +
eventName + 'ID');
+ if (col != null) {
+ col.style.color = 'green';
+ col.value = 'PASSED - ' + count;
+ count++;
+ }
+ return true;
+}
+
+// Function for testing classes
+function markClassAsWorkable(className) {
+ if ((className.indexOf('Style', 1) == (className.length - 5))||(className ==
'style'))
+ var selector = '.' + className + ':' + className;
+ else
+ var selector = '.' + className + '-' + className;
+ var counter = jQuery(selector).length;
+ var col = document.getElementById('formID:autoStylesClassesSubviewID:' +
className + 'ID');
+ if (col != null) {
+ if (counter > 0) {
+ col.style.color = 'green';
+ col.value = 'PASSED - ' + counter;
+ } else {
+ var arrJS = jQuery('script');
+ var i = 0;
+ var found = false;
+ if ((className.indexOf('Style', 1) > -1)||(className == 'style'))
+ var txtSelector = className + ':' + className;
+ else
+ var txtSelector = className + '-' + className;
+ while ((!found)&&(i < arrJS.length)) {
+ if (arrJS[i].text.indexOf(txtSelector) > -1) {
+ found = true;
+ col.style.color = 'blue';
+ col.value = 'PASSED (found in JS)';
+ }
+ i++;
+ }
+ if (!found) {
+ var eHTML = jQuery('html');
+ if (eHTML[0].innerHTML.indexOf(txtSelector) > -1) {
+ found = true;
+ col.style.color = 'blue';
+ col.value = 'PASSED (found in HTML)';
+ }
+ }
+ if (!found) {
+ col.style.color = 'red';
+ col.value = 'FAILED';
+ }
+ }
+ }
+}
+
+// Function for testing messages
+function checkMessage() {
+ var mes = document.getElementById('formID:messagesID');
+ if (mes != null) {
+ var mesText = mes.innerHTML;
+ if (mesText.indexOf('validator')>-1) {
+ var inp =
document.getElementById('formID:autoGeneralSubviewID:hiddenValidatorInput');
+ } else if (mesText.indexOf('converter')>-1) {
+ var inp =
document.getElementById('formID:autoGeneralSubviewID:hiddenConverterInput');
+ } else if (mesText.indexOf('required')>-1) {
+ var inp =
document.getElementById('formID:autoGeneralSubviewID:hiddenRequiredInput');
+ }
+ if (inp != null) {
+ inp.value = mesText;
+ }
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/styles/layout.css
===================================================================
--- branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/styles/layout.css
(rev 0)
+++
branches/community/3.3.X/test-applications/test-jsp/src/main/webapp/styles/layout.css 2009-07-10
12:44:24 UTC (rev 14881)
@@ -0,0 +1,10 @@
+.error {
+ color: red;
+}
+
+.notes {
+ border-width: 2px;
+ border-color: red;
+ border-style: solid;
+ width: 50%;
+}
\ No newline at end of file