JBoss Rich Faces SVN: r22427 - trunk/core/impl/src/main/java/org/richfaces/application/push/impl/jms.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-18 07:22:46 -0400 (Mon, 18 Apr 2011)
New Revision: 22427
Modified:
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java
Log:
https://issues.jboss.org/browse/RF-10883
Modified: trunk/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java 2011-04-15 15:57:33 UTC (rev 22426)
+++ trunk/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java 2011-04-18 11:22:46 UTC (rev 22427)
@@ -113,6 +113,10 @@
connection.setClientID(UUID.randomUUID().toString());
} catch (IllegalStateException e) {
//ignore - clientId has already been set
+ LOGGER.debug(e.getMessage(), e);
+ } catch (JMSException e) {
+ //ignore - clientId has already been set
+ LOGGER.debug(e.getMessage(), e);
}
connection.start();
@@ -172,7 +176,7 @@
javax.jms.Topic jmsTopic = lookup(rootTopicKey);
- return jmsSession.createDurableSubscriber(jmsTopic, subscriptionClientId, createMessageSelector(entry.getValue()), true);
+ return jmsSession.createDurableSubscriber(jmsTopic, subscriptionClientId, createMessageSelector(entry.getValue()), false);
}
/**
13 years, 8 months
JBoss Rich Faces SVN: r22426 - in trunk/ui/iteration/ui/src: test/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-15 11:57:33 -0400 (Fri, 15 Apr 2011)
New Revision: 22426
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChildrenIterator.java
Removed:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChilderIterator.java
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java
Log:
Renamed DataTableDataChilderIterator into DataTableDataChildrenIterator
Deleted: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChilderIterator.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChilderIterator.java 2011-04-15 14:07:29 UTC (rev 22425)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChilderIterator.java 2011-04-15 15:57:33 UTC (rev 22426)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-
-import com.google.common.collect.AbstractIterator;
-import com.google.common.collect.Iterators;
-
-/**
- * @author Nick Belaevski
- *
- */
-class DataTableDataChilderIterator extends AbstractIterator<UIComponent> {
-
- private Iterator<UIComponent> dataTableChildren;
-
- private Iterator<UIComponent> columnChildren = Iterators.emptyIterator();
-
- public DataTableDataChilderIterator(UIComponent dataTable) {
- super();
- this.dataTableChildren = dataTable.getChildren().iterator();
- }
-
- @Override
- protected UIComponent computeNext() {
- while (columnChildren.hasNext() || dataTableChildren.hasNext()) {
- if (columnChildren.hasNext()) {
- return columnChildren.next();
- }
-
- UIComponent child = dataTableChildren.next();
- if (child instanceof UIColumn || child instanceof AbstractColumn) {
- columnChildren = child.getChildren().iterator();
- } else {
- columnChildren = Iterators.emptyIterator();
- return child;
- }
- }
-
- dataTableChildren = Iterators.emptyIterator();
- columnChildren = Iterators.emptyIterator();
-
- return endOfData();
- }
-
-}
Copied: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChildrenIterator.java (from rev 22419, trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChilderIterator.java)
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChildrenIterator.java (rev 0)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/DataTableDataChildrenIterator.java 2011-04-15 15:57:33 UTC (rev 22426)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+
+import com.google.common.collect.AbstractIterator;
+import com.google.common.collect.Iterators;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+class DataTableDataChildrenIterator extends AbstractIterator<UIComponent> {
+
+ private Iterator<UIComponent> dataTableChildren;
+
+ private Iterator<UIComponent> columnChildren = Iterators.emptyIterator();
+
+ public DataTableDataChildrenIterator(UIComponent dataTable) {
+ super();
+ this.dataTableChildren = dataTable.getChildren().iterator();
+ }
+
+ @Override
+ protected UIComponent computeNext() {
+ while (columnChildren.hasNext() || dataTableChildren.hasNext()) {
+ if (columnChildren.hasNext()) {
+ return columnChildren.next();
+ }
+
+ UIComponent child = dataTableChildren.next();
+ if (child instanceof UIColumn || child instanceof AbstractColumn) {
+ columnChildren = child.getChildren().iterator();
+ } else {
+ columnChildren = Iterators.emptyIterator();
+ return child;
+ }
+ }
+
+ dataTableChildren = Iterators.emptyIterator();
+ columnChildren = Iterators.emptyIterator();
+
+ return endOfData();
+ }
+
+}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2011-04-15 14:07:29 UTC (rev 22425)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2011-04-15 15:57:33 UTC (rev 22426)
@@ -171,7 +171,7 @@
}
protected Iterator<UIComponent> dataChildren() {
- return new DataTableDataChilderIterator(this);
+ return new DataTableDataChildrenIterator(this);
}
public boolean isColumnFacetPresent(String facetName) {
Modified: trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java
===================================================================
--- trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java 2011-04-15 14:07:29 UTC (rev 22425)
+++ trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java 2011-04-15 15:57:33 UTC (rev 22426)
@@ -144,7 +144,7 @@
*/
@Test
public void testDataChildren() {
- Assert.assertTrue(table.dataChildren() instanceof DataTableDataChilderIterator);
+ Assert.assertTrue(table.dataChildren() instanceof DataTableDataChildrenIterator);
}
/**
13 years, 8 months
JBoss Rich Faces SVN: r22425 - in sandbox/trunk/ui/watermark: bom and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-04-15 10:07:29 -0400 (Fri, 15 Apr 2011)
New Revision: 22425
Removed:
sandbox/trunk/ui/watermark/bom/watermark-bom.iml
sandbox/trunk/ui/watermark/demo/watermark-demo.iml
sandbox/trunk/ui/watermark/parent/watermark-parent.iml
sandbox/trunk/ui/watermark/ui/watermark.iml
sandbox/trunk/ui/watermark/watermark-aggregator.iml
sandbox/trunk/ui/watermark/watermark-aggregator.ipr
Modified:
sandbox/trunk/ui/watermark/bom/pom.xml
sandbox/trunk/ui/watermark/demo/pom.xml
sandbox/trunk/ui/watermark/ui/pom.xml
Log:
Removed ide config files from watermark component.
Changed artifact id from watermark to watermark-ui.
Modified: sandbox/trunk/ui/watermark/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/bom/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/bom/pom.xml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
Inc. and individual contributors by the @authors tag. See the
copyright.txt in the distribution for a full listing of
@@ -41,10 +40,10 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>watermark</artifactId>
+ <artifactId>watermark-ui</artifactId>
<version>${project.version}</version>
</dependency>
-
+
</dependencies>
</dependencyManagement>
Deleted: sandbox/trunk/ui/watermark/bom/watermark-bom.iml
===================================================================
--- sandbox/trunk/ui/watermark/bom/watermark-bom.iml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/bom/watermark-bom.iml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- </component>
-</module>
-
Modified: sandbox/trunk/ui/watermark/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/demo/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/demo/pom.xml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.richfaces.sandbox.ui.watermark</groupId>
- <artifactId>watermark</artifactId>
+ <artifactId>watermark-ui</artifactId>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
Deleted: sandbox/trunk/ui/watermark/demo/watermark-demo.iml
===================================================================
--- sandbox/trunk/ui/watermark/demo/watermark-demo.iml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/demo/watermark-demo.iml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="FacetManager">
- <facet type="web" name="Web">
- <configuration>
- <descriptors>
- <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
- </descriptors>
- <webroots>
- <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
- </webroots>
- <context-artifact name="watermark-demo:war exploded" />
- </configuration>
- </facet>
- </component>
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: org.richfaces.ui:richfaces-components-ui:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" name="Maven: org.richfaces.ui:richfaces-components-api:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" name="Maven: com.google.guava:guava:r08" level="project" />
- <orderEntry type="library" name="Maven: org.richfaces.core:richfaces-core-impl:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" name="Maven: net.sourceforge.cssparser:cssparser:0.9.5" level="project" />
- <orderEntry type="library" name="Maven: org.w3c.css:sac:1.3" level="project" />
- <orderEntry type="module" module-name="watermark" />
- <orderEntry type="library" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
- <orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
- <orderEntry type="library" name="Maven: com.sun.el:el-ri:1.0" level="project" />
- </component>
-</module>
-
Deleted: sandbox/trunk/ui/watermark/parent/watermark-parent.iml
===================================================================
--- sandbox/trunk/ui/watermark/parent/watermark-parent.iml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/parent/watermark-parent.iml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
- </component>
-</module>
-
Modified: sandbox/trunk/ui/watermark/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/ui/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/ui/pom.xml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -8,7 +8,7 @@
<version>4.1.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
- <artifactId>watermark</artifactId>
+ <artifactId>watermark-ui</artifactId>
<name>Richfaces UI Components: watermark ui</name>
<dependencies>
Deleted: sandbox/trunk/ui/watermark/ui/watermark.iml
===================================================================
--- sandbox/trunk/ui/watermark/ui/watermark.iml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/ui/watermark.iml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/main" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/target/classes" />
- <excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
- <excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.core:richfaces-ui-core-ui:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:r08" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.common:richfaces-ui-common-ui:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.common:richfaces-ui-common-api:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.core:richfaces-ui-core-api:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.cdk:annotations:4.1.0-SNAPSHOT" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: javax.el:el-api:1.0" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.jboss.test-jsf:jsf-test-stage:1.0.6" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: org.jboss.el:jboss-el:1.0_02.CR5" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: javax.servlet.jsp:jsp-api:2.1" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.7" level="project" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
- </component>
-</module>
-
Deleted: sandbox/trunk/ui/watermark/watermark-aggregator.iml
===================================================================
--- sandbox/trunk/ui/watermark/watermark-aggregator.iml 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/watermark-aggregator.iml 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
- </component>
-</module>
-
Deleted: sandbox/trunk/ui/watermark/watermark-aggregator.ipr
===================================================================
--- sandbox/trunk/ui/watermark/watermark-aggregator.ipr 2011-04-15 13:42:33 UTC (rev 22424)
+++ sandbox/trunk/ui/watermark/watermark-aggregator.ipr 2011-04-15 14:07:29 UTC (rev 22425)
@@ -1,490 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="AntConfiguration">
- <defaultAnt bundledAnt="true" />
- </component>
- <component name="ArtifactManager">
- <artifact type="war" name="watermark-demo:war">
- <output-path>$PROJECT_DIR$/demo/target</output-path>
- <root id="archive" name="watermark-demo.war">
- <element id="artifact" artifact-name="watermark-demo:war exploded" />
- </root>
- </artifact>
- <artifact type="exploded-war" name="watermark-demo:war exploded">
- <output-path>$PROJECT_DIR$/demo/target/watermark-demo</output-path>
- <root id="root">
- <element id="javaee-facet-resources" facet="watermark-demo/web/Web" />
- <element id="directory" name="WEB-INF">
- <element id="directory" name="classes">
- <element id="module-output" name="watermark-demo" />
- </element>
- <element id="directory" name="lib">
- <element id="library" level="project" name="Maven: org.richfaces.ui:richfaces-components-ui:4.1.0-SNAPSHOT" />
- <element id="library" level="project" name="Maven: org.richfaces.ui:richfaces-components-api:4.1.0-SNAPSHOT" />
- <element id="library" level="project" name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT" />
- <element id="library" level="project" name="Maven: com.google.guava:guava:r08" />
- <element id="library" level="project" name="Maven: org.richfaces.core:richfaces-core-impl:4.1.0-SNAPSHOT" />
- <element id="library" level="project" name="Maven: net.sourceforge.cssparser:cssparser:0.9.5" />
- <element id="library" level="project" name="Maven: org.w3c.css:sac:1.3" />
- <element id="archive" name="watermark-4.1.0-SNAPSHOT.jar">
- <element id="module-output" name="watermark" />
- </element>
- <element id="library" level="project" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" />
- <element id="library" level="project" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" />
- <element id="library" level="project" name="Maven: com.sun.el:el-ri:1.0" />
- </element>
- </element>
- </root>
- </artifact>
- </component>
- <component name="CompilerConfiguration">
- <option name="DEFAULT_COMPILER" value="Javac" />
- <resourceExtensions>
- <entry name=".+\.(properties|xml|html|dtd|tld)" />
- <entry name=".+\.(gif|png|jpeg|jpg)" />
- </resourceExtensions>
- <wildcardResourcePatterns>
- <entry name="?*.properties" />
- <entry name="?*.xml" />
- <entry name="?*.gif" />
- <entry name="?*.png" />
- <entry name="?*.jpeg" />
- <entry name="?*.jpg" />
- <entry name="?*.html" />
- <entry name="?*.dtd" />
- <entry name="?*.tld" />
- <entry name="?*.ftl" />
- </wildcardResourcePatterns>
- <annotationProcessing enabled="false" useClasspath="true" />
- </component>
- <component name="CopyrightManager" default="">
- <module2copyright />
- </component>
- <component name="DependencyValidationManager">
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
- </component>
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
- <component name="FacetAutodetectingManager">
- <autodetection-disabled>
- <facet-type id="web">
- <modules>
- <module name="watermark-demo" />
- </modules>
- </facet-type>
- </autodetection-disabled>
- </component>
- <component name="JavacSettings">
- <option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.5" />
- </component>
- <component name="JavadocGenerationManager">
- <option name="OUTPUT_DIRECTORY" />
- <option name="OPTION_SCOPE" value="protected" />
- <option name="OPTION_HIERARCHY" value="true" />
- <option name="OPTION_NAVIGATOR" value="true" />
- <option name="OPTION_INDEX" value="true" />
- <option name="OPTION_SEPARATE_INDEX" value="true" />
- <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
- <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
- <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
- <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
- <option name="OPTION_DEPRECATED_LIST" value="true" />
- <option name="OTHER_OPTIONS" value="" />
- <option name="HEAP_SIZE" />
- <option name="LOCALE" />
- <option name="OPEN_IN_BROWSER" value="true" />
- </component>
- <component name="JsfProjectComponent">
- <option name="faceletsSupport" value="ENABLED" />
- </component>
- <component name="MavenProjectsManager">
- <option name="originalFiles">
- <list>
- <option value="$PROJECT_DIR$/pom.xml" />
- </list>
- </option>
- </component>
- <component name="Palette2">
- <group name="Swing">
- <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
- </item>
- <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
- <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
- <initial-values>
- <property name="text" value="Button" />
- </initial-values>
- </item>
- <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="RadioButton" />
- </initial-values>
- </item>
- <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="CheckBox" />
- </initial-values>
- </item>
- <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="Label" />
- </initial-values>
- </item>
- <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
- <preferred-size width="-1" height="20" />
- </default-constraints>
- </item>
- <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
- </item>
- </group>
- </component>
- <component name="ProjectModuleManager">
- <modules>
- <module fileurl="file://$PROJECT_DIR$/ui/watermark.iml" filepath="$PROJECT_DIR$/ui/watermark.iml" />
- <module fileurl="file://$PROJECT_DIR$/watermark-aggregator.iml" filepath="$PROJECT_DIR$/watermark-aggregator.iml" />
- <module fileurl="file://$PROJECT_DIR$/bom/watermark-bom.iml" filepath="$PROJECT_DIR$/bom/watermark-bom.iml" />
- <module fileurl="file://$PROJECT_DIR$/demo/watermark-demo.iml" filepath="$PROJECT_DIR$/demo/watermark-demo.iml" />
- <module fileurl="file://$PROJECT_DIR$/parent/watermark-parent.iml" filepath="$PROJECT_DIR$/parent/watermark-parent.iml" />
- </modules>
- </component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
- <output url="file://$PROJECT_DIR$/classes" />
- </component>
- <component name="SvnBranchConfigurationManager">
- <option name="mySupportsUserInfoFilter" value="true" />
- </component>
- <component name="VcsDirectoryMappings">
- <mapping directory="" vcs="" />
- </component>
- <component name="libraryTable">
- <library name="Maven: com.sun.faces:jsf-api:2.0.4-b09">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-api/2.0.4-b09/jsf-api-2.0.4-b09.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-api/2.0.4-b09/jsf-api-2.0.4-b09-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-api/2.0.4-b09/jsf-api-2.0.4-b09-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: com.sun.faces:jsf-impl:2.0.4-b09">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-impl/2.0.4-b09/jsf-impl-2.0.4-b09.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-impl/2.0.4-b09/jsf-impl-2.0.4-b09-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-impl/2.0.4-b09/jsf-impl-2.0.4-b09-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-api/4.1.0-SNAPSHOT/richfaces-core-api-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-api/4.1.0-SNAPSHOT/richfaces-core-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-api/4.1.0-SNAPSHOT/richfaces-core-api-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: com.google.guava:guava:r08">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/r08/guava-r08.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/r08/guava-r08-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/r08/guava-r08-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.core:richfaces-core-impl:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-impl/4.1.0-SNAPSHOT/richfaces-core-impl-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-impl/4.1.0-SNAPSHOT/richfaces-core-impl-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-impl/4.1.0-SNAPSHOT/richfaces-core-impl-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: net.sourceforge.cssparser:cssparser:0.9.5">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.w3c.css:sac:1.3">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/w3c/css/sac/1.3/sac-1.3.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/w3c/css/sac/1.3/sac-1.3-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/w3c/css/sac/1.3/sac-1.3-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: com.sun.el:el-ri:1.0">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/el/el-ri/1.0/el-ri-1.0.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/el/el-ri/1.0/el-ri-1.0-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/com/sun/el/el-ri/1.0/el-ri-1.0-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.cdk:annotations:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/cdk/annotations/4.1.0-SNAPSHOT/annotations-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/cdk/annotations/4.1.0-SNAPSHOT/annotations-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/cdk/annotations/4.1.0-SNAPSHOT/annotations-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: javax.servlet:servlet-api:2.5">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.5/servlet-api-2.5-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: javax.servlet.jsp:jsp-api:2.1">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: javax.el:el-api:1.0">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.jboss.test-jsf:jsf-test-stage:1.0.6">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/test-jsf/jsf-test-stage/1.0.6/jsf-test-stage-1.0.6.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/test-jsf/jsf-test-stage/1.0.6/jsf-test-stage-1.0.6-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/test-jsf/jsf-test-stage/1.0.6/jsf-test-stage-1.0.6-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.jboss.el:jboss-el:1.0_02.CR5">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/jboss-el/1.0_02.CR5/jboss-el-1.0_02.CR5.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/jboss-el/1.0_02.CR5/jboss-el-1.0_02.CR5-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/jboss-el/1.0_02.CR5/jboss-el-1.0_02.CR5-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: javax.annotation:jsr250-api:1.0">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: junit:junit:4.7">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.7/junit-4.7.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.7/junit-4.7-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.7/junit-4.7-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.ui:richfaces-components-ui:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-ui/4.1.0-SNAPSHOT/richfaces-components-ui-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-ui/4.1.0-SNAPSHOT/richfaces-components-ui-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-ui/4.1.0-SNAPSHOT/richfaces-components-ui-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.ui:richfaces-components-api:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-api/4.1.0-SNAPSHOT/richfaces-components-api-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-api/4.1.0-SNAPSHOT/richfaces-components-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-api/4.1.0-SNAPSHOT/richfaces-components-api-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.ui.core:richfaces-ui-core-ui:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-ui/4.1.0-SNAPSHOT/richfaces-ui-core-ui-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-ui/4.1.0-SNAPSHOT/richfaces-ui-core-ui-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-ui/4.1.0-SNAPSHOT/richfaces-ui-core-ui-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.ui.common:richfaces-ui-common-ui:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-ui/4.1.0-SNAPSHOT/richfaces-ui-common-ui-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-ui/4.1.0-SNAPSHOT/richfaces-ui-common-ui-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-ui/4.1.0-SNAPSHOT/richfaces-ui-common-ui-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.ui.common:richfaces-ui-common-api:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-api/4.1.0-SNAPSHOT/richfaces-ui-common-api-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-api/4.1.0-SNAPSHOT/richfaces-ui-common-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-api/4.1.0-SNAPSHOT/richfaces-ui-common-api-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- <library name="Maven: org.richfaces.ui.core:richfaces-ui-core-api:4.1.0-SNAPSHOT">
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-api/4.1.0-SNAPSHOT/richfaces-ui-core-api-4.1.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-api/4.1.0-SNAPSHOT/richfaces-ui-core-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-api/4.1.0-SNAPSHOT/richfaces-ui-core-api-4.1.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- </component>
-</project>
-
13 years, 8 months
JBoss Rich Faces SVN: r22424 - in sandbox/trunk/ui/schedule: bom and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-04-15 09:42:33 -0400 (Fri, 15 Apr 2011)
New Revision: 22424
Added:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java
Removed:
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml
Modified:
sandbox/trunk/ui/schedule/bom/pom.xml
sandbox/trunk/ui/schedule/demo/pom.xml
sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml
sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml
sandbox/trunk/ui/schedule/parent/pom.xml
sandbox/trunk/ui/schedule/pom.xml
sandbox/trunk/ui/schedule/ui/pom.xml
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java
sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java
sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js
sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml
Log:
Updated schedule component to RF-4.1-SNAPSHOT.
Fixed most of the issues.
Modified: sandbox/trunk/ui/schedule/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/bom/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/bom/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
Inc. and individual contributors by the @authors tag. See the
copyright.txt in the distribution for a full listing of
@@ -23,58 +22,35 @@
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>7</version>
- </parent>
-
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-bom</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-bom</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
<name>Richfaces UI Components: schedule bom</name>
<packaging>pom</packaging>
- <properties>
- <org.richfaces.version>4.0.0-SNAPSHOT</org.richfaces.version>
- </properties>
-
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
- <version>${org.richfaces.version}</version>
+ <version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>richfaces-ui-schedule-ui</artifactId>
+ <artifactId>schedule-ui</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>richfaces-ui-schedule-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>richfaces-ui-schedule-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>functions-ui</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui.notify</groupId>
- <artifactId>richfaces-ui-notify-ui</artifactId>
- <version>${project.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+ <url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
</project>
Modified: sandbox/trunk/ui/schedule/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/demo/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,19 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
<artifactId>schedule-demo</artifactId>
- <version>4.0.0-SNAPSHOT</version>
<name>Richfaces UI Components: schedule demo</name>
<packaging>war</packaging>
<build>
@@ -29,45 +26,35 @@
</plugins>
</build>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-bom</artifactId>
- <version>${version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<dependencies>
<dependency>
- <groupId>org.richfaces.ui.core</groupId>
- <artifactId>richfaces-ui-core-ui</artifactId>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-ui</artifactId>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-ui</artifactId>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-ui</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.notify</groupId>
- <artifactId>richfaces-ui-notify-ui</artifactId>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>compile</scope>
</dependency>
-
<dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
- <scope>provided</scope>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
- <scope>provided</scope>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
</dependency>
</dependencies>
</project>
Modified: sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/java/org/richfaces/schedule/Bean.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -34,424 +34,347 @@
import java.util.Random;
public class Bean implements Serializable {
+// ------------------------------ FIELDS ------------------------------
- private String text;
+ private CustomScheduleListener additionalListener = new CustomScheduleListener();
+
+ private boolean allDayByDefault;
+
+ private boolean allDaySlot = true;
+
+ private String allDayText = "All day";
+
+ private List<ScheduleTask> allTasks = new ArrayList<ScheduleTask>();
+
private boolean allowTaskMoving;
- private List<ScheduleTask> allTasks = new ArrayList<ScheduleTask>();
- private ExtendedDataModel lazyDataModel = new MyDataModel();
- private String selectedEventId;
- private int firstDay = Calendar.SUNDAY;
- private boolean showWeekends;
- private Date initialDate;
+
private boolean allowTaskResizing;
- private String weekMode = AbstractSchedule.WEEK_MODE_FIXED;
- private String allDayText = "All day";
- private boolean allDayByDefault;
- private boolean allDaySlot = true;
+
private Double aspectRatio = 1.;
+
private String axisFormat = "h(:mm)tt";
+
+ private String columnFormat = null;
+
+ private Integer contentHeight = 400;
+
private Integer defaultEventMinutes = 90;
- private Integer contentHeight = 400;
+
private Double dragOpacity = .2;
+
private Integer dragRevertDuration = 2000;
+
private Boolean editable = true;
- private Boolean selectable = true;
- private Boolean selectHelper = true;
- private Boolean unselectAuto = true;
- private String unselectCancel = "";
+
+ private int firstDay = Calendar.SUNDAY;
+
private Integer firstHour = 8;
+
private String headerCenter = "title";
+
private String headerLeft = "prevYear,nextYear";
+
private String headerRight = "basicDay,basicWeek agendaDay,agendaWeek month today prev,next";
+
private Integer height = 400;
+
+ private Date initialDate;
+
private boolean isRTL;
- private Integer maxTime = 17;
- private Integer minTime = 8;
- private Integer slotMinutes = 30;
- private String columnFormat = null;
- private String titleFormat = null;
- private String timeFormat = null;
- private String view = AbstractSchedule.VIEW_MONTH;
- private String locale;
- private CustomScheduleListener additionalListener = new CustomScheduleListener();
- private int taskIdSequence = 1;
- public Bean() {
- Calendar instance = Calendar.getInstance();
- instance.setTime(getInitialDate());
- Random random = new Random();
- for (int i = -30; i < 60; i++) {
- instance.set(Calendar.HOUR, minTime + random.nextInt(maxTime - minTime));
- instance.set(Calendar.MINUTE, random.nextInt(59));
- instance.add(Calendar.DAY_OF_YEAR, 1);
- Map<String, Object> data = new HashMap<String, Object>();
- data.put("category", "category-" + (i % 3));
- int taskId = taskIdSequence++;
- allTasks.add(new ScheduleTask("" + taskId, "Title " + taskId, instance.getTime(), instance.getTime(), data));
- }
- }
+ private ExtendedDataModel lazyDataModel = new MyDataModel();
- public Boolean taskMoved(ScheduleItemMoveEvent event) {
- System.out.println("taskMoved invoked " + event + " : " + isAllowTaskMoving());
- if (isAllowTaskMoving()) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Item moved", event.toString()));
- ScheduleTask task = getTask(event.getEventId());
- selectedEventId = event.getEventId();
- if (task != null) {
- boolean endDateEqualsStartDate = task.getStartDate().equals(task.getEndDate());
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(task.getStartDate());
- calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
- calendar.add(Calendar.MINUTE, event.getMinuteDelta());
- task.setStartDate(calendar.getTime());
- if (!event.isAllDay() && endDateEqualsStartDate) {
- calendar.setTime(task.getStartDate());
- calendar.add(Calendar.MINUTE, getDefaultEventMinutes());
- } else {
- calendar.setTime(task.getEndDate());
- calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
- calendar.add(Calendar.MINUTE, event.getMinuteDelta());
- }
- task.setEndDate(calendar.getTime());
- task.setAllDay(event.isAllDay());
- }
- } else {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to move this item", event.toString()));
- }
- return isAllowTaskMoving();
- }
+ private String locale;
- public Boolean taskResized(ScheduleItemResizeEvent event) {
- System.out.println("taskResized invoked " + event + " : " + isAllowTaskResizing());
- if (isAllowTaskResizing()) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Item resized", event.toString()));
- ScheduleTask task = getTask(event.getEventId());
- selectedEventId = event.getEventId();
- if (task != null) {
- Calendar calendar = Calendar.getInstance();
- Date date = task.getEndDate() == null ? task.getStartDate() : task.getEndDate();
- calendar.setTime(date);
- calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
- calendar.add(Calendar.MINUTE, event.getMinuteDelta());
- task.setEndDate(calendar.getTime());
- }
- } else {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to resize this item", event.toString()));
- }
- return isAllowTaskResizing();
- }
+ private Integer maxTime = 17;
- public void viewChanged(ScheduleViewChangeEvent event) {
- System.out.println("viewChanged invoked " + event);
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("View changed", event.toString()));
- setView(event.getView());
- }
+ private Integer minTime = 8;
- public void taskSelected(ScheduleItemSelectEvent event) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Task selected", event.toString()));
- selectedEventId = event.getEventId();
- }
+ private Boolean selectHelper = true;
- public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date range changed", event.toString()));
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(event.getStartDate());
- if (AbstractSchedule.VIEW_MONTH.equals(getView())) {
- calendar.add(Calendar.DATE, 15);
- }
- setInitialDate(calendar.getTime());
- }
+ private Boolean selectable = true;
- public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
- if (editable) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date range selected", event.toString()));
- int taskId = taskIdSequence++;
- allTasks.add(new ScheduleTask("" + taskId, "Title-" + taskId, event.getStartDate(), event.getEndDate(), event.isAllDay()));
- } else {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Date range selected", "Cannot create item. Not in edit mode."));
- }
- }
+ private String selectedEventId;
- public void dateSelected(ScheduleDateSelectEvent event) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date selected", event.toString()));
- setInitialDate(event.getDate());
- }
+ private boolean showWeekends;
- public ScheduleTask getSelectedTask() {
- return getTask(getSelectedEventId());
- }
+ private Integer slotMinutes = 30;
- protected ScheduleTask getTask(String id) {
- if (id == null) {
- return null;
- }
- for (ScheduleTask task : allTasks) {
- if (id.equals(task.getId())) {
- return task;
- }
- }
- return null;
- }
+ private String switchType = "ajax";
- public String getText() {
- return text;
- }
+ private int taskIdSequence = 1;
- public void setText(String text) {
- this.text = text;
- }
+ private String text;
- public List<ScheduleTask> getAllEvents() {
- return allTasks;
- }
+ private String timeFormat = null;
- public ExtendedDataModel getLazyDataModel() {
- return lazyDataModel;
- }
+ private String titleFormat = null;
- public boolean isAllowTaskMoving() {
- return allowTaskMoving;
- }
+ private Boolean unselectAuto = true;
- public void setAllowTaskMoving(boolean allowTaskMoving) {
- this.allowTaskMoving = allowTaskMoving;
- }
+ private String unselectCancel = "";
- public boolean isAllowTaskResizing() {
- return allowTaskResizing;
- }
+ private String view = AbstractSchedule.VIEW_MONTH;
- public void setAllowTaskResizing(boolean allowTaskResizing) {
- this.allowTaskResizing = allowTaskResizing;
- }
+ private String weekMode = AbstractSchedule.WEEK_MODE_FIXED;
- public String getSelectedEventId() {
- return selectedEventId;
- }
+// --------------------------- CONSTRUCTORS ---------------------------
- public Date getInitialDate() {
- if (initialDate == null) {
- Calendar instance = Calendar.getInstance();
- instance.set(Calendar.YEAR, 2012);
- instance.set(Calendar.MONTH, 7);
- instance.set(Calendar.DATE, 22);
- initialDate = instance.getTime();
+ public Bean() {
+ Calendar instance = Calendar.getInstance();
+ instance.setTime(getInitialDate());
+ Random random = new Random();
+ for (int i = -30; i < 60; i++) {
+ instance.set(Calendar.HOUR, minTime + random.nextInt(maxTime - minTime));
+ instance.set(Calendar.MINUTE, random.nextInt(59));
+ instance.add(Calendar.DAY_OF_YEAR, 1);
+ Map<String, Object> data = new HashMap<String, Object>();
+ data.put("category", "category-" + (i % 3));
+ int taskId = taskIdSequence++;
+ allTasks.add(new ScheduleTask("" + taskId, "Title " + taskId, instance.getTime(), instance.getTime(), data));
}
- return initialDate;
}
- public int getFirstDay() {
- return firstDay;
- }
+// --------------------- GETTER / SETTER METHODS ---------------------
- public void setFirstDay(int firstDay) {
- this.firstDay = firstDay;
+ public CustomScheduleListener getAdditionalListener() {
+ return additionalListener;
}
- public boolean isShowWeekends() {
- return showWeekends;
+ public boolean getAllDayByDefault() {
+ return allDayByDefault;
}
- public void setShowWeekends(boolean showWeekends) {
- this.showWeekends = showWeekends;
+ public void setAllDayByDefault(boolean allDayByDefault) {
+ this.allDayByDefault = allDayByDefault;
}
- public void setInitialDate(Date initialDate) {
- this.initialDate = initialDate;
+ public boolean getAllDaySlot() {
+ return allDaySlot;
}
- public String getWeekMode() {
- return weekMode;
+ public void setAllDaySlot(boolean allDaySlot) {
+ this.allDaySlot = allDaySlot;
}
- public void setWeekMode(String weekMode) {
- this.weekMode = weekMode;
+ public String getAllDayText() {
+ return allDayText;
}
public void setAllDayText(String allDayText) {
this.allDayText = allDayText;
}
- public String getAllDayText() {
- return allDayText;
+ public Double getAspectRatio() {
+ return aspectRatio;
}
- public void setAllDayByDefault(boolean allDayByDefault) {
- this.allDayByDefault = allDayByDefault;
- }
-
- public boolean getAllDayByDefault() {
- return allDayByDefault;
- }
-
- public void setAllDaySlot(boolean allDaySlot) {
- this.allDaySlot = allDaySlot;
- }
-
- public boolean getAllDaySlot() {
- return allDaySlot;
- }
-
public void setAspectRatio(Double aspectRatio) {
this.aspectRatio = aspectRatio;
}
- public Double getAspectRatio() {
- return aspectRatio;
+ public String getAxisFormat() {
+ return axisFormat;
}
public void setAxisFormat(String axisFormat) {
this.axisFormat = axisFormat;
}
- public String getAxisFormat() {
- return axisFormat;
+ public String getColumnFormat() {
+ return columnFormat;
}
- public void setDefaultEventMinutes(Integer defaultEventMinutes) {
- this.defaultEventMinutes = defaultEventMinutes;
+ public void setColumnFormat(String columnFormat) {
+ this.columnFormat = columnFormat;
}
- public Integer getDefaultEventMinutes() {
- return defaultEventMinutes;
+ public Integer getContentHeight() {
+ return contentHeight;
}
public void setContentHeight(Integer contentHeight) {
this.contentHeight = contentHeight;
}
- public Integer getContentHeight() {
- return contentHeight;
+ public Integer getDefaultEventMinutes() {
+ return defaultEventMinutes;
}
- public void setDragOpacity(Double dragOpacity) {
- this.dragOpacity = dragOpacity;
+ public void setDefaultEventMinutes(Integer defaultEventMinutes) {
+ this.defaultEventMinutes = defaultEventMinutes;
}
public Double getDragOpacity() {
return dragOpacity;
}
- public void setDragRevertDuration(Integer dragRevertDuration) {
- this.dragRevertDuration = dragRevertDuration;
+ public void setDragOpacity(Double dragOpacity) {
+ this.dragOpacity = dragOpacity;
}
public Integer getDragRevertDuration() {
return dragRevertDuration;
}
- public void setEditable(Boolean editable) {
- this.editable = editable;
+ public void setDragRevertDuration(Integer dragRevertDuration) {
+ this.dragRevertDuration = dragRevertDuration;
}
public Boolean getEditable() {
return editable;
}
- public void setSelectable(Boolean selectable) {
- this.selectable = selectable;
+ public void setEditable(Boolean editable) {
+ this.editable = editable;
}
- public Boolean getSelectable() {
- return selectable;
+ public int getFirstDay() {
+ return firstDay;
}
- public void setFirstHour(Integer firstHour) {
- this.firstHour = firstHour;
+ public void setFirstDay(int firstDay) {
+ this.firstDay = firstDay;
}
public Integer getFirstHour() {
return firstHour;
}
- public void setHeaderCenter(String headerCenter) {
- this.headerCenter = headerCenter;
+ public void setFirstHour(Integer firstHour) {
+ this.firstHour = firstHour;
}
public String getHeaderCenter() {
return headerCenter;
}
- public void setHeaderLeft(String headerLeft) {
- this.headerLeft = headerLeft;
+ public void setHeaderCenter(String headerCenter) {
+ this.headerCenter = headerCenter;
}
public String getHeaderLeft() {
return headerLeft;
}
- public void setHeaderRight(String headerRight) {
- this.headerRight = headerRight;
+ public void setHeaderLeft(String headerLeft) {
+ this.headerLeft = headerLeft;
}
public String getHeaderRight() {
return headerRight;
}
- public void setHeight(Integer height) {
- this.height = height;
+ public void setHeaderRight(String headerRight) {
+ this.headerRight = headerRight;
}
public Integer getHeight() {
return height;
}
- public void setIsRTL(Boolean isRTL) {
- this.isRTL = isRTL;
+ public void setHeight(Integer height) {
+ this.height = height;
}
+ public Date getInitialDate() {
+ if (initialDate == null) {
+ Calendar instance = Calendar.getInstance();
+ instance.set(Calendar.YEAR, 2012);
+ instance.set(Calendar.MONTH, 7);
+ instance.set(Calendar.DATE, 22);
+ initialDate = instance.getTime();
+ }
+ return initialDate;
+ }
+
+ public void setInitialDate(Date initialDate) {
+ this.initialDate = initialDate;
+ }
+
public Boolean getIsRTL() {
return isRTL;
}
- public void setMaxTime(Integer maxTime) {
- this.maxTime = maxTime;
+ public void setIsRTL(Boolean isRTL) {
+ this.isRTL = isRTL;
}
+ public ExtendedDataModel getLazyDataModel() {
+ return lazyDataModel;
+ }
+
+ public String getLocale() {
+ if (locale == null) {
+ locale = FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
+ }
+ return locale;
+ }
+
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
public Integer getMaxTime() {
return maxTime;
}
- public void setMinTime(Integer minTime) {
- this.minTime = minTime;
+ public void setMaxTime(Integer maxTime) {
+ this.maxTime = maxTime;
}
public Integer getMinTime() {
return minTime;
}
- public void setSlotMinutes(Integer slotMinutes) {
- this.slotMinutes = slotMinutes;
+ public void setMinTime(Integer minTime) {
+ this.minTime = minTime;
}
+ public Boolean getSelectHelper() {
+ return selectHelper;
+ }
+
+ public void setSelectHelper(Boolean selectHelper) {
+ this.selectHelper = selectHelper;
+ }
+
+ public Boolean getSelectable() {
+ return selectable;
+ }
+
+ public void setSelectable(Boolean selectable) {
+ this.selectable = selectable;
+ }
+
+ public String getSelectedEventId() {
+ return selectedEventId;
+ }
+
public Integer getSlotMinutes() {
return slotMinutes;
}
- public void setView(String view) {
- this.view = view;
+ public void setSlotMinutes(Integer slotMinutes) {
+ this.slotMinutes = slotMinutes;
}
- public String getView() {
- return view;
+ public String getSwitchType() {
+ return switchType;
}
- public String getColumnFormat() {
- return columnFormat;
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
}
- public void setColumnFormat(String columnFormat) {
- this.columnFormat = columnFormat;
+ public String getText() {
+ return text;
}
- public String getTitleFormat() {
- return titleFormat;
+ public void setText(String text) {
+ this.text = text;
}
- public void setTitleFormat(String titleFormat) {
- this.titleFormat = titleFormat;
- }
-
public String getTimeFormat() {
return timeFormat;
}
@@ -460,18 +383,14 @@
this.timeFormat = timeFormat;
}
- public CustomScheduleListener getAdditionalListener() {
- return additionalListener;
+ public String getTitleFormat() {
+ return titleFormat;
}
- public Boolean getSelectHelper() {
- return selectHelper;
+ public void setTitleFormat(String titleFormat) {
+ this.titleFormat = titleFormat;
}
- public void setSelectHelper(Boolean selectHelper) {
- this.selectHelper = selectHelper;
- }
-
public Boolean getUnselectAuto() {
return unselectAuto;
}
@@ -488,122 +407,166 @@
this.unselectCancel = unselectCancel;
}
- public String getLocale() {
- if (locale == null) {
- locale = FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
- }
- return locale;
+ public String getView() {
+ return view;
}
- public void setLocale(String locale) {
- this.locale = locale;
+ public void setView(String view) {
+ this.view = view;
}
- private class MyDataModel extends ExtendedDataModel implements Serializable {
+ public String getWeekMode() {
+ return weekMode;
+ }
- Object rowKey;
- java.util.Map wrappedDataMap = new HashMap();
- java.util.Map indexToRowKey = new HashMap();
- java.util.Map rowKeyToIndex = new HashMap();
- int rowCount = -1;
- int rowIndex = -1;
+ public void setWeekMode(String weekMode) {
+ this.weekMode = weekMode;
+ }
- @Override
- public void setRowKey(Object key) {
- this.rowKey = key;
- Integer index = (Integer) rowKeyToIndex.get(key);
- if (index == null) {
- index = -1;
- }
- if (index != getRowIndex()) {
- setRowIndex(rowIndex);
- }
+ public boolean isAllowTaskMoving() {
+ return allowTaskMoving;
+ }
+
+ public void setAllowTaskMoving(boolean allowTaskMoving) {
+ this.allowTaskMoving = allowTaskMoving;
+ }
+
+ public boolean isAllowTaskResizing() {
+ return allowTaskResizing;
+ }
+
+ public void setAllowTaskResizing(boolean allowTaskResizing) {
+ this.allowTaskResizing = allowTaskResizing;
+ }
+
+ public boolean isShowWeekends() {
+ return showWeekends;
+ }
+
+ public void setShowWeekends(boolean showWeekends) {
+ this.showWeekends = showWeekends;
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
+ public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date range changed", event.toString()));
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(event.getStartDate());
+ if (AbstractSchedule.VIEW_MONTH.equals(getView())) {
+ calendar.add(Calendar.DATE, 15);
}
+ setInitialDate(calendar.getTime());
+ }
- @Override
- public Object getRowKey() {
- return rowKey;
+ public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
+ if (editable) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date range selected", event.toString()));
+ int taskId = taskIdSequence++;
+ allTasks.add(new ScheduleTask("" + taskId, "Title-" + taskId, event.getStartDate(), event.getEndDate(), event.isAllDay()));
+ } else {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Date range selected", "Cannot create item. Not in edit mode."));
}
+ }
- @Override
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
- Date startDate = ((DateRange) range).getStartDate();
- Date endDate = ((DateRange) range).getEndDate();
- wrappedDataMap.clear();
- indexToRowKey.clear();
- rowKeyToIndex.clear();
- int i = 0;
- for (ScheduleTask task : allTasks) {
- if ((startDate == null || task.getStartDate().compareTo(startDate) >= 0) && (endDate == null || task.getStartDate().compareTo(endDate) < 0)) {
- wrappedDataMap.put(task.getId(), task);
- int index = i++;
- indexToRowKey.put(index, task.getId());
- rowKeyToIndex.put(task.getId(), index);
- visitor.process(context, task.getId(), argument);
+ public void dateSelected(ScheduleDateSelectEvent event) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date selected", event.toString()));
+ setInitialDate(event.getDate());
+ }
+
+ public List<ScheduleTask> getAllEvents() {
+ return allTasks;
+ }
+
+ public ScheduleTask getSelectedTask() {
+ return getTask(getSelectedEventId());
+ }
+
+ public Boolean taskMoved(ScheduleItemMoveEvent event) {
+ System.out.println("taskMoved invoked " + event + " : " + isAllowTaskMoving());
+ if (isAllowTaskMoving()) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Item moved", event.toString()));
+ ScheduleTask task = getTask(event.getEventId());
+ selectedEventId = event.getEventId();
+ if (task != null) {
+ boolean endDateEqualsStartDate = task.getStartDate().equals(task.getEndDate());
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(task.getStartDate());
+ calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
+ calendar.add(Calendar.MINUTE, event.getMinuteDelta());
+ task.setStartDate(calendar.getTime());
+ if (!event.isAllDay() && endDateEqualsStartDate) {
+ calendar.setTime(task.getStartDate());
+ calendar.add(Calendar.MINUTE, getDefaultEventMinutes());
+ } else {
+ calendar.setTime(task.getEndDate());
+ calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
+ calendar.add(Calendar.MINUTE, event.getMinuteDelta());
}
+ task.setEndDate(calendar.getTime());
+ task.setAllDay(event.isAllDay());
}
- rowCount = -1;
+ } else {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to move this item", event.toString()));
}
+ return isAllowTaskMoving();
+ }
- @Override
- public boolean isRowAvailable() {
- if (getRowKey() == null) {
- return false;
- } else {
- return null != wrappedDataMap.get(getRowKey());
+ public Boolean taskResized(ScheduleItemResizeEvent event) {
+ System.out.println("taskResized invoked " + event + " : " + isAllowTaskResizing());
+ if (isAllowTaskResizing()) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Item resized", event.toString()));
+ ScheduleTask task = getTask(event.getEventId());
+ selectedEventId = event.getEventId();
+ if (task != null) {
+ Calendar calendar = Calendar.getInstance();
+ Date date = task.getEndDate() == null ? task.getStartDate() : task.getEndDate();
+ calendar.setTime(date);
+ calendar.add(Calendar.DAY_OF_MONTH, event.getDayDelta());
+ calendar.add(Calendar.MINUTE, event.getMinuteDelta());
+ task.setEndDate(calendar.getTime());
}
+ } else {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "It is not allowed to resize this item", event.toString()));
}
+ return isAllowTaskResizing();
+ }
- @Override
- public int getRowCount() {
- if (rowCount == -1) {
- rowCount = wrappedDataMap.size();
- }
- return rowCount;
- }
+ public void taskSelected(ScheduleItemSelectEvent event) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Task selected", event.toString()));
+ selectedEventId = event.getEventId();
+ }
- @Override
- public Object getRowData() {
- if (getRowKey() == null) {
- return null;
- } else {
- return wrappedDataMap.get(getRowKey());
- }
- }
+ public void viewChanged(ScheduleViewChangeEvent event) {
+ System.out.println("viewChanged invoked " + event);
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("View changed", event.toString()));
+ setView(event.getView());
+ }
- @Override
- public int getRowIndex() {
- return rowIndex;
+ protected ScheduleTask getTask(String id) {
+ if (id == null) {
+ return null;
}
-
- @Override
- public void setRowIndex(int rowIndex) {
- this.rowIndex = rowIndex;
- Object key = indexToRowKey.get(rowIndex);
- if ((key != null && !key.equals(getRowKey())) || (key == null && getRowKey() != null)) {
- setRowKey(key);
+ for (ScheduleTask task : allTasks) {
+ if (id.equals(task.getId())) {
+ return task;
}
}
+ return null;
+ }
- @Override
- public Object getWrappedData() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
+// -------------------------- INNER CLASSES --------------------------
- @Override
- public void setWrappedData(Object data) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- }
-
public static class CustomScheduleListener implements ScheduleDateRangeChangeListener, ScheduleDateSelectListener, ScheduleItemMoveListener, ScheduleItemResizeListener, ScheduleItemSelectListener, ScheduleViewChangeListener, ScheduleDateRangeSelectListener, Serializable {
+// ------------------------------ FIELDS ------------------------------
private static FacesEvent recentlyProcessedEvent;
- private void addMessage(String text, Severity severity) {
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity, "Additional listener", text));
- }
+// ------------------------ INTERFACE METHODS ------------------------
+
+// --------------------- Interface ScheduleDateRangeChangeListener ---------------------
+
public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -611,6 +574,17 @@
}
}
+// --------------------- Interface ScheduleDateRangeSelectListener ---------------------
+
+ public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
+ if (event != recentlyProcessedEvent) {
+ recentlyProcessedEvent = event;
+ addMessage(event.toString(), FacesMessage.SEVERITY_INFO);
+ }
+ }
+
+// --------------------- Interface ScheduleDateSelectListener ---------------------
+
public void dateSelected(ScheduleDateSelectEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -618,6 +592,8 @@
}
}
+// --------------------- Interface ScheduleItemMoveListener ---------------------
+
public void itemMove(ScheduleItemMoveEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -625,6 +601,8 @@
}
}
+// --------------------- Interface ScheduleItemResizeListener ---------------------
+
public void itemResize(ScheduleItemResizeEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -632,6 +610,8 @@
}
}
+// --------------------- Interface ScheduleItemSelectListener ---------------------
+
public void itemSelected(ScheduleItemSelectEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -639,6 +619,8 @@
}
}
+// --------------------- Interface ScheduleViewChangeListener ---------------------
+
public void viewChanged(ScheduleViewChangeEvent event) {
if (event != recentlyProcessedEvent) {
recentlyProcessedEvent = event;
@@ -646,11 +628,115 @@
}
}
- public void dateRangeSelected(ScheduleDateRangeSelectEvent event) {
- if (event != recentlyProcessedEvent) {
- recentlyProcessedEvent = event;
- addMessage(event.toString(), FacesMessage.SEVERITY_INFO);
+ private void addMessage(String text, Severity severity) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity, "Additional listener", text));
+ }
+ }
+
+ private class MyDataModel extends ExtendedDataModel implements Serializable {
+// ------------------------------ FIELDS ------------------------------
+
+ java.util.Map indexToRowKey = new HashMap();
+
+ int rowCount = -1;
+
+ int rowIndex = -1;
+
+ Object rowKey;
+
+ java.util.Map rowKeyToIndex = new HashMap();
+
+ java.util.Map wrappedDataMap = new HashMap();
+
+// --------------------- GETTER / SETTER METHODS ---------------------
+
+ @Override
+ public int getRowCount() {
+ if (rowCount == -1) {
+ rowCount = wrappedDataMap.size();
}
+ return rowCount;
}
+
+ @Override
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ @Override
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
+ @Override
+ public Object getRowData() {
+ if (getRowKey() == null) {
+ return null;
+ } else {
+ return wrappedDataMap.get(getRowKey());
+ }
+ }
+
+ @Override
+ public Object getWrappedData() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isRowAvailable() {
+ if (getRowKey() == null) {
+ return false;
+ } else {
+ return null != wrappedDataMap.get(getRowKey());
+ }
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ this.rowIndex = rowIndex;
+ Object key = indexToRowKey.get(rowIndex);
+ if ((key != null && !key.equals(getRowKey())) || (key == null && getRowKey() != null)) {
+ setRowKey(key);
+ }
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ this.rowKey = key;
+ Integer index = (Integer) rowKeyToIndex.get(key);
+ if (index == null) {
+ index = -1;
+ }
+ if (index != getRowIndex()) {
+ setRowIndex(rowIndex);
+ }
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
+ Date startDate = ((DateRange) range).getStartDate();
+ Date endDate = ((DateRange) range).getEndDate();
+ wrappedDataMap.clear();
+ indexToRowKey.clear();
+ rowKeyToIndex.clear();
+ int i = 0;
+ for (ScheduleTask task : allTasks) {
+ if ((startDate == null || task.getStartDate().compareTo(startDate) >= 0) && (endDate == null || task.getStartDate().compareTo(endDate) < 0)) {
+ wrappedDataMap.put(task.getId(), task);
+ int index = i++;
+ indexToRowKey.put(index, task.getId());
+ rowKeyToIndex.put(task.getId(), index);
+ visitor.process(context, task.getId(), argument);
+ }
+ }
+ rowCount = -1;
+ }
}
}
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/index.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,11 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<ui:include src="settingsPanel.xhtml"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/menu.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,40 +1,26 @@
-<ui:component xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:notify="http://richfaces.org/notify">
+<ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html" xmlns:notify="http://richfaces.org/sandbox/notify">
<div>
<h:panelGrid columns="10" style="width:100%;">
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/index.jsf">Ajax mode
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/index.jsf">Ajax mode
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_1.jsf">Server mode
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_1.jsf">Server mode
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_2.jsf">Client mode
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_2.jsf">Client mode
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_3.jsf">Customization per view
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_3.jsf">Customization per view
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_4.jsf">Client side callbacks
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_4.jsf">Client side callbacks
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_5.jsf">Fetch additional data
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_5.jsf">Fetch additional data
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_6.jsf">With modal panel
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_6.jsf">With modal panel
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_7.jsf">Internationalization
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_7.jsf">Internationalization
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_8.jsf">JavaScript API
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_8.jsf">JavaScript API
</h:outputLink>
- <h:outputLink
- value="#{facesContext.externalContext.requestContextPath}/pages/sample_9.jsf">3 in 1
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/pages/sample_9.jsf">3 in 1
</h:outputLink>
</h:panelGrid>
</div>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_1.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:schedule="http://richfaces.org/schedule"
- xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<style type="text/css">
@@ -17,8 +12,7 @@
<p>
Notice that in this mode, we will have entire shedule re rendered on date navigation,
so "date" attribute should be updated on DateRangeChangeEvent.
- This can be achieved by binding following listener method to "dateRangeChangeListener" attribtue:
- </p>
+ This can be achieved by binding following listener method to "dateRangeChangeListener" attribtue: </p>
<pre>
public void dateRangeChanged(ScheduleDateRangeChangeEvent event) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Date range changed", event.toString()));
@@ -32,22 +26,15 @@
</pre>
<p>
Right schedule does not have "dateRangeChangeListener" attribute bound, so after
- re render it stays on the initial date.
- </p>
+ re render it stays on the initial date. </p>
<ui:include src="settingsPanel.xhtml"/>
<ui:include src="schedule.xhtml">
<ui:param name="mode" value="server"/>
</ui:include>
<h:form>
- <schedule:schedule switchType="server"
- value="#{myBean.lazyDataModel}"
- var="event"
- date="#{myBean.initialDate}"
- styleClass="slim"
- >
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:schedule switchType="server" value="#{myBean.lazyDataModel}" var="event" date="#{myBean.initialDate}" styleClass="slim">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
</schedule:schedule>
</h:form>
</ui:define>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_2.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,13 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- xmlns:schedule="http://labs.jboss.com/jbossrichfaces/ui/ui/schedule"
- >
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<ui:include src="settingsPanel.xhtml"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_3.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,48 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:schedule="http://richfaces.org/schedule">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<p>Different views can have different display options.
- This can be achieved by inserting appropriate tags within schedule tag.
- </p>
+ This can be achieved by inserting appropriate tags within schedule tag. </p>
<h:form>
- <schedule:schedule switchType="client"
- value="#{myBean.lazyDataModel}" var="event"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next"
- date="#{myBean.initialDate}"
- editable="true"
+ <schedule:schedule switchType="client" value="#{myBean.lazyDataModel}" var="event" headerCenter="title" headerLeft="prevYear,nextYear"
+ headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next" date="#{myBean.initialDate}" editable="true"
- dragOpacity="#{myBean.dragOpacity}"
- columnFormat="#{myBean.columnFormat}"
- titleFormat="#{myBean.titleFormat}"
- timeFormat="#{myBean.timeFormat}"
- >
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
- <schedule:scheduleMonthView weekMode="#{myBean.weekMode}" titleFormat="MMM/yyyy" timeFormat="h:mt"
- columnFormat="ddd" dragOpacity=".1"/>
- <schedule:scheduleAgendaDayView titleFormat="dd/MM/yyyy" timeFormat="hh:m:s{ - hh:m:s}"
- columnFormat="dd/MMM" dragOpacity=".3"/>
- <schedule:scheduleBasicDayView titleFormat="d/M/yy" timeFormat="h:mm:ss" columnFormat="d/MM"
- dragOpacity=".5"/>
- <schedule:scheduleAgendaWeekView titleFormat="MMM d[ yyyy]{ '—'[ MMM] d[ yyyy]}"
- timeFormat="HH:mm{ - HH:mm}" columnFormat="dd/MM" dragOpacity=".7"/>
- <schedule:scheduleBasicWeekView titleFormat="d/M/yy{ '—'d/M/yy}" timeFormat="h(:mm)tt"
- columnFormat="d/M" dragOpacity=".9"/>
+ dragOpacity="#{myBean.dragOpacity}" columnFormat="#{myBean.columnFormat}" titleFormat="#{myBean.titleFormat}"
+ timeFormat="#{myBean.timeFormat}">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:scheduleMonthView weekMode="#{myBean.weekMode}" titleFormat="MMM/yyyy" timeFormat="h:mt" columnFormat="ddd" dragOpacity=".1"/>
+ <schedule:scheduleAgendaDayView titleFormat="dd/MM/yyyy" timeFormat="hh:m:s{ - hh:m:s}" columnFormat="dd/MMM" dragOpacity=".3"/>
+ <schedule:scheduleBasicDayView titleFormat="d/M/yy" timeFormat="h:mm:ss" columnFormat="d/MM" dragOpacity=".5"/>
+ <schedule:scheduleAgendaWeekView titleFormat="MMM d[ yyyy]{ '—'[ MMM] d[ yyyy]}" timeFormat="HH:mm{ - HH:mm}" columnFormat="dd/MM"
+ dragOpacity=".7"/>
+ <schedule:scheduleBasicWeekView titleFormat="d/M/yy{ '—'d/M/yy}" timeFormat="h(:mm)tt" columnFormat="d/M" dragOpacity=".9"/>
</schedule:schedule>
</h:form>
- <rich:insert src="/pages/sample_3.xhtml" highlight="xhtml"/>
+ <!--<rich:insert src="/pages/sample_3.xhtml" highlight="xhtml"/>-->
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_4.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- xmlns:schedule="http://richfaces.org/schedule">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<style type="text/css">
@@ -23,69 +18,85 @@
font-size: 12px;
}
+ #log {
+ float: left;
+ width: 400px;
+ }
+
+ #log div {
+ border-bottom: 1px solid #000;
+ }
</style>
<script type="text/javascript">
+ function clearLog() {
+ jQuery("#log").html("");
+ }
function notify(action, text, timeToStay) {
- RichFaces.Notify({title:action,text:text,sticky:false,styleClass:'rf-ny-info',stayTime:timeToStay});
+ jQuery("#log").append("<div>" + action + ": " + text + "</div>");
+ // RichFaces.Notify({title:action,text:text,sticky:false,styleClass:'rf-ny-info',stayTime:timeToStay});
}
function blockEvent(item, event, action) {
- RichFaces.Notify({title:action,text:item.title,sticky:false,styleClass:'rf-ny-error'});
+ notify(action, item.title + " - blocked");
+ // RichFaces.Notify({title:action,text:item.title,sticky:false,styleClass:'rf-ny-error'});
}
- function viewChanged(view) {
+ function onviewchange(view) {
notify('View changed', view.name);
}
- function daySelected(date, allDay, event, view) {
+ function onbeforedateselect(date, allDay, event, view) {
notify('Day select', toString(date) + ' ' + (allDay ? 'with all day slot' : ''));
}
- function daySelectedComplete(date, allDay, event, view, data) {
+ function ondateselect(date, allDay, event, view, data) {
notify('Day select complete', toString(date) + ' ' + (allDay ? 'with all day slot' : '') + ";data=" + toString(data));
}
- function itemSelected(item, event, view) {
- notify("Item selected", "item:" + item.title + ";event=" + event.type + ";view:" + view.name);
+ function onbeforeitemselect(item, event, view) {
+ notify("onbeforeitemselect", "item:" + item.title + ";event=" + event.type + ";view:" + view.name);
}
- function itemSelectedComplete(item, event, view, data) {
- notify("Item selected complete", "item:" + item.title + ";event=" + event.type + ";view:" + view.name + ";data=" + toString(data));
+ function onitemselect(item, event, view, data) {
+ notify("onitemselect", "item:" + item.title + ";event=" + event.type + ";view:" + view.name + ";data=" + toString(data));
}
- function itemResized(item, dayDelta, minuteDelta, event, ui, view) {
- notify("Item resized", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
+ function onbeforeitemresize(item, dayDelta, minuteDelta, event, ui, view) {
+ notify("onbeforeitemresize", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
}
- function itemResizedComplete(item, dayDelta, minuteDelta, vetoed, event, ui, view, data) {
- notify("Item resized complete", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";vetoed=" + vetoed + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name + ";data=" + toString(data));
+ function onitemresize(item, dayDelta, minuteDelta, vetoed, event, ui, view, data) {
+ notify("onitemresize", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";vetoed=" + vetoed + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name + ";data=" + toString(data));
}
- function itemDrop(item, dayDelta, minuteDelta, allDay, event, ui, view) {
- notify("Item drop", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";allDay=" + allDay + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
+ function onbeforeitemdrop(item, dayDelta, minuteDelta, allDay, event, ui, view) {
+ notify("onbeforeitemdrop", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";allDay=" + allDay + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
}
- function itemDropComplete(item, dayDelta, minuteDelta, allDay, vetoed, event, ui, view, data) {
- notify("Item drop complete", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";allDay=" + allDay + ";vetoed=" + vetoed + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name + ";data=" + toString(data));
+ function onitemdrop(item, dayDelta, minuteDelta, allDay, vetoed, event, ui, view, data) {
+ notify("onitemdrop", "item:" + item.title + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";allDay=" + allDay + ";vetoed=" + vetoed + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name + ";data=" + toString(data));
}
- function dragStart(item, event, ui, view) {
- notify("Item drag start", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
+ function onitemdragstart(item, event, ui, view) {
+ notify("onitemdragstart", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
}
- function dragStop(item, event, ui, view) {
- notify("Item drag stop", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
+ function onitemdragstop(item, event, ui, view) {
+ notify("onitemdragstop", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
}
- function itemResizeStart(item, event, ui, view) {
- notify("Item resize start", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
+ function onitemresizestart(item, event, ui, view) {
+ notify("onitemresizestart", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
}
- function itemResizeStop(item, event, ui, view) {
- notify("Item resize stop", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
+ function onitemresizestop(item, event, ui, view) {
+ notify("onitemresizestop", "item:" + item.title + ";event=" + event.type + ";ui=" + ui + ";view:" + view.name);
}
- function itemMouseover(item) {
- notify('Mouseover', item.title, 1000);
+ function onitemmouseover(item) {
+ notify("onitemmouseover", item.title, 1000);
}
- function itemMouseout(item) {
- notify('Mouseout', item.title, 1000);
+ function onitemmouseout(item) {
+ notify("onitemmouseout", item.title, 1000);
}
- function dateRangeSelected(startDate, endDate, allDay, view) {
- notify('Date range selected', toString(startDate) + " - " + toString(endDate) + "; " + (allDay ? "all day" : "not all day") + ";view:" + view.name);
+ function ondaterangeselect(startDate, endDate, allDay, view, data) {
+ notify("ondaterangeselect", toString(startDate) + " - " + toString(endDate) + "; " + (allDay ? "all day" : "not all day") + ";view:" + view.name + ";data=" + toString(data));
}
- function dateRangeSelectedComplete(startDate, endDate, allDay, view, data) {
- notify('Date range selected complete', toString(startDate) + " - " + toString(endDate) + "; " + (allDay ? "all day" : "not all day") + ";view:" + view.name + ";data=" + toString(data));
+ function onbeforedaterangeselect(startDate, endDate, allDay, view) {
+ notify('onbeforedaterangeselect', toString(startDate) + " - " + toString(endDate) + "; " + (allDay ? "all day" : "not all day") + ";view:" + view.name);
}
- function dateRangeChanged(startDate, endDate) {
- notify('Date range changed', toString(startDate) + " - " + toString(endDate));
+ function ondaterangechange(startDate, endDate) {
+ notify('ondaterangechange', toString(startDate) + " - " + toString(endDate));
}
+ function onviewdisplay(view) {
+ notify('onviewdisplay', view);
+ }
function toString(object) {
if (object instanceof Date) {
return object.getFullYear() + "/" + object.getMonth() + "/" + object.getDate() + " " + object.getHours() + ":" + object.getMinutes();
@@ -102,82 +113,65 @@
</script>
<p>
Furst schedule's JavaScript callbacks do not veto
- any event and just notify user (veto may be raised by server side listener).
- </p>
+ any event and just notify user (veto may be raised by server side listener). </p>
<p>
Second schedule's JavaScript callbacks <b>veto</b>
- all events.
- </p>
-
+ all events. </p>
+ <input type="button" value="Clear log" onclick="clearLog()"/>
<h:form>
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}" var="event"
- date="#{myBean.initialDate}"
- editable="true"
- selectable="true"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next"
- itemResizeListener="#{myBean.taskResized}"
- itemMoveListener="#{myBean.taskMoved}"
- data="#{myBean.allDayText}"
- eventsQueue="schedule1"
- onbeforeitemselect="itemSelected(item,event,view)"
- onitemselect="itemSelectedComplete(item,event,view,data)"
- onbeforeitemresize="itemResized(item,dayDelta,minuteDelta,event,ui,view)"
- onitemresize="itemResizedComplete(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
- onbeforeitemdrop="itemDrop(item,dayDelta,minuteDelta,allDay,event,ui,view)"
- onitemdrop="itemDropComplete(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
- onitemdragstart="dragStart(item,event,ui,view)"
- onitemdragstop="dragStop(item,event,ui,view)"
- onitemresizestart="itemResizeStart(item,event,ui,view)"
- onitemresizestop="itemResizeStop(item,event,ui,view)"
- onviewchange="viewChanged(view)"
- onbeforedateselect="daySelected(date,allDay,event,view)"
- ondateselect="daySelectedComplete(date,allDay,event,view,data)"
- ondaterangeselect="dateRangeSelected(startDate,endDate,allDay,view)"
- ondaterangechange="dateRangeChanged(startDate,endDate)"
- onitemmouseover="itemMouseover(item)"
- onitemmouseout="itemMouseout(item)"
- styleClass="customFC"
- >
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <h:selectOneRadio value="#{myBean.switchType}">
+ <f:selectItem itemValue="ajax" itemLabel="Ajax"/>
+ <f:selectItem itemValue="server" itemLabel="Server"/>
+ <f:selectItem itemValue="client" itemLabel="Client"/>
+ <f:ajax render=":schedules"/>
+ </h:selectOneRadio>
+ </h:form>
+ <h:form id="schedules">
+ <schedule:schedule switchType="#{myBean.switchType}" value="#{myBean.lazyDataModel}" var="event" date="#{myBean.initialDate}" editable="true"
+ selectable="true" headerCenter="title" headerLeft="prevYear,nextYear"
+ headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next" itemResizeListener="#{myBean.taskResized}"
+ itemMoveListener="#{myBean.taskMoved}" data="#{myBean.allDayText}" eventsQueue="schedule1"
+ onbeforeitemselect="onbeforeitemselect(item,event,view)" onitemselect="onitemselect(item,event,view,data)"
+ onbeforeitemresize="onbeforeitemresize(item,dayDelta,minuteDelta,event,ui,view)"
+ onitemresize="onitemresize(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
+ onbeforeitemdrop="onbeforeitemdrop(item,dayDelta,minuteDelta,allDay,event,ui,view)"
+ onitemdrop="onitemdrop(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
+ onitemdragstart="onitemdragstart(item,event,ui,view)" onitemdragstop="onitemdragstop(item,event,ui,view)"
+ onitemresizestart="onitemresizestart(item,event,ui,view)" onitemresizestop="onitemresizestop(item,event,ui,view)"
+ onviewchange="onviewchange(view)" onbeforedateselect="onbeforedateselect(date,allDay,event,view)"
+ ondateselect="ondateselect(date,allDay,event,view,data)"
+ onbeforedaterangeselect="onbeforedaterangeselect(startDate,endDate,allDay,view)"
+ ondaterangeselect="ondaterangeselect(startDate,endDate,allDay,view)" ondaterangechange="ondaterangechange(startDate,endDate)"
+ onitemmouseover="onitemmouseover(item)" onitemmouseout="onitemmouseout(item)" onviewdisplay="onviewdisplay(view)"
+ styleClass="customFC">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
</schedule:schedule>
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}" var="event"
- date="#{myBean.initialDate}"
- editable="true"
- selectable="true"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next"
- eventsQueue="schedule2"
- onbeforeitemselect="blockEvent(item,event,'select'); return false;"
- onitemselect="itemSelectedComplete(item,event,view,data)"
- onbeforeitemresize="blockEvent(item,event,'resized'); return false;"
- onitemresize="itemResizedComplete(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
- onbeforeitemdrop="blockEvent(item,event,'drop'); return false;"
- onitemdrop="itemDropComplete(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
- onitemdragstart="blockEvent(item,event,'dragStart'); return false;"
- onitemdragstop="blockEvent(item,event,'dragStop'); return false;"
- onitemresizestart="blockEvent(item,event,'resizeStart'); return false;"
- onitemresizestop="blockEvent(item,event,'resizeStop'); return false;"
- onviewchange="viewChanged(view); return false;"
- onbeforedateselect="daySelected(date,allDay);return false;"
- ondateselect="daySelectedComplete(date,allDay,event,view,data)"
- onbeforedaterangeselect="blockEvent(startDate,endDate,'dateRangeSelected'); return false;"
- ondaterangeselect="dateRangeSelected(startDate,endDate,allDay,view,data)"
- ondaterangechange="dateRangeChanged(startDate,endDate);return false;"
- >
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:schedule switchType="#{myBean.switchType}" value="#{myBean.lazyDataModel}" var="event" date="#{myBean.initialDate}" editable="true"
+ selectable="true" headerCenter="title" headerLeft="prevYear,nextYear"
+ headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next" eventsQueue="schedule2"
+ onbeforeitemselect="blockEvent(item,event,'onbeforeitemselect'); return false;" onitemselect="onitemselect(item,event,view,data)"
+ onbeforeitemresize="blockEvent(item,event,'onbeforeitemresize'); return false;"
+ onitemresize="onitemresize(item,dayDelta,minuteDelta,vetoed,event,ui,view,data)"
+ onbeforeitemdrop="blockEvent(item,event,'onbeforeitemdrop'); return false;"
+ onitemdrop="onitemdrop(item,dayDelta,minuteDelta,allDay,vetoed,event,ui,view,data)"
+ onitemdragstart="onitemdragstart(item,event,ui,view); return false;"
+ onitemdragstop="onitemdragstop(item,event,ui,view); return false;"
+ onitemresizestart="onitemresizestart(item,event,ui,view); return false;"
+ onitemresizestop="onitemresizestop(item,event,ui,view); return false;" onviewchange="onviewchange(view); return false;"
+ onbeforedateselect="blockEvent(date,event,'onbeforedateselect');return false;"
+ ondateselect="ondateselect(date,allDay,event,view,data)"
+ onbeforedaterangeselect="blockEvent(startDate,endDate,'onbeforedaterangeselect'); return false;"
+ ondaterangeselect="ondaterangeselect(startDate,endDate,allDay,view,data)"
+ ondaterangechange="ondaterangechange(startDate,endDate);return false;" onviewdisplay="onviewdisplay(view)">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
</schedule:schedule>
</h:form>
+
+ <div id="log"></div>
<!--
TODO Uncomment this once rich:insert is ready
<rich:insert src="/pages/sample_4.xhtml" highlight="xhtml"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_5.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,48 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- >
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
- This section will be available once it is decided how to transfer additional data
- in RF4
- <!--
- TODO uncomment this once it is decided how to transfer additional data
- <script type="text/javascript">
- function notify(item, event, request, data) {
- RichFaces.Notify({title:'Data',text:data,sticky:false,styleClass:'rf-ny-info'})
- }
+ <p>Click on item to fetch additional data</p>
+ <script type="text/javascript">
+ function notify(item, event, request, data) {
+ alert(item + " " + event + " " + request + " " + data)
+ // RichFaces.Notify({title:'Data',text:data,sticky:false,styleClass:'rf-ny-info'})
+ }
- </script>
- <h:form>
+ </script>
+ <h:form>
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}" var="event"
- date="#{myBean.initialDate}"
- editable="true"
- selectable="true"
- headerCenter="title"
- headerLeft="prevYear,nextYear"
- headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next"
- styleClass="customFC"
- data="#{myBean.selectable}"
- ajaxSingle="true"
- reRender="editPanelContent"
- itemSelectedListener="#{myBean.taskSelected}"
- onItemSelectedComplete="notify(item,event,request,data)"
- >
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
- </schedule:schedule>
- </h:form>
- <rich:insert src="/pages/sample_5.xhtml" highlight="xhtml"/>
- -->
+ <schedule:schedule switchType="ajax" value="#{myBean.lazyDataModel}" var="event" date="#{myBean.initialDate}" editable="true" selectable="true"
+ headerCenter="title" headerLeft="prevYear,nextYear" headerRight="basicDay,basicWeek agendaDay,agendaWeek month today prev,next"
+ styleClass="customFC" data="#{myBean.selectable}" ajaxSingle="true" reRender="editPanelContent"
+ itemSelectedListener="#{myBean.taskSelected}" onitemselect="notify(item,event,view,data)">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ </schedule:schedule>
+ </h:form>
+ <!--<rich:insert src="/pages/sample_5.xhtml" highlight="xhtml"/>-->
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_6.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,15 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:misc="http://richfaces.org/misc"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- xmlns:schedule="http://richfaces.org/schedule"
- >
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
This section will be available once modal panel gets implemented.
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_7.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- xmlns:schedule="http://richfaces.org/schedule">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
@@ -14,8 +9,7 @@
Schedule has support for internationalization.
You need to provide messages in bundle registered with JSF
as message-bundle (not resource-bundle!).
- List of available messages can be found in
- </p>
+ List of available messages can be found in </p>
<pre>
org.richfaces.component.UIScheduleMessages_en.properties
</pre>
@@ -24,8 +18,7 @@
This demo web app has additional myMessages_fr.properties with french translation
to show how you can add custom translation.
It should be packaged in WEB-INF/classes. (Maven apps can store it in src/main/resources)
- You also need to configure faces-config.xml like this:
- </p>
+ You also need to configure faces-config.xml like this: </p>
<pre>
<application>
<message-bundle>
@@ -43,21 +36,8 @@
<p>
Note that if you want your component work in WebKit based browsers
(i.e.:chrome,safari) you cannot use html entities in your
- messages. User numeric entities instead. i.e.: &#160; instead of &nbsp;
- </p>
+ messages. User numeric entities instead. i.e.: &#160; instead of &nbsp; </p>
- <p>
- Unfortunately, in JSF 2.0.2 the locale changes are visible on next request, so
- you must refresh screen or force two ajax requests.
- </p>
-
- <p>
- Unfortunately, dynamicly generated javascript resource is not automatically
- included by JSF, so if you want to use internationalization you must add this to your facelet:
- </p>
- <pre>
- <h:outputScript name="org.richfaces.renderkit.html.scripts.ScheduleMessages" target="head"/>
- </pre>
<h:form>
<h:selectOneListbox size="1" value="#{myBean.locale}">
<f:selectItem itemValue="en" itemLabel="en"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_8.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,19 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- >
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/pages/template.xhtml">
<!--TODO write where are messages for each language located-->
<ui:define name="body">
<p>
Try out JavaScript API. For documentation see
- <h:outputLink
- value="http://arshaw.com/fullcalendar/docs/">http://arshaw.com/fullcalendar/docs/
+ <h:outputLink value="http://arshaw.com/fullcalendar/docs/">http://arshaw.com/fullcalendar/docs/
</h:outputLink>
</p>
<ui:include src="schedule.xhtml">
@@ -23,14 +17,13 @@
<div>
<i>CTRL+ENTER while in textarea to execute</i>
- <textarea id="code" onkeypress="if(event.keyCode==13 && event.ctrlKey) eval(this.value)" cols="50"
- rows="10">
+ <textarea id="code" onkeypress="if(event.keyCode==13 && event.ctrlKey) eval(this.value)" cols="50" rows="10">
schedule.today();
var today=new Date();
var tommorow=new Date(today.getFullYear(),today.getMonth(),today.getDate()+1);
schedule.select(today,tommorow);
schedule.unselect();
- schedule.render();
+ schedule.refetchItems();
RichFaces.Notify({title:schedule.getView().name});
schedule.changeView("agendaWeek");
var items = schedule.getItems();
@@ -38,7 +31,7 @@
var item = items[0];
item.title = window.prompt(item.title);
schedule.updateItem(item);
- schedule.render();
+ schedule.reRender();
}
schedule.next();
</textarea>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/sample_9.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,12 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:schedule="http://richfaces.org/schedule"
- xmlns:c="http://java.sun.com/jsp/jstl/core"
- >
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<ui:composition template="/pages/template.xhtml">
<ui:define name="body">
<style type="text/css">
@@ -20,41 +15,27 @@
</style>
<h:form>
Ajax schedule
- <schedule:schedule switchType="ajax"
- value="#{myBean.lazyDataModel}"
- var="event"
- styleClass="slim">
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:schedule switchType="ajax" value="#{myBean.lazyDataModel}" var="event" styleClass="slim">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
</schedule:schedule>
<div class="slim right">
Server schedule
- <schedule:schedule switchType="server"
- date="#{myBean.initialDate}"
- value="#{myBean.lazyDataModel}"
- var="event"
- height="400"
- styleClass="slim right"
- dateRangeChangeListener="#{myBean.dateRangeChanged}">
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:schedule switchType="server" date="#{myBean.initialDate}" value="#{myBean.lazyDataModel}" var="event" height="400"
+ styleClass="slim right" dateRangeChangeListener="#{myBean.dateRangeChanged}">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
</schedule:schedule>
</div>
- <div style="clear:both"/>
+ <div style="clear:both"></div>
<h:commandButton value="Re render client schedule">
<f:ajax event="click" render="clientSchedule"/>
</h:commandButton>
Client schedule
- <schedule:schedule id="clientSchedule"
- switchType="client"
- value="#{myBean.allEvents}"
- var="event">
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:schedule id="clientSchedule" switchType="client" value="#{myBean.allEvents}" var="event">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
</schedule:schedule>
</h:form>
</ui:define>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/schedule.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,11 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:rich="http://richfaces.org/misc"
- xmlns:schedule="http://richfaces.org/schedule">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:schedule="http://richfaces.org/sandbox/schedule">
<head>
<title></title>
</head>
@@ -13,68 +9,32 @@
<!-- mode should passed to this template as param -->
<ui:composition>
<h:form id="f">
- <schedule:schedule id="schedule"
- widgetVar="schedule"
- switchType="#{mode}"
- value="#{myBean.lazyDataModel}"
- var="event"
- weekMode="#{myBean.weekMode}"
- height="#{myBean.height}"
- date="#{myBean.initialDate}"
- firstDay="#{myBean.firstDay}"
- showWeekends="#{myBean.showWeekends}"
+ <schedule:schedule id="schedule" widgetVar="schedule" switchType="#{mode}" value="#{myBean.lazyDataModel}" var="event" weekMode="#{myBean.weekMode}"
+ height="#{myBean.height}" date="#{myBean.initialDate}" firstDay="#{myBean.firstDay}" showWeekends="#{myBean.showWeekends}"
- allDayText="#{myBean.allDayText}"
- allDayByDefault="#{myBean.allDayByDefault}"
- allDaySlot="#{myBean.allDaySlot}"
- aspectRatio="#{myBean.aspectRatio}"
- axisFormat="#{myBean.axisFormat}"
- contentHeight="#{myBean.contentHeight}"
- defaultEventMinutes="#{myBean.defaultEventMinutes}"
- dragOpacity="#{myBean.dragOpacity}"
- dragRevertDuration="#{myBean.dragRevertDuration}"
- editable="#{myBean.editable}"
- selectable="#{myBean.selectable}"
- selectHelper="#{myBean.selectHelper}"
- unselectAuto="#{myBean.unselectAuto}"
- unselectCancel="#{myBean.unselectCancel}"
- firstHour="#{myBean.firstHour}"
- headerCenter="#{myBean.headerCenter}"
- headerLeft="#{myBean.headerLeft}"
- headerRight="#{myBean.headerRight}"
- isRTL="#{myBean.isRTL}"
- maxTime="#{myBean.maxTime}"
- minTime="#{myBean.minTime}"
- slotMinutes="#{myBean.slotMinutes}"
- view="#{myBean.view}"
+ allDayText="#{myBean.allDayText}" allDayByDefault="#{myBean.allDayByDefault}" allDaySlot="#{myBean.allDaySlot}"
+ aspectRatio="#{myBean.aspectRatio}" axisFormat="#{myBean.axisFormat}" contentHeight="#{myBean.contentHeight}"
+ defaultEventMinutes="#{myBean.defaultEventMinutes}" dragOpacity="#{myBean.dragOpacity}"
+ dragRevertDuration="#{myBean.dragRevertDuration}" editable="#{myBean.editable}" selectable="#{myBean.selectable}"
+ selectHelper="#{myBean.selectHelper}" unselectAuto="#{myBean.unselectAuto}" unselectCancel="#{myBean.unselectCancel}"
+ firstHour="#{myBean.firstHour}" headerCenter="#{myBean.headerCenter}" headerLeft="#{myBean.headerLeft}"
+ headerRight="#{myBean.headerRight}" isRTL="#{myBean.isRTL}" maxTime="#{myBean.maxTime}" minTime="#{myBean.minTime}"
+ slotMinutes="#{myBean.slotMinutes}" view="#{myBean.view}"
- columnFormat="#{myBean.columnFormat}"
- titleFormat="#{myBean.titleFormat}"
- timeFormat="#{myBean.timeFormat}"
+ columnFormat="#{myBean.columnFormat}" titleFormat="#{myBean.titleFormat}" timeFormat="#{myBean.timeFormat}"
- itemResizeListener="#{myBean.taskResized}"
- itemMoveListener="#{myBean.taskMoved}"
- itemSelectListener="#{myBean.taskSelected}"
- viewChangeListener="#{myBean.viewChanged}"
- dateRangeChangeListener="#{myBean.dateRangeChanged}"
- dateRangeSelectListener="#{myBean.dateRangeSelected}"
- dateSelectListener="#{myBean.dateSelected}"
+ itemResizeListener="#{myBean.taskResized}" itemMoveListener="#{myBean.taskMoved}" itemSelectListener="#{myBean.taskSelected}"
+ viewChangeListener="#{myBean.viewChanged}" dateRangeChangeListener="#{myBean.dateRangeChanged}"
+ dateRangeSelectListener="#{myBean.dateRangeSelected}" dateSelectListener="#{myBean.dateSelected}"
- ondaterangeselect="#{rich:component('schedule')}.unselect()"
- >
- <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}"
- endDate="#{event.endDate}" allDay="#{event.allDay}"
- styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
- <schedule:scheduleMonthView weekMode="#{myBean.weekMode}" titleFormat="MM yy" timeFormat="h:m"
- columnFormat="dddd" dragOpacity=".1"/>
- <schedule:scheduleAgendaDayView titleFormat="d MMM yy" timeFormat="hh:m" columnFormat="ddd"
- dragOpacity=".3"/>
- <schedule:scheduleBasicDayView titleFormat="dd MMM yy" timeFormat="hh:mm" columnFormat="aaa ddd"
- dragOpacity=".5"/>
- <schedule:scheduleAgendaWeekView titleFormat="dd MMM yy" timeFormat="hh:mm" columnFormat="aaa ddd"
- dragOpacity=".7"/>
- <schedule:scheduleBasicWeekView titleFormat="bw dd MMM yy" timeFormat="bw hh:mm" columnFormat="bw ddd"
- dragOpacity=".9"/>
+ ondaterangeselect="#{rich:component('schedule')}.unselect()">
+ <schedule:scheduleItem eventId="#{event.id}" startDate="#{event.startDate}" title="#{event.title}" endDate="#{event.endDate}"
+ allDay="#{event.allDay}" styleClass="#{event.id == 1 ? 'first' : null}" data="#{event.data}"/>
+ <schedule:scheduleMonthView weekMode="#{myBean.weekMode}" titleFormat="MM yy" timeFormat="h:m" columnFormat="dddd" dragOpacity=".1"/>
+ <schedule:scheduleAgendaDayView titleFormat="d MMM yy" timeFormat="hh:m" columnFormat="ddd" dragOpacity=".3"/>
+ <schedule:scheduleBasicDayView titleFormat="dd MMM yy" timeFormat="hh:mm" columnFormat="aaa ddd" dragOpacity=".5"/>
+ <schedule:scheduleAgendaWeekView titleFormat="dd MMM yy" timeFormat="hh:mm" columnFormat="aaa ddd" dragOpacity=".7"/>
+ <schedule:scheduleBasicWeekView titleFormat="bw dd MMM yy" timeFormat="bw hh:mm" columnFormat="bw ddd" dragOpacity=".9"/>
<!--
TODO uncomment this
<schedule:itemSelectedListener binding="#{myBean.additionalListener}"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/settingsPanel.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,8 +1,5 @@
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:a4j="http://richfaces.org/a4j">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
<h:form styleClass="settingsPanel">
<h:panelGrid columns="2">
<h:outputLabel value="Allow task moving" for="allowTaskMoving"/>
Modified: sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml
===================================================================
--- sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/demo/src/main/webapp/pages/template.xhtml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,11 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
<f:view locale="#{myBean.locale}">
<h:head>
<style type="text/css">
@@ -34,9 +30,9 @@
</style>
</h:head>
<h:body styleClass="rich-container">
+ <!--<script type="text/javascript" src="#{request.contextPath}/schedule.js"></script>-->
<ui:include src="menu.xhtml"/>
<ui:insert name="body">Body</ui:insert>
- <h:outputScript name="org.richfaces.renderkit.html.scripts.ScheduleMessages" target="head"/>
</h:body>
</f:view>
</html>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/parent/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/parent/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/parent/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
Inc. and individual contributors by the @authors tag. See the
copyright.txt in the distribution for a full listing of
@@ -25,31 +24,29 @@
<parent>
<groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>7</version>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
<name>Richfaces UI Components: schedule parent</name>
<packaging>pom</packaging>
<properties>
<richfaces.checkstyle.version>1</richfaces.checkstyle.version>
- <org.richfaces.cdk.version>4.0.0-SNAPSHOT</org.richfaces.cdk.version>
+ <org.richfaces.cdk.version>4.1.0-SNAPSHOT</org.richfaces.cdk.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-bom</artifactId>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>schedule-bom</artifactId>
<version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
-
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
@@ -83,98 +80,24 @@
<version>2.0-alpha-4</version>
<extensions>true</extensions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle</artifactId>
- <version>${richfaces.checkstyle.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- <configuration>
- <library>
- <prefix>org.richfaces</prefix>
- <taglib>
- <uri>http://richfaces.org/schedule</uri>
- <shortName>schedule</shortName>
- <displayName>schedule component tags</displayName>
- </taglib>
- </library>
- </configuration>
- <executions>
- <execution>
- <id>cdk-generate-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
</build>
- <profiles>
- <profile>
- <id>release</id>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+ <url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <javadocVersion>1.5</javadocVersion>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-javadoc</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
Modified: sandbox/trunk/ui/schedule/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
+<?xml version="1.0" encoding="UTF-8"?><!--
JBoss, Home of Professional Open Source
Copyright , Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -27,16 +26,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>9</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-aggregator</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <artifactId>schedule-aggregator</artifactId>
<packaging>pom</packaging>
- <name>Richfaces UI Components: Schedule Aggregator</name>
+ <name>Richfaces UI Components: schedule Aggregator</name>
<modules>
<module>bom</module>
@@ -45,54 +43,30 @@
<module>demo</module>
</modules>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!--
- The dist requires clean install for prepare
- -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
+ <profiles>
+ <profile>
+ <id>cli</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>1.0.6-SNAPSHOT</version>
+ <configuration>
+ <userAliases>
+ <ui>schedule clean install</ui>
+ <demo>schedule-demo clean package</demo>
+ </userAliases>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!-- The dist requires clean install for prepare -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui-sandbox/schedul/...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui-sandbox/schedule/trunk
- </developerConnection>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/sandbox/trunk/ui/schedule</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/sandbox/trunk/ui/schedule</developerConnection>
<url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
Modified: sandbox/trunk/ui/schedule/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/schedule/ui/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/pom.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,176 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0"
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <groupId>org.richfaces.sandbox.ui.schedule</groupId>
+ <artifactId>schedule-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-ui</artifactId>
+ <artifactId>schedule-ui</artifactId>
<name>Richfaces UI Components: schedule ui</name>
- <dependencyManagement>
- <!--
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-bom</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.richfaces.ui.core</groupId>
- <artifactId>richfaces-ui-core-ui</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- -->
- </dependencyManagement>
-
<dependencies>
-
<dependency>
<groupId>org.richfaces.ui.core</groupId>
<artifactId>richfaces-ui-core-ui</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
<scope>provided</scope>
</dependency>
-
- <!-- JSF with dependencies -->
<dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
+ <artifactId>jstl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- <version>${org.richfaces.cdk.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xml-maven-plugin</artifactId>
- <version>1.0-beta-2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </pluginManagement>
-
<plugins>
<plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle</artifactId>
- <version>${richfaces.checkstyle.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
-
- <plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
- <configuration>
- <library>
- <prefix>org.richfaces</prefix>
- <taglib>
- <uri>http://richfaces.org/schedule</uri>
- <shortName>schedule</shortName>
- <displayName>schedule component tags</displayName>
- </taglib>
- </library>
- </configuration>
<executions>
<execution>
<id>cdk-generate-sources</id>
@@ -206,48 +86,4 @@
</plugins>
</build>
- <profiles>
- <profile>
- <id>release</id>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <javadocVersion>1.5</javadocVersion>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-javadoc</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- <executions>
- <execution>
- <id>generate-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
Modified: sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractSchedule.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -21,42 +21,12 @@
*/
package org.richfaces.component;
-import java.io.IOException;
-import java.sql.ResultSet;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesEvent;
-import javax.faces.model.ArrayDataModel;
-import javax.faces.model.DataModel;
-import javax.faces.model.ListDataModel;
-import javax.faces.model.ResultDataModel;
-import javax.faces.model.ResultSetDataModel;
-import javax.faces.model.ScalarDataModel;
-import javax.servlet.jsp.jstl.sql.Result;
-
-import org.ajax4jsf.component.AjaxComponent;
-import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.model.DataVisitResult;
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Description;
+import org.richfaces.cdk.annotations.Event;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
@@ -75,274 +45,326 @@
import org.richfaces.component.event.ScheduleItemResizeListener;
import org.richfaces.component.event.ScheduleItemSelectEvent;
import org.richfaces.component.event.ScheduleItemSelectListener;
-import org.richfaces.component.event.ScheduleListenerEventsProducer;
import org.richfaces.component.event.ScheduleViewChangeEvent;
import org.richfaces.component.event.ScheduleViewChangeListener;
import org.richfaces.component.model.DateRange;
+import org.richfaces.context.ExtendedPartialViewContext;
+import org.richfaces.renderkit.ScheduleRendererBase;
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+import javax.faces.model.ArrayDataModel;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+import javax.faces.model.ResultDataModel;
+import javax.faces.model.ResultSetDataModel;
+import javax.faces.model.ScalarDataModel;
+import javax.servlet.jsp.jstl.sql.Result;
+import java.sql.ResultSet;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
/**
* Base class for generation of UISchedule component.
*
* @author Bernard Labno
*/
@JsfComponent(tag = @Tag(name = "schedule",
- handler = "org.richfaces.view.facelets.html.ScheduleHandler",
- generate = true,
- type = TagType.Facelets),
- renderer = @JsfRenderer(family = AbstractSchedule.COMPONENT_FAMILY, type = "org.richfaces.ScheduleRenderer"))
-public abstract class AbstractSchedule extends UIComponentBase
- implements ScheduleCommonViewAttributes, ScheduleListenerEventsProducer, AjaxComponent {
+ handler = "org.richfaces.view.facelets.html.ScheduleTagHandler",
+ generate = true,
+ type = TagType.Facelets),
+ renderer = @JsfRenderer(family = AbstractSchedule.COMPONENT_FAMILY, type = ScheduleRendererBase.RENDERER_TYPE),
+ fires = {
+ @Event(value = ScheduleDateRangeChangeEvent.class, listener = ScheduleDateRangeChangeListener.class),
+ @Event(value = ScheduleDateRangeSelectEvent.class, listener = ScheduleDateRangeSelectListener.class),
+ @Event(value = ScheduleDateSelectEvent.class, listener = ScheduleDateSelectListener.class),
+ @Event(value = ScheduleItemMoveEvent.class, listener = ScheduleItemMoveListener.class),
+ @Event(value = ScheduleItemResizeEvent.class, listener = ScheduleItemResizeListener.class),
+ @Event(value = ScheduleItemSelectEvent.class, listener = ScheduleItemSelectListener.class),
+ @Event(value = ScheduleViewChangeEvent.class, listener = ScheduleViewChangeListener.class)
+ }
+)
+public abstract class AbstractSchedule extends UIComponentBase implements ScheduleCommonViewAttributes {
+// ------------------------------ FIELDS ------------------------------
- public static final String COMPONENT_TYPE = "org.richfaces.Schedule";
public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Schedule";
+
/**
- * Values of view attribute.
+ * Values of switchType attribute
*/
- public static final String VIEW_MONTH = "month";
- public static final String VIEW_BASIC_WEEK = "basicWeek";
+ public static final String SWITCH_TYPE_AJAX = "ajax";
+
+ public static final String SWITCH_TYPE_CLIENT = "client";
+
+ public static final String SWITCH_TYPE_SERVER = "server";
+
+ public static final String VIEW_AGENDA_DAY = "agendaDay";
+
public static final String VIEW_AGENDA_WEEK = "agendaWeek";
+
public static final String VIEW_BASIC_DAY = "basicDay";
- public static final String VIEW_AGENDA_DAY = "agendaDay";
- public static final String DEFAULT_VIEW = VIEW_MONTH;
+
+ public static final String VIEW_BASIC_WEEK = "basicWeek";
+
/**
- * Values of switchType attribute
+ * Values of view attribute.
*/
- public static final String SWITCH_TYPE_AJAX = "ajax";
- public static final String SWITCH_TYPE_SERVER = "server";
- public static final String SWITCH_TYPE_CLIENT = "client";
- public static final String DEFAULT_SWITCH_TYPE = SWITCH_TYPE_AJAX;
+ public static final String VIEW_MONTH = "month";
+
/**
* Values of weekMode attribute.
*/
public static final String WEEK_MODE_FIXED = "fixed";
+
public static final String WEEK_MODE_LIQUID = "liquid";
+
public static final String WEEK_MODE_VARIABLE = "variable";
- public static final String DEFAULT_WEEK_MODE = WEEK_MODE_FIXED;
- public static final boolean DEFAULT_SHOW_WEEKENDS = true;
- public static final boolean DEFAULT_RTL = false;
- public static final int DEFAULT_FIRST_DAY = Calendar.SUNDAY;
- public static final double DEFAULT_ASPECT_RATIO = 1.35;
- public static final boolean DEFAULT_ALL_DAY_SLOT = true;
- public static final String DEFAULT_AXIS_FORMAT = "h(:mm)tt";
- public static final int DEFAULT_SLOT_MINUTES = 30;
- public static final int DEFAULT_EVENT_MINUTES = 120;
- public static final int DEFAULT_FIRST_HOUR = 6;
- public static final String DEFAULT_MIN_TIME = "0";
- public static final String DEFAULT_MAX_TIME = "24";
- public static final boolean DEFAULT_EDITABLE = false;
- public static final boolean DEFAULT_SELECTABLE = false;
- public static final boolean DEFAULT_SELECT_HELPER = false;
- public static final boolean DEFAULT_UNSELECT_AUTO = true;
- public static final String DEFAULT_UNSELECT_CANCEL = "";
- public static final boolean DEFAULT_DISABLE_DRAGGING = false;
- public static final boolean DEFAULT_DISABLE_RESIZING = false;
- public static final int DEFAULT_DRAG_REVERT_DURATION = 500;
- public static final double DEFAULT_DRAG_OPACITY = .3;
+
public static final boolean DEFAULT_ALL_DAY_DEFAULT = true;
- private DataModel model;
- @Attribute
- public abstract Object getValue();
+ public static final boolean DEFAULT_ALL_DAY_SLOT = true;
- @Attribute
- public abstract String getVar();
+ public static final double DEFAULT_ASPECT_RATIO = 1.35;
- @Attribute
- public abstract Date getDate();
+ public static final boolean DEFAULT_AUTO_REFRESH_ON_DATE_RANGE_SELECT = true;
- public abstract void setDate(Date date);
+ public static final String DEFAULT_AXIS_FORMAT = "h(:mm)tt";
- @Attribute(defaultValue = "SwitchType." + DEFAULT_SWITCH_TYPE,
- suggestedValue = SWITCH_TYPE_AJAX + "," + SWITCH_TYPE_SERVER + "," + SWITCH_TYPE_CLIENT)
- public abstract SwitchType getSwitchType();
+ public static final boolean DEFAULT_DISABLE_DRAGGING = false;
- @Attribute(defaultValue = DEFAULT_VIEW,
- suggestedValue = VIEW_MONTH
- + "," + VIEW_AGENDA_DAY
- + "," + VIEW_AGENDA_WEEK
- + "," + VIEW_BASIC_DAY + "," + VIEW_BASIC_WEEK)
- public abstract String getView();
+ public static final boolean DEFAULT_DISABLE_RESIZING = false;
- public abstract void setView(String view);
+ public static final double DEFAULT_DRAG_OPACITY = .3;
- @Attribute
- public abstract String getHeaderLeft();
+ public static final int DEFAULT_DRAG_REVERT_DURATION = 500;
- @Attribute
- public abstract String getHeaderCenter();
+ public static final boolean DEFAULT_EDITABLE = false;
- @Attribute
- public abstract String getHeaderRight();
+ public static final int DEFAULT_EVENT_MINUTES = 120;
- @Attribute(defaultValue = "" + DEFAULT_FIRST_DAY,
- description = @Description("First day of week. 1 - sunday, 2 - monday,..,7 - saturday."))
- public abstract Integer getFirstDay();
+ public static final int DEFAULT_FIRST_DAY = Calendar.SUNDAY;
- public abstract void setFirstDay(Integer firstDay);
+ public static final int DEFAULT_FIRST_HOUR = 6;
- @Attribute(defaultValue = "" + DEFAULT_RTL)
- public abstract Boolean isRTL();
+ public static final String DEFAULT_MAX_TIME = "24";
- @Attribute(defaultValue = "" + DEFAULT_SHOW_WEEKENDS)
- public abstract Boolean isShowWeekends();
+ public static final String DEFAULT_MIN_TIME = "0";
- public abstract void setShowWeekends(Boolean showWeekends);
+ public static final boolean DEFAULT_RTL = false;
- @Attribute(defaultValue = DEFAULT_WEEK_MODE,
- suggestedValue = WEEK_MODE_FIXED + "," + WEEK_MODE_LIQUID + "," + WEEK_MODE_VARIABLE)
- public abstract String getWeekMode();
+ public static final boolean DEFAULT_SELECTABLE = false;
- @Attribute
- public abstract Integer getHeight();
+ public static final boolean DEFAULT_SELECT_HELPER = false;
- @Attribute
- public abstract Integer getContentHeight();
+ public static final boolean DEFAULT_SHOW_WEEKENDS = true;
- @Attribute(defaultValue = "" + DEFAULT_ASPECT_RATIO)
- public abstract Double getAspectRatio();
+ public static final int DEFAULT_SLOT_MINUTES = 30;
- @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_DEFAULT)
- public abstract Boolean isAllDayByDefault();
+ public static final String DEFAULT_SWITCH_TYPE = SWITCH_TYPE_AJAX;
- @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_SLOT)
- public abstract Boolean isAllDaySlot();
+ public static final boolean DEFAULT_UNSELECT_AUTO = true;
- @Attribute
- public abstract String getAllDayText();
+ public static final String DEFAULT_UNSELECT_CANCEL = "";
- @Attribute(defaultValue = DEFAULT_AXIS_FORMAT)
- public abstract String getAxisFormat();
+ public static final String DEFAULT_VIEW = VIEW_MONTH;
- @Attribute(defaultValue = "" + DEFAULT_SLOT_MINUTES)
- public abstract Integer getSlotMinutes();
+ public static final String DEFAULT_WEEK_MODE = WEEK_MODE_FIXED;
- @Attribute(defaultValue = "" + DEFAULT_EVENT_MINUTES)
- public abstract Integer getDefaultEventMinutes();
+ private DataModel model;
- @Attribute(defaultValue = "" + DEFAULT_FIRST_HOUR)
- public abstract Integer getFirstHour();
+// -------------------------- STATIC METHODS --------------------------
- @Attribute(defaultValue = DEFAULT_MIN_TIME)
- public abstract String getMinTime();
+ /**
+ * Tells value of firstDay. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of firstDay
+ */
+ public static int getFirstDay(AbstractSchedule schedule) {
+ Integer firstDay = schedule.getFirstDay();
+ return firstDay == null ? AbstractSchedule.DEFAULT_FIRST_DAY : firstDay;
+ }
- @Attribute(defaultValue = DEFAULT_MAX_TIME)
- public abstract String getMaxTime();
+ /**
+ * Gets first displayed day on schedule. This is used mainly when schedule
+ * is in ajax or server mode to calculate initial events daterange.
+ * Initial events are sent during first render in order to avoid extra
+ * ajax request right after first render.
+ *
+ * @param schedule schedule configuration for which date is calculated
+ * @return first day displayed on schedule
+ */
+ public static Date getFirstDisplayedDay(AbstractSchedule schedule) {
+ Calendar calendar = Calendar.getInstance();
+ Date date = schedule.getDate();
+ if (date != null) {
+ calendar.setTime(date);
+ }
+ int firstDayOfWeek = getFirstDay(schedule);
+ calendar.setFirstDayOfWeek(firstDayOfWeek);
+ String view = getView(schedule);
+ boolean showWeekends = isShowWeekends(schedule);
+ if (VIEW_MONTH.equals(view)) {
+ calendar.set(Calendar.DATE, 1);
+ if (!showWeekends) {
+ int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if (dayOfWeek == Calendar.SUNDAY) {
+ calendar.add(Calendar.DATE, 1);
+ } else if (dayOfWeek == Calendar.SATURDAY) {
+ calendar.add(Calendar.DATE, 2);
+ }
+ }
+ if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
+ firstDayOfWeek++;
+ }
+ /**
+ * Following 1 line is a fix to what i believe is a bug of java.util.Calendar
+ */
+ calendar.get(Calendar.DAY_OF_WEEK);
+ calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
+ calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
+ if (!showWeekends) {
+ int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if (dayOfWeek == Calendar.SUNDAY) {
+ calendar.add(Calendar.DATE, 1);
+ } else if (dayOfWeek == Calendar.SATURDAY) {
+ calendar.add(Calendar.DATE, 2);
+ }
+ }
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
+ return calendar.getTime();
+ } else {
+ throw new IllegalStateException("Invalid view attribute: " + view);
+ }
+ }
- @Attribute(defaultValue = "" + DEFAULT_EDITABLE)
- public abstract Boolean isEditable();
+ /**
+ * Gets last displayed day on schedule.
+ *
+ * @param schedule schedule configuration for which date is calculated
+ * @return last day displayed on schedule
+ * @see AbstractSchedule#getFirstDisplayedDay(org.richfaces.component.AbstractSchedule)
+ */
+ public static Date getLastDisplayedDate(AbstractSchedule schedule) {
+ Calendar calendar = Calendar.getInstance();
+ int firstDayOfWeek = getFirstDay(schedule);
+ String view = getView(schedule);
+ boolean showWeekends = isShowWeekends(schedule);
+ if (VIEW_MONTH.equals(view)) {
+ if (WEEK_MODE_FIXED.equals(getWeekMode(schedule))) {
+ calendar.setTime(getFirstDisplayedDay(schedule));
+ calendar.add(Calendar.DAY_OF_YEAR, 42);
+ } else {
+ Date date = schedule.getDate();
+ if (date != null) {
+ calendar.setTime(date);
+ }
- @Attribute(defaultValue = "" + DEFAULT_SELECTABLE)
- public abstract Boolean isSelectable();
+ if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
+ firstDayOfWeek++;
+ }
+ calendar.setFirstDayOfWeek(firstDayOfWeek);
+ calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
+ int dayOfWeek = firstDayOfWeek + 6;
+ if (dayOfWeek > Calendar.SATURDAY) {
+ dayOfWeek -= 7;
+ }
+ /**
+ * Following 1 line is a fix to what i believe is a bug of java.util.Calendar
+ */
+ calendar.get(Calendar.DAY_OF_WEEK);
+ calendar.set(Calendar.DAY_OF_WEEK, dayOfWeek);
+ calendar.add(Calendar.DATE, 1);
+ }
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
+ calendar.setFirstDayOfWeek(firstDayOfWeek);
+ calendar.setTime(getFirstDisplayedDay(schedule));
+ calendar.add(Calendar.DATE, 7);
+ if (!showWeekends) {
+ int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if (dayOfWeek - 1 == Calendar.SUNDAY) {
+ calendar.add(Calendar.DATE, -2);
+ } else if (dayOfWeek - 1 == Calendar.SATURDAY) {
+ calendar.add(Calendar.DATE, -1);
+ }
+ }
+ return calendar.getTime();
+ } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
+ calendar.setTime(getFirstDisplayedDay(schedule));
+ calendar.add(Calendar.DATE, 1);
+ return calendar.getTime();
+ } else {
+ throw new IllegalStateException("Invalid view attribute: " + view);
+ }
+ }
- @Attribute(defaultValue = "" + DEFAULT_SELECT_HELPER)
- public abstract Boolean isSelectHelper();
+ /**
+ * Tells value of view. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of view
+ */
+ public static String getView(AbstractSchedule schedule) {
+ String view = schedule.getView();
+ return view == null ? AbstractSchedule.DEFAULT_VIEW : view;
+ }
- @Attribute(defaultValue = "" + DEFAULT_UNSELECT_AUTO)
- public abstract Boolean isUnselectAuto();
+ /**
+ * Tells value of weekMode. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of weekMode
+ */
+ public static String getWeekMode(AbstractSchedule schedule) {
+ String weekMode = schedule.getWeekMode();
+ return weekMode == null ? AbstractSchedule.DEFAULT_WEEK_MODE : weekMode;
+ }
- @Attribute(defaultValue = DEFAULT_UNSELECT_CANCEL)
- public abstract String getUnselectCancel();
+ /**
+ * Tells if showWeekends is true or false. If it is not set it returns
+ * default value.
+ *
+ * @param schedule inspected schedule
+ * @return value of showWeekends
+ */
+ public static boolean isShowWeekends(AbstractSchedule schedule) {
+ Boolean showWeekends = schedule.isShowWeekends();
+ return showWeekends == null ? AbstractSchedule.DEFAULT_SHOW_WEEKENDS : schedule.isShowWeekends();
+ }
- @Attribute(defaultValue = "" + DEFAULT_DISABLE_DRAGGING)
- public abstract Boolean isDisableDragging();
+// ------------------------ INTERFACE METHODS ------------------------
- @Attribute(defaultValue = "" + DEFAULT_DISABLE_RESIZING)
- public abstract Boolean isDisableResizing();
- @Attribute(defaultValue = "" + DEFAULT_DRAG_REVERT_DURATION)
- public abstract Integer getDragRevertDuration();
+// --------------------- Interface ScheduleCommonViewAttributes ---------------------
@Attribute(defaultValue = "" + DEFAULT_DRAG_OPACITY)
public abstract Double getDragOpacity();
- @Attribute
- public abstract String getStyleClass();
+// -------------------------- OTHER METHODS --------------------------
- @Attribute(events = @EventName("beforeitemselect"))
- public abstract String getOnbeforeitemselect();
-
- @Attribute(events = @EventName("itemselect"))
- public abstract String getOnitemselect();
-
- @Attribute(events = @EventName("itemdragstart"))
- public abstract String getOnitemdragstart();
-
- @Attribute(events = @EventName("itemdragstop"))
- public abstract String getOnitemdragstop();
-
- @Attribute(events = @EventName("beforeitemdrop"))
- public abstract String getOnbeforeitemdrop();
-
- @Attribute(events = @EventName("itemdrop"))
- public abstract String getOnitemdrop();
-
- @Attribute(events = @EventName("itemresizestart"))
- public abstract String getOnitemresizestart();
-
- @Attribute(events = @EventName("itemresizestop"))
- public abstract String getOnitemresizestop();
-
- @Attribute(events = @EventName("beforeitemresize"))
- public abstract String getOnbeforeitemresize();
-
- @Attribute(events = @EventName("itemresize"))
- public abstract String getOnitemresize();
-
- @Attribute(events = @EventName("itemmouseover"))
- public abstract String getOnitemmouseover();
-
- @Attribute(events = @EventName("itemmouseout"))
- public abstract String getOnitemmouseout();
-
- @Attribute(events = @EventName("viewchange"))
- public abstract String getOnviewchange();
-
- @Attribute(events = @EventName("beforedateselect"))
- public abstract String getOnbeforedateselect();
-
- @Attribute(events = @EventName("dateselect"))
- public abstract String getOndateselect();
-
- @Attribute(events = @EventName("beforedaterangeselect"))
- public abstract String getOnbeforedaterangeselect();
-
- @Attribute(events = @EventName("daterangeselect"))
- public abstract String getOndaterangeselect();
-
- @Attribute(events = @EventName("daterangechange"))
- public abstract String getOndaterangechange();
-
- @Attribute(signature = @Signature(parameters = ScheduleItemMoveEvent.class, returnType = Boolean.class))
- public abstract MethodExpression getItemMoveListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleItemSelectEvent.class))
- public abstract MethodExpression getItemSelectListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleItemResizeEvent.class, returnType = Boolean.class))
- public abstract MethodExpression getItemResizeListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleViewChangeEvent.class))
- public abstract MethodExpression getViewChangeListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleDateRangeChangeEvent.class))
- public abstract MethodExpression getDateRangeChangeListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleDateRangeSelectEvent.class))
- public abstract MethodExpression getDateRangeSelectListener();
-
- @Attribute(signature = @Signature(parameters = ScheduleDateSelectEvent.class))
- public abstract MethodExpression getDateSelectListener();
-
- @Attribute
- public abstract String getWidgetVar();
-
- private void setResponseData(Object data) {
- FacesContext facesContext = getFacesContext();
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
-
- ajaxContext.getResponseComponentDataMap().put(getClientId(facesContext), data);
- }
-
/**
* React on various events.
* Vetoable events are first broadcasted to listeners bound via EL to
@@ -373,11 +395,7 @@
if (expression != null) {
expression.invoke(facesContext.getELContext(), new Object[]{event});
}
- try {
- setResponseData(getScheduleData(calendarAjaxEvent.getStartDate(), calendarAjaxEvent.getEndDate()));
- } catch (IOException ex) {
- getFacesContext().getExternalContext().log("Cannot get schedule data", ex);
- }
+ setResponseData(getScheduleData(calendarAjaxEvent.getStartDate(), calendarAjaxEvent.getEndDate()));
} else if (event instanceof ScheduleItemMoveEvent) {
FacesContext facesContext = getFacesContext();
MethodExpression expression = getItemMoveListener();
@@ -426,48 +444,143 @@
if (expression != null) {
expression.invoke(facesContext.getELContext(), new Object[]{event});
}
-// } else if (event instanceof AjaxEvent) {
-// FacesContext context = getFacesContext();
-// // complete re-Render fields. AjaxEvent deliver before render
-// // response.
-// AjaxContext.getCurrentInstance(context).addRegionsFromComponent(this);
-// // Put data for send in response
-// Object data = getData();
-// AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
-// if (null != data) {
-// ajaxContext.setResponseData(data);
-// }
-// String focus = getFocus();
-// if (null != focus) {
-// // search for component in tree.
-// // XXX - use more pourful search, as in h:outputLabel
-// // component.
-//// UIComponent focusComponent = RendererUtils.getInstance().
-//// findComponentFor(this, focus);
-//// if (null != focusComponent) {
-//// focus = focusComponent.getClientId(context);
-//// }
-//// TODO put focus data here
-//// ajaxContext.getResponseDataMap().put(AjaxActionComponent.FOCUS_DATA_ID, focus);
-// }
-// ajaxContext.setOncomplete(getOncomplete());
} else {
super.broadcast(event);
}
}
+ @Attribute
+ public abstract String getAllDayText();
+
+ @Attribute(defaultValue = "" + DEFAULT_ASPECT_RATIO)
+ public abstract Double getAspectRatio();
+
+ @Attribute(defaultValue = DEFAULT_AXIS_FORMAT)
+ public abstract String getAxisFormat();
+
+ @Attribute
+ public abstract Integer getContentHeight();
+
+ @Attribute
+ public abstract Date getDate();
+
+ @Attribute(signature = @Signature(parameters = ScheduleDateRangeChangeEvent.class))
+ public abstract MethodExpression getDateRangeChangeListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleDateRangeSelectEvent.class))
+ public abstract MethodExpression getDateRangeSelectListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleDateSelectEvent.class))
+ public abstract MethodExpression getDateSelectListener();
+
+ @Attribute(defaultValue = "" + DEFAULT_EVENT_MINUTES)
+ public abstract Integer getDefaultEventMinutes();
+
+ @Attribute(defaultValue = "" + DEFAULT_DRAG_REVERT_DURATION)
+ public abstract Integer getDragRevertDuration();
+
+ @Attribute(defaultValue = "" + DEFAULT_FIRST_DAY,
+ description = @Description("First day of week. 1 - sunday, 2 - monday,..,7 - saturday."))
+ public abstract Integer getFirstDay();
+
+ @Attribute(defaultValue = "" + DEFAULT_FIRST_HOUR)
+ public abstract Integer getFirstHour();
+
+ @Attribute
+ public abstract String getHeaderCenter();
+
+ @Attribute
+ public abstract String getHeaderLeft();
+
+ @Attribute
+ public abstract String getHeaderRight();
+
+ @Attribute
+ public abstract Integer getHeight();
+
+ @Attribute(signature = @Signature(parameters = ScheduleItemMoveEvent.class, returnType = Boolean.class))
+ public abstract MethodExpression getItemMoveListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleItemResizeEvent.class, returnType = Boolean.class))
+ public abstract MethodExpression getItemResizeListener();
+
+ @Attribute(signature = @Signature(parameters = ScheduleItemSelectEvent.class))
+ public abstract MethodExpression getItemSelectListener();
+
+ @Attribute(defaultValue = DEFAULT_MAX_TIME)
+ public abstract String getMaxTime();
+
+ @Attribute(defaultValue = DEFAULT_MIN_TIME)
+ public abstract String getMinTime();
+
+ @Attribute(events = @EventName("beforedaterangeselect"))
+ public abstract String getOnbeforedaterangeselect();
+
+ @Attribute(events = @EventName("beforedateselect"))
+ public abstract String getOnbeforedateselect();
+
+ @Attribute(events = @EventName("beforeitemdrop"))
+ public abstract String getOnbeforeitemdrop();
+
+ @Attribute(events = @EventName("beforeitemresize"))
+ public abstract String getOnbeforeitemresize();
+
+ @Attribute(events = @EventName("beforeitemselect"))
+ public abstract String getOnbeforeitemselect();
+
+ @Attribute(events = @EventName("daterangechange"))
+ public abstract String getOndaterangechange();
+
+ @Attribute(events = @EventName("daterangeselect"))
+ public abstract String getOndaterangeselect();
+
+ @Attribute(events = @EventName(value = "dateselect", defaultEvent = true))
+ public abstract String getOndateselect();
+
+ @Attribute(events = @EventName("itemdragstart"))
+ public abstract String getOnitemdragstart();
+
+ @Attribute(events = @EventName("itemdragstop"))
+ public abstract String getOnitemdragstop();
+
+ @Attribute(events = @EventName("itemdrop"))
+ public abstract String getOnitemdrop();
+
+ @Attribute(events = @EventName("itemmouseout"))
+ public abstract String getOnitemmouseout();
+
+ @Attribute(events = @EventName("itemmouseover"))
+ public abstract String getOnitemmouseover();
+
+ @Attribute(events = @EventName("itemresize"))
+ public abstract String getOnitemresize();
+
+ @Attribute(events = @EventName("itemresizestart"))
+ public abstract String getOnitemresizestart();
+
+ @Attribute(events = @EventName("itemresizestop"))
+ public abstract String getOnitemresizestop();
+
+ @Attribute(events = @EventName("itemselect"))
+ public abstract String getOnitemselect();
+
+ @Attribute(events = @EventName("viewchange"))
+ public abstract String getOnviewchange();
+
+ @Attribute(events = @EventName("viewdisplay"))
+ public abstract String getOnviewdisplay();
+
/**
* Gets data from provided data model within given range.
* Range is [startDate;endDate), which means that start date is inclusive
* and end date is exclusive.
* Data are in form of list of maps, which is ready to serialize to JSON.
*
- * @param startDate
- * @param endDate
- * @return
- * @throws IOException
+ * @param startDate date of earliest item
+ * @param endDate date of lates item
+ * @return list of items as map of their properties
*/
- public List<Map<String, Object>> getScheduleData(Date startDate, Date endDate) throws IOException {
+ public List<Map<String, Object>> getScheduleData(Date startDate, Date endDate) {
/**
* Locale must be US because this is the format the javascript widget supports
*/
@@ -528,175 +641,93 @@
return data;
}
- /**
- * Gets first displayed day on schedule. This is used mainly when schedule
- * is in ajax or server mode to calculate initial events daterange.
- * Initial events are sent during first render in order to avoid extra
- * ajax request right after first render.
- *
- * @param schedule schedule configuration for which date is calculated
- * @return first day displayed on schedule
- */
- public static Date getFirstDisplayedDay(AbstractSchedule schedule) {
- Calendar calendar = Calendar.getInstance();
- Date date = schedule.getDate();
- if (date != null) {
- calendar.setTime(date);
- }
- int firstDayOfWeek = getFirstDay(schedule);
- calendar.setFirstDayOfWeek(firstDayOfWeek);
- String view = getView(schedule);
- boolean showWeekends = isShowWeekends(schedule);
- if (VIEW_MONTH.equals(view)) {
- calendar.set(Calendar.DATE, 1);
- if (!showWeekends) {
- int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
- if (dayOfWeek == Calendar.SUNDAY) {
- calendar.add(Calendar.DATE, 1);
- } else if (dayOfWeek == Calendar.SATURDAY) {
- calendar.add(Calendar.DATE, 2);
- }
- }
- if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
- firstDayOfWeek++;
- }
- /**
- * Following 1 line is a fix to what i believe is a bug of java.util.Calendar
- */
- calendar.get(Calendar.DAY_OF_WEEK);
- calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
- return calendar.getTime();
- } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
- calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
- if (!showWeekends) {
- int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
- if (dayOfWeek == Calendar.SUNDAY) {
- calendar.add(Calendar.DATE, 1);
- } else if (dayOfWeek == Calendar.SATURDAY) {
- calendar.add(Calendar.DATE, 2);
- }
- }
- return calendar.getTime();
- } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
- return calendar.getTime();
- } else {
- throw new IllegalStateException("Invalid view attribute: " + view);
- }
- }
+ @Attribute(defaultValue = "" + DEFAULT_SLOT_MINUTES)
+ public abstract Integer getSlotMinutes();
- /**
- * Gets last displayed day on schedule.
- *
- * @param schedule schedule configuration for which date is calculated
- * @return last day displayed on schedule
- * @see AbstractSchedule#getFirstDisplayedDay(org.richfaces.component.AbstractSchedule)
- */
- public static Date getLastDisplayedDate(AbstractSchedule schedule) {
- Calendar calendar = Calendar.getInstance();
- int firstDayOfWeek = getFirstDay(schedule);
- String view = getView(schedule);
- boolean showWeekends = isShowWeekends(schedule);
- if (VIEW_MONTH.equals(view)) {
- if (WEEK_MODE_FIXED.equals(getWeekMode(schedule))) {
- calendar.setTime(getFirstDisplayedDay(schedule));
- calendar.add(Calendar.DAY_OF_YEAR, 42);
- } else {
- Date date = schedule.getDate();
- if (date != null) {
- calendar.setTime(date);
- }
+ @Attribute
+ public abstract String getStyleClass();
- if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
- firstDayOfWeek++;
- }
- calendar.setFirstDayOfWeek(firstDayOfWeek);
- calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
- int dayOfWeek = firstDayOfWeek + 6;
- if (dayOfWeek > Calendar.SATURDAY) {
- dayOfWeek -= 7;
- }
- /**
- * Following 1 line is a fix to what i believe is a bug of java.util.Calendar
- */
- calendar.get(Calendar.DAY_OF_WEEK);
- calendar.set(Calendar.DAY_OF_WEEK, dayOfWeek);
- calendar.add(Calendar.DATE, 1);
- }
- return calendar.getTime();
- } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
- calendar.setFirstDayOfWeek(firstDayOfWeek);
- calendar.setTime(getFirstDisplayedDay(schedule));
- calendar.add(Calendar.DATE, 7);
- if (!showWeekends) {
- int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
- if (dayOfWeek - 1 == Calendar.SUNDAY) {
- calendar.add(Calendar.DATE, -2);
- } else if (dayOfWeek - 1 == Calendar.SATURDAY) {
- calendar.add(Calendar.DATE, -1);
- }
- }
- return calendar.getTime();
- } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
- calendar.setTime(getFirstDisplayedDay(schedule));
- calendar.add(Calendar.DATE, 1);
- return calendar.getTime();
- } else {
- throw new IllegalStateException("Invalid view attribute: " + view);
- }
+ @Attribute(defaultValue = "SwitchType." + DEFAULT_SWITCH_TYPE,
+ suggestedValue = SWITCH_TYPE_AJAX + "," + SWITCH_TYPE_SERVER + "," + SWITCH_TYPE_CLIENT)
+ public abstract SwitchType getSwitchType();
- }
+ @Attribute(defaultValue = DEFAULT_UNSELECT_CANCEL)
+ public abstract String getUnselectCancel();
- /**
- * Here go static methods for getting value or default value of attributes.
- */
- /**
- * Tells if showWeekends is true or false. If it is not set it returns
- * default value.
- *
- * @param schedule inspected schedule
- * @return value of showWeekends
- */
- public static boolean isShowWeekends(AbstractSchedule schedule) {
- Boolean showWeekends = schedule.isShowWeekends();
- return showWeekends == null ? AbstractSchedule.DEFAULT_SHOW_WEEKENDS : schedule.isShowWeekends();
- }
+ @Attribute(required = true)
+ public abstract Object getValue();
- /**
- * Tells value of firstDay. If it is not set it returns
- * default value.
- *
- * @param schedule inspected schedule
- * @return value of firstDay
- */
- public static int getFirstDay(AbstractSchedule schedule) {
- Integer firstDay = schedule.getFirstDay();
- return firstDay == null ? AbstractSchedule.DEFAULT_FIRST_DAY : firstDay;
- }
+ @Attribute(required = true)
+ public abstract String getVar();
- /**
- * Tells value of weekMode. If it is not set it returns
- * default value.
- *
- * @param schedule inspected schedule
- * @return value of weekMode
- */
- public static String getWeekMode(AbstractSchedule schedule) {
- String weekMode = schedule.getWeekMode();
- return weekMode == null ? AbstractSchedule.DEFAULT_WEEK_MODE : weekMode;
- }
+ @Attribute(defaultValue = DEFAULT_VIEW,
+ suggestedValue = VIEW_MONTH
+ + "," + VIEW_AGENDA_DAY
+ + "," + VIEW_AGENDA_WEEK
+ + "," + VIEW_BASIC_DAY + "," + VIEW_BASIC_WEEK)
+ public abstract String getView();
+ @Attribute(signature = @Signature(parameters = ScheduleViewChangeEvent.class))
+ public abstract MethodExpression getViewChangeListener();
+
+ @Attribute(defaultValue = DEFAULT_WEEK_MODE,
+ suggestedValue = WEEK_MODE_FIXED + "," + WEEK_MODE_LIQUID + "," + WEEK_MODE_VARIABLE)
+ public abstract String getWeekMode();
+
+ @Attribute
+ public abstract String getWidgetVar();
+
+ @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_DEFAULT)
+ public abstract Boolean isAllDayByDefault();
+
+ @Attribute(defaultValue = "" + DEFAULT_ALL_DAY_SLOT)
+ public abstract Boolean isAllDaySlot();
+
/**
- * Tells value of view. If it is not set it returns
- * default value.
+ * Tells if schedule should be automatically refreshed when date range is selected.
*
- * @param schedule inspected schedule
- * @return value of view
+ * @return true if schedule should be refreshed automaticaly; flase otherwise.
*/
- public static String getView(AbstractSchedule schedule) {
- String view = schedule.getView();
- return view == null ? AbstractSchedule.DEFAULT_VIEW : view;
+ @Attribute(defaultValue = "true")
+ public abstract boolean isAutoRefreshOnDateRangeSelect();
+
+ @Attribute(defaultValue = "" + DEFAULT_DISABLE_DRAGGING)
+ public abstract Boolean isDisableDragging();
+
+ @Attribute(defaultValue = "" + DEFAULT_DISABLE_RESIZING)
+ public abstract Boolean isDisableResizing();
+
+ @Attribute(defaultValue = "" + DEFAULT_EDITABLE)
+ public abstract Boolean isEditable();
+
+ @Attribute(defaultValue = "" + DEFAULT_RTL)
+ public abstract Boolean isRTL();
+
+ @Attribute(defaultValue = "" + DEFAULT_SELECT_HELPER)
+ public abstract Boolean isSelectHelper();
+
+ @Attribute(defaultValue = "" + DEFAULT_SELECTABLE)
+ public abstract Boolean isSelectable();
+
+ @Attribute(defaultValue = "" + DEFAULT_SHOW_WEEKENDS)
+ public abstract Boolean isShowWeekends();
+
+ @Attribute(defaultValue = "" + DEFAULT_UNSELECT_AUTO)
+ public abstract Boolean isUnselectAuto();
+
+ public void setDataModel(DataModel model) {
+ this.model = model;
}
+ public abstract void setDate(Date date);
+
+ public abstract void setFirstDay(Integer firstDay);
+
+ public abstract void setShowWeekends(Boolean showWeekends);
+
+ public abstract void setView(String view);
+
+ @SuppressWarnings("unchecked")
protected DataModel getDataModel() {
// Return any previously cached DataModel instance
if (this.model != null) {
@@ -721,94 +752,9 @@
setDataModel(new ScalarDataModel(current));
}
return model;
-
}
- public void setDataModel(DataModel model) {
- this.model = model;
+ private void setResponseData(Object data) {
+ ExtendedPartialViewContext.getInstance(getFacesContext()).getResponseComponentDataMap().put(getClientId(getFacesContext()), data);
}
-
- public void addItemSelectedListener(ScheduleItemSelectListener listener) {
- addFacesListener(listener);
- }
-
- public void removeItemSelectedListener(ScheduleItemSelectListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleItemSelectListener[] getItemSelectedListeners() {
- return (ScheduleItemSelectListener[]) getFacesListeners(ScheduleItemSelectListener.class);
- }
-
- public void addItemMoveListener(ScheduleItemMoveListener listener) {
- addFacesListener(listener);
- }
-
- public void removeItemMoveListener(ScheduleItemMoveListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleItemMoveListener[] getItemMoveListeners() {
- return (ScheduleItemMoveListener[]) getFacesListeners(ScheduleItemMoveListener.class);
- }
-
- public void addItemResizeListener(ScheduleItemResizeListener listener) {
- addFacesListener(listener);
- }
-
- public void removeItemResizeListener(ScheduleItemResizeListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleItemResizeListener[] getItemResizeListeners() {
- return (ScheduleItemResizeListener[]) getFacesListeners(ScheduleItemResizeListener.class);
- }
-
- public void addViewChangedListener(ScheduleViewChangeListener listener) {
- addFacesListener(listener);
- }
-
- public void removeViewChangedListener(ScheduleViewChangeListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleViewChangeListener[] getViewChangedListeners() {
- return (ScheduleViewChangeListener[]) getFacesListeners(ScheduleViewChangeListener.class);
- }
-
- public void addDateRangeChangedListener(ScheduleDateRangeChangeListener listener) {
- addFacesListener(listener);
- }
-
- public void removeDateRangeChangedListener(ScheduleDateRangeChangeListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleDateRangeChangeListener[] getDateRangeChangedListeners() {
- return (ScheduleDateRangeChangeListener[]) getFacesListeners(ScheduleDateRangeChangeListener.class);
- }
-
- public void addDateRangeSelectedListener(ScheduleDateRangeSelectListener listener) {
- addFacesListener(listener);
- }
-
- public void removeDateRangeSelectedListener(ScheduleDateRangeSelectListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleDateRangeSelectListener[] getDateRangeSelectedListeners() {
- return (ScheduleDateRangeSelectListener[]) getFacesListeners(ScheduleDateRangeSelectListener.class);
- }
-
- public void addDateSelectedListener(ScheduleDateSelectListener listener) {
- addFacesListener(listener);
- }
-
- public void removeDateSelectedListener(ScheduleDateSelectListener listener) {
- removeFacesListener(listener);
- }
-
- public ScheduleDateSelectListener[] getDateSelectedListeners() {
- return (ScheduleDateSelectListener[]) getFacesListeners(ScheduleDateSelectListener.class);
- }
}
Modified: sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/AbstractScheduleItem.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -21,27 +21,29 @@
*/
package org.richfaces.component;
-import java.util.Date;
-
-import javax.faces.component.UIComponentBase;
-
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import javax.faces.component.UIComponentBase;
+import java.util.Date;
+
@JsfComponent(tag = @Tag(name = "scheduleItem", type = TagType.Facelets))
public abstract class AbstractScheduleItem extends UIComponentBase {
public static final String COMPONENT_TYPE = "org.richfaces.ScheduleItem";
+
public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
+
public static final boolean DEFAULT_ALL_DAY = true;
+
public static final boolean DEFAULT_EDITABLE = AbstractSchedule.DEFAULT_EDITABLE;
@Attribute
public abstract String getStyleClass();
- @Attribute
+ @Attribute(required = true)
public abstract String getTitle();
@Attribute
@@ -50,17 +52,18 @@
@Attribute
public abstract Date getEndDate();
- @Attribute
+ @Attribute(required = true)
public abstract String getEventId();
- @Attribute(defaultValue = "" + DEFAULT_ALL_DAY)
+ @Attribute(defaultValue = "DEFAULT_ALL_DAY")
public abstract Boolean isAllDay();
@Attribute
public abstract String getUrl();
- @Attribute(defaultValue = "false")
+ @Attribute
public abstract Boolean isEditable();
+ @Attribute
public abstract Object getData();
}
Deleted: sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/event/ScheduleListenerEventsProducer.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,46 +0,0 @@
-package org.richfaces.component.event;
-
-public interface ScheduleListenerEventsProducer {
-
- void addItemSelectedListener(ScheduleItemSelectListener listener);
-
- void removeItemSelectedListener(ScheduleItemSelectListener listener);
-
- ScheduleItemSelectListener[] getItemSelectedListeners();
-
- void addItemMoveListener(ScheduleItemMoveListener listener);
-
- void removeItemMoveListener(ScheduleItemMoveListener listener);
-
- ScheduleItemMoveListener[] getItemMoveListeners();
-
- void addItemResizeListener(ScheduleItemResizeListener listener);
-
- void removeItemResizeListener(ScheduleItemResizeListener listener);
-
- ScheduleItemResizeListener[] getItemResizeListeners();
-
- void addViewChangedListener(ScheduleViewChangeListener listener);
-
- void removeViewChangedListener(ScheduleViewChangeListener listener);
-
- ScheduleViewChangeListener[] getViewChangedListeners();
-
- void addDateRangeChangedListener(ScheduleDateRangeChangeListener listener);
-
- void removeDateRangeChangedListener(ScheduleDateRangeChangeListener listener);
-
- ScheduleDateRangeChangeListener[] getDateRangeChangedListeners();
-
- void addDateRangeSelectedListener(ScheduleDateRangeSelectListener listener);
-
- void removeDateRangeSelectedListener(ScheduleDateRangeSelectListener listener);
-
- ScheduleDateRangeSelectListener[] getDateRangeSelectedListeners();
-
- void addDateSelectedListener(ScheduleDateSelectListener listener);
-
- void removeDateSelectedListener(ScheduleDateSelectListener listener);
-
- ScheduleDateSelectListener[] getDateSelectedListeners();
-}
Added: sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java (rev 0)
+++ sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/component/package-info.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -0,0 +1,4 @@
+@TagLibrary(uri = "http://richfaces.org/sandbox/schedule", shortName = "schedule", prefix = "schedule", displayName = "Schedule component tags") package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.TagLibrary;
+
Modified: sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/ScheduleRendererBase.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,25 +1,10 @@
package org.richfaces.renderkit;
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UINamingContainer;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSObject;
import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptString;
import org.richfaces.component.AbstractSchedule;
import org.richfaces.component.AbstractScheduleAgendaDayView;
import org.richfaces.component.AbstractScheduleAgendaWeekView;
@@ -38,6 +23,24 @@
import org.richfaces.renderkit.util.AjaxRendererUtils;
import org.richfaces.renderkit.util.RendererUtils;
+import javax.faces.FacesException;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UINamingContainer;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
@ResourceDependencies({
@ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js", target = "head"),
@@ -51,27 +54,49 @@
@ResourceDependency(name = "richfaces.schedule.js", target = "head"),
@ResourceDependency(name = "org.richfaces.renderkit.html.scripts.ScheduleMessages", target = "head"),
@ResourceDependency(name = "fullcalendar.css", target = "head")})
-public abstract class ScheduleRendererBase extends AjaxComponentRendererBase {
+public abstract class ScheduleRendererBase extends RendererBase {
+// ------------------------------ FIELDS ------------------------------
- public static final String RENDERER_TYPE = "org.richfaces.ScheduleRenderer";
+ public static final String DATE_RANGE_CHANGED_EVENT = "dateRangeChange";
+
+ public static final String DATE_RANGE_SELECTED_EVENT = "dateRangeSelect";
+
+ public static final String DATE_SELECTED_EVENT = "dateSelect";
+
public static final String ITEM_MOVE_EVENT = "itemMove";
+
public static final String ITEM_RESIZE_EVENT = "itemResize";
+
public static final String ITEM_SELECTED_EVENT = "itemSelect";
- public static final String DATE_RANGE_CHANGED_EVENT = "dateRangeChange";
+
+ public static final String RENDERER_TYPE = "org.richfaces.ScheduleRenderer";
+
public static final String VIEW_CHANGED_EVENT = "viewChange";
- public static final String DATE_SELECTED_EVENT = "dateSelect";
- public static final String DATE_RANGE_SELECTED_EVENT = "dateRangeSelect";
+
+ private static final String ALL_DAY_PARAM = "allDay";
+
private static final String CALLBACK = "callback";
+
+ private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+ private static final String DAY_DELTA_PARAM = "dayDelta";
+
+ private static final Map<String, Object> DEFAULTS;
+
private static final String END_DATE_PARAM = "endDate";
- private static final String START_DATE_PARAM = "startDate";
+
+ private static final String EVENT_TYPE_PARAM = "eventType";
+
private static final String ITEM_ID_PARAM = "itemId";
- private static final String DAY_DELTA_PARAM = "dayDelta";
+
private static final String MINUTE_DELTA_PARAM = "minuteDelta";
- private static final String ALL_DAY_PARAM = "allDay";
- private static final String EVENT_TYPE_PARAM = "eventType";
+
+ private static final String START_DATE_PARAM = "startDate";
+
private static final String VIEW_PARAM = "view";
- private static final Map<String, Object> DEFAULTS;
+// -------------------------- STATIC METHODS --------------------------
+
/**
* Following defaults are be used by addOptionIfSetAndNotDefault
*/
@@ -79,7 +104,7 @@
Map<String, Object> defaults = new HashMap<String, Object>();
defaults.put("styleClass", "");
defaults.put("defaultView", AbstractSchedule.DEFAULT_VIEW);
- defaults.put("firstDay", AbstractSchedule.DEFAULT_FIRST_DAY);
+ defaults.put("firstDay", AbstractSchedule.DEFAULT_FIRST_DAY - 1);
defaults.put("isRTL", AbstractSchedule.DEFAULT_RTL);
defaults.put("weekends", AbstractSchedule.DEFAULT_SHOW_WEEKENDS);
defaults.put("weekMode", AbstractSchedule.DEFAULT_WEEK_MODE);
@@ -100,6 +125,7 @@
defaults.put("disableResizing", AbstractSchedule.DEFAULT_DISABLE_RESIZING);
defaults.put("dragRevertDuration", AbstractSchedule.DEFAULT_DRAG_REVERT_DURATION);
defaults.put("allDayDefault", AbstractSchedule.DEFAULT_ALL_DAY_DEFAULT);
+ defaults.put("autoRefreshOnDateRangeSelect", AbstractSchedule.DEFAULT_AUTO_REFRESH_ON_DATE_RANGE_SELECT);
defaults.put("onbeforeitemselect", "");
defaults.put("onitemselect", "");
defaults.put("onbeforeitemdrop", "");
@@ -113,6 +139,7 @@
defaults.put("onitemmouseover", "");
defaults.put("onitemmouseout", "");
defaults.put("onviewchange", "");
+ defaults.put("onviewdisplay", "");
defaults.put("onbeforedateselect", "");
defaults.put("ondateselect", "");
defaults.put("onbeforedaterangeselect", "");
@@ -121,6 +148,15 @@
DEFAULTS = Collections.unmodifiableMap(defaults);
}
+ private static void copyAttribute(String attribute, String suffix, UIComponent source, UIComponent target) {
+ Object value = source.getAttributes().get(attribute);
+ if (value != null) {
+ target.getAttributes().put(attribute + suffix, value);
+ }
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
@Override
public void decode(FacesContext context, UIComponent component) {
if (!component.isRendered()) {
@@ -147,8 +183,8 @@
try {
if (DATE_RANGE_CHANGED_EVENT.equals(eventTypeParam)) {
- Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
- Date endDate = new Date(Long.parseLong(endDateParam) * 1000);
+ Date startDate = DATE_FORMAT.parse(startDateParam);
+ Date endDate = DATE_FORMAT.parse(endDateParam);
new ScheduleDateRangeChangeEvent(component, startDate, endDate).queue();
} else if (ITEM_MOVE_EVENT.equals(eventTypeParam)) {
int dayDelta = Integer.parseInt(dayDeltaParam);
@@ -164,43 +200,76 @@
} else if (VIEW_CHANGED_EVENT.equals(eventTypeParam)) {
new ScheduleViewChangeEvent(component, viewParam).queue();
} else if (DATE_SELECTED_EVENT.equals(eventTypeParam)) {
- Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
+ Date startDate = DATE_FORMAT.parse(startDateParam);
boolean allDay = Boolean.parseBoolean(allDayParam);
new ScheduleDateSelectEvent(component, startDate, allDay).queue();
} else if (DATE_RANGE_SELECTED_EVENT.equals(eventTypeParam)) {
- Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
- Date endDate = new Date(Long.parseLong(endDateParam) * 1000);
+ Date startDate = DATE_FORMAT.parse(startDateParam);
+ Date endDate = DATE_FORMAT.parse(endDateParam);
boolean allDay = Boolean.parseBoolean(allDayParam);
new ScheduleDateRangeSelectEvent(component, startDate, endDate, allDay).queue();
}
- } catch (NumberFormatException ex) {
+ } catch (ParseException ex) {
throw new FacesException("Cannot convert request parmeters", ex);
}
}
}
- protected void writeInitFunction(FacesContext context, UIComponent component) throws IOException {
- AbstractSchedule schedule = (AbstractSchedule) component;
- ResponseWriter writer = context.getResponseWriter();
- String clientId = schedule.getClientId(context);
- Locale locale = context.getViewRoot().getLocale();
- String widgetVar = schedule.getWidgetVar();
- if (widgetVar != null) {
- writer.writeText("var " + widgetVar + " = ", null);
+ private void addOptionHash(String attribute, UIComponent source, Map<String, Object> options) {
+ Map<String, Object> hash = new HashMap<String, Object>(3);
+ Map<String, Object> attributes = source.getAttributes();
+ addOptionIfSetAndNotDefault("month", attributes.get(attribute + "Month"), hash);
+ addOptionIfSetAndNotDefault("basicWeek", attributes.get(attribute + "BasicWeek"), hash);
+ addOptionIfSetAndNotDefault("agendaWeek", attributes.get(attribute + "AgendaWeek"), hash);
+ addOptionIfSetAndNotDefault("basicDay", attributes.get(attribute + "BasicDay"), hash);
+ addOptionIfSetAndNotDefault("agendaDay", attributes.get(attribute + "AgendaDay"), hash);
+ addOptionIfSetAndNotDefault("", attributes.get(attribute), hash);
+ if (hash.size() > 0) {
+ options.put(attribute, hash);
}
- writer.writeText(new JSObject("RichFaces.Schedule", clientId, locale.toString(),
- getOptions(schedule),
- DATE_RANGE_CHANGED_EVENT,
- ITEM_SELECTED_EVENT,
- ITEM_MOVE_EVENT,
- ITEM_RESIZE_EVENT,
- VIEW_CHANGED_EVENT,
- DATE_SELECTED_EVENT,
- DATE_RANGE_SELECTED_EVENT,
- createSubmitEventFunction(context, schedule)).toScript(),
- null);
}
+ protected void addOptionIfSetAndNotDefault(String optionName, Object value, Map<String, Object> options) {
+ if (value != null && !"".equals(value) && !value.equals(DEFAULTS.get(optionName))) {
+ options.put(optionName, value);
+ }
+ }
+
+ protected Object createSubmitEventFunction(FacesContext context, AbstractSchedule component) {
+ ScriptString jsFunction;
+ Map<String, Object> params = new HashMap<String, Object>();
+ params.put(getFieldId(context, component, START_DATE_PARAM), new JSReference(START_DATE_PARAM));
+ params.put(getFieldId(context, component, END_DATE_PARAM), new JSReference(END_DATE_PARAM));
+ params.put(getFieldId(context, component, ITEM_ID_PARAM), new JSReference(ITEM_ID_PARAM));
+ params.put(getFieldId(context, component, DAY_DELTA_PARAM), new JSReference(DAY_DELTA_PARAM));
+ params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new JSReference(MINUTE_DELTA_PARAM));
+ params.put(getFieldId(context, component, ALL_DAY_PARAM), new JSReference(ALL_DAY_PARAM));
+ params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
+ params.put(getFieldId(context, component, VIEW_PARAM), new JSReference(VIEW_PARAM));
+ String clientId = component.getClientId();
+ params.put(clientId, clientId);
+ if (isAjaxMode(component)) {
+ AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context, component);
+ ajaxFunction.getOptions().getParameters().putAll(params);
+ ajaxFunction.getOptions().set("complete", new JSReference(CALLBACK));
+ jsFunction = ajaxFunction;
+ } else if (SwitchType.server.equals(component.getSwitchType())) {
+ jsFunction = new JSFunction("RichFaces.submitForm", "#"
+ + RendererUtils.getInstance().getNestingForm(context, component).getClientId(context),
+ params,
+ "");
+ } else {
+ return null;
+ }
+ return new JSFunctionDefinition("event", VIEW_PARAM, EVENT_TYPE_PARAM, ITEM_ID_PARAM, START_DATE_PARAM,
+ END_DATE_PARAM, DAY_DELTA_PARAM, MINUTE_DELTA_PARAM, ALL_DAY_PARAM, CALLBACK).addToBody(jsFunction);
+ }
+
+ protected String getFieldId(FacesContext context, AbstractSchedule component, String attribute) {
+ return RendererUtils.getInstance().clientId(context, component) + UINamingContainer.getSeparatorChar(context)
+ + attribute;
+ }
+
protected Map<String, Object> getOptions(AbstractSchedule schedule) throws IOException {
/**
* Copy attributes from child view components
@@ -237,7 +306,10 @@
/**
* firstDayOfWeek numeration in Calendar (sunday=1,monday=2,etc.) and in widget(sunday=0,monday=1,etc.)
*/
- addOptionIfSetAndNotDefault("firstDay", schedule.getFirstDay() - 1, options);
+ Integer firstDay = schedule.getFirstDay();
+ if (firstDay != null) {
+ addOptionIfSetAndNotDefault("firstDay", firstDay - 1, options);
+ }
addOptionIfSetAndNotDefault("isRTL", schedule.isRTL(), options);
addOptionIfSetAndNotDefault("weekends", schedule.isShowWeekends(), options);
addOptionIfSetAndNotDefault("weekMode", schedule.getWeekMode(), options);
@@ -272,6 +344,7 @@
options.put("header", headerOptions);
}
addOptionIfSetAndNotDefault("allDayDefault", schedule.isAllDayByDefault(), options);
+ addOptionIfSetAndNotDefault("autoRefreshOnDateRangeSelect", schedule.isAutoRefreshOnDateRangeSelect(), options);
addOptionIfSetAndNotDefault("onbeforeitemselect", schedule.getOnbeforeitemselect(), options);
addOptionIfSetAndNotDefault("onitemselect", schedule.getOnitemselect(), options);
@@ -286,6 +359,7 @@
addOptionIfSetAndNotDefault("onitemmouseover", schedule.getOnitemmouseover(), options);
addOptionIfSetAndNotDefault("onitemmouseout", schedule.getOnitemmouseout(), options);
addOptionIfSetAndNotDefault("onviewchange", schedule.getOnviewchange(), options);
+ addOptionIfSetAndNotDefault("onviewdisplay", schedule.getOnviewdisplay(), options);
addOptionIfSetAndNotDefault("onbeforedateselect", schedule.getOnbeforedateselect(), options);
addOptionIfSetAndNotDefault("ondateselect", schedule.getOndateselect(), options);
addOptionIfSetAndNotDefault("onbeforedaterangeselect", schedule.getOnbeforedaterangeselect(), options);
@@ -323,48 +397,6 @@
return options;
}
- protected Object createSubmitEventFunction(FacesContext context, AbstractSchedule component) {
- JSFunction jsFunction;
- Map<String, Object> params = new HashMap<String, Object>();
- params.put(getFieldId(context, component, START_DATE_PARAM), new JSReference(START_DATE_PARAM));
- params.put(getFieldId(context, component, END_DATE_PARAM), new JSReference(END_DATE_PARAM));
- params.put(getFieldId(context, component, ITEM_ID_PARAM), new JSReference(ITEM_ID_PARAM));
- params.put(getFieldId(context, component, DAY_DELTA_PARAM), new JSReference(DAY_DELTA_PARAM));
- params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new JSReference(MINUTE_DELTA_PARAM));
- params.put(getFieldId(context, component, ALL_DAY_PARAM), new JSReference(ALL_DAY_PARAM));
- params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
- params.put(getFieldId(context, component, VIEW_PARAM), new JSReference(VIEW_PARAM));
- String clientId = component.getClientId();
- params.put(clientId, clientId);
- if (isAjaxMode(component)) {
- jsFunction = AjaxRendererUtils.buildAjaxFunction(context, component, AjaxRendererUtils.AJAX_FUNCTION_NAME);
- AjaxEventOptions eventOptions = AjaxRendererUtils.buildEventOptions(context, component);
- eventOptions.getParameters().putAll(params);
- eventOptions.set("complete", new JSReference(CALLBACK));
- jsFunction.addParameter(eventOptions);
- } else if (AbstractSchedule.SWITCH_TYPE_SERVER.equals(component.getSwitchType())) {
- jsFunction = new JSFunction("RichFaces.submitForm",
- RendererUtils.getInstance().getNestingForm(context, component).getClientId(context),
- params,
- "");
- } else {
- return null;
- }
- return new JSFunctionDefinition("event", VIEW_PARAM, EVENT_TYPE_PARAM, ITEM_ID_PARAM, START_DATE_PARAM,
- END_DATE_PARAM, DAY_DELTA_PARAM, MINUTE_DELTA_PARAM, ALL_DAY_PARAM, CALLBACK).addToBody(jsFunction);
- }
-
- protected void addOptionIfSetAndNotDefault(String optionName, Object value, Map<String, Object> options) {
- if (value != null && !"".equals(value) && !value.equals(DEFAULTS.get(optionName))) {
- options.put(optionName, value);
- }
- }
-
- protected String getFieldId(FacesContext context, AbstractSchedule component, String attribute) {
- return RendererUtils.getInstance().clientId(context, component) + UINamingContainer.getSeparatorChar(context)
- + attribute;
- }
-
protected boolean isAjaxMode(AbstractSchedule component) {
SwitchType mode = component.getSwitchType();
return SwitchType.ajax.equals(mode) || null == mode;
@@ -375,24 +407,18 @@
return SwitchType.client.equals(mode);
}
- private void addOptionHash(String attribute, UIComponent source, Map<String, Object> options) {
- Map<String, Object> hash = new HashMap<String, Object>(3);
- Map<String, Object> attributes = source.getAttributes();
- addOptionIfSetAndNotDefault("month", attributes.get(attribute + "Month"), hash);
- addOptionIfSetAndNotDefault("basicWeek", attributes.get(attribute + "BasicWeek"), hash);
- addOptionIfSetAndNotDefault("agendaWeek", attributes.get(attribute + "AgendaWeek"), hash);
- addOptionIfSetAndNotDefault("basicDay", attributes.get(attribute + "BasicDay"), hash);
- addOptionIfSetAndNotDefault("agendaDay", attributes.get(attribute + "AgendaDay"), hash);
- addOptionIfSetAndNotDefault("", attributes.get(attribute), hash);
- if (hash.size() > 0) {
- options.put(attribute, hash);
+ protected void writeInitFunction(FacesContext context, UIComponent component) throws IOException {
+ AbstractSchedule schedule = (AbstractSchedule) component;
+ ResponseWriter writer = context.getResponseWriter();
+ String clientId = schedule.getClientId(context);
+ Locale locale = context.getViewRoot().getLocale();
+ String widgetVar = schedule.getWidgetVar();
+ if (widgetVar != null) {
+ writer.writeText("var " + widgetVar + " = ", null);
}
+ final Map<String, Object> options = getOptions(schedule);
+ options.put("locale", locale.toString());
+ options.put("submitEventFunction", createSubmitEventFunction(context, schedule));
+ writer.writeText(new JSObject("RichFaces.ui.Schedule", clientId, options).toScript(), null);
}
-
- private static void copyAttribute(String attribute, String suffix, UIComponent source, UIComponent target) {
- Object value = source.getAttributes().get(attribute);
- if (value != null) {
- target.getAttributes().put(attribute + suffix, value);
- }
- }
}
Modified: sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,5 +1,13 @@
package org.richfaces.renderkit.html.scripts;
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.resource.AbstractCacheableResource;
+import org.richfaces.resource.DynamicResource;
+
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -9,20 +17,13 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.log.LogFactory;
-import org.richfaces.log.Logger;
-import org.richfaces.renderkit.HtmlConstants;
-import org.richfaces.resource.AbstractCacheableResource;
-import org.richfaces.resource.DynamicResource;
-
@DynamicResource
public class ScheduleMessages extends AbstractCacheableResource {
public static final String BUNDLE_NAME = "org.richfaces.component.UIScheduleMessages";
+
private static final String MESSAGE_KEY_BASE = "org.richfaces.component.UISchedule.";
+
private static final Logger LOG = LogFactory.getLogger(ScheduleMessages.class);
public ScheduleMessages() {
@@ -35,7 +36,7 @@
FacesContext facesContext = FacesContext.getCurrentInstance();
Application application = facesContext.getApplication();
StringBuilder out = new StringBuilder();
- out.append("RichFaces.Schedule.prototype.messages=jQuery.extend(RichFaces.Schedule.prototype.messages,{");
+ out.append("RichFaces.ui.Schedule.prototype.messages=jQuery.extend(RichFaces.ui.Schedule.prototype.messages,{");
Iterator<Locale> supportedLocales = application.getSupportedLocales();
while (supportedLocales.hasNext()) {
Locale locale = supportedLocales.next();
Modified: sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/resources/richfaces.schedule.js 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,158 +1,204 @@
-window.RichFaces = window.RichFaces || {};
-//TODO test ajax reRender
-RichFaces.Schedule = function(id, locale, options, dateRangeChangeEventName, itemSelectEventName, itemMoveEventName, itemResizeEventName, viewChangeEventName, dateSelectEventName, dateRangeSelectEventName, submitEventFunction) {
-
- var _this = this;
- this.scheduleNode = document.getElementById(id);
- this.scheduleNode[RichFaces.RICH_CONTAINER] = {component: this};
- if (!this.scheduleNode) {
- throw "No element with id '" + id + "' found.";
- }
-
- /**
- * Message bundle setup.
- */
- options = jQuery.extend({}, this.messages[locale], options);
-
- jQuery(document).ready(function() {
- _this.delegate = jQuery(_this.scheduleNode).fullCalendar(options);
- });
-
-
- // ---
- /**
- * Utility functions.
- */
- var getResponseData = function(event) {
- return event.componentData[id];
- }
-
- // ---
- /**
- * Converts javascript date into integer that can be used as param
- * for new Date(long) - milliseconds since epoch.
- */
- var formatDateParam = function(date) {
- return Math.round(date.getTime() / 1000);
- };
- /**
- * Compares two dates with with an accuracy of a day.
- */
- var isSameDay = function(dateA, dateB) {
- if (!dateA instanceof Date || !dateB instanceof Date) {
- throw "Both params must be Date objects";
- }
- return dateA.getYear() == dateB.getYear()
- && dateA.getMonth() == dateB.getMonth()
- && dateA.getDate() == dateB.getDate();
- };
- // ---
- /**
- * DELEGATE SETUP.
- * Delegate (fullCalendar) needs callback methods
- * for various events such as item clicking, dragging, resizing or loading
- * items.
- * Functions below can be overriden by ones declared in "options" parameter.
- */
- // ---
- /**
- * Called by fullCalendar when it needs to load items - initial load,
- * view type change, time navigation.
- * If in ajax mode, then some initial items should be provided.
- * If so then they are used for the first invocation of this function.
- * This avoids creating additional ajax request on initial rendering.
- * Custom users code cannot raise veto so any return statements there are
- * ignored.
- */
- var dateRangeChange = function(startDate, endDate, callback) {
- var firstInvocation = options.initialItems != null;
- if (firstInvocation) {
- var startDateData = options.initialItems.startDate;
- var endDateData = options.initialItems.endDate;
- var initialStartDate = new Date(startDateData.year, startDateData.month, startDateData.date);
- var initialEndDate = new Date(endDateData.year, endDateData.month, endDateData.date);
- var items = options.initialItems.items;
+/**
+ * This function evaluates code in template with object in ScopeChain.
+ * This is usefull if you need to evaluate code that uses member names
+ * that colide with external names that the code refers to.
+ * There is almost exact method in utils.js called Richfaces.eval,
+ * but it swallows exception thrown during evaluation, which makes debugging
+ * hard.
+ */
+(function ($, rf) {
+ // Create (for example) ui container for our component class
+ rf.ui = rf.ui || {};
+ // Default options definition if needed for the component
+ // var defaultOptions = {};
+ var SUBMIT_EVENT_FUNCTION = 'submitEventFunction';
+ // Extending component class with new properties and methods using extendClass
+ // $super - reference to the parent prototype, will be available inside those methods
+ rf.ui.Schedule = rf.BaseComponent.extendClass({
+ // class name
+ name:"Schedule",
+ init: function (componentId, options) {
+ if (!document.getElementById(componentId)) {
+ throw "No element with id '" + componentId + "' found.";
+ }
+ this.options = options;
+ // call constructor of parent class if needed
+ $super.constructor.call(this, componentId);
+ // attach component object to DOM element for
+ // future cleaning and for client side API calls
+ this.attachToDom(this.id);
+ // ...
/**
- * After initial load this should be cleaned so items are not cached.
+ * Message bundle & event handlers setup.
*/
- options.initialItems = null;
- /**
- * In case the JSF component made a mistake in calculating initial
- * date range we don't use initial items and just continue.
- */
- if (isSameDay(startDate, initialStartDate) && isSameDay(endDate, initialEndDate)) {
- callback(items);
- return;
+ options = jQuery.extend({
+ events: function(startDate, endDate, callback) {
+ _this.__dateRangeChange(startDate, endDate, callback)
+ },
+ eventDragStart: function(item, event, ui, view) {
+ _this.__itemDragStart(item, event, ui, view)
+ },
+ eventDragStop: function(item, event, ui, view) {
+ _this.__itemDragStop(item, event, ui, view)
+ },
+ eventDrop: function(item, dayDelta, minuteDelta, allDay, revertFunc, event, ui, view) {
+ _this.__itemDrop(item, dayDelta, minuteDelta, allDay, revertFunc, event, ui, view)
+ },
+ eventResizeStart: function(item, event, ui, view) {
+ _this.__itemResizeStart(item, event, ui, view)
+ },
+ eventResizeStop: function(item, event, ui, view) {
+ _this.__itemResizeStop(item, event, ui, view)
+ },
+ eventResize: function(item, dayDelta, minuteDelta, revertFunc, event, ui, view) {
+ _this.__itemResized(item, dayDelta, minuteDelta, revertFunc, event, ui, view)
+ },
+ eventClick: function(item, dayDelta, minuteDelta, revertFunc, event, ui, view) {
+ _this.__itemClick(item, dayDelta, minuteDelta, revertFunc, event, ui, view)
+ },
+ eventMouseover: function(item, event, view) {
+ _this.__itemMouseover(item, event, view)
+ },
+ eventMouseout: function(item, event, view) {
+ _this.__itemMouseout(item, event, view)
+ },
+ viewDisplay: function(view) {
+ _this.__viewChanged(view)
+ },
+ dayClick: function(date, allDay, event, view) {
+ _this.__dayClick(date, allDay, event, view)
+ },
+ select: function(startDate, endDate, allDay, view) {
+ _this.__dateRangeSelected(startDate, endDate, allDay, view)
+ }
+ }, this.messages[options['locale']], options);
+ var _this = this;
+ jQuery(function() {
+ jQuery(document.getElementById(_this.id)).fullCalendar(options);
+ });
+ },
+ // private functions definition
+ /**
+ * Utility functions.
+ */
+ __getResponseComponentData : function(event) {
+ return event.componentData[this.id];
+ },
+ /**
+ * Converts javascript date into integer that can be used as param
+ * for new Date(long) - milliseconds since epoch.
+ */
+ __formatDateParam : function(date) {
+ return jQuery.fullCalendar.formatDate(date, "yyyy-MM-dd HH:mm:ss");
+ },
+ /**
+ * Compares two dates with with an accuracy of a day.
+ */
+ __isSameDay : function(dateA, dateB) {
+ if (!dateA instanceof Date || !dateB instanceof Date) {
+ throw "Both params must be Date objects";
}
- }
- if (submitEventFunction != null) {
- submitEventFunction({} /* stub event */,
- null,
- dateRangeChangeEventName,
- null,
- formatDateParam(startDate),
- formatDateParam(endDate),
- null, null, null,
- function(event) {
- var data = getResponseData(event);
- if (data != undefined) {
- callback(data);
+ return dateA.getYear() == dateB.getYear()
+ && dateA.getMonth() == dateB.getMonth()
+ && dateA.getDate() == dateB.getDate();
+ },
+ /**
+ * Executes event handler passed in options.
+ * @param eventName name of the event
+ * @param context hash of variables that should be placed in scope when during evaluation
+ */
+ __executeInlineEventHandler : function(eventName, context) {
+ if (this.options[eventName] != null) {
+ return rf.ui.Schedule.eval("(function(){" + this.options[eventName] + "})()", context);
+ } else {
+ return null;
+ }
+ },
+ __getDelegate : function() {
+ return jQuery(document.getElementById(this.id));
+ },
+ // ---
+ /**
+ * DELEGATE SETUP.
+ * Delegate (fullCalendar) needs callback methods
+ * for various events such as item clicking, dragging, resizing or loading
+ * items.
+ * Functions below can be overriden by ones declared in "options" parameter.
+ */
+ // ---
+ /**
+ * Called by fullCalendar when it needs to load items - initial load,
+ * view type change, time navigation.
+ * If in ajax mode, then some initial items should be provided.
+ * If so then they are used for the first invocation of this function.
+ * This avoids creating additional ajax request on initial rendering.
+ * Custom users code cannot raise veto so any return statements there are
+ * ignored.
+ */
+ __dateRangeChange : function(startDate, endDate, callback) {
+ var firstInvocation = this.options.initialItems != null;
+ if (firstInvocation) {
+ var startDateData = this.options.initialItems.startDate;
+ var endDateData = this.options.initialItems.endDate;
+ var initialStartDate = new Date(startDateData['year'], startDateData.month, startDateData.date);
+ var initialEndDate = new Date(endDateData['year'], endDateData.month, endDateData.date);
+ var items = this.options.initialItems.items;
+ /**
+ * After initial load this should be cleaned so items are not cached.
+ */
+ this.options.initialItems = null;
+ /**
+ * In case the JSF component made a mistake in calculating initial
+ * date range we don't use initial items and just continue.
+ */
+ if (this.__isSameDay(startDate, initialStartDate) && this.__isSameDay(endDate, initialEndDate)) {
+ callback(items);
+ return;
+ }
+ }
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION]({} /* stub event */,
+ null,
+ 'dateRangeChange',
+ null,
+ this.__formatDateParam(startDate),
+ this.__formatDateParam(endDate),
+ null, null, null,
+ function(event) {
+ var data = _this.__getResponseComponentData(event);
+ if (data != undefined) {
+ callback(data);
+ }
+ _this.__executeInlineEventHandler('ondaterangechange', { 'startDate':startDate, 'endDate':endDate, 'event':event, 'items':data });
}
- if (options.ondaterangechange != null) {
- RichFaces.Schedule.eval("(function(){" + options.ondaterangechange + "})()", {
- 'startDate':startDate,
- 'endDate':endDate,
- 'data':data,
- 'items':data
- });
- }
- }
- );
- } else if (!firstInvocation && options.ondaterangechange != null) {
- RichFaces.Schedule.eval("(function(){" + options.ondaterangechange + "})()", {
- 'startDate':startDate,
- 'endDate':endDate
- });
- }
- };
- /**
- * Called by fullCalendar when item has started to be dragged.
- */
- var itemDragStart = function(item, event, ui, view) {
- if (options.onitemdragstart != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemdragstart + "})()", {
+ );
+ } else if (!firstInvocation) {
+ this.__executeInlineEventHandler('ondaterangechange', { 'startDate':startDate, 'endDate':endDate, 'event':null, 'items':null });
+ }
+ },
+ /**
+ * Called by fullCalendar when item has started to be dragged.
+ */
+ __itemDragStart: function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemdragstart', { 'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item has stopped to be dragged.
+ * This is invoked between itemDragStart and itemDrop.
+ */
+ __itemDragStop : function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemdragstop', { 'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item was dropped (dragging finished).
+ * This is invoked after itemDragStop.
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ */
+ __itemDrop : function(item, dayDelta, minuteDelta, allDay, revertFunc, event, ui, view) {
+ var result = this.__executeInlineEventHandler('onbeforeitemdrop', {
'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item has stopped to be dragged.
- * This is invoked between itemDragStart and itemDrop.
- */
- var itemDragStop = function(item, event, ui, view) {
- if (options.onitemdragstop != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemdragstop + "})()", {
- 'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item was dropped (dragging finished).
- * This is invoked after itemDragStop.
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- */
- var itemDrop = function(item, dayDelta, minuteDelta, allDay, revertFunc, event, ui, view) {
- var result;
- if (options.onbeforeitemdrop != null) {
- result = RichFaces.Schedule.eval("(function(){" + options.onbeforeitemdrop + "})()", {
- 'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
'allDay':allDay,
@@ -164,25 +210,24 @@
revertFunc();
return;
}
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- itemMoveEventName,
- item.id,
- null,
- null,
- dayDelta, minuteDelta, allDay,
- function(event) {
- var decision = getResponseData(event);
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'itemMove',
+ item.id,
+ null,
+ null,
+ dayDelta, minuteDelta, allDay,
+ function(event) {
+ var decision = _this.__getResponseComponentData(event);
- var vetoed = false;
- if (decision != undefined && decision !== true) {
- revertFunc();
- vetoed = true;
- }
- if (options.onitemdrop != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemdrop + "})()", {
+ var vetoed = false;
+ if (decision != undefined && decision !== true) {
+ revertFunc();
+ vetoed = true;
+ }
+ _this.__executeInlineEventHandler('onitemdrop', {
'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
@@ -193,49 +238,43 @@
'data':decision,
'vetoed':vetoed
});
- }
- }
- );
- }
- };
- /**
- * Called by fullCalendar when item has started to be resized.
- */
- var itemResizeStart = function(item, event, ui, view) {
- if (options.onitemresizestart != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemresizestart + "})()", {
+ });
+ } else {
+ this.__executeInlineEventHandler('onitemdrop', {
+ 'item':item,
+ 'dayDelta':dayDelta,
+ 'minuteDelta':minuteDelta,
+ 'allDay':allDay,
+ 'event':event,
+ 'ui':ui,
+ 'view':view,
+ 'data':null,
+ 'vetoed':null
+ });
+ }
+ },
+ /**
+ * Called by fullCalendar when item has started to be resized.
+ */
+ __itemResizeStart : function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemresizestart', { 'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item has stopped to be resized.
+ * This is invoked between itemResizeStart and itemResized.
+ */
+ __itemResizeStop : function(item, event, ui, view) {
+ this.__executeInlineEventHandler('onitemresizestop', { 'item':item, 'event':event, 'ui':ui, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item was resized.
+ * This is invoked after itemResizeStop.
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ */
+ __itemResized : function(item, dayDelta, minuteDelta, revertFunc, event, ui, view) {
+ var result = this.__executeInlineEventHandler('onbeforeitemresize', {
'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item has stopped to be resized.
- * This is invoked between itemResizeStart and itemResized.
- */
- var itemResizeStop = function(item, event, ui, view) {
- if (options.onitemresizestop != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemresizestop + "})()", {
- 'item':item,
- 'event':event,
- 'ui':ui,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item was resized.
- * This is invoked after itemResizeStop.
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- */
- var itemResized = function(item, dayDelta, minuteDelta, revertFunc, event, ui, view) {
- var result;
- if (options.onbeforeitemresize != null) {
- result = RichFaces.Schedule.eval("(function(){" + options.onbeforeitemresize + "})()", {
- 'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
'event':event,
@@ -246,24 +285,23 @@
revertFunc();
return;
}
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- itemResizeEventName,
- item.id,
- null,
- null,
- dayDelta, minuteDelta, null,
- function(event) {
- var decision = getResponseData(event);
- var vetoed = false;
- if (decision != undefined && decision !== true) {
- revertFunc();
- vetoed = true;
- }
- if (options.onitemresize != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemresize + "})()", {
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'itemResize',
+ item.id,
+ null,
+ null,
+ dayDelta, minuteDelta, null,
+ function(event) {
+ var decision = _this.__getResponseComponentData(event);
+ var vetoed = false;
+ if (decision != undefined && decision !== true) {
+ revertFunc();
+ vetoed = true;
+ }
+ _this.__executeInlineEventHandler('onitemresize', {
'item':item,
'dayDelta':dayDelta,
'minuteDelta':minuteDelta,
@@ -274,285 +312,241 @@
'vetoed':vetoed
});
}
- }
- );
- }
- };
- /**
- * Called by fullCalendar when mouse moves over item.
- */
- var itemMouseover = function(item, event, view) {
- if (options.onitemmouseover != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemmouseover + "})()", {
- 'item':item,
- 'event':event,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when mouse leaves item.
- */
- var itemMouseout = function(item, event, view) {
- if (options.onitemmouseout != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemmouseout + "})()", {
- 'item':item,
- 'event':event,
- 'view':view
- });
- }
- };
- /**
- * Called by fullCalendar when item is clicked.
- * Custom users code may return "false". In such case
- * changes no event will be sent to server and false will be returned
- * to fullCalendar, which will prevent redirecting to URL associated
- * with item (if such url was defined for the item).
- */
- var itemClick = function(item, event, view) {
- var result;
- if (options.onbeforeitemselect != null) {
- result = RichFaces.Schedule.eval("(function(){" + options.onbeforeitemselect + "})()", {
- 'item':item,
- 'event':event,
- 'view':view
- });
- }
- if (result === false) {
- return false;
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- itemSelectEventName,
- item.id,
- null, null, null, null, null, function(event) {
- var data = getResponseData(event);
-
- if (options.onitemselect != null) {
- RichFaces.Schedule.eval("(function(){" + options.onitemselect + "})()", {
- 'item':item,
- 'event':event,
- 'view':view,
- 'data':data
- });
+ );
+ } else {
+ this.__executeInlineEventHandler('onitemresize', {
+ 'item':item,
+ 'dayDelta':dayDelta,
+ 'minuteDelta':minuteDelta,
+ 'event':event,
+ 'ui':ui,
+ 'view':view,
+ 'data':null,
+ 'vetoed':null
+ });
+ }
+ },
+ /**
+ * Called by fullCalendar when mouse moves over item.
+ */
+ __itemMouseover : function(item, event, view) {
+ this.__executeInlineEventHandler('onitemmouseover', { 'item':item, 'event':event, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when mouse leaves item.
+ */
+ __itemMouseout : function(item, event, view) {
+ this.__executeInlineEventHandler('onitemmouseout', { 'item':item, 'event':event, 'view':view });
+ },
+ /**
+ * Called by fullCalendar when item is clicked.
+ * Custom users code may return "false". In such case
+ * changes no event will be sent to server and false will be returned
+ * to fullCalendar, which will prevent redirecting to URL associated
+ * with item (if such url was defined for the item).
+ */
+ __itemClick : function(item, event, view) {
+ var result = this.__executeInlineEventHandler('onbeforeitemselect', { 'item':item, 'event':event, 'view':view });
+ if (result === false) {
+ return false;
+ }
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'itemSelect',
+ item.id,
+ null, null, null, null, null, function(event) {
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('onitemselect', { 'item':item, 'event':event, 'view':view, 'data':data });
}
+ );
+ } else {
+ this.__executeInlineEventHandler('onitemselect', { 'item':item, 'event':event, 'view':view, 'data':null });
}
- );
- }
- return result;
- };
- /**
- * Called by fullCalendar when day is clicked.
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- */
- var dayClick = function(date, allDay, event, view) {
- if (options.onbeforedateselect != null) {
- var result = RichFaces.Schedule.eval("(function(){" + options.onbeforedateselect + "})()", {
- 'date':date,
- 'allDay':allDay,
- 'event':event,
- 'view':view
- });
+ return result;
+ },
+ /**
+ * Called by fullCalendar when day is clicked.
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ */
+ __dayClick : function(date, allDay, event, view) {
+ var result = this.__executeInlineEventHandler('onbeforedateselect', { 'date':date, 'allDay':allDay, 'event':event, 'view':view });
if (result === false) {
return;
}
- }
- if (submitEventFunction != null) {
- submitEventFunction(event,
- null,
- dateSelectEventName,
- null, formatDateParam(date), null, null, null, allDay, function(event) {
- var data = getResponseData(event);
- if (options.ondateselect != null) {
- RichFaces.Schedule.eval("(function(){" + options.ondateselect + "})()", {
- 'date':date,
- 'allDay':allDay,
- 'event':event,
- 'view':view,
- 'data':data
- });
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION](event,
+ null,
+ 'dateSelect',
+ null, this.__formatDateParam(date), null, null, null, allDay, function(event) {
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('ondateselect', { 'date':date, 'allDay':allDay, 'event':event, 'view':view, 'data':data });
}
+ );
+ } else {
+ this.__executeInlineEventHandler('ondateselect', { 'date':date, 'allDay':allDay, 'event':event, 'view':view, 'data':null });
}
- );
- }
- };
- var selectedView;
- /**
- * Called by fullCalendar when view or dates change.
- * We want to notify user only about view change, so we cache current view
- * on private variable "selectedView" and compare it with value passed
- * in parameter.
- * Custom users code may not raise veto so any "return" statements are
- * ignored.
- */
- var viewChanged = function(view) {
- if (selectedView != view && selectedView != undefined) {
- if (submitEventFunction != null) {
- submitEventFunction({},
- view.name,
- viewChangeEventName,
- null, null, null, null, null, null, function(event) {
- var data = getResponseData(event);
- if (options.onviewchange != null) {
- RichFaces.Schedule.eval("(function(){" + options.onviewchange + "})()", {
- 'view':view,
- 'data':data
- });
+ },
+ /**
+ * Called by fullCalendar when view or dates change.
+ * We want to notify user only about view change, so we cache current view
+ * on private variable "selectedView" and compare it with value passed
+ * in parameter.
+ * Custom users code may not raise veto so any "return" statements are
+ * ignored.
+ */
+ __viewChanged : function(view) {
+ this.__executeInlineEventHandler('onviewdisplay', { 'view':view });
+ if (this.selectedView != view && this.selectedView != undefined) {
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION]({},
+ view.name,
+ 'viewChange',
+ null, null, null, null, null, null, function(event) {
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('onviewchange', { 'view':view, 'event':event, 'data':data });
}
+ );
+ } else {
+ this.__executeInlineEventHandler('onviewchange', {'view':view, 'event':null, 'data':null});
}
- );
- } else if (options.onviewchange != null) {
- RichFaces.Schedule.eval("(function(){" + options.onviewchange + "})()", {
- 'view':view
- });
}
- }
- selectedView = view;
- };
- /**
- * Called by fullCalendar when some date range is selected (user clicks
- * and drags over empty time cells).
- * Custom users code may raise veto by returning "false". In such case
- * changes will be reverted and no event will be sent to server.
- * What is more, selection will be cleared at the end of this function.
- * (This is bad, i guess, but for now i don't see other way to
- * hide selection marker after selection was made, event sent to server,
- * and server side listeners have created new event for that selection.
- * If no unselect would happen then we selection helper would still be there
- * and mess the looks)
- */
- var dateRangeSelected = function(startDate, endDate, allDay, view) {
- if (!_this.delegate.fullCalendar('option', 'selectable')) {
- return;
- }
- var result;
- if (options.onbeforedaterangeselect != null) {
- result = RichFaces.Schedule.eval("(function(){" + options.onbeforedaterangeselect + "})()", {
- 'startDate':startDate,
- 'endDate':endDate,
- 'allDay':allDay,
- 'view':view
- });
- }
- if (result === false) {
- return;
- }
- if (submitEventFunction != null) {
- submitEventFunction({},
- null,
- dateRangeSelectEventName,
- null, formatDateParam(startDate), formatDateParam(endDate), null, null, allDay,
- function(event) {
- var data = getResponseData(event);
- _this.refetchItems();
- if (options.ondaterangeselect != null) {
- RichFaces.Schedule.eval("(function(){" + options.ondaterangeselect + "})()", {
+ this.selectedView = view;
+ },
+ /**
+ * Called by fullCalendar when some date range is selected (user clicks
+ * and drags over empty time cells).
+ * Custom users code may raise veto by returning "false". In such case
+ * changes will be reverted and no event will be sent to server.
+ * What is more, selection will be cleared at the end of this function.
+ * (This is bad, i guess, but for now i don't see other way to
+ * hide selection marker after selection was made, event sent to server,
+ * and server side listeners have created new event for that selection.
+ * If no unselect would happen then we selection helper would still be there
+ * and mess the looks)
+ */
+ __dateRangeSelected : function(startDate, endDate, allDay, view) {
+ if (!this.__getDelegate().fullCalendar('option', 'selectable')) {
+ return;
+ }
+ var result = this.__executeInlineEventHandler('onbeforedaterangeselect', { 'startDate':startDate, 'endDate':endDate, 'allDay':allDay, 'view':view });
+ if (result === false) {
+ return;
+ }
+ if (this.options[SUBMIT_EVENT_FUNCTION] != null) {
+ var _this = this;
+ this.options[SUBMIT_EVENT_FUNCTION]({},
+ null,
+ 'dateRangeSelect',
+ null, this.__formatDateParam(startDate), this.__formatDateParam(endDate), null, null, allDay,
+ function(event) {
+ if (_this.options['autoRefreshOnDateRangeSelect'] !== false) {
+ _this.refetchItems();
+ }
+ var data = _this.__getResponseComponentData(event);
+ _this.__executeInlineEventHandler('ondaterangeselect', {
'startDate':startDate,
'endDate':endDate,
'allDay':allDay,
'view':view,
+ 'event':event,
'data':data
});
}
- }
- );
+ );
+ } else {
+ this.__executeInlineEventHandler('ondaterangeselect', {
+ 'startDate':startDate,
+ 'endDate':endDate,
+ 'allDay':allDay,
+ 'view':view,
+ 'event':null,
+ 'data':null
+ });
+ }
+ },
+ // public API
+ select : function(startDate, endDate, allDay) {
+ this.__getDelegate().fullCalendar('select', startDate, endDate, allDay);
+ },
+ unselect: function() {
+ this.__getDelegate().fullCalendar('unselect');
+ },
+ render: function() {
+ this.__getDelegate().fullCalendar('render');
+ },
+ getView: function() {
+ return this.__getDelegate().fullCalendar('getView');
+ },
+ changeView: function(viewName) {
+ this.__getDelegate().fullCalendar('changeView', viewName);
+ },
+ prev: function() {
+ this.__getDelegate().fullCalendar('prev');
+ },
+ next: function() {
+ this.__getDelegate().fullCalendar('next');
+ },
+ prevYear: function() {
+ this.__getDelegate().fullCalendar('prevYear');
+ },
+ nextYear: function() {
+ this.__getDelegate().fullCalendar('nextYear');
+ },
+ today: function() {
+ this.__getDelegate().fullCalendar('today');
+ },
+ gotoDate: function(year, month, date) {
+ this.__getDelegate().fullCalendar('gotoDate', year, month, date);
+ },
+ incrementDate: function(years, months, days) {
+ this.__getDelegate().fullCalendar('incrementDate', years, months, days);
+ },
+ updateItem: function(item) {
+ this.__getDelegate().fullCalendar('updateItem', item);
+ },
+ getItems: function(idOrFilter) {
+ return this.__getDelegate().fullCalendar('clientEvents', idOrFilter);
+ },
+ removeItems: function(idOrFilter) {
+ this.__getDelegate().fullCalendar('removeEvents', idOrFilter);
+ },
+ refetchItems: function() {
+ this.__getDelegate().fullCalendar('refetchEvents');
+ },
+ addItemsSource: function(source) {
+ this.__getDelegate().fullCalendar('addEventSource', source);
+ },
+ removeItemsSource: function(source) {
+ this.__getDelegate().fullCalendar('removeEventSource', source);
+ },
+ addItem: function(event, stick) {
+ this.__getDelegate().fullCalendar('renderEvent', event, stick);
+ },
+ reRender: function() {
+ this.__getDelegate().fullCalendar('rerenderEvents');
+ },
+ // destructor definition
+ destroy: function () {
+ // define destructor if additional cleaning is needed but
+ // in most cases its not nessesary.
+ // call parent’s destructor
+ $super.destroy.call(this);
+ this.__getDelegate().fullCalendar('destroy');
}
- };
- options = jQuery.extend({
- events: dateRangeChange,
- eventDragStart: itemDragStart,
- eventDragStop: itemDragStop,
- eventDrop: itemDrop,
- eventResizeStart: itemResizeStart,
- eventResizeStop: itemResizeStop,
- eventResize: itemResized,
- eventClick: itemClick,
- eventMouseover: itemMouseover,
- eventMouseout: itemMouseout,
- viewDisplay: viewChanged,
- dayClick: dayClick,
- select: dateRangeSelected
- }, options);
-
-};
-RichFaces.Schedule.prototype.messages = {};
-/**
- * This function evaluates code in template with object in ScopeChain.
- * This is usefull if you need to evaluate code that uses member names
- * that colide with external names that the code refers to.
- * There is almost exact method in utils.js called Richfaces.eval,
- * but it swallows exception thrown during evaluation, which makes debugging
- * hard.
- */
-RichFaces.Schedule.eval = function(template, object) {
+ });
+ rf.ui.Schedule.prototype.messages = [];
+ // define super class reference - reference to the parent prototype
+ var $super = rf.ui.Schedule.$super;
+})(jQuery, RichFaces);
+RichFaces.ui.Schedule.eval = function(template, object) {
var value;
with (object) {
value = eval(template);
}
return value;
-};
-RichFaces.Schedule.prototype.select = function(startDate, endDate, allDay) {
- this.delegate.fullCalendar('select', startDate, endDate, allDay);
-};
-RichFaces.Schedule.prototype.unselect = function() {
- this.delegate.fullCalendar('unselect');
-};
-RichFaces.Schedule.prototype.render = function() {
- this.delegate.fullCalendar('render');
-};
-RichFaces.Schedule.prototype.destroy = function() {
- this.delegate.fullCalendar('destroy');
-};
-RichFaces.Schedule.prototype.getView = function() {
- return this.delegate.fullCalendar('getView');
-};
-RichFaces.Schedule.prototype.changeView = function(viewName) {
- this.delegate.fullCalendar('changeView', viewName);
-};
-RichFaces.Schedule.prototype.prev = function() {
- this.delegate.fullCalendar('prev');
-};
-RichFaces.Schedule.prototype.next = function() {
- this.delegate.fullCalendar('next');
-};
-RichFaces.Schedule.prototype.prevYear = function() {
- this.delegate.fullCalendar('prevYear');
-};
-RichFaces.Schedule.prototype.nextYear = function() {
- this.delegate.fullCalendar('nextYear');
-};
-RichFaces.Schedule.prototype.today = function() {
- this.delegate.fullCalendar('today');
-};
-RichFaces.Schedule.prototype.gotoDate = function(year, month, date) {
- this.delegate.fullCalendar('gotoDate', year, month, date);
-};
-RichFaces.Schedule.prototype.incrementDate = function(years, months, days) {
- this.delegate.fullCalendar('incrementDate', years, months, days);
-};
-RichFaces.Schedule.prototype.updateItem = function(item) {
- this.delegate.fullCalendar('updateItem', item);
-};
-RichFaces.Schedule.prototype.getItems = function(idOrFilter) {
- return this.delegate.fullCalendar('clientEvents', idOrFilter);
-};
-RichFaces.Schedule.prototype.removeItems = function(idOrFilter) {
- this.delegate.fullCalendar('removeEvents', idOrFilter);
-};
-RichFaces.Schedule.prototype.refetchItems = function() {
- this.delegate.fullCalendar('refetchEvents');
-};
-RichFaces.Schedule.prototype.addItemsSource = function(source) {
- this.delegate.fullCalendar('addEventSource', source);
-};
-RichFaces.Schedule.prototype.removeItemsSource = function(source) {
- this.delegate.fullCalendar('removeEventSource', source);
-};
-RichFaces.Schedule.prototype.addItem = function(event, stick) {
- this.delegate.fullCalendar('renderEvent', event, stick);
-};
-RichFaces.Schedule.prototype.reRender = function() {
- this.delegate.fullCalendar('rerenderEvents');
};
\ No newline at end of file
Deleted: sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/resources/META-INF/schedule.taglib.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,573 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
- version="2.0" id="schedule">
- <namespace>http://richfaces.org/schedule</namespace>
- <tag>
- <tag-name>scheduleMonthView</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleMonthView</component-type>
- <renderer-type>org.richfaces.ScheduleMonthViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>weekMode</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>schedule</tag-name>
- <component>
- <component-type>org.richfaces.Schedule</component-type>
- <renderer-type>org.richfaces.ScheduleRenderer</renderer-type>
- <handler-class>org.richfaces.view.facelets.html.ScheduleHandler</handler-class>
- </component>
- <attribute>
- <name>allDayByDefault</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>allDaySlot</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>allDayText</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>aspectRatio</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <name>axisFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>contentHeight</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>date</name>
- <type>java.util.Date</type>
- </attribute>
- <attribute>
- <name>dateRangeChangeListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>dateRangeSelectListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>dateSelectListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>defaultEventMinutes</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>disableDragging</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>disableResizing</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <name>dragRevertDuration</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>editable</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <description>First day of week. 1 - sunday, 2 - monday,..,7 - saturday.</description>
- <name>firstDay</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>firstHour</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>headerCenter</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>headerLeft</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>headerRight</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>height</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>itemMoveListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>itemResizeListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>itemSelectListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>maxTime</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>minTime</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforedaterangeselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforedateselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforeitemdrop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforeitemresize</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onbeforeitemselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>ondaterangechange</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>ondaterangeselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>ondateselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemdragstart</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemdragstop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemdrop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemmouseout</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemmouseover</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemresize</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemresizestart</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemresizestop</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onitemselect</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>onviewchange</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>rTL</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>selectHelper</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>selectable</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>showWeekends</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>slotMinutes</name>
- <type>java.lang.Integer</type>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>switchType</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>unselectAuto</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>unselectCancel</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>value</name>
- <type>java.lang.Object</type>
- </attribute>
- <attribute>
- <name>var</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>view</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>viewChangeListener</name>
- <type>javax.el.MethodExpression</type>
- </attribute>
- <attribute>
- <name>weekMode</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>widgetVar</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleAgendaWeekView</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleAgendaWeekView</component-type>
- <renderer-type>org.richfaces.ScheduleAgendaWeekViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleBasicWeekView</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleBasicWeekView</component-type>
- <renderer-type>org.richfaces.ScheduleBasicWeekViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleItem</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleItem</component-type>
- <renderer-type>org.richfaces.ScheduleItemRenderer</renderer-type>
- </component>
- <attribute>
- <name>allDay</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>editable</name>
- <type>java.lang.Boolean</type>
- </attribute>
- <attribute>
- <name>endDate</name>
- <type>java.util.Date</type>
- </attribute>
- <attribute>
- <name>eventId</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>startDate</name>
- <type>java.util.Date</type>
- </attribute>
- <attribute>
- <name>styleClass</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>title</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>url</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleAgendaDayView</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleAgendaDayView</component-type>
- <renderer-type>org.richfaces.ScheduleAgendaDayViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
- <tag>
- <tag-name>scheduleBasicDayView</tag-name>
- <component>
- <component-type>org.richfaces.ScheduleBasicDayView</component-type>
- <renderer-type>org.richfaces.ScheduleBasicDayViewRenderer</renderer-type>
- </component>
- <attribute>
- <description>The value binding expression used to wire up this component to a component property of a
- JavaBean class
- </description>
- <name>binding</name>
- <type>javax.faces.component.UIComponent</type>
- </attribute>
- <attribute>
- <name>columnFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>dragOpacity</name>
- <type>java.lang.Double</type>
- </attribute>
- <attribute>
- <description>The component identifier for this component. This value must be unique within the closest
- parent component that is a naming container.
- </description>
- <name>id</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>Flag indicating whether or not this component should be rendered (during Render Response
- Phase), or processed on any subsequent form submit. The default value for this property is true.
- </description>
- <name>rendered</name>
- <type>boolean</type>
- </attribute>
- <attribute>
- <name>timeFormat</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <name>titleFormat</name>
- <type>java.lang.String</type>
- </attribute>
- </tag>
-</facelet-taglib>
\ No newline at end of file
Modified: sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml
===================================================================
--- sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml 2011-04-15 12:37:03 UTC (rev 22423)
+++ sandbox/trunk/ui/schedule/ui/src/main/templates/org/richfaces/schedule.template.xml 2011-04-15 13:42:33 UTC (rev 22424)
@@ -1,13 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+ xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core" xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite">
-<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
- xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
- xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee">
-
<cc:interface>
<cdk:class>org.richfaces.renderkit.ScheduleRenderer</cdk:class>
<cdk:superclass>org.richfaces.renderkit.ScheduleRendererBase</cdk:superclass>
@@ -16,12 +11,12 @@
</cc:interface>
<cc:implementation>
- <cdk:call
- expression="org.richfaces.renderkit.util.FormUtil.throwEnclFormReqExceptionIfNeed(facesContext, component);"/>
- <div id="#{clientId}" class="rich-schedule #{component.attributes['styleClass']}"/>
- <script type="text/javascript">
- <cdk:call expression="writeInitFunction(facesContext,component);"/>
- </script>
+ <cdk:call expression="org.richfaces.renderkit.util.FormUtil.throwEnclFormReqExceptionIfNeed(facesContext, component);"/>
+ <div id="#{clientId}" class="rich-schedule #{component.attributes['styleClass']}">
+ <script type="text/javascript">
+ <cdk:call expression="writeInitFunction(facesContext,component);"/>
+ </script>
+ </div>
</cc:implementation>
</cdk:root>
\ No newline at end of file
13 years, 8 months
JBoss Rich Faces SVN: r22423 - in branches/4.0.X: examples/iteration-demo/src/main/java/org/richfaces/demo and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-15 08:37:03 -0400 (Fri, 15 Apr 2011)
New Revision: 22423
Added:
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java
branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java
branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/
branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml
branches/4.0.X/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml
branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml
branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml
branches/4.0.X/examples/iteration-demo/src/main/webapp/rf10888.xhtml
branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java
Removed:
branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml
Modified:
branches/4.0.X/examples/iteration-demo/pom.xml
branches/4.0.X/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml
branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
Log:
https://issues.jboss.org/browse/RF-10888
JPA 2 data table demo
Fix reviewed by Konstantin Mishin
Modified: branches/4.0.X/examples/iteration-demo/pom.xml
===================================================================
--- branches/4.0.X/examples/iteration-demo/pom.xml 2011-04-14 19:34:56 UTC (rev 22422)
+++ branches/4.0.X/examples/iteration-demo/pom.xml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -84,8 +84,23 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
- <scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb-j5</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>2.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.java-persistence</groupId>
+ <artifactId>jpa-api</artifactId>
+ <version>2.0-cr-1</version>
+ </dependency>
</dependencies>
<build>
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java (from rev 22419, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,251 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Order;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.Root;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceRange;
+import org.richfaces.component.SortOrder;
+import org.richfaces.model.Arrangeable;
+import org.richfaces.model.ArrangeableState;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.SortField;
+
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+public abstract class JPADataModel<T> extends ExtendedDataModel<T> implements Arrangeable {
+
+ private EntityManager entityManager;
+
+ private Object rowKey;
+
+ private ArrangeableState arrangeableState;
+
+ private Class<T> entityClass;
+
+ public JPADataModel(EntityManager entityManager, Class<T> entityClass) {
+ super();
+
+ this.entityManager = entityManager;
+ this.entityClass = entityClass;
+ }
+
+ public void arrange(FacesContext context, ArrangeableState state) {
+ arrangeableState = state;
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ rowKey = key;
+ }
+
+ @Override
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ private CriteriaQuery<Long> createCountCriteriaQuery() {
+ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+ CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
+ Root<T> root = criteriaQuery.from(entityClass);
+
+ Expression<Boolean> filterCriteria = createFilterCriteria(criteriaBuilder, root);
+ if (filterCriteria != null) {
+ criteriaQuery.where(filterCriteria);
+ }
+
+ Expression<Long> count = criteriaBuilder.count(root);
+ criteriaQuery.select(count);
+
+ return criteriaQuery;
+ }
+
+ private CriteriaQuery<T> createSelectCriteriaQuery() {
+ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+ CriteriaQuery<T> criteriaQuery = criteriaBuilder.createQuery(entityClass);
+ Root<T> root = criteriaQuery.from(entityClass);
+
+ if (arrangeableState != null) {
+
+ List<Order> orders = createOrders(criteriaBuilder, root);
+ if (!orders.isEmpty()) {
+ criteriaQuery.orderBy(orders);
+ }
+
+ Expression<Boolean> filterCriteria = createFilterCriteria(criteriaBuilder, root);
+ if (filterCriteria != null) {
+ criteriaQuery.where(filterCriteria);
+ }
+ }
+
+ return criteriaQuery;
+ }
+
+ private List<Order> createOrders(CriteriaBuilder criteriaBuilder, Root<T> root) {
+ List<Order> orders = Lists.newArrayList();
+ List<SortField> sortFields = arrangeableState.getSortFields();
+ if (sortFields != null && !sortFields.isEmpty()) {
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ for (SortField sortField: sortFields) {
+ String propertyName = (String) sortField.getSortBy().getValue(facesContext.getELContext());
+
+ Path<Object> expression = root.get(propertyName);
+
+ Order jpaOrder;
+ SortOrder sortOrder = sortField.getSortOrder();
+ if (sortOrder == SortOrder.ascending) {
+ jpaOrder = criteriaBuilder.asc(expression);
+ } else if (sortOrder == SortOrder.descending) {
+ jpaOrder = criteriaBuilder.desc(expression);
+ } else {
+ throw new IllegalArgumentException(sortOrder.toString());
+ }
+
+ orders.add(jpaOrder);
+ }
+ }
+
+ return orders;
+ }
+
+ protected ArrangeableState getArrangeableState() {
+ return arrangeableState;
+ }
+
+ protected Class<T> getEntityClass() {
+ return entityClass;
+ }
+
+ protected Expression<Boolean> createFilterCriteriaForField(String propertyName, Object filterValue, Root<T> root, CriteriaBuilder criteriaBuilder) {
+ String stringFilterValue = (String) filterValue;
+ if (Strings.isNullOrEmpty(stringFilterValue)) {
+ return null;
+ }
+
+ stringFilterValue = stringFilterValue.toLowerCase(arrangeableState.getLocale());
+
+ Path<String> expression = root.get(propertyName);
+ Expression<Integer> locator = criteriaBuilder.locate(criteriaBuilder.lower(expression), stringFilterValue);
+ return criteriaBuilder.gt(locator, 0);
+ }
+
+
+ private Expression<Boolean> createFilterCriteria(CriteriaBuilder criteriaBuilder, Root<T> root) {
+ Expression<Boolean> filterCriteria = null;
+ List<FilterField> filterFields = arrangeableState.getFilterFields();
+ if (filterFields != null && !filterFields.isEmpty()) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ for (FilterField filterField : filterFields) {
+ String propertyName = (String) filterField.getFilterExpression().getValue(facesContext.getELContext());
+ Object filterValue = filterField.getFilterValue();
+
+ Expression<Boolean> predicate = createFilterCriteriaForField(propertyName, filterValue, root, criteriaBuilder);
+
+ if (predicate == null) {
+ continue;
+ }
+
+ if (filterCriteria == null) {
+ filterCriteria = predicate.as(Boolean.class);
+ } else {
+ filterCriteria = criteriaBuilder.and(filterCriteria, predicate.as(Boolean.class));
+ }
+ }
+
+ }
+ return filterCriteria;
+ }
+
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
+ CriteriaQuery<T> criteriaQuery = createSelectCriteriaQuery();
+ TypedQuery<T> query = entityManager.createQuery(criteriaQuery);
+
+ SequenceRange sequenceRange = (SequenceRange) range;
+ if (sequenceRange.getFirstRow() >= 0 && sequenceRange.getRows() > 0) {
+ query.setFirstResult(sequenceRange.getFirstRow());
+ query.setMaxResults(sequenceRange.getRows());
+ }
+
+ List<T> data = query.getResultList();
+ for (T t : data) {
+ visitor.process(context, getId(t), argument);
+ }
+ }
+
+
+ @Override
+ public boolean isRowAvailable() {
+ return rowKey != null;
+ }
+
+ @Override
+ public int getRowCount() {
+ CriteriaQuery<Long> criteriaQuery = createCountCriteriaQuery();
+ return entityManager.createQuery(criteriaQuery).getSingleResult().intValue();
+ }
+
+ @Override
+ public T getRowData() {
+ return entityManager.find(entityClass, rowKey);
+ }
+
+ @Override
+ public int getRowIndex() {
+ return -1;
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object getWrappedData() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ throw new UnsupportedOperationException();
+ }
+
+ //TODO - implement using metadata
+ protected abstract Object getId(T t);
+}
\ No newline at end of file
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java (from rev 22419, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseListener;
+import javax.faces.lifecycle.Lifecycle;
+
+class PersistenceLifecycle extends Lifecycle {
+
+ private static final class PersistenceServiceRef {
+
+ static final PersistenceService PERSISTENCE_SERVICE = (PersistenceService) FacesContext.getCurrentInstance().
+ getExternalContext().getApplicationMap().get("persistenceService");
+
+ private PersistenceServiceRef() {
+ }
+
+ }
+
+ private Lifecycle lifecycle;
+
+ public PersistenceLifecycle(Lifecycle lifecycle) {
+ this.lifecycle = lifecycle;
+ }
+
+ public void addPhaseListener(PhaseListener listener) {
+ lifecycle.addPhaseListener(listener);
+ }
+
+ public PhaseListener[] getPhaseListeners() {
+ return lifecycle.getPhaseListeners();
+ }
+
+ public void removePhaseListener(PhaseListener listener) {
+ lifecycle.removePhaseListener(listener);
+ }
+
+ public void execute(FacesContext context) throws FacesException {
+ try {
+ lifecycle.execute(context);
+ } finally {
+ PersistenceServiceRef.PERSISTENCE_SERVICE.closeEntityManager();
+ }
+ }
+
+ public void render(FacesContext context) throws FacesException {
+ try {
+ lifecycle.render(context);
+ } finally {
+ PersistenceServiceRef.PERSISTENCE_SERVICE.closeEntityManager();
+ }
+ }
+
+
+}
\ No newline at end of file
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java (from rev 22419, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.util.Iterator;
+
+import javax.faces.FacesWrapper;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PersistenceLifecycleFactory extends LifecycleFactory implements FacesWrapper<LifecycleFactory> {
+
+ private LifecycleFactory lifecycleFactory;
+
+ private Lifecycle defaultLifecycle;
+
+ public PersistenceLifecycleFactory(LifecycleFactory lifecycleFactory) {
+ super();
+ this.lifecycleFactory = lifecycleFactory;
+ }
+
+ @Override
+ public void addLifecycle(String lifecycleId, Lifecycle lifecycle) {
+ getWrapped().addLifecycle(lifecycleId, lifecycle);
+ }
+
+ @Override
+ public Lifecycle getLifecycle(String lifecycleId) {
+ if (LifecycleFactory.DEFAULT_LIFECYCLE.equals(lifecycleId)) {
+ if (defaultLifecycle == null) {
+ createDefaultLifecycle();
+ }
+
+ return defaultLifecycle;
+ }
+
+ return lifecycleFactory.getLifecycle(lifecycleId);
+ }
+
+ private void createDefaultLifecycle() {
+ defaultLifecycle = new PersistenceLifecycle(lifecycleFactory.getLifecycle(DEFAULT_LIFECYCLE));
+ }
+
+ @Override
+ public Iterator<String> getLifecycleIds() {
+ return lifecycleFactory.getLifecycleIds();
+ }
+
+}
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java (from rev 22419, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.context.FacesContext;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
+import javax.persistence.Persistence;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Node;
+
+import com.google.common.collect.Lists;
+import com.google.common.io.Closeables;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(eager = true)
+@ApplicationScoped
+public class PersistenceService {
+
+ private static final Logger LOGGER = Logger.getLogger(PersistenceService.class.getName());
+
+ private EntityManagerFactory entityManagerFactory;
+
+ public EntityManager getEntityManager() {
+ Map<Object, Object> attributes = FacesContext.getCurrentInstance().getAttributes();
+
+ EntityManager manager = (EntityManager) attributes.get(PersistenceService.class);
+
+ if (manager == null) {
+ manager = entityManagerFactory.createEntityManager();
+ attributes.put(PersistenceService.class, manager);
+ manager.getTransaction().begin();
+ }
+
+ return manager;
+ }
+
+ void closeEntityManager() {
+ Map<Object, Object> attributes = FacesContext.getCurrentInstance().getAttributes();
+
+ EntityManager entityManager = (EntityManager) attributes.remove(PersistenceService.class);
+
+ if (entityManager != null) {
+ try {
+ entityManager.getTransaction().commit();
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, e.getMessage(), e);
+ try {
+ entityManager.getTransaction().rollback();
+ } catch (Exception e1) {
+ LOGGER.log(Level.SEVERE, e1.getMessage(), e1);
+ }
+ } finally {
+ entityManager.close();
+ }
+ }
+ }
+
+ @PostConstruct
+ public void init() {
+ entityManagerFactory = Persistence.createEntityManagerFactory("iterationDemo", new Properties());
+
+
+ EntityManager em = entityManagerFactory.createEntityManager();
+
+ EntityTransaction transaction = em.getTransaction();
+
+ try {
+ transaction.begin();
+
+ for (Person person: parseTestData()) {
+ em.persist(person);
+ }
+
+ transaction.commit();
+ } catch (Exception e) {
+ transaction.rollback();
+ e.printStackTrace();
+ } finally {
+ em.close();
+ }
+ }
+
+ private List<Person> parseTestData() throws Exception {
+ InputStream dataStream = null;
+ try {
+ dataStream = PersistenceService.class.getResourceAsStream("data.xml");
+ DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Node node = documentBuilder.parse(dataStream).getDocumentElement();
+
+ List<Person> persons = Lists.newArrayList();
+
+ for (Node personNode = node.getFirstChild(); personNode != null; personNode = personNode.getNextSibling()) {
+ if (personNode.getNodeType() != Node.ELEMENT_NODE) {
+ continue;
+ }
+
+ Person person = new Person();
+ persons.add(person);
+
+ for (Node personDataNode = personNode.getFirstChild(); personDataNode != null; personDataNode = personDataNode.getNextSibling()) {
+ if (personDataNode.getNodeType() != Node.ELEMENT_NODE) {
+ continue;
+ }
+
+ String nodeName = personDataNode.getNodeName();
+ String text = personDataNode.getTextContent();
+ if ("name".equals(nodeName)) {
+ person.setName(text);
+ } else if ("surname".equals(nodeName)) {
+ person.setSurname(text);
+ } else if ("email".equals(nodeName)) {
+ person.setEmail(text);
+ }
+ }
+ }
+
+ return persons;
+ } finally {
+ Closeables.closeQuietly(dataStream);
+ }
+ }
+
+ @PreDestroy
+ public void destroy() {
+ entityManagerFactory.close();
+ entityManagerFactory = null;
+ }
+
+}
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java (from rev 22419, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@Entity
+public class Person {
+
+ private String name;
+
+ private String surname;
+
+ private String email;
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ public Person() {
+ }
+
+ public Person(String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getSurname() {
+ return surname;
+ }
+
+ public void setSurname(String surname) {
+ this.surname = surname;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+}
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java (from rev 22419, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+
+import java.util.Map;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.persistence.EntityManager;
+
+import org.richfaces.component.SortOrder;
+
+import com.google.common.collect.Maps;
+
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean
+@SessionScoped
+public class PersonBean {
+
+ private static final class PersonDataModel extends JPADataModel<Person> {
+
+ private PersonDataModel(EntityManager entityManager) {
+ super(entityManager, Person.class);
+ }
+
+ @Override
+ protected Object getId(Person t) {
+ return t.getId();
+ }
+ }
+
+ @ManagedProperty(value = "#{persistenceService}")
+ private PersistenceService persistenceService;
+
+ private Map<String, SortOrder> sortOrders = Maps.newHashMapWithExpectedSize(1);
+
+ private Map<String, String> filterValues = Maps.newHashMap();
+
+ public void setPersistenceService(PersistenceService persistenceService) {
+ this.persistenceService = persistenceService;
+ }
+
+ public Map<String, SortOrder> getSortOrders() {
+ return sortOrders;
+ }
+
+ public Map<String, String> getFilterValues() {
+ return filterValues;
+ }
+
+ public SortOrder getSortOrder(String name) {
+ SortOrder sortOrder = getSortOrders().get(name);
+
+ if (sortOrder == null) {
+ sortOrder = SortOrder.unsorted;
+ }
+
+ return sortOrder;
+ }
+
+ public void switchSortOrder(String name) {
+ SortOrder newSortOrder = null;
+
+ switch (getSortOrder(name)) {
+ case unsorted:
+ newSortOrder = SortOrder.ascending;
+ break;
+ case ascending:
+ newSortOrder = SortOrder.descending;
+ break;
+ case descending:
+ newSortOrder = SortOrder.ascending;
+ break;
+ default:
+ throw new IllegalStateException();
+ }
+
+ sortOrders.clear();
+ sortOrders.put(name, newSortOrder);
+ }
+
+ public Object getDataModel() {
+ return new PersonDataModel(persistenceService.getEntityManager());
+ }
+}
\ No newline at end of file
Copied: branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java (from rev 22420, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.util.List;
+import java.util.regex.Pattern;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.base.Strings;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(name = "rf10888")
+@SessionScoped
+public class RF10888 {
+
+ private String name;
+
+ private String surname;
+
+ private String email;
+
+ @ManagedProperty(value = "#{persistenceService}")
+ private PersistenceService persistenceService;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSurname() {
+ return surname;
+ }
+
+ public void setSurname(String surname) {
+ this.surname = surname;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public void setPersistenceService(PersistenceService persistenceService) {
+ this.persistenceService = persistenceService;
+ }
+
+ private Predicate<Person> contains(String value, Function<Person, CharSequence> accessor) {
+ return Predicates.compose(Predicates.contains(Pattern.compile(Pattern.quote(value), Pattern.CASE_INSENSITIVE)), accessor);
+ }
+
+ public Object getFilteredData() {
+ @SuppressWarnings("unchecked")
+ List<Person> resultList = (List<Person>) persistenceService.getEntityManager().createQuery("SELECT p from Person as p").getResultList();
+
+ List<Predicate<Person>> predicates = Lists.newArrayList();
+
+ if (!Strings.isNullOrEmpty(name)) {
+ predicates.add(contains(name, new Function<Person, CharSequence>() {
+ public CharSequence apply(Person input) {
+ return input.getName();
+ }
+ }));
+ }
+ if (!Strings.isNullOrEmpty(surname)) {
+ predicates.add(contains(surname, new Function<Person, CharSequence>() {
+ public CharSequence apply(Person input) {
+ return input.getSurname();
+ }
+ }));
+ }
+ if (!Strings.isNullOrEmpty(email)) {
+ predicates.add(contains(email, new Function<Person, CharSequence>() {
+ public CharSequence apply(Person input) {
+ return input.getEmail();
+ }
+ }));
+ }
+
+ return Lists.newArrayList(Collections2.filter(resultList, Predicates.and(predicates)));
+ }
+
+}
Deleted: branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/resources/META-INF/persistence.xml 2011-04-14 11:53:42 UTC (rev 22419)
+++ branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="1.0"
- xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
- <persistence-unit name="iterationDemo"
- transaction-type="RESOURCE_LOCAL">
- <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
- <class>org.richfaces.demo.Person</class>
- <properties>
- <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
- <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:iteration_demo" />
- <property name="javax.persistence.jdbc.user" value="sa" />
- <property name="javax.persistence.jdbc.password" value=""/>
- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
- <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
- </properties>
- </persistence-unit>
-</persistence>
\ No newline at end of file
Copied: branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml (from rev 22419, trunk/examples/iteration-demo/src/main/resources/META-INF/persistence.xml)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/resources/META-INF/persistence.xml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="1.0"
+ xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
+ <persistence-unit name="iterationDemo"
+ transaction-type="RESOURCE_LOCAL">
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <class>org.richfaces.demo.Person</class>
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:iteration_demo" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value=""/>
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
+ <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Copied: branches/4.0.X/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml (from rev 22419, trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,1003 @@
+<persons>
+ <person>
+ <name>Savannah</name>
+ <surname>Dickerson</surname>
+ <email>ac.sem(a)Phasellus.com</email>
+ </person>
+ <person>
+ <name>Melyssa</name>
+ <surname>Scott</surname>
+ <email>orci(a)at.com</email>
+ </person>
+ <person>
+ <name>Jemima</name>
+ <surname>Workman</surname>
+ <email>ac.mattis.semper(a)eget.org</email>
+ </person>
+ <person>
+ <name>Evelyn</name>
+ <surname>Santiago</surname>
+ <email>consectetuer.cursus(a)nonmagna.com</email>
+ </person>
+ <person>
+ <name>Blossom</name>
+ <surname>Diaz</surname>
+ <email>non.leo(a)mattisvelit.ca</email>
+ </person>
+ <person>
+ <name>Miriam</name>
+ <surname>Gonzales</surname>
+ <email>velit(a)urna.com</email>
+ </person>
+ <person>
+ <name>Jada</name>
+ <surname>Dennis</surname>
+ <email>lectus.ante(a)lectus.com</email>
+ </person>
+ <person>
+ <name>Jessica</name>
+ <surname>Cotton</surname>
+ <email>in(a)purus.com</email>
+ </person>
+ <person>
+ <name>Henry</name>
+ <surname>Blackburn</surname>
+ <email>amet.risus.Donec(a)semper.com</email>
+ </person>
+ <person>
+ <name>Raymond</name>
+ <surname>Estrada</surname>
+ <email>vitae(a)eutellus.ca</email>
+ </person>
+ <person>
+ <name>Rhiannon</name>
+ <surname>Dodson</surname>
+ <email>dictum(a)Nullamscelerisque.edu</email>
+ </person>
+ <person>
+ <name>Nigel</name>
+ <surname>Ferrell</surname>
+ <email>dictum.Phasellus(a)velitin.ca</email>
+ </person>
+ <person>
+ <name>Kane</name>
+ <surname>Cook</surname>
+ <email>massa.Vestibulum(a)eu.com</email>
+ </person>
+ <person>
+ <name>Leandra</name>
+ <surname>Macias</surname>
+ <email>erat.Vivamus.nisi(a)NullainterdumCurabitur.ca</email>
+ </person>
+ <person>
+ <name>Ivory</name>
+ <surname>Sanchez</surname>
+ <email>Cras.lorem(a)non.org</email>
+ </person>
+ <person>
+ <name>Kelly</name>
+ <surname>Palmer</surname>
+ <email>dolor.egestas.rhoncus(a)risusDonecegestas.com</email>
+ </person>
+ <person>
+ <name>Jenna</name>
+ <surname>Willis</surname>
+ <email>ipsum.dolor(a)luctus.ca</email>
+ </person>
+ <person>
+ <name>Ivana</name>
+ <surname>Wolf</surname>
+ <email>ac(a)infelis.com</email>
+ </person>
+ <person>
+ <name>Graiden</name>
+ <surname>Hall</surname>
+ <email>purus(a)Integer.edu</email>
+ </person>
+ <person>
+ <name>Daria</name>
+ <surname>Petty</surname>
+ <email>tortor.dictum(a)egestasrhoncus.edu</email>
+ </person>
+ <person>
+ <name>Holmes</name>
+ <surname>Lang</surname>
+ <email>adipiscing.enim(a)Nullamscelerisque.ca</email>
+ </person>
+ <person>
+ <name>Michelle</name>
+ <surname>Miranda</surname>
+ <email>Nam.consequat.dolor(a)Naminterdum.edu</email>
+ </person>
+ <person>
+ <name>Calista</name>
+ <surname>Everett</surname>
+ <email>Donec.nibh(a)laoreetlibero.com</email>
+ </person>
+ <person>
+ <name>September</name>
+ <surname>Nicholson</surname>
+ <email>iaculis.odio(a)sollicitudincommodo.ca</email>
+ </person>
+ <person>
+ <name>Rosalyn</name>
+ <surname>Cline</surname>
+ <email>Fusce.fermentum.fermentum(a)gravidanuncsed.edu</email>
+ </person>
+ <person>
+ <name>Christen</name>
+ <surname>Cleveland</surname>
+ <email>Duis.volutpat.nunc(a)metusvitaevelit.ca</email>
+ </person>
+ <person>
+ <name>Igor</name>
+ <surname>Sears</surname>
+ <email>non(a)eu.edu</email>
+ </person>
+ <person>
+ <name>Plato</name>
+ <surname>Johnston</surname>
+ <email>suscipit.est(a)Lorem.org</email>
+ </person>
+ <person>
+ <name>Kelsie</name>
+ <surname>Peterson</surname>
+ <email>lacus.Aliquam(a)dolorelitpellentesque.org</email>
+ </person>
+ <person>
+ <name>Lionel</name>
+ <surname>Puckett</surname>
+ <email>mi.lacinia.mattis(a)lacusEtiambibendum.org</email>
+ </person>
+ <person>
+ <name>Orlando</name>
+ <surname>Hayes</surname>
+ <email>Mauris.quis(a)fringilla.org</email>
+ </person>
+ <person>
+ <name>Fuller</name>
+ <surname>Keller</surname>
+ <email>In.nec.orci(a)utmolestiein.org</email>
+ </person>
+ <person>
+ <name>Brandon</name>
+ <surname>Woodward</surname>
+ <email>eget.magna(a)etnuncQuisque.edu</email>
+ </person>
+ <person>
+ <name>Lyle</name>
+ <surname>George</surname>
+ <email>lacus.Mauris(a)risus.edu</email>
+ </person>
+ <person>
+ <name>Abbot</name>
+ <surname>Valdez</surname>
+ <email>tincidunt.Donec.vitae(a)velit.ca</email>
+ </person>
+ <person>
+ <name>Kessie</name>
+ <surname>Carr</surname>
+ <email>Suspendisse.commodo(a)nonbibendum.ca</email>
+ </person>
+ <person>
+ <name>Louis</name>
+ <surname>Mitchell</surname>
+ <email>condimentum.Donec(a)convallisconvallis.com</email>
+ </person>
+ <person>
+ <name>Francesca</name>
+ <surname>Walters</surname>
+ <email>non.leo(a)eu.edu</email>
+ </person>
+ <person>
+ <name>Giacomo</name>
+ <surname>Cross</surname>
+ <email>Morbi(a)nunc.edu</email>
+ </person>
+ <person>
+ <name>Iris</name>
+ <surname>Curtis</surname>
+ <email>nec.euismod.in(a)Nullamsuscipit.ca</email>
+ </person>
+ <person>
+ <name>Abdul</name>
+ <surname>Atkins</surname>
+ <email>Donec.non.justo(a)lobortismauris.com</email>
+ </person>
+ <person>
+ <name>Dominique</name>
+ <surname>Knight</surname>
+ <email>suscipit.est.ac(a)odioNam.org</email>
+ </person>
+ <person>
+ <name>Odysseus</name>
+ <surname>Barnett</surname>
+ <email>nisi.a.odio(a)tempor.com</email>
+ </person>
+ <person>
+ <name>Hammett</name>
+ <surname>Ray</surname>
+ <email>eu.sem(a)purusactellus.ca</email>
+ </person>
+ <person>
+ <name>Gage</name>
+ <surname>Branch</surname>
+ <email>ac.libero(a)neque.ca</email>
+ </person>
+ <person>
+ <name>Quinn</name>
+ <surname>Wilcox</surname>
+ <email>Fusce(a)ipsumdolor.org</email>
+ </person>
+ <person>
+ <name>Ursa</name>
+ <surname>Bishop</surname>
+ <email>montes(a)tempor.org</email>
+ </person>
+ <person>
+ <name>Gray</name>
+ <surname>Riddle</surname>
+ <email>Suspendisse(a)magnanec.org</email>
+ </person>
+ <person>
+ <name>Jorden</name>
+ <surname>Christensen</surname>
+ <email>a.feugiat(a)id.edu</email>
+ </person>
+ <person>
+ <name>Hashim</name>
+ <surname>Knight</surname>
+ <email>Mauris(a)aliquetProin.edu</email>
+ </person>
+ <person>
+ <name>Whitney</name>
+ <surname>Hansen</surname>
+ <email>nibh.Phasellus.nulla(a)ullamcorperDuis.org</email>
+ </person>
+ <person>
+ <name>Lacy</name>
+ <surname>Thompson</surname>
+ <email>justo(a)egestasurnajusto.org</email>
+ </person>
+ <person>
+ <name>Chelsea</name>
+ <surname>Blanchard</surname>
+ <email>magna(a)dictum.org</email>
+ </person>
+ <person>
+ <name>Kaseem</name>
+ <surname>Melendez</surname>
+ <email>sem.semper.erat(a)mattis.edu</email>
+ </person>
+ <person>
+ <name>Lillian</name>
+ <surname>Conway</surname>
+ <email>mattis(a)egetmetus.com</email>
+ </person>
+ <person>
+ <name>Allistair</name>
+ <surname>Britt</surname>
+ <email>tellus.faucibus.leo(a)Aenean.org</email>
+ </person>
+ <person>
+ <name>Merritt</name>
+ <surname>Melton</surname>
+ <email>blandit(a)enimdiamvel.org</email>
+ </person>
+ <person>
+ <name>Vivien</name>
+ <surname>Baker</surname>
+ <email>accumsan(a)velitegestas.com</email>
+ </person>
+ <person>
+ <name>Quinn</name>
+ <surname>Lowery</surname>
+ <email>vitae.erat(a)ridiculusmusDonec.ca</email>
+ </person>
+ <person>
+ <name>Fleur</name>
+ <surname>Rios</surname>
+ <email>ullamcorper.viverra(a)egetvolutpatornare.ca</email>
+ </person>
+ <person>
+ <name>Suki</name>
+ <surname>Leach</surname>
+ <email>luctus.Curabitur(a)nibh.com</email>
+ </person>
+ <person>
+ <name>Scarlet</name>
+ <surname>Cannon</surname>
+ <email>dictum.eu.placerat(a)imperdiet.edu</email>
+ </person>
+ <person>
+ <name>Ross</name>
+ <surname>Reid</surname>
+ <email>in.hendrerit(a)tincidunt.ca</email>
+ </person>
+ <person>
+ <name>Amethyst</name>
+ <surname>Pennington</surname>
+ <email>Mauris.nulla.Integer(a)Fuscemollis.org</email>
+ </person>
+ <person>
+ <name>Gregory</name>
+ <surname>Lyons</surname>
+ <email>nisl.sem.consequat(a)Phasellus.ca</email>
+ </person>
+ <person>
+ <name>Constance</name>
+ <surname>Thomas</surname>
+ <email>accumsan(a)ipsum.ca</email>
+ </person>
+ <person>
+ <name>Cleo</name>
+ <surname>Chandler</surname>
+ <email>massa(a)penatibusetmagnis.org</email>
+ </person>
+ <person>
+ <name>Cruz</name>
+ <surname>Paul</surname>
+ <email>ornare.In(a)temporbibendum.org</email>
+ </person>
+ <person>
+ <name>Tyrone</name>
+ <surname>Nunez</surname>
+ <email>arcu.Nunc(a)nisi.org</email>
+ </person>
+ <person>
+ <name>Evan</name>
+ <surname>Erickson</surname>
+ <email>Etiam(a)nibh.org</email>
+ </person>
+ <person>
+ <name>Claudia</name>
+ <surname>Nash</surname>
+ <email>Cras.sed(a)estacmattis.com</email>
+ </person>
+ <person>
+ <name>Pascale</name>
+ <surname>Cherry</surname>
+ <email>mi(a)nonjustoProin.edu</email>
+ </person>
+ <person>
+ <name>Evelyn</name>
+ <surname>Baxter</surname>
+ <email>ante.ipsum.primis(a)adlitoratorquent.org</email>
+ </person>
+ <person>
+ <name>Wing</name>
+ <surname>Gill</surname>
+ <email>per(a)semperet.ca</email>
+ </person>
+ <person>
+ <name>Raja</name>
+ <surname>Smith</surname>
+ <email>euismod.in(a)Duisa.com</email>
+ </person>
+ <person>
+ <name>Gail</name>
+ <surname>Fisher</surname>
+ <email>Integer.mollis.Integer(a)nullaInteger.edu</email>
+ </person>
+ <person>
+ <name>Garth</name>
+ <surname>Kaufman</surname>
+ <email>Suspendisse(a)conguea.ca</email>
+ </person>
+ <person>
+ <name>Donna</name>
+ <surname>Holman</surname>
+ <email>orci.luctus(a)Integerinmagna.com</email>
+ </person>
+ <person>
+ <name>Harriet</name>
+ <surname>Rhodes</surname>
+ <email>eu(a)ametultricies.edu</email>
+ </person>
+ <person>
+ <name>Brody</name>
+ <surname>Jacobs</surname>
+ <email>magna.sed(a)Vivamusmolestiedapibus.org</email>
+ </person>
+ <person>
+ <name>Colton</name>
+ <surname>Duffy</surname>
+ <email>id.magna(a)nullaIntegervulputate.edu</email>
+ </person>
+ <person>
+ <name>Edan</name>
+ <surname>Baxter</surname>
+ <email>Cras(a)orciUt.ca</email>
+ </person>
+ <person>
+ <name>Desirae</name>
+ <surname>Thomas</surname>
+ <email>et(a)hendreritDonec.ca</email>
+ </person>
+ <person>
+ <name>Drew</name>
+ <surname>Dixon</surname>
+ <email>lectus.a.sollicitudin(a)rutrumurnanec.ca</email>
+ </person>
+ <person>
+ <name>Jasper</name>
+ <surname>Stein</surname>
+ <email>Nunc.commodo(a)Duis.edu</email>
+ </person>
+ <person>
+ <name>Stacy</name>
+ <surname>Taylor</surname>
+ <email>turpis.non(a)maurisblanditmattis.org</email>
+ </person>
+ <person>
+ <name>Indigo</name>
+ <surname>Ballard</surname>
+ <email>pellentesque.massa(a)odioEtiamligula.com</email>
+ </person>
+ <person>
+ <name>Leroy</name>
+ <surname>Golden</surname>
+ <email>ultrices(a)Aliquamnec.com</email>
+ </person>
+ <person>
+ <name>Erasmus</name>
+ <surname>Mcguire</surname>
+ <email>fermentum(a)Donecporttitor.com</email>
+ </person>
+ <person>
+ <name>Lev</name>
+ <surname>Mccray</surname>
+ <email>lectus.convallis.est(a)blanditenim.org</email>
+ </person>
+ <person>
+ <name>Ima</name>
+ <surname>Petersen</surname>
+ <email>egestas(a)acmieleifend.org</email>
+ </person>
+ <person>
+ <name>Murphy</name>
+ <surname>Mcintosh</surname>
+ <email>tempus.risus.Donec(a)dolorquamelementum.edu</email>
+ </person>
+ <person>
+ <name>Kelsie</name>
+ <surname>Cantrell</surname>
+ <email>ut.aliquam(a)commodohendreritDonec.org</email>
+ </person>
+ <person>
+ <name>Claudia</name>
+ <surname>Carlson</surname>
+ <email>fringilla(a)fermentumconvallisligula.com</email>
+ </person>
+ <person>
+ <name>Cole</name>
+ <surname>Walsh</surname>
+ <email>quis.pede.Praesent(a)intempus.org</email>
+ </person>
+ <person>
+ <name>Hu</name>
+ <surname>Baker</surname>
+ <email>Aliquam(a)Vivamusnibh.com</email>
+ </person>
+ <person>
+ <name>Lara</name>
+ <surname>Wong</surname>
+ <email>a.dui(a)leo.ca</email>
+ </person>
+ <person>
+ <name>Simone</name>
+ <surname>Lancaster</surname>
+ <email>netus.et(a)egettincidunt.ca</email>
+ </person>
+ <person>
+ <name>Heather</name>
+ <surname>Harrison</surname>
+ <email>tellus(a)lacus.edu</email>
+ </person>
+ <person>
+ <name>Zenia</name>
+ <surname>Curtis</surname>
+ <email>faucibus.lectus.a(a)fringilla.org</email>
+ </person>
+ <person>
+ <name>Stuart</name>
+ <surname>Pugh</surname>
+ <email>nulla.Cras.eu(a)asollicitudinorci.org</email>
+ </person>
+ <person>
+ <name>Shelley</name>
+ <surname>Goodman</surname>
+ <email>quam.dignissim(a)habitantmorbitristique.ca</email>
+ </person>
+ <person>
+ <name>Keegan</name>
+ <surname>Olson</surname>
+ <email>dolor.dapibus(a)tortor.org</email>
+ </person>
+ <person>
+ <name>Hop</name>
+ <surname>Rodriguez</surname>
+ <email>vitae.semper.egestas(a)natoque.ca</email>
+ </person>
+ <person>
+ <name>Deanna</name>
+ <surname>Frye</surname>
+ <email>Vivamus(a)risus.org</email>
+ </person>
+ <person>
+ <name>Rebecca</name>
+ <surname>Medina</surname>
+ <email>sociis(a)etmagnisdis.com</email>
+ </person>
+ <person>
+ <name>Sarah</name>
+ <surname>Patton</surname>
+ <email>ullamcorper(a)ettristique.com</email>
+ </person>
+ <person>
+ <name>Jenette</name>
+ <surname>Martin</surname>
+ <email>tempor.lorem.eget(a)etrutrum.com</email>
+ </person>
+ <person>
+ <name>Gil</name>
+ <surname>Brady</surname>
+ <email>tellus(a)inmagna.org</email>
+ </person>
+ <person>
+ <name>Jena</name>
+ <surname>Merritt</surname>
+ <email>litora(a)eu.ca</email>
+ </person>
+ <person>
+ <name>Christine</name>
+ <surname>Brennan</surname>
+ <email>ac(a)lectusasollicitudin.com</email>
+ </person>
+ <person>
+ <name>Clark</name>
+ <surname>Contreras</surname>
+ <email>natoque.penatibus.et(a)orciUtsagittis.org</email>
+ </person>
+ <person>
+ <name>Bo</name>
+ <surname>Becker</surname>
+ <email>est.vitae.sodales(a)Fusce.edu</email>
+ </person>
+ <person>
+ <name>Lacey</name>
+ <surname>Guerrero</surname>
+ <email>Fusce.dolor.quam(a)Aliquamvulputateullamcorper.com</email>
+ </person>
+ <person>
+ <name>Cullen</name>
+ <surname>Mason</surname>
+ <email>bibendum(a)purusin.com</email>
+ </person>
+ <person>
+ <name>Jenette</name>
+ <surname>Stuart</surname>
+ <email>sociis.natoque.penatibus(a)penatibus.com</email>
+ </person>
+ <person>
+ <name>Selma</name>
+ <surname>Zamora</surname>
+ <email>pede.Suspendisse.dui(a)fermentum.com</email>
+ </person>
+ <person>
+ <name>Clinton</name>
+ <surname>Peterson</surname>
+ <email>odio.Etiam(a)ornare.ca</email>
+ </person>
+ <person>
+ <name>Axel</name>
+ <surname>Henderson</surname>
+ <email>a(a)pedeCumsociis.org</email>
+ </person>
+ <person>
+ <name>Margaret</name>
+ <surname>Roy</surname>
+ <email>Sed(a)vehicularisusNulla.ca</email>
+ </person>
+ <person>
+ <name>Price</name>
+ <surname>Lyons</surname>
+ <email>magna(a)habitantmorbi.org</email>
+ </person>
+ <person>
+ <name>Logan</name>
+ <surname>Sharp</surname>
+ <email>In.at.pede(a)auctorodio.org</email>
+ </person>
+ <person>
+ <name>Marvin</name>
+ <surname>Ramirez</surname>
+ <email>Donec.tincidunt(a)et.edu</email>
+ </person>
+ <person>
+ <name>Briar</name>
+ <surname>Short</surname>
+ <email>nunc.interdum.feugiat(a)sedhendrerit.ca</email>
+ </person>
+ <person>
+ <name>Flynn</name>
+ <surname>York</surname>
+ <email>non.nisi(a)purusmauris.org</email>
+ </person>
+ <person>
+ <name>Benjamin</name>
+ <surname>Stevenson</surname>
+ <email>consectetuer(a)Aeneaneuismodmauris.org</email>
+ </person>
+ <person>
+ <name>Dieter</name>
+ <surname>Nicholson</surname>
+ <email>risus(a)enimgravida.org</email>
+ </person>
+ <person>
+ <name>Lacy</name>
+ <surname>Baker</surname>
+ <email>eu.neque.pellentesque(a)duiFuscealiquam.com</email>
+ </person>
+ <person>
+ <name>Kaseem</name>
+ <surname>Holder</surname>
+ <email>non.quam(a)Loremipsum.ca</email>
+ </person>
+ <person>
+ <name>Yeo</name>
+ <surname>Sanchez</surname>
+ <email>nisi.a(a)Namnullamagna.ca</email>
+ </person>
+ <person>
+ <name>Heidi</name>
+ <surname>Black</surname>
+ <email>tempus(a)faucibuslectusa.org</email>
+ </person>
+ <person>
+ <name>Cameron</name>
+ <surname>Vang</surname>
+ <email>turpis(a)tinciduntnuncac.com</email>
+ </person>
+ <person>
+ <name>Ryan</name>
+ <surname>Harris</surname>
+ <email>nec.ligula.consectetuer(a)risusInmi.edu</email>
+ </person>
+ <person>
+ <name>Debra</name>
+ <surname>Cortez</surname>
+ <email>luctus(a)pede.com</email>
+ </person>
+ <person>
+ <name>Neville</name>
+ <surname>Mcintyre</surname>
+ <email>egestas(a)placeratvelitQuisque.ca</email>
+ </person>
+ <person>
+ <name>Hope</name>
+ <surname>Romero</surname>
+ <email>dignissim.tempor(a)nonmagnaNam.com</email>
+ </person>
+ <person>
+ <name>Mechelle</name>
+ <surname>Kidd</surname>
+ <email>orci.Ut.sagittis(a)nonenimcommodo.ca</email>
+ </person>
+ <person>
+ <name>Nora</name>
+ <surname>Rivera</surname>
+ <email>gravida(a)consequatdolorvitae.edu</email>
+ </person>
+ <person>
+ <name>Zeph</name>
+ <surname>Snyder</surname>
+ <email>Donec.est(a)enimEtiam.ca</email>
+ </person>
+ <person>
+ <name>Britanni</name>
+ <surname>Williamson</surname>
+ <email>nulla.ante(a)sempereratin.edu</email>
+ </person>
+ <person>
+ <name>Jermaine</name>
+ <surname>Jones</surname>
+ <email>sapien.Aenean(a)Quisquenonummyipsum.org</email>
+ </person>
+ <person>
+ <name>Steel</name>
+ <surname>Newton</surname>
+ <email>cursus.et(a)Curabiturut.org</email>
+ </person>
+ <person>
+ <name>Hyatt</name>
+ <surname>Manning</surname>
+ <email>eget.massa.Suspendisse(a)aptenttaciti.edu</email>
+ </person>
+ <person>
+ <name>Stone</name>
+ <surname>Sloan</surname>
+ <email>adipiscing.elit.Curabitur(a)estvitaesodales.org</email>
+ </person>
+ <person>
+ <name>Lewis</name>
+ <surname>Guthrie</surname>
+ <email>neque.Nullam(a)Nuncpulvinararcu.edu</email>
+ </person>
+ <person>
+ <name>Sandra</name>
+ <surname>Cannon</surname>
+ <email>lobortis.nisi.nibh(a)luctuslobortisClass.com</email>
+ </person>
+ <person>
+ <name>Daria</name>
+ <surname>Page</surname>
+ <email>Aenean.sed.pede(a)facilisis.edu</email>
+ </person>
+ <person>
+ <name>Mohammad</name>
+ <surname>Soto</surname>
+ <email>blandit(a)aliquamarcuAliquam.org</email>
+ </person>
+ <person>
+ <name>Kerry</name>
+ <surname>Lowery</surname>
+ <email>vitae(a)mauriserateget.edu</email>
+ </person>
+ <person>
+ <name>Quinlan</name>
+ <surname>Roy</surname>
+ <email>est.ac(a)mollisvitaeposuere.com</email>
+ </person>
+ <person>
+ <name>Patricia</name>
+ <surname>Kirkland</surname>
+ <email>ipsum.dolor(a)orci.org</email>
+ </person>
+ <person>
+ <name>Janna</name>
+ <surname>Banks</surname>
+ <email>id.mollis.nec(a)eteuismodet.org</email>
+ </person>
+ <person>
+ <name>Lucius</name>
+ <surname>William</surname>
+ <email>sem(a)Nullamlobortis.com</email>
+ </person>
+ <person>
+ <name>Ira</name>
+ <surname>Buck</surname>
+ <email>pede.nonummy(a)dapibusgravidaAliquam.ca</email>
+ </person>
+ <person>
+ <name>Shellie</name>
+ <surname>Charles</surname>
+ <email>est(a)lobortisultricesVivamus.org</email>
+ </person>
+ <person>
+ <name>Stewart</name>
+ <surname>Cabrera</surname>
+ <email>libero(a)feugiat.com</email>
+ </person>
+ <person>
+ <name>April</name>
+ <surname>Sheppard</surname>
+ <email>sit(a)seddictumeleifend.ca</email>
+ </person>
+ <person>
+ <name>Gail</name>
+ <surname>Rollins</surname>
+ <email>odio(a)Proinnonmassa.ca</email>
+ </person>
+ <person>
+ <name>Ross</name>
+ <surname>Levy</surname>
+ <email>sit.amet.ultricies(a)Quisqueliberolacus.com</email>
+ </person>
+ <person>
+ <name>Hadley</name>
+ <surname>Mccormick</surname>
+ <email>vitae.posuere.at(a)enimnonnisi.org</email>
+ </person>
+ <person>
+ <name>Susan</name>
+ <surname>Banks</surname>
+ <email>interdum(a)nislsemconsequat.org</email>
+ </person>
+ <person>
+ <name>Nash</name>
+ <surname>Nolan</surname>
+ <email>convallis.dolor(a)enimSed.ca</email>
+ </person>
+ <person>
+ <name>Gretchen</name>
+ <surname>Carson</surname>
+ <email>elit.dictum.eu(a)temporarcuVestibulum.ca</email>
+ </person>
+ <person>
+ <name>Harper</name>
+ <surname>Hull</surname>
+ <email>eget(a)imperdiet.edu</email>
+ </person>
+ <person>
+ <name>Porter</name>
+ <surname>Benson</surname>
+ <email>tempus.non(a)Aenean.org</email>
+ </person>
+ <person>
+ <name>Xenos</name>
+ <surname>Tate</surname>
+ <email>blandit(a)antebibendum.org</email>
+ </person>
+ <person>
+ <name>Ali</name>
+ <surname>Carver</surname>
+ <email>Nulla.aliquet(a)ornare.org</email>
+ </person>
+ <person>
+ <name>Zachery</name>
+ <surname>Shepherd</surname>
+ <email>vitae.erat(a)sed.edu</email>
+ </person>
+ <person>
+ <name>Garrett</name>
+ <surname>Leach</surname>
+ <email>risus(a)quisurna.org</email>
+ </person>
+ <person>
+ <name>Mufutau</name>
+ <surname>Greer</surname>
+ <email>bibendum(a)luctus.com</email>
+ </person>
+ <person>
+ <name>Ryan</name>
+ <surname>Bryant</surname>
+ <email>turpis(a)purus.edu</email>
+ </person>
+ <person>
+ <name>Lacey</name>
+ <surname>Riley</surname>
+ <email>sed.turpis.nec(a)molestieSed.ca</email>
+ </person>
+ <person>
+ <name>Tiger</name>
+ <surname>Ryan</surname>
+ <email>lorem(a)vel.com</email>
+ </person>
+ <person>
+ <name>Upton</name>
+ <surname>Sullivan</surname>
+ <email>amet(a)Proin.com</email>
+ </person>
+ <person>
+ <name>Juliet</name>
+ <surname>Tate</surname>
+ <email>pede.Cum(a)eu.edu</email>
+ </person>
+ <person>
+ <name>Dieter</name>
+ <surname>Bowman</surname>
+ <email>lorem.eu(a)pellentesqueegetdictum.com</email>
+ </person>
+ <person>
+ <name>Jelani</name>
+ <surname>Knapp</surname>
+ <email>Nulla(a)Morbi.org</email>
+ </person>
+ <person>
+ <name>Martena</name>
+ <surname>Leblanc</surname>
+ <email>arcu.Vestibulum.ut(a)quamquis.edu</email>
+ </person>
+ <person>
+ <name>Megan</name>
+ <surname>Hull</surname>
+ <email>eu.nulla(a)amalesuada.com</email>
+ </person>
+ <person>
+ <name>Ginger</name>
+ <surname>Mcpherson</surname>
+ <email>dui.augue(a)Innecorci.com</email>
+ </person>
+ <person>
+ <name>Kylan</name>
+ <surname>Gilmore</surname>
+ <email>urna.Ut.tincidunt(a)aliquetsemut.com</email>
+ </person>
+ <person>
+ <name>Carlos</name>
+ <surname>King</surname>
+ <email>fermentum(a)lacus.com</email>
+ </person>
+ <person>
+ <name>Irma</name>
+ <surname>Blake</surname>
+ <email>Aliquam.nec(a)adipiscingelit.com</email>
+ </person>
+ <person>
+ <name>Tad</name>
+ <surname>Allen</surname>
+ <email>rhoncus.Proin.nisl(a)vehiculaaliquet.ca</email>
+ </person>
+ <person>
+ <name>Fiona</name>
+ <surname>Kline</surname>
+ <email>risus(a)gravidasagittisDuis.ca</email>
+ </person>
+ <person>
+ <name>Nell</name>
+ <surname>Franco</surname>
+ <email>blandit(a)viverraMaecenasiaculis.org</email>
+ </person>
+ <person>
+ <name>Scarlet</name>
+ <surname>Hall</surname>
+ <email>tincidunt(a)Nullamsuscipit.com</email>
+ </person>
+ <person>
+ <name>Zane</name>
+ <surname>Mccray</surname>
+ <email>volutpat.Nulla(a)malesuadafringilla.edu</email>
+ </person>
+ <person>
+ <name>Connor</name>
+ <surname>Salas</surname>
+ <email>Sed.nulla.ante(a)eu.com</email>
+ </person>
+ <person>
+ <name>Carlos</name>
+ <surname>Hunt</surname>
+ <email>Nam(a)nequevenenatislacus.org</email>
+ </person>
+ <person>
+ <name>Lane</name>
+ <surname>Andrews</surname>
+ <email>a.sollicitudin(a)inconsequat.org</email>
+ </person>
+ <person>
+ <name>Shana</name>
+ <surname>Ballard</surname>
+ <email>elementum(a)nibhlacinia.org</email>
+ </person>
+ <person>
+ <name>Conan</name>
+ <surname>Bradshaw</surname>
+ <email>vel.arcu.Curabitur(a)eratnonummyultricies.ca</email>
+ </person>
+ <person>
+ <name>Colleen</name>
+ <surname>Brooks</surname>
+ <email>erat.volutpat(a)cubiliaCurae;.edu</email>
+ </person>
+ <person>
+ <name>Francis</name>
+ <surname>Hardy</surname>
+ <email>sit.amet.luctus(a)dignissimlacus.com</email>
+ </person>
+ <person>
+ <name>Reuben</name>
+ <surname>Rodriguez</surname>
+ <email>natoque.penatibus.et(a)euaccumsansed.com</email>
+ </person>
+ <person>
+ <name>Iris</name>
+ <surname>Reid</surname>
+ <email>sed(a)Quisquepurussapien.edu</email>
+ </person>
+ <person>
+ <name>Phillip</name>
+ <surname>Schmidt</surname>
+ <email>ut(a)tortornibhsit.com</email>
+ </person>
+ <person>
+ <name>Jonas</name>
+ <surname>Crane</surname>
+ <email>ac.mi(a)luctusCurabitur.org</email>
+ </person>
+ <person>
+ <name>Abbot</name>
+ <surname>Terry</surname>
+ <email>fringilla(a)Crasconvallisconvallis.com</email>
+ </person>
+</persons>
+
\ No newline at end of file
Modified: branches/4.0.X/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-04-14 19:34:56 UTC (rev 22422)
+++ branches/4.0.X/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -10,4 +10,8 @@
<converter-id>org.richfaces.demo.PackageKeyConverter</converter-id>
<converter-class>org.richfaces.demo.model.tree.adaptors.PackageKeyConverter</converter-class>
</converter>
+
+ <factory>
+ <lifecycle-factory>org.richfaces.demo.PersistenceLifecycleFactory</lifecycle-factory>
+ </factory>
</faces-config>
Copied: branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml (from rev 22419, trunk/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<ui:composition>
+ <it:column sortBy="#{property}"
+ sortOrder="#{bean.sortOrders[property]}"
+ filterValue="#{bean.filterValues[property]}"
+ filterExpression="#{property}">
+ <f:facet name="header">
+ <h:commandLink style="color: white;"
+ action="#{bean.switchSortOrder(property)}">
+ #{bean.getSortOrder(property)}
+ <a4j:ajax render="richTable" />
+ </h:commandLink>
+ <br />
+ <h:inputText value="#{bean.filterValues[property]}">
+ <a4j:ajax render="richTable@body scroller" event="keyup" />
+ </h:inputText>
+ </f:facet>
+
+ <h:outputText value="#{record[property]}" />
+ </it:column>
+</ui:composition>
+</html>
Copied: branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml (from rev 22419, trunk/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:misc="http://richfaces.org/misc"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html"/>
+
+<h:head>
+ <title>Richfaces JPA Demo</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <it:dataTable keepSaved="true" id="richTable" var="record" value="#{personBean.dataModel}" rows="20">
+ <ui:include src="jpaColumn.xhtml">
+ <ui:param name="bean" value="#{personBean}" />
+ <ui:param name="property" value="name" />
+ </ui:include>
+ <ui:include src="jpaColumn.xhtml">
+ <ui:param name="bean" value="#{personBean}" />
+ <ui:param name="property" value="surname" />
+ </ui:include>
+ <ui:include src="jpaColumn.xhtml">
+ <ui:param name="bean" value="#{personBean}" />
+ <ui:param name="property" value="email" />
+ </ui:include>
+
+ <f:facet name="footer">
+ <it:dataScroller id="scroller" />
+ </f:facet>
+ </it:dataTable>
+ </h:form>
+</h:body>
+</html>
Copied: branches/4.0.X/examples/iteration-demo/src/main/webapp/rf10888.xhtml (from rev 22420, trunk/examples/iteration-demo/src/main/webapp/rf10888.xhtml)
===================================================================
--- branches/4.0.X/examples/iteration-demo/src/main/webapp/rf10888.xhtml (rev 0)
+++ branches/4.0.X/examples/iteration-demo/src/main/webapp/rf10888.xhtml 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<ui:composition>
+ <h:head></h:head>
+ <h:body>
+ <h:form>
+ <h:panelGrid columns="2">
+ Name
+ <h:inputText value="#{rf10888.name}">
+ <f:ajax render="table scroller" event="keyup" />
+ </h:inputText>
+
+ Surname
+ <h:inputText value="#{rf10888.surname}">
+ <f:ajax render="table scroller" event="keyup" />
+ </h:inputText>
+
+ E-mail
+ <h:inputText value="#{rf10888.email}">
+ <f:ajax render="table scroller" event="keyup" />
+ </h:inputText>
+ </h:panelGrid>
+
+ <it:dataScroller id="scroller" for="table" />
+ <h:dataTable value="#{rf10888.filteredData}" id="table" var="record" rows="20">
+ <h:column>
+ <f:facet name="header">
+ Name
+ </f:facet>
+ #{record.name}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ Surname
+ </f:facet>
+ #{record.surname}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ E-mail
+ </f:facet>
+ #{record.email}
+ </h:column>
+
+ <f:facet name="footer">
+ <it:dataScroller />
+ </f:facet>
+ </h:dataTable>
+ </h:form>
+ </h:body>
+</ui:composition>
+</html>
Copied: branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java (from rev 22420, trunk/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java)
===================================================================
--- branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java (rev 0)
+++ branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class DataComponentsContextUtil {
+
+ private static final String MODEL_RESET_ATTRIBUTE_SUFFIX = "#" + DataComponentsContextUtil.class.getName();
+
+ private DataComponentsContextUtil() {}
+
+ private static String getAttributeName(FacesContext context, UIComponent component) {
+ return component.getClientId(context) + MODEL_RESET_ATTRIBUTE_SUFFIX;
+ }
+
+ public static void resetDataModelOncePerPhase(FacesContext context, UIComponent component) {
+ String attributeName = getAttributeName(context, component);
+ if (context.getCurrentPhaseId() != context.getAttributes().put(attributeName, context.getCurrentPhaseId())) {
+ resetDataModel(context, component);
+ }
+ }
+
+ private static void resetDataModel(FacesContext context, UIComponent component) {
+ if (component instanceof UIDataAdaptor) {
+ ((UIDataAdaptor) component).resetDataModel();
+ } else if (component instanceof UIData) {
+ //hack to reset cached data model
+ component.setValueExpression("value", component.getValueExpression("value"));
+ } else {
+ throw new IllegalArgumentException(component.toString());
+ }
+ }
+}
Modified: branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2011-04-14 19:34:56 UTC (rev 22422)
+++ branches/4.0.X/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -922,7 +922,7 @@
}
protected void preEncodeBegin(FacesContext context) {
- resetDataModel();
+ DataComponentsContextUtil.resetDataModelOncePerPhase(context, this);
if (!isKeepSaved()) {
//TODO - this also resets state for the nested iteration components - is it correct?
Modified: branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2011-04-14 19:34:56 UTC (rev 22422)
+++ branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -37,9 +37,9 @@
import org.ajax4jsf.component.IterationStateHolder;
import org.richfaces.DataScrollerUtils;
+import org.richfaces.application.FacesMessages;
import org.richfaces.application.MessageFactory;
import org.richfaces.application.ServiceTracker;
-import org.richfaces.application.FacesMessages;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
Modified: branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2011-04-14 19:34:56 UTC (rev 22422)
+++ branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2011-04-15 12:37:03 UTC (rev 22423)
@@ -38,10 +38,11 @@
import org.ajax4jsf.Messages;
import org.richfaces.DataScrollerUtils;
import org.richfaces.component.AbstractDataScroller;
+import org.richfaces.component.DataComponentsContextUtil;
import org.richfaces.component.UIDataAdaptor;
import org.richfaces.component.util.MessageUtil;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.richfaces.log.Logger;
public class DataTablePreRenderListener implements SystemEventListener {
@@ -120,8 +121,10 @@
dataTable = activeDataScroller.getDataTable();
}
- String scrollerStateKey = dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE;
if ((activeDataScroller != null) && (dataTable != null)) {
+ DataComponentsContextUtil.resetDataModelOncePerPhase(facesContext, dataTable);
+
+ String scrollerStateKey = dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE;
int rowCount = DataScrollerUtils.getRowCount(dataTable);
int rows = DataScrollerUtils.getRows(dataTable);
int pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
13 years, 8 months
JBoss Rich Faces SVN: r22422 - in sandbox/trunk/ui/watermark: bom and 28 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-04-14 15:34:56 -0400 (Thu, 14 Apr 2011)
New Revision: 22422
Added:
sandbox/trunk/ui/watermark/bom/
sandbox/trunk/ui/watermark/bom/pom.xml
sandbox/trunk/ui/watermark/bom/watermark-bom.iml
sandbox/trunk/ui/watermark/demo/
sandbox/trunk/ui/watermark/demo/pom.xml
sandbox/trunk/ui/watermark/demo/src/
sandbox/trunk/ui/watermark/demo/src/main/
sandbox/trunk/ui/watermark/demo/src/main/java/
sandbox/trunk/ui/watermark/demo/src/main/java/org/
sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/
sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/sandbox/
sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/sandbox/watermark/
sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/sandbox/watermark/WatermarkBean.java
sandbox/trunk/ui/watermark/demo/src/main/resources/
sandbox/trunk/ui/watermark/demo/src/main/webapp/
sandbox/trunk/ui/watermark/demo/src/main/webapp/META-INF/
sandbox/trunk/ui/watermark/demo/src/main/webapp/META-INF/context.xml
sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/
sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/faces-config.xml
sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/ui/watermark/demo/src/main/webapp/index.jsp
sandbox/trunk/ui/watermark/demo/src/main/webapp/index.xhtml
sandbox/trunk/ui/watermark/demo/src/test/
sandbox/trunk/ui/watermark/demo/src/test/java/
sandbox/trunk/ui/watermark/demo/watermark-demo.iml
sandbox/trunk/ui/watermark/parent/
sandbox/trunk/ui/watermark/parent/pom.xml
sandbox/trunk/ui/watermark/parent/watermark-parent.iml
sandbox/trunk/ui/watermark/pom.xml
sandbox/trunk/ui/watermark/ui/
sandbox/trunk/ui/watermark/ui/pom.xml
sandbox/trunk/ui/watermark/ui/src/
sandbox/trunk/ui/watermark/ui/src/main/
sandbox/trunk/ui/watermark/ui/src/main/java/
sandbox/trunk/ui/watermark/ui/src/main/java/org/
sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/AbstractWatermark.java
sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/package-info.java
sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/renderkit/WatermarkRendererBase.java
sandbox/trunk/ui/watermark/ui/src/main/resources/
sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/
sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/jquery.watermark.js
sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/richfaces.watermark.js
sandbox/trunk/ui/watermark/ui/src/main/templates/
sandbox/trunk/ui/watermark/ui/src/main/templates/README
sandbox/trunk/ui/watermark/ui/src/main/templates/org/
sandbox/trunk/ui/watermark/ui/src/main/templates/org/richfaces/
sandbox/trunk/ui/watermark/ui/src/main/templates/org/richfaces/watermark.template.xml
sandbox/trunk/ui/watermark/ui/src/test/
sandbox/trunk/ui/watermark/ui/src/test/java/
sandbox/trunk/ui/watermark/ui/src/test/resources/
sandbox/trunk/ui/watermark/ui/watermark.iml
sandbox/trunk/ui/watermark/watermark-aggregator.iml
sandbox/trunk/ui/watermark/watermark-aggregator.ipr
Log:
Imported watermark component into sandbox.
Added: sandbox/trunk/ui/watermark/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/bom/pom.xml (rev 0)
+++ sandbox/trunk/ui/watermark/bom/pom.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark-bom</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: watermark bom</name>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>watermark</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+</project>
Added: sandbox/trunk/ui/watermark/bom/watermark-bom.iml
===================================================================
--- sandbox/trunk/ui/watermark/bom/watermark-bom.iml (rev 0)
+++ sandbox/trunk/ui/watermark/bom/watermark-bom.iml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+
Added: sandbox/trunk/ui/watermark/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/demo/pom.xml (rev 0)
+++ sandbox/trunk/ui/watermark/demo/pom.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>watermark-demo</artifactId>
+ <name>Richfaces UI Components: watermark demo</name>
+ <packaging>war</packaging>
+ <build>
+ <finalName>watermark-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+</project>
+
+
Added: sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/sandbox/watermark/WatermarkBean.java
===================================================================
--- sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/sandbox/watermark/WatermarkBean.java (rev 0)
+++ sandbox/trunk/ui/watermark/demo/src/main/java/org/richfaces/sandbox/watermark/WatermarkBean.java 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,49 @@
+package org.richfaces.sandbox.watermark;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.io.Serializable;
+
+public class WatermarkBean implements Serializable {
+// ------------------------------ FIELDS ------------------------------
+
+ private Object date;
+
+ private String text = "Watermark text";
+ private Object watermarkedInput;
+
+// --------------------- GETTER / SETTER METHODS ---------------------
+
+ public Object getDate() {
+ return date;
+ }
+
+ public void setDate(Object date) {
+ this.date = date;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public Object getWatermarkedInput() {
+ return watermarkedInput;
+ }
+
+ public void setWatermarkedInput(Object watermarkedInput) {
+ this.watermarkedInput = watermarkedInput;
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
+ public Object submit() {
+ final FacesContext context = FacesContext.getCurrentInstance();
+ context.addMessage(null, new FacesMessage("Text:" + getWatermarkedInput()));
+ context.addMessage(null, new FacesMessage("Date:" + getDate()));
+ return null;
+ }
+}
Added: sandbox/trunk/ui/watermark/demo/src/main/webapp/META-INF/context.xml
===================================================================
--- sandbox/trunk/ui/watermark/demo/src/main/webapp/META-INF/context.xml (rev 0)
+++ sandbox/trunk/ui/watermark/demo/src/main/webapp/META-INF/context.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context antiJARLocking="true" path="/schedule-demo"/>
Added: sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/faces-config.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+ <managed-bean>
+ <managed-bean-name>watermarkBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.sandbox.watermark.WatermarkBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added: sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ sandbox/trunk/ui/watermark/demo/src/main/webapp/WEB-INF/web.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="WebApp_ID"
+ version="2.5">
+ <display-name>Watermark demo</display-name>
+ <context-param>
+ <param-name>com.sun.faces.allowTextChildren</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>classic</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</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.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+
+</web-app>
Added: sandbox/trunk/ui/watermark/demo/src/main/webapp/index.jsp
===================================================================
--- sandbox/trunk/ui/watermark/demo/src/main/webapp/index.jsp (rev 0)
+++ sandbox/trunk/ui/watermark/demo/src/main/webapp/index.jsp 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+<body>
+<jsp:forward page="index.jsf"/>
+</body>
+</html>
Added: sandbox/trunk/ui/watermark/demo/src/main/webapp/index.xhtml
===================================================================
--- sandbox/trunk/ui/watermark/demo/src/main/webapp/index.xhtml (rev 0)
+++ sandbox/trunk/ui/watermark/demo/src/main/webapp/index.xhtml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"
+ xmlns:watermark="http://richfaces.org/sandbox/watermark">
+<h:head>
+ <title>Watermark sample</title>
+ <style type="text/css">
+ .rich-container input.watermark {
+ color: #777;
+ }
+ </style>
+</h:head>
+
+<h:body class="rich-container">
+<rich:messages ajaxRendered="true"/>
+
+<h:form>
+ <a4j:poll ajaxSingle="true" interval="5000"/>
+ <a4j:queue requestDelay="400" ignoreDupResponses="true"/>
+
+ <h:outputLabel value="Watermark text" for="text"/>
+ <h:inputText id="text" value="#{watermarkBean.text}" required="true">
+ <f:ajax event="valueChange" render="@form"/>
+ </h:inputText>
+ <h:commandButton value="Submit" action="#{watermarkBean.submit}"/>
+ <br/><br/>
+ <h:inputText id="watermarked" value="#{watermarkBean.watermarkedInput}">
+ <watermark:watermark value="#{watermarkBean.text}"/>
+ </h:inputText>
+
+ <rich:calendar id="calendar" value="#{watermarkBean.date}" enableManualInput="true" ajaxSingle="true"/>
+ <watermark:watermark value="#{watermarkBean.text}" for="calendar" suffix="InputDate"/>
+
+ <!--<rich:comboBox>-->
+ <!--<watermark:watermark value="#{watermarkBean.text}" suffix="comboboxField"/>-->
+ <!--</rich:comboBox>-->
+
+ <input id="htmlInput" type="text"/>
+ <watermark:watermark value="#{watermarkBean.text}" for="htmlInput"/>
+</h:form>
+
+<div id="status"></div>
+<!--<rich:insert src="/index.xhtml" highlight="xhtml" rendered="#{showSource!=false}"/>-->
+
+</h:body>
+</html>
Added: sandbox/trunk/ui/watermark/demo/watermark-demo.iml
===================================================================
--- sandbox/trunk/ui/watermark/demo/watermark-demo.iml (rev 0)
+++ sandbox/trunk/ui/watermark/demo/watermark-demo.iml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="web" name="Web">
+ <configuration>
+ <descriptors>
+ <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+ </descriptors>
+ <webroots>
+ <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+ </webroots>
+ <context-artifact name="watermark-demo:war exploded" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="Maven: org.richfaces.ui:richfaces-components-ui:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: org.richfaces.ui:richfaces-components-api:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: com.google.guava:guava:r08" level="project" />
+ <orderEntry type="library" name="Maven: org.richfaces.core:richfaces-core-impl:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" name="Maven: net.sourceforge.cssparser:cssparser:0.9.5" level="project" />
+ <orderEntry type="library" name="Maven: org.w3c.css:sac:1.3" level="project" />
+ <orderEntry type="module" module-name="watermark" />
+ <orderEntry type="library" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
+ <orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
+ <orderEntry type="library" name="Maven: com.sun.el:el-ri:1.0" level="project" />
+ </component>
+</module>
+
Added: sandbox/trunk/ui/watermark/parent/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/parent/pom.xml (rev 0)
+++ sandbox/trunk/ui/watermark/parent/pom.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark-parent</artifactId>
+ <name>Richfaces UI Components: watermark parent</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ <org.richfaces.cdk.version>4.1.0-SNAPSHOT</org.richfaces.cdk.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
Added: sandbox/trunk/ui/watermark/parent/watermark-parent.iml
===================================================================
--- sandbox/trunk/ui/watermark/parent/watermark-parent.iml (rev 0)
+++ sandbox/trunk/ui/watermark/parent/watermark-parent.iml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
+ </component>
+</module>
+
Added: sandbox/trunk/ui/watermark/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/pom.xml (rev 0)
+++ sandbox/trunk/ui/watermark/pom.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>watermark-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: watermark Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ <module>demo</module>
+ </modules>
+
+ <profiles>
+ <profile>
+ <id>cli</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>1.0.6-SNAPSHOT</version>
+ <configuration>
+ <userAliases>
+ <ui>watermark clean install</ui>
+ <demo>watermark-demo clean package</demo>
+ </userAliases>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/sandbox/trunk/ui/watermark</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/sandbox/trunk/ui/watermark</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+ <url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Added: sandbox/trunk/ui/watermark/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/watermark/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/watermark/ui/pom.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.watermark</groupId>
+ <artifactId>watermark-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+ <artifactId>watermark</artifactId>
+ <name>Richfaces UI Components: watermark ui</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/AbstractWatermark.java
===================================================================
--- sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/AbstractWatermark.java (rev 0)
+++ sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/AbstractWatermark.java 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.renderkit.WatermarkRendererBase;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.context.FacesContext;
+
+/**
+ * Adds watermark capability to HTML input and textarea elements.
+ * A watermark typically appears as light gray text within an input or textarea element whenever
+ * the element is empty and does not have focus. This provides a hint to the user as to what
+ * the input or textarea element is used for, or the type of input that is required.
+ */
+@JsfComponent(tag = @Tag(name = "watermark", type = TagType.Facelets),
+ renderer = @JsfRenderer(family = AbstractWatermark.COMPONENT_FAMILY, type = WatermarkRendererBase.RENDERER_TYPE),
+ attributes = {"core-props.xml","javax.faces.component.ValueHolder.xml"}
+)
+public abstract class AbstractWatermark extends UIOutput {
+// ------------------------------ FIELDS ------------------------------
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Watermark";
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Watermark";
+
+// -------------------------- OTHER METHODS --------------------------
+
+ public String getTargetClientId(FacesContext context) {
+ String sid = getFor();
+ String target;
+ if (sid != null && ! "".equals(sid)) {
+ try {
+
+ UIComponent forcomp = findComponent(sid);
+ if (forcomp != null) {
+ target = forcomp.getClientId(context);
+ } else {
+ target = sid;
+ }
+ }catch(IllegalArgumentException e) {
+ target = sid;
+ }
+ } else {
+ target = getParent().getClientId(context);
+ }
+ String suffix = getSuffix();
+ if(suffix != null && !"".equals(suffix)) {
+ target += suffix;
+ }
+ return target;
+ }
+
+ /**
+ * This attribute is not used.
+ * @return irrelevant
+ */
+ @Attribute(hidden = true)
+ public abstract String getTitle();
+
+ @Attribute(required = true)
+ public abstract Object getValue();
+
+ /**
+ * Use this if watermark should be attached to element with id different then component id.
+ * i.e.: rich:comboBox with id="combo" nested in form with id="f" renders input with
+ * clientId="f:combocomboboxField"
+ * So in order to attach watermark to that element provide suffix="comboboxField".
+ *
+ * @return the suffix
+ */
+ @Attribute
+ public abstract String getSuffix();
+
+ /**
+ * Use this if watermark cannot be nested within come components i.e. in calendar.
+ * <p/>
+ * Example 1: rich:calendar with id="c" nested in form with id="f" renders input with
+ * clientId="f:cInputDate".
+ * rich:calendar also gets messed up if watermark is nested within, so place it outside of calendar.
+ * So in order to attach watermark to that element provide for="c" suffix="InputDate".
+ * <p/>
+ * Example 2: watermark should be attached to pure html input (not jsf component) with id="htmlInput".
+ * To achieve this provide for="htmlInput".
+ *
+ * @return id of component for which watermark should be applied
+ */
+ @Attribute
+ public abstract String getFor();
+}
Added: sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/package-info.java (rev 0)
+++ sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/component/package-info.java 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,5 @@
+@TagLibrary(uri = "http://richfaces.org/sandbox/watermark", shortName = "watermark", prefix = "watermark", displayName = "Watermark component")
+package org.richfaces.component;
+
+import org.richfaces.cdk.annotations.TagLibrary;
+
Added: sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/renderkit/WatermarkRendererBase.java
===================================================================
--- sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/renderkit/WatermarkRendererBase.java (rev 0)
+++ sandbox/trunk/ui/watermark/ui/src/main/java/org/richfaces/renderkit/WatermarkRendererBase.java 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,66 @@
+package org.richfaces.renderkit;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractWatermark;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js", target = "head"),
+ @ResourceDependency(name = "jquery.watermark.js", target = "head"),
+ @ResourceDependency(name = "base-component.reslib", library = "org.richfaces", target = "head"),
+ @ResourceDependency(name = "richfaces.watermark.js", target = "head")
+})
+public abstract class WatermarkRendererBase extends RendererBase {
+// ------------------------------ FIELDS ------------------------------
+
+ /**
+ * Following defaults are be used by addOptionIfSetAndNotDefault
+ */
+ public static final Map<String, Object> DEFAULTS;
+
+ public static final String RENDERER_TYPE = "org.richfaces.WatermarkRenderer";
+
+// -------------------------- STATIC METHODS --------------------------
+
+ static {
+ Map<String, Object> defaults = new HashMap<String, Object>();
+ defaults.put("styleClass", "");
+ defaults.put("useNative", true);
+ DEFAULTS = Collections.unmodifiableMap(defaults);
+ }
+
+ protected void addOptionIfSetAndNotDefault(String optionName, Object value, Map<String, Object> options) {
+ if (value != null && !"".equals(value) && !value.equals(DEFAULTS.get(optionName))) {
+ options.put(optionName, value);
+ }
+ }
+
+ protected Map<String, Object> getOptions(AbstractWatermark watermark) {
+ /**
+ * Include only attributes that are actually set.
+ */
+ Map<String, Object> options = new HashMap<String, Object>();
+ addOptionIfSetAndNotDefault("styleClass", watermark.getAttributes().get("styleClass"), options);
+ addOptionIfSetAndNotDefault("text", watermark.getValue(), options);
+ return options;
+ }
+
+ protected void writeInitFunction(FacesContext context, UIComponent component) throws IOException {
+ AbstractWatermark watermark = (AbstractWatermark) component;
+ ResponseWriter writer = context.getResponseWriter();
+ String clientId = watermark.getClientId(context);
+ final Map<String, Object> options = getOptions(watermark);
+ options.put("targetId", watermark.getTargetClientId(context));
+ writer.writeText(new JSObject("RichFaces.ui.Watermark", clientId, options).toScript(), null);
+ }
+}
+
Added: sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/jquery.watermark.js
===================================================================
--- sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/jquery.watermark.js (rev 0)
+++ sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/jquery.watermark.js 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,527 @@
+/*
+ Watermark plugin for jQuery
+ Version: 3.0.6
+ http://jquery-watermark.googlecode.com/
+
+ Copyright (c) 2009-2010 Todd Northrop
+ http://www.speednet.biz/
+
+ June 21, 2010
+
+ Requires: jQuery 1.2.3+
+
+ Dual licensed under the MIT or GPL Version 2 licenses.
+ See mit-license.txt and gpl2-license.txt in the project root for details.
+------------------------------------------------------*/
+
+(function ($) {
+
+var
+ // Will speed up references to undefined
+ undefined,
+
+ // String constants for data names
+ dataFlag = "watermark",
+ dataClass = "watermarkClass",
+ dataFocus = "watermarkFocus",
+ dataFormSubmit = "watermarkSubmit",
+ dataMaxLen = "watermarkMaxLength",
+ dataPassword = "watermarkPassword",
+ dataText = "watermarkText",
+
+ // Includes only elements with watermark defined
+ selWatermarkDefined = ":data(" + dataFlag + ")",
+
+ // Includes only elements capable of having watermark
+ selWatermarkAble = ":text,:password,:search,textarea",
+
+ // triggerFns:
+ // Array of function names to look for in the global namespace.
+ // Any such functions found will be hijacked to trigger a call to
+ // hideAll() any time they are called. The default value is the
+ // ASP.NET function that validates the controls on the page
+ // prior to a postback.
+ //
+ // Am I missing other important trigger function(s) to look for?
+ // Please leave me feedback:
+ // http://code.google.com/p/jquery-watermark/issues/list
+ triggerFns = [
+ "Page_ClientValidate"
+ ],
+
+ // Holds a value of true if a watermark was displayed since the last
+ // hideAll() was executed. Avoids repeatedly calling hideAll().
+ pageDirty = false;
+
+// Extends jQuery with a custom selector - ":data(...)"
+// :data(<name>) Includes elements that have a specific name defined in the jQuery data collection. (Only the existence of the name is checked; the value is ignored.)
+// :data(<name>=<value>) Includes elements that have a specific jQuery data name defined, with a specific value associated with it.
+// :data(<name>!=<value>) Includes elements that have a specific jQuery data name defined, with a value that is not equal to the value specified.
+// :data(<name>^=<value>) Includes elements that have a specific jQuery data name defined, with a value that starts with the value specified.
+// :data(<name>$=<value>) Includes elements that have a specific jQuery data name defined, with a value that ends with the value specified.
+// :data(<name>*=<value>) Includes elements that have a specific jQuery data name defined, with a value that contains the value specified.
+$.extend($.expr[":"], {
+ "search": function (elem) {
+ return "search" === (elem.type || "");
+ },
+
+ "data": function (element, index, matches, set) {
+ var data, parts = /^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(matches[3]);
+
+ if (parts) {
+ data = $(element).data(parts[1]);
+
+ if (data !== undefined) {
+
+ if (parts[2]) {
+ data = "" + data;
+
+ switch (parts[2]) {
+ case "=":
+ return (data == parts[3]);
+ case "!=":
+ return (data != parts[3]);
+ case "^=":
+ return (data.slice(0, parts[3].length) == parts[3]);
+ case "$=":
+ return (data.slice(-parts[3].length) == parts[3]);
+ case "*=":
+ return (data.indexOf(parts[3]) !== -1);
+ }
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+});
+
+$.watermark = {
+
+ // Current version number of the plugin
+ version: "3.0.6",
+
+ // Default options used when watermarks are instantiated.
+ // Can be changed to affect the default behavior for all
+ // new or updated watermarks.
+ // BREAKING CHANGE: The $.watermark.className
+ // property that was present prior to version 3.0.2 must
+ // be changed to $.watermark.options.className
+ options: {
+
+ // Default class name for all watermarks
+ className: "watermark",
+
+ // If true, plugin will detect and use native browser support for
+ // watermarks, if available. (e.g., WebKit's placeholder attribute.)
+ useNative: true
+ },
+
+ // Hide one or more watermarks by specifying any selector type
+ // i.e., DOM element, string selector, jQuery matched set, etc.
+ hide: function (selector) {
+ $(selector).filter(selWatermarkDefined).each(
+ function () {
+ $.watermark._hide($(this));
+ }
+ );
+ },
+
+ // Internal use only.
+ _hide: function ($input, focus) {
+ var inputVal = $input.val() || "",
+ inputWm = $input.data(dataText) || "",
+ maxLen = $input.data(dataMaxLen) || 0,
+ className = $input.data(dataClass);
+
+ if ((inputWm.length) && (inputVal == inputWm)) {
+ $input.val("");
+
+ // Password type?
+ if ($input.data(dataPassword)) {
+
+ if (($input.attr("type") || "") === "text") {
+ var $pwd = $input.data(dataPassword) || [],
+ $wrap = $input.parent() || [];
+
+ if (($pwd.length) && ($wrap.length)) {
+ $wrap[0].removeChild($input[0]); // Can't use jQuery methods, because they destroy data
+ $wrap[0].appendChild($pwd[0]);
+ $input = $pwd;
+ }
+ }
+ }
+
+ if (maxLen) {
+ $input.attr("maxLength", maxLen);
+ $input.removeData(dataMaxLen);
+ }
+
+ if (focus) {
+ $input.attr("autocomplete", "off"); // Avoid NS_ERROR_XPC_JS_THREW_STRING error in Firefox
+
+ window.setTimeout(
+ function () {
+ $input.select(); // Fix missing cursor in IE
+ }
+ , 1);
+ }
+ }
+
+ className && $input.removeClass(className);
+ },
+
+ // Display one or more watermarks by specifying any selector type
+ // i.e., DOM element, string selector, jQuery matched set, etc.
+ // If conditions are not right for displaying a watermark, ensures that watermark is not shown.
+ show: function (selector) {
+ $(selector).filter(selWatermarkDefined).each(
+ function () {
+ $.watermark._show($(this));
+ }
+ );
+ },
+
+ // Internal use only.
+ _show: function ($input) {
+ var val = $input.val() || "",
+ text = $input.data(dataText) || "",
+ type = $input.attr("type") || "",
+ className = $input.data(dataClass);
+
+ if (((val.length == 0) || (val == text)) && (!$input.data(dataFocus))) {
+ pageDirty = true;
+
+ // Password type?
+ if ($input.data(dataPassword)) {
+
+ if (type === "password") {
+ var $pwd = $input.data(dataPassword) || [],
+ $wrap = $input.parent() || [];
+
+ if (($pwd.length) && ($wrap.length)) {
+ $wrap[0].removeChild($input[0]); // Can't use jQuery methods, because they destroy data
+ $wrap[0].appendChild($pwd[0]);
+ $input = $pwd;
+ $input.attr("maxLength", text.length);
+ }
+ }
+ }
+
+ // Ensure maxLength big enough to hold watermark (input of type="text" or type="search" only)
+ if ((type === "text") || (type === "search")) {
+ var maxLen = $input.attr("maxLength") || 0;
+
+ if ((maxLen > 0) && (text.length > maxLen)) {
+ $input.data(dataMaxLen, maxLen);
+ $input.attr("maxLength", text.length);
+ }
+ }
+
+ className && $input.addClass(className);
+ $input.val(text);
+ }
+ else {
+ $.watermark._hide($input);
+ }
+ },
+
+ // Hides all watermarks on the current page.
+ hideAll: function () {
+ if (pageDirty) {
+ $.watermark.hide(selWatermarkAble);
+ pageDirty = false;
+ }
+ },
+
+ // Displays all watermarks on the current page.
+ showAll: function () {
+ $.watermark.show(selWatermarkAble);
+ }
+};
+
+$.fn.watermark = function (text, options) {
+ /// <summary>
+ /// Set watermark text and class name on all input elements of type="text/password/search" and
+ /// textareas within the matched set. If className is not specified in options, the default is
+ /// "watermark". Within the matched set, only input elements with type="text/password/search"
+ /// and textareas are affected; all other elements are ignored.
+ /// </summary>
+ /// <returns type="jQuery">
+ /// Returns the original jQuery matched set (not just the input and texarea elements).
+ /// </returns>
+ /// <param name="text" type="String">
+ /// Text to display as a watermark when the input or textarea element has an empty value and does not
+ /// have focus. The first time watermark() is called on an element, if this argument is empty (or not
+ /// a String type), then the watermark will have the net effect of only changing the class name when
+ /// the input or textarea element's value is empty and it does not have focus.
+ /// </param>
+ /// <param name="options" type="Object" optional="true">
+ /// Provides the ability to override the default watermark options ($.watermark.options). For backward
+ /// compatibility, if a string value is supplied, it is used as the class name that overrides the class
+ /// name in $.watermark.options.className. Properties include:
+ /// className: When the watermark is visible, the element will be styled using this class name.
+ /// useNative (Boolean or Function): Specifies if native browser support for watermarks will supersede
+ /// plugin functionality. If useNative is a function, the return value from the function will
+ /// determine if native support is used. The function is passed one argument -- a jQuery object
+ /// containing the element being tested as the only element in its matched set -- and the DOM
+ /// element being tested is the object on which the function is invoked (the value of "this").
+ /// </param>
+ /// <remarks>
+ /// The effect of changing the text and class name on an input element is called a watermark because
+ /// typically light gray text is used to provide a hint as to what type of input is required. However,
+ /// the appearance of the watermark can be something completely different: simply change the CSS style
+ /// pertaining to the supplied class name.
+ ///
+ /// The first time watermark() is called on an element, the watermark text and class name are initialized,
+ /// and the focus and blur events are hooked in order to control the display of the watermark. Also, as
+ /// of version 3.0, drag and drop events are hooked to guard against dropped text being appended to the
+ /// watermark. If native watermark support is provided by the browser, it is detected and used, unless
+ /// the useNative option is set to false.
+ ///
+ /// Subsequently, watermark() can be called again on an element in order to change the watermark text
+ /// and/or class name, and it can also be called without any arguments in order to refresh the display.
+ ///
+ /// For example, after changing the value of the input or textarea element programmatically, watermark()
+ /// should be called without any arguments to refresh the display, because the change event is only
+ /// triggered by user actions, not by programmatic changes to an input or textarea element's value.
+ ///
+ /// The one exception to programmatic updates is for password input elements: you are strongly cautioned
+ /// against changing the value of a password input element programmatically (after the page loads).
+ /// The reason is that some fairly hairy code is required behind the scenes to make the watermarks bypass
+ /// IE security and switch back and forth between clear text (for watermarks) and obscured text (for
+ /// passwords). It is *possible* to make programmatic changes, but it must be done in a certain way, and
+ /// overall it is not recommended.
+ /// </remarks>
+
+ if (!this.length) {
+ return this;
+ }
+
+ var hasClass = false,
+ hasText = (typeof(text) === "string");
+
+ if (typeof(options) === "object") {
+ hasClass = (typeof(options.className) === "string");
+ options = $.extend({}, $.watermark.options, options);
+ }
+ else if (typeof(options) === "string") {
+ hasClass = true;
+ options = $.extend({}, $.watermark.options, {className: options});
+ }
+ else {
+ options = $.watermark.options;
+ }
+
+ if (typeof(options.useNative) !== "function") {
+ options.useNative = options.useNative? function () { return true; } : function () { return false; };
+ }
+
+ return this.each(
+ function () {
+ var $input = $(this);
+
+ if (!$input.is(selWatermarkAble)) {
+ return;
+ }
+
+ // Watermark already initialized?
+ if ($input.data(dataFlag)) {
+
+ // If re-defining text or class, first remove existing watermark, then make changes
+ if (hasText || hasClass) {
+ $.watermark._hide($input);
+
+ if (hasText) {
+ $input.data(dataText, text);
+ }
+
+ if (hasClass) {
+ $input.data(dataClass, options.className);
+ }
+ }
+ }
+ else {
+
+ // Detect and use native browser support, if enabled in options
+ if (options.useNative.call(this, $input)) {
+
+ // Placeholder attribute (WebKit)
+ // Big thanks to Opera for the wacky test required
+ if ((("" + $input.css("-webkit-appearance")).replace("undefined", "") !== "") && (($input.attr("tagName") || "") !== "TEXTAREA")) {
+
+ // className is not set because WebKit doesn't appear to have
+ // a separate class name property for placeholders (watermarks).
+ if (hasText) {
+ $input.attr("placeholder", text);
+ }
+
+ // Only set data flag for non-native watermarks (purposely commented-out)
+ // $input.data(dataFlag, 1);
+ return;
+ }
+ }
+
+ $input.data(dataText, hasText? text : "");
+ $input.data(dataClass, options.className);
+ $input.data(dataFlag, 1); // Flag indicates watermark was initialized
+
+ // Special processing for password type
+ if (($input.attr("type") || "") === "password") {
+ var $wrap = $input.wrap("<span>").parent(),
+ $wm = $($wrap.html().replace(/type=["']?password["']?/i, 'type="text"'));
+
+ $wm.data(dataText, $input.data(dataText));
+ $wm.data(dataClass, $input.data(dataClass));
+ $wm.data(dataFlag, 1);
+ $wm.attr("maxLength", text.length);
+
+ $wm.focus(
+ function () {
+ $.watermark._hide($wm, true);
+ }
+ ).bind("dragenter",
+ function () {
+ $.watermark._hide($wm);
+ }
+ ).bind("dragend",
+ function () {
+ window.setTimeout(function () { $wm.blur(); }, 1);
+ }
+ );
+ $input.blur(
+ function () {
+ $.watermark._show($input);
+ }
+ ).bind("dragleave",
+ function () {
+ $.watermark._show($input);
+ }
+ );
+
+ $wm.data(dataPassword, $input);
+ $input.data(dataPassword, $wm);
+ }
+ else {
+
+ $input.focus(
+ function () {
+ $input.data(dataFocus, 1);
+ $.watermark._hide($input, true);
+ }
+ ).blur(
+ function () {
+ $input.data(dataFocus, 0);
+ $.watermark._show($input);
+ }
+ ).bind("dragenter",
+ function () {
+ $.watermark._hide($input);
+ }
+ ).bind("dragleave",
+ function () {
+ $.watermark._show($input);
+ }
+ ).bind("dragend",
+ function () {
+ window.setTimeout(function () { $.watermark._show($input); }, 1);
+ }
+ ).bind("drop",
+ // Firefox makes this lovely function necessary because the dropped text
+ // is merged with the watermark before the drop event is called.
+ function (evt) {
+ var dropText = evt.originalEvent.dataTransfer.getData("Text");
+
+ if ($input.val().replace(dropText, "") === $input.data(dataText)) {
+ $input.val(dropText);
+ }
+
+ $input.focus();
+ }
+ );
+ }
+
+ // In order to reliably clear all watermarks before form submission,
+ // we need to replace the form's submit function with our own
+ // function. Otherwise watermarks won't be cleared when the form
+ // is submitted programmatically.
+ if (this.form) {
+ var form = this.form,
+ $form = $(form);
+
+ if (!$form.data(dataFormSubmit)) {
+ $form.submit($.watermark.hideAll);
+
+ // form.submit exists for all browsers except Google Chrome
+ // (see "else" below for explanation)
+ if (form.submit) {
+ $form.data(dataFormSubmit, form.submit);
+
+ form.submit = (function (f, $f) {
+ return function () {
+ var nativeSubmit = $f.data(dataFormSubmit);
+
+ $.watermark.hideAll();
+
+ if (nativeSubmit.apply) {
+ nativeSubmit.apply(f, Array.prototype.slice.call(arguments));
+ }
+ else {
+ nativeSubmit();
+ }
+ };
+ })(form, $form);
+ }
+ else {
+ $form.data(dataFormSubmit, 1);
+
+ // This strangeness is due to the fact that Google Chrome's
+ // form.submit function is not visible to JavaScript (identifies
+ // as "undefined"). I had to invent a solution here because hours
+ // of Googling (ironically) for an answer did not turn up anything
+ // useful. Within my own form.submit function I delete the form's
+ // submit function, and then call the non-existent function --
+ // which, in the world of Google Chrome, still exists.
+ form.submit = (function (f) {
+ return function () {
+ $.watermark.hideAll();
+ delete f.submit;
+ f.submit();
+ };
+ })(form);
+ }
+ }
+ }
+ }
+
+ $.watermark._show($input);
+ }
+ );
+};
+
+// Hijack any functions found in the triggerFns list
+if (triggerFns.length) {
+
+ // Wait until DOM is ready before searching
+ $(function () {
+ var i, name, fn;
+
+ for (i=triggerFns.length-1; i>=0; i--) {
+ name = triggerFns[i];
+ fn = window[name];
+
+ if (typeof(fn) === "function") {
+ window[name] = (function (origFn) {
+ return function () {
+ $.watermark.hideAll();
+ return origFn.apply(null, Array.prototype.slice.call(arguments));
+ };
+ })(fn);
+ }
+ }
+ });
+}
+
+})(jQuery);
Added: sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/richfaces.watermark.js
===================================================================
--- sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/richfaces.watermark.js (rev 0)
+++ sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/richfaces.watermark.js 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,32 @@
+(function ($, rf) {
+ // Create (for example) ui container for our component class
+ rf.ui = rf.ui || {};
+ // Default options definition if needed for the component
+ var defaultOptions = {};
+ // Extending component class with new properties and methods using extendClass
+ // $super - reference to the parent prototype, will be available inside those methods
+ rf.ui.Watermark = rf.BaseComponent.extendClass({
+ // class name
+ name:"Watermark",
+ init: function (componentId, options) {
+ // call constructor of parent class if needed
+ $super.constructor.call(this, componentId);
+ // attach component object to DOM element for
+ // future cleaning and for client side API calls
+ this.attachToDom(this.id);
+ jQuery(function() {
+ options.className = options['styleClass'];
+ jQuery(document.getElementById(options.targetId)).watermark(options.text, options);
+ });
+ },
+ // destructor definition
+ destroy: function () {
+ // define destructor if additional cleaning is needed but
+ // in most cases its not nessesary.
+ // call parent’s destructor
+ $super.destroy.call(this);
+ }
+ });
+ // define super class reference - reference to the parent prototype
+ var $super = rf.ui.Watermark.$super;
+})(jQuery, RichFaces);
\ No newline at end of file
Property changes on: sandbox/trunk/ui/watermark/ui/src/main/resources/META-INF/resources/richfaces.watermark.js
___________________________________________________________________
Added: svn:executable
+
Added: sandbox/trunk/ui/watermark/ui/src/main/templates/README
===================================================================
Added: sandbox/trunk/ui/watermark/ui/src/main/templates/org/richfaces/watermark.template.xml
===================================================================
--- sandbox/trunk/ui/watermark/ui/src/main/templates/org/richfaces/watermark.template.xml (rev 0)
+++ sandbox/trunk/ui/watermark/ui/src/main/templates/org/richfaces/watermark.template.xml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+ xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core" xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.WatermarkRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.WatermarkRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.Watermark</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.WatermarkRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <script id="#{clientId}" type="text/javascript">
+ <cdk:call expression="writeInitFunction(facesContext,component)"/>
+ </script>
+ </cc:implementation>
+
+</cdk:root>
\ No newline at end of file
Added: sandbox/trunk/ui/watermark/ui/watermark.iml
===================================================================
--- sandbox/trunk/ui/watermark/ui/watermark.iml (rev 0)
+++ sandbox/trunk/ui/watermark/ui/watermark.iml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/main" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target/classes" />
+ <excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
+ <excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.core:richfaces-ui-core-ui:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:r08" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.common:richfaces-ui-common-ui:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.common:richfaces-ui-common-api:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.ui.core:richfaces-ui-core-api:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.richfaces.cdk:annotations:4.1.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: javax.el:el-api:1.0" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.jboss.test-jsf:jsf-test-stage:1.0.6" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.jboss.el:jboss-el:1.0_02.CR5" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.servlet.jsp:jsp-api:2.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.7" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
+ </component>
+</module>
+
Added: sandbox/trunk/ui/watermark/watermark-aggregator.iml
===================================================================
--- sandbox/trunk/ui/watermark/watermark-aggregator.iml (rev 0)
+++ sandbox/trunk/ui/watermark/watermark-aggregator.iml 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" level="project" />
+ </component>
+</module>
+
Added: sandbox/trunk/ui/watermark/watermark-aggregator.ipr
===================================================================
--- sandbox/trunk/ui/watermark/watermark-aggregator.ipr (rev 0)
+++ sandbox/trunk/ui/watermark/watermark-aggregator.ipr 2011-04-14 19:34:56 UTC (rev 22422)
@@ -0,0 +1,490 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="AntConfiguration">
+ <defaultAnt bundledAnt="true" />
+ </component>
+ <component name="ArtifactManager">
+ <artifact type="war" name="watermark-demo:war">
+ <output-path>$PROJECT_DIR$/demo/target</output-path>
+ <root id="archive" name="watermark-demo.war">
+ <element id="artifact" artifact-name="watermark-demo:war exploded" />
+ </root>
+ </artifact>
+ <artifact type="exploded-war" name="watermark-demo:war exploded">
+ <output-path>$PROJECT_DIR$/demo/target/watermark-demo</output-path>
+ <root id="root">
+ <element id="javaee-facet-resources" facet="watermark-demo/web/Web" />
+ <element id="directory" name="WEB-INF">
+ <element id="directory" name="classes">
+ <element id="module-output" name="watermark-demo" />
+ </element>
+ <element id="directory" name="lib">
+ <element id="library" level="project" name="Maven: org.richfaces.ui:richfaces-components-ui:4.1.0-SNAPSHOT" />
+ <element id="library" level="project" name="Maven: org.richfaces.ui:richfaces-components-api:4.1.0-SNAPSHOT" />
+ <element id="library" level="project" name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT" />
+ <element id="library" level="project" name="Maven: com.google.guava:guava:r08" />
+ <element id="library" level="project" name="Maven: org.richfaces.core:richfaces-core-impl:4.1.0-SNAPSHOT" />
+ <element id="library" level="project" name="Maven: net.sourceforge.cssparser:cssparser:0.9.5" />
+ <element id="library" level="project" name="Maven: org.w3c.css:sac:1.3" />
+ <element id="archive" name="watermark-4.1.0-SNAPSHOT.jar">
+ <element id="module-output" name="watermark" />
+ </element>
+ <element id="library" level="project" name="Maven: com.sun.faces:jsf-api:2.0.4-b09" />
+ <element id="library" level="project" name="Maven: com.sun.faces:jsf-impl:2.0.4-b09" />
+ <element id="library" level="project" name="Maven: com.sun.el:el-ri:1.0" />
+ </element>
+ </element>
+ </root>
+ </artifact>
+ </component>
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <resourceExtensions>
+ <entry name=".+\.(properties|xml|html|dtd|tld)" />
+ <entry name=".+\.(gif|png|jpeg|jpg)" />
+ </resourceExtensions>
+ <wildcardResourcePatterns>
+ <entry name="?*.properties" />
+ <entry name="?*.xml" />
+ <entry name="?*.gif" />
+ <entry name="?*.png" />
+ <entry name="?*.jpeg" />
+ <entry name="?*.jpg" />
+ <entry name="?*.html" />
+ <entry name="?*.dtd" />
+ <entry name="?*.tld" />
+ <entry name="?*.ftl" />
+ </wildcardResourcePatterns>
+ <annotationProcessing enabled="false" useClasspath="true" />
+ </component>
+ <component name="CopyrightManager" default="">
+ <module2copyright />
+ </component>
+ <component name="DependencyValidationManager">
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </component>
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+ <component name="FacetAutodetectingManager">
+ <autodetection-disabled>
+ <facet-type id="web">
+ <modules>
+ <module name="watermark-demo" />
+ </modules>
+ </facet-type>
+ </autodetection-disabled>
+ </component>
+ <component name="JavacSettings">
+ <option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.5" />
+ </component>
+ <component name="JavadocGenerationManager">
+ <option name="OUTPUT_DIRECTORY" />
+ <option name="OPTION_SCOPE" value="protected" />
+ <option name="OPTION_HIERARCHY" value="true" />
+ <option name="OPTION_NAVIGATOR" value="true" />
+ <option name="OPTION_INDEX" value="true" />
+ <option name="OPTION_SEPARATE_INDEX" value="true" />
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
+ <option name="OPTION_DEPRECATED_LIST" value="true" />
+ <option name="OTHER_OPTIONS" value="" />
+ <option name="HEAP_SIZE" />
+ <option name="LOCALE" />
+ <option name="OPEN_IN_BROWSER" value="true" />
+ </component>
+ <component name="JsfProjectComponent">
+ <option name="faceletsSupport" value="ENABLED" />
+ </component>
+ <component name="MavenProjectsManager">
+ <option name="originalFiles">
+ <list>
+ <option value="$PROJECT_DIR$/pom.xml" />
+ </list>
+ </option>
+ </component>
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/ui/watermark.iml" filepath="$PROJECT_DIR$/ui/watermark.iml" />
+ <module fileurl="file://$PROJECT_DIR$/watermark-aggregator.iml" filepath="$PROJECT_DIR$/watermark-aggregator.iml" />
+ <module fileurl="file://$PROJECT_DIR$/bom/watermark-bom.iml" filepath="$PROJECT_DIR$/bom/watermark-bom.iml" />
+ <module fileurl="file://$PROJECT_DIR$/demo/watermark-demo.iml" filepath="$PROJECT_DIR$/demo/watermark-demo.iml" />
+ <module fileurl="file://$PROJECT_DIR$/parent/watermark-parent.iml" filepath="$PROJECT_DIR$/parent/watermark-parent.iml" />
+ </modules>
+ </component>
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/classes" />
+ </component>
+ <component name="SvnBranchConfigurationManager">
+ <option name="mySupportsUserInfoFilter" value="true" />
+ </component>
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="" />
+ </component>
+ <component name="libraryTable">
+ <library name="Maven: com.sun.faces:jsf-api:2.0.4-b09">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-api/2.0.4-b09/jsf-api-2.0.4-b09.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-api/2.0.4-b09/jsf-api-2.0.4-b09-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-api/2.0.4-b09/jsf-api-2.0.4-b09-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: com.sun.faces:jsf-impl:2.0.4-b09">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-impl/2.0.4-b09/jsf-impl-2.0.4-b09.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-impl/2.0.4-b09/jsf-impl-2.0.4-b09-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/faces/jsf-impl/2.0.4-b09/jsf-impl-2.0.4-b09-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.core:richfaces-core-api:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-api/4.1.0-SNAPSHOT/richfaces-core-api-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-api/4.1.0-SNAPSHOT/richfaces-core-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-api/4.1.0-SNAPSHOT/richfaces-core-api-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: com.google.guava:guava:r08">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/r08/guava-r08.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/r08/guava-r08-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/r08/guava-r08-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.core:richfaces-core-impl:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-impl/4.1.0-SNAPSHOT/richfaces-core-impl-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-impl/4.1.0-SNAPSHOT/richfaces-core-impl-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/core/richfaces-core-impl/4.1.0-SNAPSHOT/richfaces-core-impl-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: net.sourceforge.cssparser:cssparser:0.9.5">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.w3c.css:sac:1.3">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/w3c/css/sac/1.3/sac-1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/w3c/css/sac/1.3/sac-1.3-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/w3c/css/sac/1.3/sac-1.3-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: com.sun.el:el-ri:1.0">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/el/el-ri/1.0/el-ri-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/el/el-ri/1.0/el-ri-1.0-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/el/el-ri/1.0/el-ri-1.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.cdk:annotations:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/cdk/annotations/4.1.0-SNAPSHOT/annotations-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/cdk/annotations/4.1.0-SNAPSHOT/annotations-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/cdk/annotations/4.1.0-SNAPSHOT/annotations-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: javax.servlet:servlet-api:2.5">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.5/servlet-api-2.5-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: javax.servlet.jsp:jsp-api:2.1">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: javax.el:el-api:1.0">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/el/el-api/1.0/el-api-1.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.jboss.test-jsf:jsf-test-stage:1.0.6">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/test-jsf/jsf-test-stage/1.0.6/jsf-test-stage-1.0.6.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/test-jsf/jsf-test-stage/1.0.6/jsf-test-stage-1.0.6-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/test-jsf/jsf-test-stage/1.0.6/jsf-test-stage-1.0.6-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.jboss.el:jboss-el:1.0_02.CR5">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/jboss-el/1.0_02.CR5/jboss-el-1.0_02.CR5.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/jboss-el/1.0_02.CR5/jboss-el-1.0_02.CR5-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/el/jboss-el/1.0_02.CR5/jboss-el-1.0_02.CR5-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: javax.annotation:jsr250-api:1.0">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: junit:junit:4.7">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.7/junit-4.7.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.7/junit-4.7-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.7/junit-4.7-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.ui:richfaces-components-ui:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-ui/4.1.0-SNAPSHOT/richfaces-components-ui-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-ui/4.1.0-SNAPSHOT/richfaces-components-ui-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-ui/4.1.0-SNAPSHOT/richfaces-components-ui-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.ui:richfaces-components-api:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-api/4.1.0-SNAPSHOT/richfaces-components-api-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-api/4.1.0-SNAPSHOT/richfaces-components-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/richfaces-components-api/4.1.0-SNAPSHOT/richfaces-components-api-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.ui.core:richfaces-ui-core-ui:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-ui/4.1.0-SNAPSHOT/richfaces-ui-core-ui-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-ui/4.1.0-SNAPSHOT/richfaces-ui-core-ui-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-ui/4.1.0-SNAPSHOT/richfaces-ui-core-ui-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.ui.common:richfaces-ui-common-ui:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-ui/4.1.0-SNAPSHOT/richfaces-ui-common-ui-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-ui/4.1.0-SNAPSHOT/richfaces-ui-common-ui-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-ui/4.1.0-SNAPSHOT/richfaces-ui-common-ui-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.ui.common:richfaces-ui-common-api:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-api/4.1.0-SNAPSHOT/richfaces-ui-common-api-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-api/4.1.0-SNAPSHOT/richfaces-ui-common-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/common/richfaces-ui-common-api/4.1.0-SNAPSHOT/richfaces-ui-common-api-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ <library name="Maven: org.richfaces.ui.core:richfaces-ui-core-api:4.1.0-SNAPSHOT">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-api/4.1.0-SNAPSHOT/richfaces-ui-core-api-4.1.0-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-api/4.1.0-SNAPSHOT/richfaces-ui-core-api-4.1.0-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/richfaces/ui/core/richfaces-ui-core-api/4.1.0-SNAPSHOT/richfaces-ui-core-api-4.1.0-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </component>
+</project>
+
13 years, 8 months
JBoss Rich Faces SVN: r22421 - sandbox/trunk/ui.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2011-04-14 15:31:46 -0400 (Thu, 14 Apr 2011)
New Revision: 22421
Added:
sandbox/trunk/ui/watermark/
Log:
Imported watermark component into sandbox.
13 years, 8 months
JBoss Rich Faces SVN: r22420 - in trunk: examples/iteration-demo/src/main/java/org/richfaces/demo and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-14 13:54:15 -0400 (Thu, 14 Apr 2011)
New Revision: 22420
Added:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java
trunk/examples/iteration-demo/src/main/webapp/rf10888.xhtml
trunk/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java
Modified:
trunk/examples/iteration-demo/pom.xml
trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
Log:
https://issues.jboss.org/browse/RF-10888
Modified: trunk/examples/iteration-demo/pom.xml
===================================================================
--- trunk/examples/iteration-demo/pom.xml 2011-04-14 11:53:42 UTC (rev 22419)
+++ trunk/examples/iteration-demo/pom.xml 2011-04-14 17:54:15 UTC (rev 22420)
@@ -84,7 +84,6 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/RF10888.java 2011-04-14 17:54:15 UTC (rev 22420)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.util.List;
+import java.util.regex.Pattern;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.base.Strings;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(name = "rf10888")
+@SessionScoped
+public class RF10888 {
+
+ private String name;
+
+ private String surname;
+
+ private String email;
+
+ @ManagedProperty(value = "#{persistenceService}")
+ private PersistenceService persistenceService;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSurname() {
+ return surname;
+ }
+
+ public void setSurname(String surname) {
+ this.surname = surname;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public void setPersistenceService(PersistenceService persistenceService) {
+ this.persistenceService = persistenceService;
+ }
+
+ private Predicate<Person> contains(String value, Function<Person, CharSequence> accessor) {
+ return Predicates.compose(Predicates.contains(Pattern.compile(Pattern.quote(value), Pattern.CASE_INSENSITIVE)), accessor);
+ }
+
+ public Object getFilteredData() {
+ @SuppressWarnings("unchecked")
+ List<Person> resultList = (List<Person>) persistenceService.getEntityManager().createQuery("SELECT p from Person as p").getResultList();
+
+ List<Predicate<Person>> predicates = Lists.newArrayList();
+
+ if (!Strings.isNullOrEmpty(name)) {
+ predicates.add(contains(name, new Function<Person, CharSequence>() {
+ public CharSequence apply(Person input) {
+ return input.getName();
+ }
+ }));
+ }
+ if (!Strings.isNullOrEmpty(surname)) {
+ predicates.add(contains(surname, new Function<Person, CharSequence>() {
+ public CharSequence apply(Person input) {
+ return input.getSurname();
+ }
+ }));
+ }
+ if (!Strings.isNullOrEmpty(email)) {
+ predicates.add(contains(email, new Function<Person, CharSequence>() {
+ public CharSequence apply(Person input) {
+ return input.getEmail();
+ }
+ }));
+ }
+
+ return Lists.newArrayList(Collections2.filter(resultList, Predicates.and(predicates)));
+ }
+
+}
Added: trunk/examples/iteration-demo/src/main/webapp/rf10888.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/rf10888.xhtml (rev 0)
+++ trunk/examples/iteration-demo/src/main/webapp/rf10888.xhtml 2011-04-14 17:54:15 UTC (rev 22420)
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<ui:composition>
+ <h:head></h:head>
+ <h:body>
+ <h:form>
+ <h:panelGrid columns="2">
+ Name
+ <h:inputText value="#{rf10888.name}">
+ <f:ajax render="table scroller" event="keyup" />
+ </h:inputText>
+
+ Surname
+ <h:inputText value="#{rf10888.surname}">
+ <f:ajax render="table scroller" event="keyup" />
+ </h:inputText>
+
+ E-mail
+ <h:inputText value="#{rf10888.email}">
+ <f:ajax render="table scroller" event="keyup" />
+ </h:inputText>
+ </h:panelGrid>
+
+ <it:dataScroller id="scroller" for="table" />
+ <h:dataTable value="#{rf10888.filteredData}" id="table" var="record" rows="20">
+ <h:column>
+ <f:facet name="header">
+ Name
+ </f:facet>
+ #{record.name}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ Surname
+ </f:facet>
+ #{record.surname}
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">
+ E-mail
+ </f:facet>
+ #{record.email}
+ </h:column>
+
+ <f:facet name="footer">
+ <it:dataScroller />
+ </f:facet>
+ </h:dataTable>
+ </h:form>
+ </h:body>
+</ui:composition>
+</html>
Added: trunk/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java (rev 0)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/DataComponentsContextUtil.java 2011-04-14 17:54:15 UTC (rev 22420)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class DataComponentsContextUtil {
+
+ private static final String MODEL_RESET_ATTRIBUTE_SUFFIX = "#" + DataComponentsContextUtil.class.getName();
+
+ private DataComponentsContextUtil() {}
+
+ private static String getAttributeName(FacesContext context, UIComponent component) {
+ return component.getClientId(context) + MODEL_RESET_ATTRIBUTE_SUFFIX;
+ }
+
+ public static void resetDataModelOncePerPhase(FacesContext context, UIComponent component) {
+ String attributeName = getAttributeName(context, component);
+ if (context.getCurrentPhaseId() != context.getAttributes().put(attributeName, context.getCurrentPhaseId())) {
+ resetDataModel(context, component);
+ }
+ }
+
+ private static void resetDataModel(FacesContext context, UIComponent component) {
+ if (component instanceof UIDataAdaptor) {
+ ((UIDataAdaptor) component).resetDataModel();
+ } else if (component instanceof UIData) {
+ //hack to reset cached data model
+ component.setValueExpression("value", component.getValueExpression("value"));
+ } else {
+ throw new IllegalArgumentException(component.toString());
+ }
+ }
+}
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2011-04-14 11:53:42 UTC (rev 22419)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2011-04-14 17:54:15 UTC (rev 22420)
@@ -922,7 +922,7 @@
}
protected void preEncodeBegin(FacesContext context) {
- resetDataModel();
+ DataComponentsContextUtil.resetDataModelOncePerPhase(context, this);
if (!isKeepSaved()) {
//TODO - this also resets state for the nested iteration components - is it correct?
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2011-04-14 11:53:42 UTC (rev 22419)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2011-04-14 17:54:15 UTC (rev 22420)
@@ -37,9 +37,9 @@
import org.ajax4jsf.component.IterationStateHolder;
import org.richfaces.DataScrollerUtils;
+import org.richfaces.application.FacesMessages;
import org.richfaces.application.MessageFactory;
import org.richfaces.application.ServiceTracker;
-import org.richfaces.application.FacesMessages;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2011-04-14 11:53:42 UTC (rev 22419)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2011-04-14 17:54:15 UTC (rev 22420)
@@ -38,10 +38,11 @@
import org.ajax4jsf.Messages;
import org.richfaces.DataScrollerUtils;
import org.richfaces.component.AbstractDataScroller;
+import org.richfaces.component.DataComponentsContextUtil;
import org.richfaces.component.UIDataAdaptor;
import org.richfaces.component.util.MessageUtil;
+import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
-import org.richfaces.log.Logger;
public class DataTablePreRenderListener implements SystemEventListener {
@@ -120,8 +121,10 @@
dataTable = activeDataScroller.getDataTable();
}
- String scrollerStateKey = dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE;
if ((activeDataScroller != null) && (dataTable != null)) {
+ DataComponentsContextUtil.resetDataModelOncePerPhase(facesContext, dataTable);
+
+ String scrollerStateKey = dataTable.getClientId(facesContext) + AbstractDataScroller.SCROLLER_STATE_ATTRIBUTE;
int rowCount = DataScrollerUtils.getRowCount(dataTable);
int rows = DataScrollerUtils.getRows(dataTable);
int pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
13 years, 8 months
JBoss Rich Faces SVN: r22419 - in trunk/examples/iteration-demo: src/main/java/org/richfaces/demo and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-14 07:53:42 -0400 (Thu, 14 Apr 2011)
New Revision: 22419
Added:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java
trunk/examples/iteration-demo/src/main/resources/META-INF/
trunk/examples/iteration-demo/src/main/resources/META-INF/persistence.xml
trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml
trunk/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml
trunk/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml
Modified:
trunk/examples/iteration-demo/pom.xml
trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
JPA 2 data table demo
Modified: trunk/examples/iteration-demo/pom.xml
===================================================================
--- trunk/examples/iteration-demo/pom.xml 2011-04-13 09:48:09 UTC (rev 22418)
+++ trunk/examples/iteration-demo/pom.xml 2011-04-14 11:53:42 UTC (rev 22419)
@@ -86,6 +86,22 @@
<artifactId>jstl</artifactId>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb-j5</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>2.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.java-persistence</groupId>
+ <artifactId>jpa-api</artifactId>
+ <version>2.0-cr-1</version>
+ </dependency>
</dependencies>
<build>
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/JPADataModel.java 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,251 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Order;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.Root;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceRange;
+import org.richfaces.component.SortOrder;
+import org.richfaces.model.Arrangeable;
+import org.richfaces.model.ArrangeableState;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.SortField;
+
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+public abstract class JPADataModel<T> extends ExtendedDataModel<T> implements Arrangeable {
+
+ private EntityManager entityManager;
+
+ private Object rowKey;
+
+ private ArrangeableState arrangeableState;
+
+ private Class<T> entityClass;
+
+ public JPADataModel(EntityManager entityManager, Class<T> entityClass) {
+ super();
+
+ this.entityManager = entityManager;
+ this.entityClass = entityClass;
+ }
+
+ public void arrange(FacesContext context, ArrangeableState state) {
+ arrangeableState = state;
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ rowKey = key;
+ }
+
+ @Override
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ private CriteriaQuery<Long> createCountCriteriaQuery() {
+ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+ CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
+ Root<T> root = criteriaQuery.from(entityClass);
+
+ Expression<Boolean> filterCriteria = createFilterCriteria(criteriaBuilder, root);
+ if (filterCriteria != null) {
+ criteriaQuery.where(filterCriteria);
+ }
+
+ Expression<Long> count = criteriaBuilder.count(root);
+ criteriaQuery.select(count);
+
+ return criteriaQuery;
+ }
+
+ private CriteriaQuery<T> createSelectCriteriaQuery() {
+ CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+ CriteriaQuery<T> criteriaQuery = criteriaBuilder.createQuery(entityClass);
+ Root<T> root = criteriaQuery.from(entityClass);
+
+ if (arrangeableState != null) {
+
+ List<Order> orders = createOrders(criteriaBuilder, root);
+ if (!orders.isEmpty()) {
+ criteriaQuery.orderBy(orders);
+ }
+
+ Expression<Boolean> filterCriteria = createFilterCriteria(criteriaBuilder, root);
+ if (filterCriteria != null) {
+ criteriaQuery.where(filterCriteria);
+ }
+ }
+
+ return criteriaQuery;
+ }
+
+ private List<Order> createOrders(CriteriaBuilder criteriaBuilder, Root<T> root) {
+ List<Order> orders = Lists.newArrayList();
+ List<SortField> sortFields = arrangeableState.getSortFields();
+ if (sortFields != null && !sortFields.isEmpty()) {
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ for (SortField sortField: sortFields) {
+ String propertyName = (String) sortField.getSortBy().getValue(facesContext.getELContext());
+
+ Path<Object> expression = root.get(propertyName);
+
+ Order jpaOrder;
+ SortOrder sortOrder = sortField.getSortOrder();
+ if (sortOrder == SortOrder.ascending) {
+ jpaOrder = criteriaBuilder.asc(expression);
+ } else if (sortOrder == SortOrder.descending) {
+ jpaOrder = criteriaBuilder.desc(expression);
+ } else {
+ throw new IllegalArgumentException(sortOrder.toString());
+ }
+
+ orders.add(jpaOrder);
+ }
+ }
+
+ return orders;
+ }
+
+ protected ArrangeableState getArrangeableState() {
+ return arrangeableState;
+ }
+
+ protected Class<T> getEntityClass() {
+ return entityClass;
+ }
+
+ protected Expression<Boolean> createFilterCriteriaForField(String propertyName, Object filterValue, Root<T> root, CriteriaBuilder criteriaBuilder) {
+ String stringFilterValue = (String) filterValue;
+ if (Strings.isNullOrEmpty(stringFilterValue)) {
+ return null;
+ }
+
+ stringFilterValue = stringFilterValue.toLowerCase(arrangeableState.getLocale());
+
+ Path<String> expression = root.get(propertyName);
+ Expression<Integer> locator = criteriaBuilder.locate(criteriaBuilder.lower(expression), stringFilterValue);
+ return criteriaBuilder.gt(locator, 0);
+ }
+
+
+ private Expression<Boolean> createFilterCriteria(CriteriaBuilder criteriaBuilder, Root<T> root) {
+ Expression<Boolean> filterCriteria = null;
+ List<FilterField> filterFields = arrangeableState.getFilterFields();
+ if (filterFields != null && !filterFields.isEmpty()) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ for (FilterField filterField : filterFields) {
+ String propertyName = (String) filterField.getFilterExpression().getValue(facesContext.getELContext());
+ Object filterValue = filterField.getFilterValue();
+
+ Expression<Boolean> predicate = createFilterCriteriaForField(propertyName, filterValue, root, criteriaBuilder);
+
+ if (predicate == null) {
+ continue;
+ }
+
+ if (filterCriteria == null) {
+ filterCriteria = predicate.as(Boolean.class);
+ } else {
+ filterCriteria = criteriaBuilder.and(filterCriteria, predicate.as(Boolean.class));
+ }
+ }
+
+ }
+ return filterCriteria;
+ }
+
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
+ CriteriaQuery<T> criteriaQuery = createSelectCriteriaQuery();
+ TypedQuery<T> query = entityManager.createQuery(criteriaQuery);
+
+ SequenceRange sequenceRange = (SequenceRange) range;
+ if (sequenceRange.getFirstRow() >= 0 && sequenceRange.getRows() > 0) {
+ query.setFirstResult(sequenceRange.getFirstRow());
+ query.setMaxResults(sequenceRange.getRows());
+ }
+
+ List<T> data = query.getResultList();
+ for (T t : data) {
+ visitor.process(context, getId(t), argument);
+ }
+ }
+
+
+ @Override
+ public boolean isRowAvailable() {
+ return rowKey != null;
+ }
+
+ @Override
+ public int getRowCount() {
+ CriteriaQuery<Long> criteriaQuery = createCountCriteriaQuery();
+ return entityManager.createQuery(criteriaQuery).getSingleResult().intValue();
+ }
+
+ @Override
+ public T getRowData() {
+ return entityManager.find(entityClass, rowKey);
+ }
+
+ @Override
+ public int getRowIndex() {
+ return -1;
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object getWrappedData() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ throw new UnsupportedOperationException();
+ }
+
+ //TODO - implement using metadata
+ protected abstract Object getId(T t);
+}
\ No newline at end of file
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycle.java 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseListener;
+import javax.faces.lifecycle.Lifecycle;
+
+class PersistenceLifecycle extends Lifecycle {
+
+ private static final class PersistenceServiceRef {
+
+ static final PersistenceService PERSISTENCE_SERVICE = (PersistenceService) FacesContext.getCurrentInstance().
+ getExternalContext().getApplicationMap().get("persistenceService");
+
+ private PersistenceServiceRef() {
+ }
+
+ }
+
+ private Lifecycle lifecycle;
+
+ public PersistenceLifecycle(Lifecycle lifecycle) {
+ this.lifecycle = lifecycle;
+ }
+
+ public void addPhaseListener(PhaseListener listener) {
+ lifecycle.addPhaseListener(listener);
+ }
+
+ public PhaseListener[] getPhaseListeners() {
+ return lifecycle.getPhaseListeners();
+ }
+
+ public void removePhaseListener(PhaseListener listener) {
+ lifecycle.removePhaseListener(listener);
+ }
+
+ public void execute(FacesContext context) throws FacesException {
+ try {
+ lifecycle.execute(context);
+ } finally {
+ PersistenceServiceRef.PERSISTENCE_SERVICE.closeEntityManager();
+ }
+ }
+
+ public void render(FacesContext context) throws FacesException {
+ try {
+ lifecycle.render(context);
+ } finally {
+ PersistenceServiceRef.PERSISTENCE_SERVICE.closeEntityManager();
+ }
+ }
+
+
+}
\ No newline at end of file
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceLifecycleFactory.java 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.util.Iterator;
+
+import javax.faces.FacesWrapper;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PersistenceLifecycleFactory extends LifecycleFactory implements FacesWrapper<LifecycleFactory> {
+
+ private LifecycleFactory lifecycleFactory;
+
+ private Lifecycle defaultLifecycle;
+
+ public PersistenceLifecycleFactory(LifecycleFactory lifecycleFactory) {
+ super();
+ this.lifecycleFactory = lifecycleFactory;
+ }
+
+ @Override
+ public void addLifecycle(String lifecycleId, Lifecycle lifecycle) {
+ getWrapped().addLifecycle(lifecycleId, lifecycle);
+ }
+
+ @Override
+ public Lifecycle getLifecycle(String lifecycleId) {
+ if (LifecycleFactory.DEFAULT_LIFECYCLE.equals(lifecycleId)) {
+ if (defaultLifecycle == null) {
+ createDefaultLifecycle();
+ }
+
+ return defaultLifecycle;
+ }
+
+ return lifecycleFactory.getLifecycle(lifecycleId);
+ }
+
+ private void createDefaultLifecycle() {
+ defaultLifecycle = new PersistenceLifecycle(lifecycleFactory.getLifecycle(DEFAULT_LIFECYCLE));
+ }
+
+ @Override
+ public Iterator<String> getLifecycleIds() {
+ return lifecycleFactory.getLifecycleIds();
+ }
+
+}
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersistenceService.java 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.context.FacesContext;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
+import javax.persistence.Persistence;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Node;
+
+import com.google.common.collect.Lists;
+import com.google.common.io.Closeables;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(eager = true)
+@ApplicationScoped
+public class PersistenceService {
+
+ private static final Logger LOGGER = Logger.getLogger(PersistenceService.class.getName());
+
+ private EntityManagerFactory entityManagerFactory;
+
+ public EntityManager getEntityManager() {
+ Map<Object, Object> attributes = FacesContext.getCurrentInstance().getAttributes();
+
+ EntityManager manager = (EntityManager) attributes.get(PersistenceService.class);
+
+ if (manager == null) {
+ manager = entityManagerFactory.createEntityManager();
+ attributes.put(PersistenceService.class, manager);
+ manager.getTransaction().begin();
+ }
+
+ return manager;
+ }
+
+ void closeEntityManager() {
+ Map<Object, Object> attributes = FacesContext.getCurrentInstance().getAttributes();
+
+ EntityManager entityManager = (EntityManager) attributes.remove(PersistenceService.class);
+
+ if (entityManager != null) {
+ try {
+ entityManager.getTransaction().commit();
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, e.getMessage(), e);
+ try {
+ entityManager.getTransaction().rollback();
+ } catch (Exception e1) {
+ LOGGER.log(Level.SEVERE, e1.getMessage(), e1);
+ }
+ } finally {
+ entityManager.close();
+ }
+ }
+ }
+
+ @PostConstruct
+ public void init() {
+ entityManagerFactory = Persistence.createEntityManagerFactory("iterationDemo", new Properties());
+
+
+ EntityManager em = entityManagerFactory.createEntityManager();
+
+ EntityTransaction transaction = em.getTransaction();
+
+ try {
+ transaction.begin();
+
+ for (Person person: parseTestData()) {
+ em.persist(person);
+ }
+
+ transaction.commit();
+ } catch (Exception e) {
+ transaction.rollback();
+ e.printStackTrace();
+ } finally {
+ em.close();
+ }
+ }
+
+ private List<Person> parseTestData() throws Exception {
+ InputStream dataStream = null;
+ try {
+ dataStream = PersistenceService.class.getResourceAsStream("data.xml");
+ DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Node node = documentBuilder.parse(dataStream).getDocumentElement();
+
+ List<Person> persons = Lists.newArrayList();
+
+ for (Node personNode = node.getFirstChild(); personNode != null; personNode = personNode.getNextSibling()) {
+ if (personNode.getNodeType() != Node.ELEMENT_NODE) {
+ continue;
+ }
+
+ Person person = new Person();
+ persons.add(person);
+
+ for (Node personDataNode = personNode.getFirstChild(); personDataNode != null; personDataNode = personDataNode.getNextSibling()) {
+ if (personDataNode.getNodeType() != Node.ELEMENT_NODE) {
+ continue;
+ }
+
+ String nodeName = personDataNode.getNodeName();
+ String text = personDataNode.getTextContent();
+ if ("name".equals(nodeName)) {
+ person.setName(text);
+ } else if ("surname".equals(nodeName)) {
+ person.setSurname(text);
+ } else if ("email".equals(nodeName)) {
+ person.setEmail(text);
+ }
+ }
+ }
+
+ return persons;
+ } finally {
+ Closeables.closeQuietly(dataStream);
+ }
+ }
+
+ @PreDestroy
+ public void destroy() {
+ entityManagerFactory.close();
+ entityManagerFactory = null;
+ }
+
+}
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/Person.java 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@Entity
+public class Person {
+
+ private String name;
+
+ private String surname;
+
+ private String email;
+
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ public Person() {
+ }
+
+ public Person(String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getSurname() {
+ return surname;
+ }
+
+ public void setSurname(String surname) {
+ this.surname = surname;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+}
Added: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java (rev 0)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/PersonBean.java 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo;
+
+
+import java.util.Map;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.persistence.EntityManager;
+
+import org.richfaces.component.SortOrder;
+
+import com.google.common.collect.Maps;
+
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean
+@SessionScoped
+public class PersonBean {
+
+ private static final class PersonDataModel extends JPADataModel<Person> {
+
+ private PersonDataModel(EntityManager entityManager) {
+ super(entityManager, Person.class);
+ }
+
+ @Override
+ protected Object getId(Person t) {
+ return t.getId();
+ }
+ }
+
+ @ManagedProperty(value = "#{persistenceService}")
+ private PersistenceService persistenceService;
+
+ private Map<String, SortOrder> sortOrders = Maps.newHashMapWithExpectedSize(1);
+
+ private Map<String, String> filterValues = Maps.newHashMap();
+
+ public void setPersistenceService(PersistenceService persistenceService) {
+ this.persistenceService = persistenceService;
+ }
+
+ public Map<String, SortOrder> getSortOrders() {
+ return sortOrders;
+ }
+
+ public Map<String, String> getFilterValues() {
+ return filterValues;
+ }
+
+ public SortOrder getSortOrder(String name) {
+ SortOrder sortOrder = getSortOrders().get(name);
+
+ if (sortOrder == null) {
+ sortOrder = SortOrder.unsorted;
+ }
+
+ return sortOrder;
+ }
+
+ public void switchSortOrder(String name) {
+ SortOrder newSortOrder = null;
+
+ switch (getSortOrder(name)) {
+ case unsorted:
+ newSortOrder = SortOrder.ascending;
+ break;
+ case ascending:
+ newSortOrder = SortOrder.descending;
+ break;
+ case descending:
+ newSortOrder = SortOrder.ascending;
+ break;
+ default:
+ throw new IllegalStateException();
+ }
+
+ sortOrders.clear();
+ sortOrders.put(name, newSortOrder);
+ }
+
+ public Object getDataModel() {
+ return new PersonDataModel(persistenceService.getEntityManager());
+ }
+}
\ No newline at end of file
Added: trunk/examples/iteration-demo/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/resources/META-INF/persistence.xml (rev 0)
+++ trunk/examples/iteration-demo/src/main/resources/META-INF/persistence.xml 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="1.0"
+ xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
+ <persistence-unit name="iterationDemo"
+ transaction-type="RESOURCE_LOCAL">
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <class>org.richfaces.demo.Person</class>
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:iteration_demo" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value=""/>
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
+ <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Added: trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml (rev 0)
+++ trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/data.xml 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,1003 @@
+<persons>
+ <person>
+ <name>Savannah</name>
+ <surname>Dickerson</surname>
+ <email>ac.sem(a)Phasellus.com</email>
+ </person>
+ <person>
+ <name>Melyssa</name>
+ <surname>Scott</surname>
+ <email>orci(a)at.com</email>
+ </person>
+ <person>
+ <name>Jemima</name>
+ <surname>Workman</surname>
+ <email>ac.mattis.semper(a)eget.org</email>
+ </person>
+ <person>
+ <name>Evelyn</name>
+ <surname>Santiago</surname>
+ <email>consectetuer.cursus(a)nonmagna.com</email>
+ </person>
+ <person>
+ <name>Blossom</name>
+ <surname>Diaz</surname>
+ <email>non.leo(a)mattisvelit.ca</email>
+ </person>
+ <person>
+ <name>Miriam</name>
+ <surname>Gonzales</surname>
+ <email>velit(a)urna.com</email>
+ </person>
+ <person>
+ <name>Jada</name>
+ <surname>Dennis</surname>
+ <email>lectus.ante(a)lectus.com</email>
+ </person>
+ <person>
+ <name>Jessica</name>
+ <surname>Cotton</surname>
+ <email>in(a)purus.com</email>
+ </person>
+ <person>
+ <name>Henry</name>
+ <surname>Blackburn</surname>
+ <email>amet.risus.Donec(a)semper.com</email>
+ </person>
+ <person>
+ <name>Raymond</name>
+ <surname>Estrada</surname>
+ <email>vitae(a)eutellus.ca</email>
+ </person>
+ <person>
+ <name>Rhiannon</name>
+ <surname>Dodson</surname>
+ <email>dictum(a)Nullamscelerisque.edu</email>
+ </person>
+ <person>
+ <name>Nigel</name>
+ <surname>Ferrell</surname>
+ <email>dictum.Phasellus(a)velitin.ca</email>
+ </person>
+ <person>
+ <name>Kane</name>
+ <surname>Cook</surname>
+ <email>massa.Vestibulum(a)eu.com</email>
+ </person>
+ <person>
+ <name>Leandra</name>
+ <surname>Macias</surname>
+ <email>erat.Vivamus.nisi(a)NullainterdumCurabitur.ca</email>
+ </person>
+ <person>
+ <name>Ivory</name>
+ <surname>Sanchez</surname>
+ <email>Cras.lorem(a)non.org</email>
+ </person>
+ <person>
+ <name>Kelly</name>
+ <surname>Palmer</surname>
+ <email>dolor.egestas.rhoncus(a)risusDonecegestas.com</email>
+ </person>
+ <person>
+ <name>Jenna</name>
+ <surname>Willis</surname>
+ <email>ipsum.dolor(a)luctus.ca</email>
+ </person>
+ <person>
+ <name>Ivana</name>
+ <surname>Wolf</surname>
+ <email>ac(a)infelis.com</email>
+ </person>
+ <person>
+ <name>Graiden</name>
+ <surname>Hall</surname>
+ <email>purus(a)Integer.edu</email>
+ </person>
+ <person>
+ <name>Daria</name>
+ <surname>Petty</surname>
+ <email>tortor.dictum(a)egestasrhoncus.edu</email>
+ </person>
+ <person>
+ <name>Holmes</name>
+ <surname>Lang</surname>
+ <email>adipiscing.enim(a)Nullamscelerisque.ca</email>
+ </person>
+ <person>
+ <name>Michelle</name>
+ <surname>Miranda</surname>
+ <email>Nam.consequat.dolor(a)Naminterdum.edu</email>
+ </person>
+ <person>
+ <name>Calista</name>
+ <surname>Everett</surname>
+ <email>Donec.nibh(a)laoreetlibero.com</email>
+ </person>
+ <person>
+ <name>September</name>
+ <surname>Nicholson</surname>
+ <email>iaculis.odio(a)sollicitudincommodo.ca</email>
+ </person>
+ <person>
+ <name>Rosalyn</name>
+ <surname>Cline</surname>
+ <email>Fusce.fermentum.fermentum(a)gravidanuncsed.edu</email>
+ </person>
+ <person>
+ <name>Christen</name>
+ <surname>Cleveland</surname>
+ <email>Duis.volutpat.nunc(a)metusvitaevelit.ca</email>
+ </person>
+ <person>
+ <name>Igor</name>
+ <surname>Sears</surname>
+ <email>non(a)eu.edu</email>
+ </person>
+ <person>
+ <name>Plato</name>
+ <surname>Johnston</surname>
+ <email>suscipit.est(a)Lorem.org</email>
+ </person>
+ <person>
+ <name>Kelsie</name>
+ <surname>Peterson</surname>
+ <email>lacus.Aliquam(a)dolorelitpellentesque.org</email>
+ </person>
+ <person>
+ <name>Lionel</name>
+ <surname>Puckett</surname>
+ <email>mi.lacinia.mattis(a)lacusEtiambibendum.org</email>
+ </person>
+ <person>
+ <name>Orlando</name>
+ <surname>Hayes</surname>
+ <email>Mauris.quis(a)fringilla.org</email>
+ </person>
+ <person>
+ <name>Fuller</name>
+ <surname>Keller</surname>
+ <email>In.nec.orci(a)utmolestiein.org</email>
+ </person>
+ <person>
+ <name>Brandon</name>
+ <surname>Woodward</surname>
+ <email>eget.magna(a)etnuncQuisque.edu</email>
+ </person>
+ <person>
+ <name>Lyle</name>
+ <surname>George</surname>
+ <email>lacus.Mauris(a)risus.edu</email>
+ </person>
+ <person>
+ <name>Abbot</name>
+ <surname>Valdez</surname>
+ <email>tincidunt.Donec.vitae(a)velit.ca</email>
+ </person>
+ <person>
+ <name>Kessie</name>
+ <surname>Carr</surname>
+ <email>Suspendisse.commodo(a)nonbibendum.ca</email>
+ </person>
+ <person>
+ <name>Louis</name>
+ <surname>Mitchell</surname>
+ <email>condimentum.Donec(a)convallisconvallis.com</email>
+ </person>
+ <person>
+ <name>Francesca</name>
+ <surname>Walters</surname>
+ <email>non.leo(a)eu.edu</email>
+ </person>
+ <person>
+ <name>Giacomo</name>
+ <surname>Cross</surname>
+ <email>Morbi(a)nunc.edu</email>
+ </person>
+ <person>
+ <name>Iris</name>
+ <surname>Curtis</surname>
+ <email>nec.euismod.in(a)Nullamsuscipit.ca</email>
+ </person>
+ <person>
+ <name>Abdul</name>
+ <surname>Atkins</surname>
+ <email>Donec.non.justo(a)lobortismauris.com</email>
+ </person>
+ <person>
+ <name>Dominique</name>
+ <surname>Knight</surname>
+ <email>suscipit.est.ac(a)odioNam.org</email>
+ </person>
+ <person>
+ <name>Odysseus</name>
+ <surname>Barnett</surname>
+ <email>nisi.a.odio(a)tempor.com</email>
+ </person>
+ <person>
+ <name>Hammett</name>
+ <surname>Ray</surname>
+ <email>eu.sem(a)purusactellus.ca</email>
+ </person>
+ <person>
+ <name>Gage</name>
+ <surname>Branch</surname>
+ <email>ac.libero(a)neque.ca</email>
+ </person>
+ <person>
+ <name>Quinn</name>
+ <surname>Wilcox</surname>
+ <email>Fusce(a)ipsumdolor.org</email>
+ </person>
+ <person>
+ <name>Ursa</name>
+ <surname>Bishop</surname>
+ <email>montes(a)tempor.org</email>
+ </person>
+ <person>
+ <name>Gray</name>
+ <surname>Riddle</surname>
+ <email>Suspendisse(a)magnanec.org</email>
+ </person>
+ <person>
+ <name>Jorden</name>
+ <surname>Christensen</surname>
+ <email>a.feugiat(a)id.edu</email>
+ </person>
+ <person>
+ <name>Hashim</name>
+ <surname>Knight</surname>
+ <email>Mauris(a)aliquetProin.edu</email>
+ </person>
+ <person>
+ <name>Whitney</name>
+ <surname>Hansen</surname>
+ <email>nibh.Phasellus.nulla(a)ullamcorperDuis.org</email>
+ </person>
+ <person>
+ <name>Lacy</name>
+ <surname>Thompson</surname>
+ <email>justo(a)egestasurnajusto.org</email>
+ </person>
+ <person>
+ <name>Chelsea</name>
+ <surname>Blanchard</surname>
+ <email>magna(a)dictum.org</email>
+ </person>
+ <person>
+ <name>Kaseem</name>
+ <surname>Melendez</surname>
+ <email>sem.semper.erat(a)mattis.edu</email>
+ </person>
+ <person>
+ <name>Lillian</name>
+ <surname>Conway</surname>
+ <email>mattis(a)egetmetus.com</email>
+ </person>
+ <person>
+ <name>Allistair</name>
+ <surname>Britt</surname>
+ <email>tellus.faucibus.leo(a)Aenean.org</email>
+ </person>
+ <person>
+ <name>Merritt</name>
+ <surname>Melton</surname>
+ <email>blandit(a)enimdiamvel.org</email>
+ </person>
+ <person>
+ <name>Vivien</name>
+ <surname>Baker</surname>
+ <email>accumsan(a)velitegestas.com</email>
+ </person>
+ <person>
+ <name>Quinn</name>
+ <surname>Lowery</surname>
+ <email>vitae.erat(a)ridiculusmusDonec.ca</email>
+ </person>
+ <person>
+ <name>Fleur</name>
+ <surname>Rios</surname>
+ <email>ullamcorper.viverra(a)egetvolutpatornare.ca</email>
+ </person>
+ <person>
+ <name>Suki</name>
+ <surname>Leach</surname>
+ <email>luctus.Curabitur(a)nibh.com</email>
+ </person>
+ <person>
+ <name>Scarlet</name>
+ <surname>Cannon</surname>
+ <email>dictum.eu.placerat(a)imperdiet.edu</email>
+ </person>
+ <person>
+ <name>Ross</name>
+ <surname>Reid</surname>
+ <email>in.hendrerit(a)tincidunt.ca</email>
+ </person>
+ <person>
+ <name>Amethyst</name>
+ <surname>Pennington</surname>
+ <email>Mauris.nulla.Integer(a)Fuscemollis.org</email>
+ </person>
+ <person>
+ <name>Gregory</name>
+ <surname>Lyons</surname>
+ <email>nisl.sem.consequat(a)Phasellus.ca</email>
+ </person>
+ <person>
+ <name>Constance</name>
+ <surname>Thomas</surname>
+ <email>accumsan(a)ipsum.ca</email>
+ </person>
+ <person>
+ <name>Cleo</name>
+ <surname>Chandler</surname>
+ <email>massa(a)penatibusetmagnis.org</email>
+ </person>
+ <person>
+ <name>Cruz</name>
+ <surname>Paul</surname>
+ <email>ornare.In(a)temporbibendum.org</email>
+ </person>
+ <person>
+ <name>Tyrone</name>
+ <surname>Nunez</surname>
+ <email>arcu.Nunc(a)nisi.org</email>
+ </person>
+ <person>
+ <name>Evan</name>
+ <surname>Erickson</surname>
+ <email>Etiam(a)nibh.org</email>
+ </person>
+ <person>
+ <name>Claudia</name>
+ <surname>Nash</surname>
+ <email>Cras.sed(a)estacmattis.com</email>
+ </person>
+ <person>
+ <name>Pascale</name>
+ <surname>Cherry</surname>
+ <email>mi(a)nonjustoProin.edu</email>
+ </person>
+ <person>
+ <name>Evelyn</name>
+ <surname>Baxter</surname>
+ <email>ante.ipsum.primis(a)adlitoratorquent.org</email>
+ </person>
+ <person>
+ <name>Wing</name>
+ <surname>Gill</surname>
+ <email>per(a)semperet.ca</email>
+ </person>
+ <person>
+ <name>Raja</name>
+ <surname>Smith</surname>
+ <email>euismod.in(a)Duisa.com</email>
+ </person>
+ <person>
+ <name>Gail</name>
+ <surname>Fisher</surname>
+ <email>Integer.mollis.Integer(a)nullaInteger.edu</email>
+ </person>
+ <person>
+ <name>Garth</name>
+ <surname>Kaufman</surname>
+ <email>Suspendisse(a)conguea.ca</email>
+ </person>
+ <person>
+ <name>Donna</name>
+ <surname>Holman</surname>
+ <email>orci.luctus(a)Integerinmagna.com</email>
+ </person>
+ <person>
+ <name>Harriet</name>
+ <surname>Rhodes</surname>
+ <email>eu(a)ametultricies.edu</email>
+ </person>
+ <person>
+ <name>Brody</name>
+ <surname>Jacobs</surname>
+ <email>magna.sed(a)Vivamusmolestiedapibus.org</email>
+ </person>
+ <person>
+ <name>Colton</name>
+ <surname>Duffy</surname>
+ <email>id.magna(a)nullaIntegervulputate.edu</email>
+ </person>
+ <person>
+ <name>Edan</name>
+ <surname>Baxter</surname>
+ <email>Cras(a)orciUt.ca</email>
+ </person>
+ <person>
+ <name>Desirae</name>
+ <surname>Thomas</surname>
+ <email>et(a)hendreritDonec.ca</email>
+ </person>
+ <person>
+ <name>Drew</name>
+ <surname>Dixon</surname>
+ <email>lectus.a.sollicitudin(a)rutrumurnanec.ca</email>
+ </person>
+ <person>
+ <name>Jasper</name>
+ <surname>Stein</surname>
+ <email>Nunc.commodo(a)Duis.edu</email>
+ </person>
+ <person>
+ <name>Stacy</name>
+ <surname>Taylor</surname>
+ <email>turpis.non(a)maurisblanditmattis.org</email>
+ </person>
+ <person>
+ <name>Indigo</name>
+ <surname>Ballard</surname>
+ <email>pellentesque.massa(a)odioEtiamligula.com</email>
+ </person>
+ <person>
+ <name>Leroy</name>
+ <surname>Golden</surname>
+ <email>ultrices(a)Aliquamnec.com</email>
+ </person>
+ <person>
+ <name>Erasmus</name>
+ <surname>Mcguire</surname>
+ <email>fermentum(a)Donecporttitor.com</email>
+ </person>
+ <person>
+ <name>Lev</name>
+ <surname>Mccray</surname>
+ <email>lectus.convallis.est(a)blanditenim.org</email>
+ </person>
+ <person>
+ <name>Ima</name>
+ <surname>Petersen</surname>
+ <email>egestas(a)acmieleifend.org</email>
+ </person>
+ <person>
+ <name>Murphy</name>
+ <surname>Mcintosh</surname>
+ <email>tempus.risus.Donec(a)dolorquamelementum.edu</email>
+ </person>
+ <person>
+ <name>Kelsie</name>
+ <surname>Cantrell</surname>
+ <email>ut.aliquam(a)commodohendreritDonec.org</email>
+ </person>
+ <person>
+ <name>Claudia</name>
+ <surname>Carlson</surname>
+ <email>fringilla(a)fermentumconvallisligula.com</email>
+ </person>
+ <person>
+ <name>Cole</name>
+ <surname>Walsh</surname>
+ <email>quis.pede.Praesent(a)intempus.org</email>
+ </person>
+ <person>
+ <name>Hu</name>
+ <surname>Baker</surname>
+ <email>Aliquam(a)Vivamusnibh.com</email>
+ </person>
+ <person>
+ <name>Lara</name>
+ <surname>Wong</surname>
+ <email>a.dui(a)leo.ca</email>
+ </person>
+ <person>
+ <name>Simone</name>
+ <surname>Lancaster</surname>
+ <email>netus.et(a)egettincidunt.ca</email>
+ </person>
+ <person>
+ <name>Heather</name>
+ <surname>Harrison</surname>
+ <email>tellus(a)lacus.edu</email>
+ </person>
+ <person>
+ <name>Zenia</name>
+ <surname>Curtis</surname>
+ <email>faucibus.lectus.a(a)fringilla.org</email>
+ </person>
+ <person>
+ <name>Stuart</name>
+ <surname>Pugh</surname>
+ <email>nulla.Cras.eu(a)asollicitudinorci.org</email>
+ </person>
+ <person>
+ <name>Shelley</name>
+ <surname>Goodman</surname>
+ <email>quam.dignissim(a)habitantmorbitristique.ca</email>
+ </person>
+ <person>
+ <name>Keegan</name>
+ <surname>Olson</surname>
+ <email>dolor.dapibus(a)tortor.org</email>
+ </person>
+ <person>
+ <name>Hop</name>
+ <surname>Rodriguez</surname>
+ <email>vitae.semper.egestas(a)natoque.ca</email>
+ </person>
+ <person>
+ <name>Deanna</name>
+ <surname>Frye</surname>
+ <email>Vivamus(a)risus.org</email>
+ </person>
+ <person>
+ <name>Rebecca</name>
+ <surname>Medina</surname>
+ <email>sociis(a)etmagnisdis.com</email>
+ </person>
+ <person>
+ <name>Sarah</name>
+ <surname>Patton</surname>
+ <email>ullamcorper(a)ettristique.com</email>
+ </person>
+ <person>
+ <name>Jenette</name>
+ <surname>Martin</surname>
+ <email>tempor.lorem.eget(a)etrutrum.com</email>
+ </person>
+ <person>
+ <name>Gil</name>
+ <surname>Brady</surname>
+ <email>tellus(a)inmagna.org</email>
+ </person>
+ <person>
+ <name>Jena</name>
+ <surname>Merritt</surname>
+ <email>litora(a)eu.ca</email>
+ </person>
+ <person>
+ <name>Christine</name>
+ <surname>Brennan</surname>
+ <email>ac(a)lectusasollicitudin.com</email>
+ </person>
+ <person>
+ <name>Clark</name>
+ <surname>Contreras</surname>
+ <email>natoque.penatibus.et(a)orciUtsagittis.org</email>
+ </person>
+ <person>
+ <name>Bo</name>
+ <surname>Becker</surname>
+ <email>est.vitae.sodales(a)Fusce.edu</email>
+ </person>
+ <person>
+ <name>Lacey</name>
+ <surname>Guerrero</surname>
+ <email>Fusce.dolor.quam(a)Aliquamvulputateullamcorper.com</email>
+ </person>
+ <person>
+ <name>Cullen</name>
+ <surname>Mason</surname>
+ <email>bibendum(a)purusin.com</email>
+ </person>
+ <person>
+ <name>Jenette</name>
+ <surname>Stuart</surname>
+ <email>sociis.natoque.penatibus(a)penatibus.com</email>
+ </person>
+ <person>
+ <name>Selma</name>
+ <surname>Zamora</surname>
+ <email>pede.Suspendisse.dui(a)fermentum.com</email>
+ </person>
+ <person>
+ <name>Clinton</name>
+ <surname>Peterson</surname>
+ <email>odio.Etiam(a)ornare.ca</email>
+ </person>
+ <person>
+ <name>Axel</name>
+ <surname>Henderson</surname>
+ <email>a(a)pedeCumsociis.org</email>
+ </person>
+ <person>
+ <name>Margaret</name>
+ <surname>Roy</surname>
+ <email>Sed(a)vehicularisusNulla.ca</email>
+ </person>
+ <person>
+ <name>Price</name>
+ <surname>Lyons</surname>
+ <email>magna(a)habitantmorbi.org</email>
+ </person>
+ <person>
+ <name>Logan</name>
+ <surname>Sharp</surname>
+ <email>In.at.pede(a)auctorodio.org</email>
+ </person>
+ <person>
+ <name>Marvin</name>
+ <surname>Ramirez</surname>
+ <email>Donec.tincidunt(a)et.edu</email>
+ </person>
+ <person>
+ <name>Briar</name>
+ <surname>Short</surname>
+ <email>nunc.interdum.feugiat(a)sedhendrerit.ca</email>
+ </person>
+ <person>
+ <name>Flynn</name>
+ <surname>York</surname>
+ <email>non.nisi(a)purusmauris.org</email>
+ </person>
+ <person>
+ <name>Benjamin</name>
+ <surname>Stevenson</surname>
+ <email>consectetuer(a)Aeneaneuismodmauris.org</email>
+ </person>
+ <person>
+ <name>Dieter</name>
+ <surname>Nicholson</surname>
+ <email>risus(a)enimgravida.org</email>
+ </person>
+ <person>
+ <name>Lacy</name>
+ <surname>Baker</surname>
+ <email>eu.neque.pellentesque(a)duiFuscealiquam.com</email>
+ </person>
+ <person>
+ <name>Kaseem</name>
+ <surname>Holder</surname>
+ <email>non.quam(a)Loremipsum.ca</email>
+ </person>
+ <person>
+ <name>Yeo</name>
+ <surname>Sanchez</surname>
+ <email>nisi.a(a)Namnullamagna.ca</email>
+ </person>
+ <person>
+ <name>Heidi</name>
+ <surname>Black</surname>
+ <email>tempus(a)faucibuslectusa.org</email>
+ </person>
+ <person>
+ <name>Cameron</name>
+ <surname>Vang</surname>
+ <email>turpis(a)tinciduntnuncac.com</email>
+ </person>
+ <person>
+ <name>Ryan</name>
+ <surname>Harris</surname>
+ <email>nec.ligula.consectetuer(a)risusInmi.edu</email>
+ </person>
+ <person>
+ <name>Debra</name>
+ <surname>Cortez</surname>
+ <email>luctus(a)pede.com</email>
+ </person>
+ <person>
+ <name>Neville</name>
+ <surname>Mcintyre</surname>
+ <email>egestas(a)placeratvelitQuisque.ca</email>
+ </person>
+ <person>
+ <name>Hope</name>
+ <surname>Romero</surname>
+ <email>dignissim.tempor(a)nonmagnaNam.com</email>
+ </person>
+ <person>
+ <name>Mechelle</name>
+ <surname>Kidd</surname>
+ <email>orci.Ut.sagittis(a)nonenimcommodo.ca</email>
+ </person>
+ <person>
+ <name>Nora</name>
+ <surname>Rivera</surname>
+ <email>gravida(a)consequatdolorvitae.edu</email>
+ </person>
+ <person>
+ <name>Zeph</name>
+ <surname>Snyder</surname>
+ <email>Donec.est(a)enimEtiam.ca</email>
+ </person>
+ <person>
+ <name>Britanni</name>
+ <surname>Williamson</surname>
+ <email>nulla.ante(a)sempereratin.edu</email>
+ </person>
+ <person>
+ <name>Jermaine</name>
+ <surname>Jones</surname>
+ <email>sapien.Aenean(a)Quisquenonummyipsum.org</email>
+ </person>
+ <person>
+ <name>Steel</name>
+ <surname>Newton</surname>
+ <email>cursus.et(a)Curabiturut.org</email>
+ </person>
+ <person>
+ <name>Hyatt</name>
+ <surname>Manning</surname>
+ <email>eget.massa.Suspendisse(a)aptenttaciti.edu</email>
+ </person>
+ <person>
+ <name>Stone</name>
+ <surname>Sloan</surname>
+ <email>adipiscing.elit.Curabitur(a)estvitaesodales.org</email>
+ </person>
+ <person>
+ <name>Lewis</name>
+ <surname>Guthrie</surname>
+ <email>neque.Nullam(a)Nuncpulvinararcu.edu</email>
+ </person>
+ <person>
+ <name>Sandra</name>
+ <surname>Cannon</surname>
+ <email>lobortis.nisi.nibh(a)luctuslobortisClass.com</email>
+ </person>
+ <person>
+ <name>Daria</name>
+ <surname>Page</surname>
+ <email>Aenean.sed.pede(a)facilisis.edu</email>
+ </person>
+ <person>
+ <name>Mohammad</name>
+ <surname>Soto</surname>
+ <email>blandit(a)aliquamarcuAliquam.org</email>
+ </person>
+ <person>
+ <name>Kerry</name>
+ <surname>Lowery</surname>
+ <email>vitae(a)mauriserateget.edu</email>
+ </person>
+ <person>
+ <name>Quinlan</name>
+ <surname>Roy</surname>
+ <email>est.ac(a)mollisvitaeposuere.com</email>
+ </person>
+ <person>
+ <name>Patricia</name>
+ <surname>Kirkland</surname>
+ <email>ipsum.dolor(a)orci.org</email>
+ </person>
+ <person>
+ <name>Janna</name>
+ <surname>Banks</surname>
+ <email>id.mollis.nec(a)eteuismodet.org</email>
+ </person>
+ <person>
+ <name>Lucius</name>
+ <surname>William</surname>
+ <email>sem(a)Nullamlobortis.com</email>
+ </person>
+ <person>
+ <name>Ira</name>
+ <surname>Buck</surname>
+ <email>pede.nonummy(a)dapibusgravidaAliquam.ca</email>
+ </person>
+ <person>
+ <name>Shellie</name>
+ <surname>Charles</surname>
+ <email>est(a)lobortisultricesVivamus.org</email>
+ </person>
+ <person>
+ <name>Stewart</name>
+ <surname>Cabrera</surname>
+ <email>libero(a)feugiat.com</email>
+ </person>
+ <person>
+ <name>April</name>
+ <surname>Sheppard</surname>
+ <email>sit(a)seddictumeleifend.ca</email>
+ </person>
+ <person>
+ <name>Gail</name>
+ <surname>Rollins</surname>
+ <email>odio(a)Proinnonmassa.ca</email>
+ </person>
+ <person>
+ <name>Ross</name>
+ <surname>Levy</surname>
+ <email>sit.amet.ultricies(a)Quisqueliberolacus.com</email>
+ </person>
+ <person>
+ <name>Hadley</name>
+ <surname>Mccormick</surname>
+ <email>vitae.posuere.at(a)enimnonnisi.org</email>
+ </person>
+ <person>
+ <name>Susan</name>
+ <surname>Banks</surname>
+ <email>interdum(a)nislsemconsequat.org</email>
+ </person>
+ <person>
+ <name>Nash</name>
+ <surname>Nolan</surname>
+ <email>convallis.dolor(a)enimSed.ca</email>
+ </person>
+ <person>
+ <name>Gretchen</name>
+ <surname>Carson</surname>
+ <email>elit.dictum.eu(a)temporarcuVestibulum.ca</email>
+ </person>
+ <person>
+ <name>Harper</name>
+ <surname>Hull</surname>
+ <email>eget(a)imperdiet.edu</email>
+ </person>
+ <person>
+ <name>Porter</name>
+ <surname>Benson</surname>
+ <email>tempus.non(a)Aenean.org</email>
+ </person>
+ <person>
+ <name>Xenos</name>
+ <surname>Tate</surname>
+ <email>blandit(a)antebibendum.org</email>
+ </person>
+ <person>
+ <name>Ali</name>
+ <surname>Carver</surname>
+ <email>Nulla.aliquet(a)ornare.org</email>
+ </person>
+ <person>
+ <name>Zachery</name>
+ <surname>Shepherd</surname>
+ <email>vitae.erat(a)sed.edu</email>
+ </person>
+ <person>
+ <name>Garrett</name>
+ <surname>Leach</surname>
+ <email>risus(a)quisurna.org</email>
+ </person>
+ <person>
+ <name>Mufutau</name>
+ <surname>Greer</surname>
+ <email>bibendum(a)luctus.com</email>
+ </person>
+ <person>
+ <name>Ryan</name>
+ <surname>Bryant</surname>
+ <email>turpis(a)purus.edu</email>
+ </person>
+ <person>
+ <name>Lacey</name>
+ <surname>Riley</surname>
+ <email>sed.turpis.nec(a)molestieSed.ca</email>
+ </person>
+ <person>
+ <name>Tiger</name>
+ <surname>Ryan</surname>
+ <email>lorem(a)vel.com</email>
+ </person>
+ <person>
+ <name>Upton</name>
+ <surname>Sullivan</surname>
+ <email>amet(a)Proin.com</email>
+ </person>
+ <person>
+ <name>Juliet</name>
+ <surname>Tate</surname>
+ <email>pede.Cum(a)eu.edu</email>
+ </person>
+ <person>
+ <name>Dieter</name>
+ <surname>Bowman</surname>
+ <email>lorem.eu(a)pellentesqueegetdictum.com</email>
+ </person>
+ <person>
+ <name>Jelani</name>
+ <surname>Knapp</surname>
+ <email>Nulla(a)Morbi.org</email>
+ </person>
+ <person>
+ <name>Martena</name>
+ <surname>Leblanc</surname>
+ <email>arcu.Vestibulum.ut(a)quamquis.edu</email>
+ </person>
+ <person>
+ <name>Megan</name>
+ <surname>Hull</surname>
+ <email>eu.nulla(a)amalesuada.com</email>
+ </person>
+ <person>
+ <name>Ginger</name>
+ <surname>Mcpherson</surname>
+ <email>dui.augue(a)Innecorci.com</email>
+ </person>
+ <person>
+ <name>Kylan</name>
+ <surname>Gilmore</surname>
+ <email>urna.Ut.tincidunt(a)aliquetsemut.com</email>
+ </person>
+ <person>
+ <name>Carlos</name>
+ <surname>King</surname>
+ <email>fermentum(a)lacus.com</email>
+ </person>
+ <person>
+ <name>Irma</name>
+ <surname>Blake</surname>
+ <email>Aliquam.nec(a)adipiscingelit.com</email>
+ </person>
+ <person>
+ <name>Tad</name>
+ <surname>Allen</surname>
+ <email>rhoncus.Proin.nisl(a)vehiculaaliquet.ca</email>
+ </person>
+ <person>
+ <name>Fiona</name>
+ <surname>Kline</surname>
+ <email>risus(a)gravidasagittisDuis.ca</email>
+ </person>
+ <person>
+ <name>Nell</name>
+ <surname>Franco</surname>
+ <email>blandit(a)viverraMaecenasiaculis.org</email>
+ </person>
+ <person>
+ <name>Scarlet</name>
+ <surname>Hall</surname>
+ <email>tincidunt(a)Nullamsuscipit.com</email>
+ </person>
+ <person>
+ <name>Zane</name>
+ <surname>Mccray</surname>
+ <email>volutpat.Nulla(a)malesuadafringilla.edu</email>
+ </person>
+ <person>
+ <name>Connor</name>
+ <surname>Salas</surname>
+ <email>Sed.nulla.ante(a)eu.com</email>
+ </person>
+ <person>
+ <name>Carlos</name>
+ <surname>Hunt</surname>
+ <email>Nam(a)nequevenenatislacus.org</email>
+ </person>
+ <person>
+ <name>Lane</name>
+ <surname>Andrews</surname>
+ <email>a.sollicitudin(a)inconsequat.org</email>
+ </person>
+ <person>
+ <name>Shana</name>
+ <surname>Ballard</surname>
+ <email>elementum(a)nibhlacinia.org</email>
+ </person>
+ <person>
+ <name>Conan</name>
+ <surname>Bradshaw</surname>
+ <email>vel.arcu.Curabitur(a)eratnonummyultricies.ca</email>
+ </person>
+ <person>
+ <name>Colleen</name>
+ <surname>Brooks</surname>
+ <email>erat.volutpat(a)cubiliaCurae;.edu</email>
+ </person>
+ <person>
+ <name>Francis</name>
+ <surname>Hardy</surname>
+ <email>sit.amet.luctus(a)dignissimlacus.com</email>
+ </person>
+ <person>
+ <name>Reuben</name>
+ <surname>Rodriguez</surname>
+ <email>natoque.penatibus.et(a)euaccumsansed.com</email>
+ </person>
+ <person>
+ <name>Iris</name>
+ <surname>Reid</surname>
+ <email>sed(a)Quisquepurussapien.edu</email>
+ </person>
+ <person>
+ <name>Phillip</name>
+ <surname>Schmidt</surname>
+ <email>ut(a)tortornibhsit.com</email>
+ </person>
+ <person>
+ <name>Jonas</name>
+ <surname>Crane</surname>
+ <email>ac.mi(a)luctusCurabitur.org</email>
+ </person>
+ <person>
+ <name>Abbot</name>
+ <surname>Terry</surname>
+ <email>fringilla(a)Crasconvallisconvallis.com</email>
+ </person>
+</persons>
+
\ No newline at end of file
Modified: trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-04-13 09:48:09 UTC (rev 22418)
+++ trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml 2011-04-14 11:53:42 UTC (rev 22419)
@@ -10,4 +10,8 @@
<converter-id>org.richfaces.demo.PackageKeyConverter</converter-id>
<converter-class>org.richfaces.demo.model.tree.adaptors.PackageKeyConverter</converter-class>
</converter>
+
+ <factory>
+ <lifecycle-factory>org.richfaces.demo.PersistenceLifecycleFactory</lifecycle-factory>
+ </factory>
</faces-config>
Added: trunk/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml (rev 0)
+++ trunk/examples/iteration-demo/src/main/webapp/jpaColumn.xhtml 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<ui:composition>
+ <it:column sortBy="#{property}"
+ sortOrder="#{bean.sortOrders[property]}"
+ filterValue="#{bean.filterValues[property]}"
+ filterExpression="#{property}">
+ <f:facet name="header">
+ <h:commandLink style="color: white;"
+ action="#{bean.switchSortOrder(property)}">
+ #{bean.getSortOrder(property)}
+ <a4j:ajax render="richTable" />
+ </h:commandLink>
+ <br />
+ <h:inputText value="#{bean.filterValues[property]}">
+ <a4j:ajax render="richTable@body scroller" event="keyup" />
+ </h:inputText>
+ </f:facet>
+
+ <h:outputText value="#{record[property]}" />
+ </it:column>
+</ui:composition>
+</html>
Added: trunk/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml (rev 0)
+++ trunk/examples/iteration-demo/src/main/webapp/jpaDataTable.xhtml 2011-04-14 11:53:42 UTC (rev 22419)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:misc="http://richfaces.org/misc"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html"/>
+
+<h:head>
+ <title>Richfaces JPA Demo</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <it:dataTable keepSaved="true" id="richTable" var="record" value="#{personBean.dataModel}" rows="20">
+ <ui:include src="jpaColumn.xhtml">
+ <ui:param name="bean" value="#{personBean}" />
+ <ui:param name="property" value="name" />
+ </ui:include>
+ <ui:include src="jpaColumn.xhtml">
+ <ui:param name="bean" value="#{personBean}" />
+ <ui:param name="property" value="surname" />
+ </ui:include>
+ <ui:include src="jpaColumn.xhtml">
+ <ui:param name="bean" value="#{personBean}" />
+ <ui:param name="property" value="email" />
+ </ui:include>
+
+ <f:facet name="footer">
+ <it:dataScroller id="scroller" />
+ </f:facet>
+ </it:dataTable>
+ </h:form>
+</h:body>
+</html>
13 years, 8 months
JBoss Rich Faces SVN: r22418 - trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-04-13 05:48:09 -0400 (Wed, 13 Apr 2011)
New Revision: 22418
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
Log:
https://issues.jboss.org/browse/RF-10847
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2011-04-12 16:26:12 UTC (rev 22417)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2011-04-13 09:48:09 UTC (rev 22418)
@@ -94,6 +94,18 @@
}
@Override
+ protected boolean isSubmitted(FacesContext context, AbstractTogglePanel panel) {
+ UIComponent item = (UIComponent) panel.getItem(panel.getSubmittedActiveItem());
+
+ if (item == null) {
+ return false;
+ }
+
+ Map<String, String> parameterMap = context.getExternalContext().getRequestParameterMap();
+ return parameterMap.get(item.getClientId(context)) != null;
+ }
+
+ @Override
protected void doEncodeBegin(ResponseWriter w, FacesContext context, UIComponent component) throws IOException {
super.doEncodeBegin(w, context, component);
@@ -151,17 +163,17 @@
private void writeTopTabHeader(FacesContext context, ResponseWriter writer, AbstractTab tab) throws IOException {
boolean isActive = tab.isActive();
boolean isDisabled = tab.isDisabled();
-
+
encodeTabHeader(context, tab, writer, inactive, !isActive && !isDisabled);
encodeTabHeader(context, tab, writer, active, isActive && !isDisabled);
encodeTabHeader(context, tab, writer, disabled, isDisabled);
-
+
}
private void encodeTabHeader(FacesContext context, AbstractTab tab, ResponseWriter writer,
- AbstractTogglePanelTitledItem.HeaderStates state, Boolean isDisplay) throws IOException {
+ AbstractTogglePanelTitledItem.HeaderStates state, Boolean isDisplay) throws IOException {
-
+
writer.startElement(TD_ELEM, tab);
writer.writeAttribute(ID_ATTRIBUTE, tab.getClientId(context) + ":header:" + state.toString(), null);
renderPassThroughAttributes(context, tab, HEADER_ATTRIBUTES);
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2011-04-12 16:26:12 UTC (rev 22417)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2011-04-13 09:48:09 UTC (rev 22418)
@@ -73,23 +73,30 @@
protected void doDecode(FacesContext context, UIComponent component) {
AbstractTogglePanel panel = (AbstractTogglePanel) component;
- Map<String, String> requestMap =
+ Map<String, String> requestParameterMap =
context.getExternalContext().getRequestParameterMap();
// Get the new panel value to show
- String newValue = requestMap.get(getValueRequestParamName(context, component));
+ String newValue = requestParameterMap.get(getValueRequestParamName(context, component));
if (newValue != null) {
panel.setSubmittedActiveItem(newValue);
- }
-
- if (requestMap.get("javax.faces.partial.ajax") != null) {
- PartialViewContext pvc = context.getPartialViewContext();
- pvc.getRenderIds().add(
- component.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR
+
+ if (isSubmitted(context, panel)) {
+ PartialViewContext pvc = context.getPartialViewContext();
+
+ pvc.getRenderIds().add(
+ component.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR
+ AbstractTogglePanel.ACTIVE_ITEM_META_COMPONENT);
+ }
+
}
}
+ protected boolean isSubmitted(FacesContext context, AbstractTogglePanel panel) {
+ Map<String, String> parameterMap = context.getExternalContext().getRequestParameterMap();
+ return parameterMap.get(panel.getClientId(context)) != null;
+ }
+
protected static void addOnCompleteParam(FacesContext context, String newValue, String panelId) {
StringBuilder onComplete = new StringBuilder();
onComplete.append("RichFaces.$('").append(panelId)
13 years, 8 months