JBoss Rich Faces SVN: r12763 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-02-26 18:55:44 -0500 (Thu, 26 Feb 2009)
New Revision: 12763
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
https://jira.jboss.org/jira/browse/RF-4429
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-26 16:04:24 UTC (rev 12762)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-26 23:55:44 UTC (rev 12763)
@@ -377,7 +377,7 @@
}
var anchor = oldnode.parentNode;
- if(!window.opera && oldnode.outerHTML && !oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ){
+ if(!window.opera && !A4J.AJAX.isWebkitBreakingAmps() && oldnode.outerHTML && !oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ){
LOG.debug("Replace content of node by outerHTML()");
try {
oldnode.innerHTML = "";
@@ -1617,6 +1617,23 @@
return s;
}
+A4J.AJAX.isWebkitBreakingAmps = function() {
+ //RF-4429
+ if (!this._webkitBreakingAmps) {
+ var elt = document.createElement("div");
+ elt.innerHTML = "<a href='#a=a&b=b'>link</a>";
+
+ var link = elt.firstChild;
+ if (link && link.getAttribute && /&b=b$/.test(link.getAttribute('href'))) {
+ this._webkitBreakingAmps = 2;
+ } else {
+ this._webkitBreakingAmps = 1;
+ }
+ }
+
+ return this._webkitBreakingAmps > 1;
+};
+
A4J.AJAX.isXhtmlScriptMode = function() {
if (!this._xhtmlScriptMode) {
var elt = document.createElement("div");
15 years, 10 months
JBoss Rich Faces SVN: r12762 - in trunk/ui/tree/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-02-26 11:04:24 -0500 (Thu, 26 Feb 2009)
New Revision: 12762
Modified:
trunk/ui/tree/src/main/config/component/tree.xml
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
https://jira.jboss.org/jira/browse/RF-5746
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2009-02-26 15:43:16 UTC (rev 12761)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2009-02-26 16:04:24 UTC (rev 12762)
@@ -172,6 +172,11 @@
<description>JavaScript handler to be called on right click.
Returning false prevents default browser context menu from being displayed</description>
</property>
+ <property>
+ <name>rightClickSelection</name>
+ <classname>boolean</classname>
+ <description>Allow to select tree item using mouse right click</description>
+ </property>
<property hidden="true">
<name>varState</name>
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2009-02-26 15:43:16 UTC (rev 12761)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2009-02-26 16:04:24 UTC (rev 12762)
@@ -680,7 +680,7 @@
}
private static final String[] OPTIONS_ATTRIBUTES_LIST = { "showConnectingLines", "toggleOnClick",
- "disableKeyboardNavigation"};
+ "disableKeyboardNavigation", "rightClickSelection"};
public String getOptions(FacesContext context, UITree tree) {
Map<String, Object> attributes = tree.getAttributes();
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2009-02-26 15:43:16 UTC (rev 12761)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2009-02-26 16:04:24 UTC (rev 12762)
@@ -422,7 +422,7 @@
toggleSelection: function(e) {
if (e && !e[Richfaces.TreeSelectEvent] && !Richfaces.eventIsSynthetic(e)) {
if (e && e.type == "mousedown" /* can be keydown */) {
- if(Event.isLeftClick(e)) {
+ if((this.tree.rightClickSelection && Event.isRightClick(e)) || Event.isLeftClick(e)) {
var src = Event.element(e);
if(src.tagName &&
/^(input|select|option|button|textarea)$/i.test(src.tagName))
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2009-02-26 15:43:16 UTC (rev 12761)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2009-02-26 16:04:24 UTC (rev 12762)
@@ -84,6 +84,7 @@
this.toggleOnClick = options.toggleOnClick;
this.showConnectingLines = options.showConnectingLines;
this.disableKeyboardNavigation = options.disableKeyboardNavigation;
+ this.rightClickSelection = options.rightClickSelection;
var options = Object.extend({
columnCount: 0
15 years, 10 months
JBoss Rich Faces SVN: r12761 - trunk/test-applications/realworld2/web/src/main/webapp/layout.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-02-26 10:43:16 -0500 (Thu, 26 Feb 2009)
New Revision: 12761
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
Log:
Remove nested form
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12760 - in trunk/test-applications/realworld2/ejb/src/main: resources and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-02-26 10:40:10 -0500 (Thu, 26 Feb 2009)
New Revision: 12760
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
Log:
Userprefs
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-02-26 15:40:02 UTC (rev 12759)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-02-26 15:40:10 UTC (rev 12760)
@@ -130,10 +130,13 @@
@Temporal(TemporalType.TIMESTAMP)
private Date birthDate;
- @NotEmpty
@NotNull
private Sex sex;
+ private Boolean doNotShowMail;
+
+ private Boolean informAboutNews;
+
@OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL}, fetch = FetchType.LAZY)
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
@org.hibernate.annotations.OrderBy(clause = "NAME asc")
@@ -298,6 +301,23 @@
public void setSex(Sex sex) {
this.sex = sex;
}
+
+ public Boolean getDoNotShowMail() {
+ return doNotShowMail;
+ }
+
+ public void setDoNotShowMail(Boolean doNotShowMail) {
+ this.doNotShowMail = doNotShowMail;
+ }
+
+ public Boolean getInformAboutNews() {
+ return informAboutNews;
+ }
+
+ public void setInformAboutNews(Boolean informAboutNews) {
+ this.informAboutNews = informAboutNews;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-02-26 15:40:02 UTC (rev 12759)
+++ trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-02-26 15:40:10 UTC (rev 12760)
@@ -1,6 +1,6 @@
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex) VALUES (1, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'amarkhel', '8cb2237d0679ca88db6464eac60da96345513964', '1985-01-08', 1);
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex) VALUES (2, 'Nick', 'Curtis', 'nkurtis(a)iba.com', 'Viking', '8cb2237d0679ca88db6464eac60da96345513964', '1978-01-08', 1);
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex) VALUES (3, 'John', 'Smith', 'jsmith(a)jboss.com', 'Noname', '8cb2237d0679ca88db6464eac60da96345513964', '1970-01-08', 1);
+INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, doNotShowMail, informAboutNews) VALUES (1, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'amarkhel', '8cb2237d0679ca88db6464eac60da96345513964', '1985-01-08', 1, 1, 1);
+INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, doNotShowMail, informAboutNews) VALUES (2, 'Nick', 'Curtis', 'nkurtis(a)iba.com', 'Viking', '8cb2237d0679ca88db6464eac60da96345513964', '1978-01-08', 1, 1, 1);
+INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, doNotShowMail, informAboutNews) VALUES (3, 'John', 'Smith', 'jsmith(a)jboss.com', 'Noname', '8cb2237d0679ca88db6464eac60da96345513964', '1970-01-08', 1, 1, 1);
INSERT INTO shelfs(shelf_id, name, description, shelf_user_id) VALUES (1, 'Nature', 'Nature pictures', 1);
INSERT INTO shelfs(shelf_id, name, description, shelf_user_id) VALUES (2, 'Sport', 'Nature pictures', 1);
15 years, 10 months
JBoss Rich Faces SVN: r12759 - in trunk/test-applications/realworld2/web/src/main: webapp/includes and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-02-26 10:40:02 -0500 (Thu, 26 Feb 2009)
New Revision: 12759
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/userPrefs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
Log:
Userprefs
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java 2009-02-26 15:40:02 UTC (rev 12759)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.richfaces.realworld.user;
+
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Sex;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.util.ConversationState;
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+@Name("userPrefsBean")
+(a)Scope(ScopeType.CONVERSATION)
+public class UserPrefsBean {
+
+ @In(value="conversationState")
+ ConversationState conversationState;
+
+ static final SelectItem [] sexs = new SelectItem []
+ {
+ new SelectItem(Sex.MALE, "Male"),
+ new SelectItem(Sex.FEMALE, "Female")
+ };
+
+
+ public void clickUserListener(ActionEvent event) {
+ conversationState.setMainArea(NavigationEnum.USER_PREFS);
+ conversationState.setSelectedUser(conversationState.getUser());
+ }
+
+ public SelectItem [] getSexs () {
+ return sexs;
+ }
+}
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/userPrefs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12758 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-02-26 08:40:51 -0500 (Thu, 26 Feb 2009)
New Revision: 12758
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
Log:
https://jira.jboss.org/jira/browse/RF-5940
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2009-02-26 13:40:12 UTC (rev 12757)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2009-02-26 13:40:51 UTC (rev 12758)
@@ -231,7 +231,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:dropDownMenu value="File" direction="bottom-right" jointPoint="tr">
+<rich:dropDownMenu value="File" direction="bottom-right" jointPoint="bl">
<rich:menuItem submitMode="ajax" value="New" action="#{ddmenu.doNew}"/>
<rich:menuItem submitMode="ajax" value="Open" action="#{ddmenu.doOpen}"/>
<rich:menuGroup value="Save As...">
15 years, 10 months
JBoss Rich Faces SVN: r12757 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/separator and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-02-26 08:40:12 -0500 (Thu, 26 Feb 2009)
New Revision: 12757
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java
Log:
RF-6187
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml 2009-02-26 13:40:12 UTC (rev 12757)
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <rich:separator id="componentId" rendered="#{autoTestBean.rendered}"
+ onclick="EventQueue.fire('onclick')"
+ onmousedown="EventQueue.fire('onmousedown')"
+ onmousemove="EventQueue.fire('onmousemove')"
+ onmouseup="EventQueue.fire('onmouseup')"
+ onmouseout="EventQueue.fire('onmouseout')"
+ onmouseover="EventQueue.fire('onmouseover')"
+ onkeydown="EventQueue.fire('onkeydown')"
+ onkeypress="EventQueue.fire('onkeypress')"
+ onkeyup="EventQueue.fire('onkeyup')"
+ style="width: 100%; color: yellow;" styleClass="noname" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java 2009-02-26 13:40:12 UTC (rev 12757)
@@ -0,0 +1,44 @@
+package org.richfaces.testng;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class SeparatorTest extends SeleniumTestBase {
+
+ /**
+ * component with rendered = false is not present on the page,
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testStandardAttributes(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ autoTester.testRendered();
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("width", "100%");
+ styleAttributes.put("color", "yellow");
+ autoTester.testHTMLEvents();
+ Assert.assertTrue(selenium.getAttribute("xpath=id('"
+ + autoTester.getClientId(AutoTester.COMPONENT_ID) + "')/div@class")
+ .indexOf("noname") != -1);
+ Assert.assertTrue(selenium.getAttribute("xpath=id('"
+ + autoTester.getClientId(AutoTester.COMPONENT_ID) + "')/div@style").toLowerCase()
+ .indexOf("color: yellow") != -1);
+ }
+
+ @Override
+ public String getTestUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/separator/separatorAutoTest.xhtml";
+ }
+}
15 years, 10 months
JBoss Rich Faces SVN: r12756 - in trunk/test-applications/realworld2: ear and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-26 08:24:40 -0500 (Thu, 26 Feb 2009)
New Revision: 12756
Added:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
Modified:
trunk/test-applications/realworld2/
trunk/test-applications/realworld2/ear/
trunk/test-applications/realworld2/ejb/
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld2/web/
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/album.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/panelBar/tree.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/main.xhtml
Log:
Property changes on: trunk/test-applications/realworld2
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: trunk/test-applications/realworld2/ear
___________________________________________________________________
Name: svn:ignore
+ *.project
.settings
target
Property changes on: trunk/test-applications/realworld2/ejb
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -41,4 +41,6 @@
public List<Album> getRootAlbums(User user);
public void addFavoriteImage(Image image);
public void removeFromFavoriteImages(User user, Image image);
+ public Long countAlbums(User user);
+ public Long countImages(User user);
}
\ No newline at end of file
Added: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java (rev 0)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -0,0 +1,41 @@
+package org.richfaces.realworld.service;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+
+@Name("searchAction")
+@Stateless
+public class SearchAction {
+
+ @In(value="entityManager")
+ EntityManager em;
+
+ @In @Out
+ private User user;
+
+ public List<Image> searchByImage(Map<String, String> params){
+ return null;
+ }
+
+ public List<Image> searchByTags(Map<String, String> params){
+ return null;
+ }
+
+ public List<Album> searchByAlbum(Map<String, String> params){
+ return null;
+ }
+
+ public List<Image> searchByUsers(Map<String, String> params){
+ return null;
+ }
+}
Property changes on: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -107,4 +107,12 @@
user.removeFromFavoriteImages(image);
em.flush();
}
+
+ public Long countAlbums(User user){
+ return (Long)em.createQuery("select count(a) from Album a where a.owner=:user").setParameter("user", user).getSingleResult();
+ }
+
+ public Long countImages(User user){
+ return (Long)em.createQuery("select count(i) from Image i where i.album.owner=:user").setParameter("user", user).getSingleResult();
+ }
}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld2/web
___________________________________________________________________
Name: svn:ignore
+ *.classpath
*.project
.settings
target
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -86,6 +86,7 @@
//Update conversation state
conversationState.setSelectedImage(null);
conversationState.setSelectedAlbum(album);
+ Events.instance().raiseEvent("albumAdded");
setOncomplete();
}
@@ -105,6 +106,7 @@
public void editAlbum(Album album){
albumAction.editAlbum(album);
conversationState.setSelectedAlbum(album);
+ Events.instance().raiseEvent("albumEdited");
}
public void deleteAlbum(Album album){
@@ -115,9 +117,9 @@
deleteDirectory(string);
conversationState.setSelectedImage(null);
conversationState.setSelectedAlbum(null);
+ Events.instance().raiseEvent("albumDeleted");
}
-
private void removeFromTree(Album album2) {
if(album.getParent() != null){
TreeNode shelf = treeRoot.findShelf(album.getParent());
@@ -135,7 +137,6 @@
fileManager.addDirectory(user.getLogin(), album.getId().toString());
}
-
public List<Album> getSharedAlbums(){
if(null == sharedAlbums){
sharedAlbums=albumAction.getSharedAlbums();
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -64,11 +64,13 @@
public void deleteImage(Image image){
String imagePath = image.getPath();
imageAction.deleteImage(image);
- fileManager.deleteImage(fileManager.transformToServerPath(imagePath));
+ fileManager.deleteImage(imagePath);
+ Events.instance().raiseEvent("imageDeleted");
}
public void editImage(Image image){
imageAction.editImage(image);
+ Events.instance().raiseEvent("imageEdited");
setOncomplete();
}
@@ -77,6 +79,7 @@
imageAction.addImage(image);
conversationState.setSelectedAlbum(image.getAlbum());
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
+ Events.instance().raiseEvent("imageAdded");
setOncomplete();
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -21,11 +21,14 @@
package org.richfaces.realworld.manager;
import java.io.Serializable;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
@@ -41,6 +44,8 @@
@In
private User user;
+ private Long countImages;
+ private Long countAlbums;
@In(create=true, required=true)
private IUserAction userAction;
@@ -63,4 +68,43 @@
public List<Album> getRootAlbums(User user2) {
return userAction.getRootAlbums(user2);
}
+
+ public Long countImages(User u) {
+ if(null == countImages ){
+ countImages = userAction.countImages(u);
+ }
+ return countImages;
+ }
+
+ public Long countAlbums(User u) {
+ if(null == countAlbums ){
+ countAlbums = userAction.countAlbums(user);
+ }
+ return countAlbums;
+ }
+
+ @Observer(value = "imageAdded", create = false)
+ public void onImageAdded() {
+ updateStatistics(countAlbums, countImages + 1);
+ }
+
+ @Observer(value = "imageDeleted", create = false)
+ public void onImageDeleted(){
+ updateStatistics(countAlbums, countImages - 1);
+ }
+
+ @Observer(value = "albumDeleted", create = false)
+ public void onAlbumDeleted(){
+ updateStatistics(countAlbums-1, countImages - 1);
+ }
+
+ @Observer(value = "albumAdded", create = false)
+ public void onAlbumAdded(){
+ updateStatistics(countAlbums+1, countImages - 1);
+ }
+
+ private void updateStatistics(Long i, Long j) {
+ countAlbums = i;
+ countImages = j;
+ }
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -33,8 +33,10 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.MetaTag;
+import org.richfaces.realworld.domain.Shelf;
import org.richfaces.realworld.manager.AlbumManager;
import org.richfaces.realworld.manager.ImageManager;
+import org.richfaces.realworld.manager.ShelfManager;
@Name("confirmationPopupHelper")
@Scope(ScopeType.CONVERSATION)
@@ -50,39 +52,46 @@
private Image image;
@In(create=true, required=true) @Out(required=false)
+ private Shelf shelf;
+
+ @In(create=true, required=true) @Out(required=false)
private Album album;
- @In(create=true, required=true)
+ @In(create=true)
private AlbumManager albumManager;
- @In(create=true, required=true)
+ @In(create=true)
+ private ShelfManager shelfManager;
+
+ @In(create=true)
private ImageManager imageManager;
public void initImagePopup( String actionName, String caption, Image image){
this.caption = caption;
this.actionName = actionName;
- if(null != image){
- this.image = image;
- //image.setMeta(new ArrayList<MetaTag>(image.getTags()));
- }else{
- this.image = new Image();
- }
+ this.image = image;
}
public void initAlbumData( String actionName, String caption, Album album){
this.caption = caption;
this.actionName = actionName;
- if(null != album){
- this.album = album;
- }else{
- this.album = new Album();
- }
+ this.album = album;
}
- public void deleteAlbum(ActionEvent event){
+ public void initShelfData( String actionName, String caption, Shelf shelf){
+ this.caption = caption;
+ this.actionName = actionName;
+ this.shelf = shelf;
+ }
+
+ public void deleteAlbum(){
albumManager.deleteAlbum(this.album);
}
+ public void deleteShelf(){
+ shelfManager.deleteShelf(this.shelf);
+ }
+
public String getCaption() {
return caption;
}
@@ -99,7 +108,7 @@
this.actionName = actionName;
}
- public void deleteImage(ActionEvent event){
+ public void deleteImage(){
imageManager.deleteImage(this.image);
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -21,7 +21,23 @@
package org.richfaces.realworld.navigation;
public enum NavigationEnum {
- IMAGE_PREVIEW,
- FILE_UPLOAD,
- USER_PREFS, SEARCH, WHAT_NEW, ALBUM_PREVIEW, SHELF_PREVIEW, ALL_SHELFS, TAGS, ALL_ALBUMS, ALL_IMAGES,
+ IMAGE_PREVIEW("includes/imagePreview.xhtml"),
+ FILE_UPLOAD("includes/fileUpload.xhtml"),
+ USER_PREFS("includes/userPrefs.xhtml"),
+ SEARCH("includes/search.xhtml"),
+ WHAT_NEW("includes/recent.xhtml"),
+ ALBUM_PREVIEW("includes/albumPreview.xhtml"),
+ SHELF_PREVIEW("includes/shelfPreview.xhtml"),
+ ALL_SHELFS("includes/shelfs.xhtml"),
+ TAGS("includes/tags.xhtml"),
+ ALL_ALBUMS("includes/albums.xhtml"),
+ ALL_IMAGES("includes/images.xhtml");
+
+ private NavigationEnum(String t){
+ template=t;
+ }
+ private String template;
+ public String getTemplate() {
+ return template;
+ }
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-26 13:24:40 UTC (rev 12756)
@@ -56,8 +56,6 @@
private static final long serialVersionUID = 5656562187249324512L;
- @In Conversation conversation;
-
@In("#{messages['acess_not_granted']}")
private String HAVENT_ACCESS;
@@ -86,6 +84,30 @@
return mainArea;
}
+ public void selectShelfs(){
+ setMainArea(NavigationEnum.ALL_SHELFS);
+ setSelectedAlbum(null);
+ setSelectedShelf(null);
+ setSelectedImage(null);
+ setSelectedUser(user);
+ }
+
+ public void selectAlbums(){
+ setMainArea(NavigationEnum.ALL_ALBUMS);
+ setSelectedAlbum(null);
+ setSelectedShelf(null);
+ setSelectedImage(null);
+ setSelectedUser(user);
+ }
+
+ public void selectImages(){
+ setMainArea(NavigationEnum.ALL_IMAGES);
+ setSelectedAlbum(null);
+ setSelectedShelf(null);
+ setSelectedImage(null);
+ setSelectedUser(user);
+ }
+
@Observer(Constants.UPDATE_MAIN_AREA_EVENT)
public void setMainArea(NavigationEnum mainArea) {
this.mainArea = mainArea;
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-02-26 13:23:04 UTC (rev 12755)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-02-26 13:24:40 UTC (rev 12756)
@@ -13,6 +13,10 @@
<source>templates/shelf.xhtml</source>
</tag>
<tag>
+ <tag-name>confirm</tag-name>
+ <source>templates/confirmation.xhtml</source>
+ </tag>
+ <tag>
<tag-name>image</tag-name>
<source>templates/image.xhtml</source>
</tag>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/album.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/panelBar/tree.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12755 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/inputNumberSlider and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-26 08:23:04 -0500 (Thu, 26 Feb 2009)
New Revision: 12755
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSliderBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSlider/inputNumberSliderAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
Log:
RF-5862, RF-5863
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSliderBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSliderBean.java 2009-02-26 13:14:14 UTC (rev 12754)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InputNumberSliderBean.java 2009-02-26 13:23:04 UTC (rev 12755)
@@ -29,6 +29,8 @@
private Integer value = 40;
+ private boolean enabledManualInput = true;
+
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
if (((Integer) value).intValue() > 90) {
throw new ValidatorException(new FacesMessage("Fake validation. Value is more than 90."));
@@ -60,4 +62,25 @@
this.value = 40;
}
+ public void initEnableManualInputAttributeTest() {
+ reset();
+ this.enabledManualInput = false;
+ }
+
+ /**
+ * Gets value of enabledManualInput field.
+ * @return value of enabledManualInput field
+ */
+ public boolean isEnabledManualInput() {
+ return enabledManualInput;
+ }
+
+ /**
+ * Set a new value for enabledManualInput field.
+ * @param enabledManualInput a new value for enabledManualInput field
+ */
+ public void setEnabledManualInput(boolean enabledManualInput) {
+ this.enabledManualInput = enabledManualInput;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inputNumberSlider/inputNumberSliderAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2009-02-26 13:14:14 UTC (rev 12754)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2009-02-26 13:23:04 UTC (rev 12755)
@@ -36,6 +36,8 @@
private final static String RESET_METHOD = "#{sliderBean.reset}";
+ private final static String ENABLE_MANUAL_INPUT_TEST = "#{sliderBean.initEnableManualInputAttributeTest}";
+
private final static String LOOK_AND_FEEL_TEST_URL = "pages/inputNumberSlider/styleAndClasseStandardHTMLAttributesTest.xhtml";
@Test
@@ -94,32 +96,6 @@
AssertTextEquals(output, "40");
}
- private void checkSliderVisualState(int value) {
- String id = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
- writeStatus("Checking value in input field");
- AssertValueEquals(id + "Input", Integer.toString(value));
- AssertTextEquals(id + "Tip", Integer.toString(value));
-
- writeStatus("Checking tip and tracker position");
- String actualHandle = runScript("document.getElementById('" + id + "Handle').style.left");
- String actualTip = runScript("document.getElementById('" + id + "Tip').style.left");
-
- Assert.assertEquals(actualHandle, actualTip);
- Assert.assertTrue(actualTip.endsWith("px"));
-
- int actual = new Integer(actualTip.replace("px", "")).intValue();
- int expected = BAR_SCALE * value;
- Assert.assertTrue(Math.abs(actual - expected) < BAR_SCALE,
- "Handle position is not syncronized with slider value!");
- }
-
- private void clickSlider(int position) {
- String track = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID) + "Track";
- String coords = "" + BAR_SCALE * position + ",1";
- selenium.mouseDownAt(track, coords);
- selenium.mouseUpAt(track, coords);
- }
-
@Test
public void testValueChangeEventFiredAndModelUpdatedOnSubmit(Template template) {
AutoTester tester = getAutoTester(this);
@@ -254,6 +230,74 @@
assertClassAttributeContains(tipId, "tip-class", "tipClass attribute was not output to client");
}
+ @Test
+ public void testClickingEdgesInputBoundaryValues(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Check clicking edges input boundary values");
+
+ clickSlider(0);
+ Assert.assertEquals(getSliderValue(), "0");
+
+ clickSlider(100);
+ Assert.assertEquals(getSliderValue(), "100");
+ }
+
+ @Test
+ public void testEnableManualInputAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, ENABLE_MANUAL_INPUT_TEST);
+ writeStatus("Check setting enableManualInput to false makes input read-only");
+
+ String inputId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID) + "Input";
+ Assert.assertFalse(selenium.isEditable(inputId), "Slider's input has to be read only");
+ }
+
+ @Test
+ public void testAdditionalIncreasingDecreasingControls(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Check clicking an arrow changes the driven value on the amount defined with 'step' attribute");
+
+ String slider = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ String arrowDec = slider + "ArrowDec";
+ String arrowInc = slider + "ArrowInc";
+
+ selenium.mouseDownAt(arrowDec, "1,1");
+ selenium.mouseUpAt(arrowDec, "1,1");
+ Assert.assertEquals(getSliderValue(), "39", "Value would have decreased by one");
+
+ selenium.mouseDownAt(arrowInc, "1,1");
+ selenium.mouseUpAt(arrowInc, "1,1");
+ Assert.assertEquals(getSliderValue(), "40", "Value would have increased by one");
+ }
+
+ private void checkSliderVisualState(int value) {
+ String id = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ writeStatus("Checking value in input field");
+ AssertValueEquals(id + "Input", Integer.toString(value));
+ AssertTextEquals(id + "Tip", Integer.toString(value));
+
+ writeStatus("Checking tip and tracker position");
+ String actualHandle = runScript("document.getElementById('" + id + "Handle').style.left");
+ String actualTip = runScript("document.getElementById('" + id + "Tip').style.left");
+
+ Assert.assertEquals(actualHandle, actualTip);
+ Assert.assertTrue(actualTip.endsWith("px"));
+
+ int actual = new Integer(actualTip.replace("px", "")).intValue();
+ int expected = BAR_SCALE * value;
+ Assert.assertTrue(Math.abs(actual - expected) < BAR_SCALE,
+ "Handle position is not syncronized with slider value!");
+ }
+
+ private void clickSlider(int position) {
+ String track = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID) + "Track";
+ String coords = "" + BAR_SCALE * position + ",1";
+ selenium.mouseDownAt(track, coords);
+ selenium.mouseUpAt(track, coords);
+ }
+
private String getSliderValue() {
return selenium.getValue("name=" + getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
}
15 years, 10 months
JBoss Rich Faces SVN: r12754 - Plan and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-02-26 08:14:14 -0500 (Thu, 26 Feb 2009)
New Revision: 12754
Modified:
trunk/test-applications/qa/Test Plan/TestPlan-RF.doc
Log:
Modified: trunk/test-applications/qa/Test Plan/TestPlan-RF.doc
===================================================================
(Binary files differ)
15 years, 10 months