JBoss Rich Faces SVN: r11493 - trunk/ui/editor/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-02 11:29:39 -0500 (Tue, 02 Dec 2008)
New Revision: 11493
Modified:
trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5195
Modified: trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-02 16:20:19 UTC (rev 11492)
+++ trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-02 16:29:39 UTC (rev 11493)
@@ -326,22 +326,25 @@
+ ";\n", null);
}
if (component.getOninit() != null && component.getOninit().length() > 0) {
- writer.writeText("tinyMceParams.oninit = " + component.getOninit()
- + ";\n", null);
+ writer.writeText("tinyMceParams.oninit = function () {\n"
+ + component.getOninit() + "\n" + "};\n", null);
}
if (component.getOnsave() != null && component.getOnsave().length() > 0) {
- writer.writeText("tinyMceParams.save_callback = "
- + component.getOnsave() + ";\n", null);
+ writer.writeText(
+ "tinyMceParams.save_callback = function (element_id, html, body) {\n"
+ + component.getOnsave() + "\n" + "};\n", null);
}
if (component.getOnchange() != null
&& component.getOnchange().length() > 0) {
- writer.writeText("tinyMceParams.onchange_callback = "
- + component.getOnchange() + ";\n", null);
+ writer.writeText(
+ "tinyMceParams.onchange_callback = function (inst) {\n"
+ + component.getOnchange() + "\n" + "};\n", null);
}
if (component.getOnsetup() != null
&& component.getOnsetup().length() > 0) {
- writer.writeText("tinyMceParams.setup = " + component.getOnsetup()
- + ";\n", null);
+ writer.writeText("tinyMceParams.setup = function (ed) {\n"
+ + component.getOnsetup() + "\n" + "};\n", null);
+
}
if (component.getDialogType() != null
&& component.getDialogType().length() > 0) {
16 years
JBoss Rich Faces SVN: r11492 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/editor and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-02 11:20:19 -0500 (Tue, 02 Dec 2008)
New Revision: 11492
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties
Modified:
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java 2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1,61 @@
+package org.richfaces.demo.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class EditorBean {
+
+ private String currentConfiguration = CONFIGS_PACKAGE + "simple";
+ private String viewMode = "visual";
+ private String value;
+ private boolean liveUpdatesEnabled=false;
+
+ private static final String CONFIGS_PACKAGE = "/org/richfaces/demo/editor/";
+ List<SelectItem> configurations = new ArrayList<SelectItem>();
+
+ public EditorBean() {
+ configurations.add(new SelectItem(CONFIGS_PACKAGE + "simple", "Simple"));
+ configurations.add(new SelectItem(CONFIGS_PACKAGE + "advanced", "Advanced"));
+ }
+
+ public String getCurrentConfiguration() {
+ return currentConfiguration;
+ }
+
+ public void setCurrentConfiguration(String currentConfiguration) {
+ this.currentConfiguration = currentConfiguration;
+ }
+
+ public List<SelectItem> getConfigurations() {
+ return configurations;
+ }
+
+ public String getViewMode() {
+ return viewMode;
+ }
+
+ public void setViewMode(String viewMode) {
+ this.viewMode = viewMode;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public boolean isLiveUpdatesEnabled() {
+ return liveUpdatesEnabled;
+ }
+
+ public void setLiveUpdatesEnabled(boolean liveUpdatesEnabled) {
+ this.liveUpdatesEnabled = liveUpdatesEnabled;
+ }
+
+
+
+}
Added: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties (rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties 2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1,5 @@
+theme="advanced"
+theme_advanced_toolbar_location="top"
+theme_advanced_toolbar_align="center"
+plugins="preview,insertdatetime"
+theme_advanced_buttons3="hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
Added: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties (rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties 2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1 @@
+theme="simple"
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -403,6 +403,16 @@
<managed-bean-class>org.richfaces.demo.extendedDataTable.ExtendedTableBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>queueBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.queue.QueueBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>editorBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.editor.EditorBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -13,10 +13,14 @@
}
</style>
<h:form>
-
+ <script type="text/javascript">
+ function custom(){
+ alert(1);
+ }
+ </script>
<h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2">
<a4j:outputPanel id="calendar" layout="block">
- <rich:calendar value="#{calendarBean.selectedDate}"
+ <rich:calendar value="#{calendarBean.selectedDate}" oncollapse="custom()"
locale="#{calendarBean.locale}"
popup="#{calendarBean.popup}"
datePattern="#{calendarBean.pattern}"
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -4,9 +4,44 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .column{
+ width:50%;
+ vertical-align:top;
+ }
+ </style>
<h:form>
- <rich:editor>
+ <a4j:jsFunction name="submit" reRender="result"/>
+ <h:panelGrid columns="2" width="100%" columnClasses="column,column">
+ <rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}" onchange="submit">
+ </rich:editor>
- </rich:editor>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Editor Settings"/>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Select Editor Theme"/>
+ <h:selectOneRadio value="#{editorBean.currentConfiguration}" layout="pageDirection">
+ <f:selectItems value="#{editorBean.configurations}"/>
+ <a4j:support event="onchange" reRender="editor" />
+ </h:selectOneRadio>
+ <h:outputText value="Toggle Modes"/>
+ <h:selectOneRadio value="#{editorBean.viewMode}" layout="pageDirection">
+ <f:selectItem itemLabel="WYSIWYG mode" itemValue="visual"/>
+ <f:selectItem itemLabel="Simple Text Area" itemValue="source"/>
+ <a4j:support event="onchange" reRender="editor" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ </rich:panel>
+ </h:panelGrid>
+
+ <rich:panel id="result">
+ <f:facet name="header">
+ <h:outputText value="Preview"/>
+ </f:facet>
+ <h:outputText escape="false" value="#{editorBean.value}"/>
+ </rich:panel>
+
</h:form>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -4,7 +4,21 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .link{
+ width:40px;
+ height:40px;
+ }
+ </style>
<h:form>
- QUEUE SAMPLE
+ <rich:dataGrid value="#{queueBean.buttons}" var="button" columns="4">
+ <rich:paint2D cacheable="false" paint="#{queueBean.paint}" data="#{button.color}">
+ </rich:paint2D>
+ <ui:remove>
+ <h:panelGroup layout="block" style="background-color: #{button.color}" styleClass="link">
+ <h:outputText value="#{button.name}"/>
+ </h:panelGroup>
+ </ui:remove>
+ </rich:dataGrid>
</h:form>
</ui:composition>
16 years
JBoss Rich Faces SVN: r11491 - trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-02 11:07:06 -0500 (Tue, 02 Dec 2008)
New Revision: 11491
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java
Log:
https://jira.jboss.org/jira/browse/RF-4473
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java 2008-12-02 16:03:29 UTC (rev 11490)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java 2008-12-02 16:07:06 UTC (rev 11491)
@@ -22,7 +22,9 @@
package org.ajax4jsf.webapp.taglib;
import javax.faces.component.ActionSource;
+import javax.faces.component.ActionSource2;
import javax.faces.event.ActionEvent;
+import javax.faces.event.MethodExpressionActionListener;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.el.LegacyMethodBinding;
@@ -30,6 +32,7 @@
import com.sun.facelets.tag.Metadata;
import com.sun.facelets.tag.MetadataTarget;
import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.util.FacesAPI;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -56,7 +59,23 @@
AjaxActionsRule.ACTION_SIG)));
}
}
+
+ final static class ActionMapper2 extends Metadata {
+ private final TagAttribute attr;
+
+ public ActionMapper2(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((ActionSource2) instance).setActionExpression(this.attr
+ .getMethodExpression(ctx, String.class,
+ AjaxActionsRule.ACTION_SIG));
+ }
+
+ }
+
public final static class ActionListenerMapper extends Metadata {
private final TagAttribute attr;
@@ -73,7 +92,25 @@
}
}
+
+ final static class ActionListenerMapper2 extends Metadata {
+ private final TagAttribute attr;
+
+ public ActionListenerMapper2(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((ActionSource2) instance)
+ .addActionListener(new MethodExpressionActionListener(
+ this.attr.getMethodExpression(ctx, null,
+ AjaxActionsRule.ACTION_LISTENER_SIG)));
+
+ }
+
+ }
+
public final static AjaxActionsRule instance = new AjaxActionsRule();
public AjaxActionsRule() {
@@ -83,14 +120,23 @@
public Metadata applyRule(String name, TagAttribute attribute,
MetadataTarget meta) {
if (meta.isTargetInstanceOf(ActionSource.class)) {
+ boolean elSupport = FacesAPI.getComponentVersion(meta.getTargetClass()) >= 12;
if ("action".equals(name)) {
- return new ActionMapper(attribute);
+ if (elSupport && meta.isTargetInstanceOf(ActionSource2.class)) {
+ return new ActionMapper2(attribute);
+ } else {
+ return new ActionMapper(attribute);
+ }
}
if ("actionListener".equals(name)) {
- return new ActionListenerMapper(attribute);
+ if (elSupport && meta.isTargetInstanceOf(ActionSource2.class)) {
+ return new ActionListenerMapper2(attribute);
+ } else {
+ return new ActionListenerMapper(attribute);
+ }
}
}
return null;
16 years
JBoss Rich Faces SVN: r11490 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-02 11:03:29 -0500 (Tue, 02 Dec 2008)
New Revision: 11490
Added:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -89,7 +89,6 @@
private String changedName;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
- @org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
private List<Image> images = new ArrayList<Image>();
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -17,10 +17,13 @@
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
@Entity
@Name("message")
@Table(name = "messages")
+(a)Scope(ScopeType.PAGE)
public class Message implements Serializable{
@Id
@@ -31,7 +34,15 @@
@Temporal(TemporalType.TIMESTAMP)
private Date date;
- @ManyToOne(fetch = FetchType.EAGER)
+ private boolean readed;
+
+ @Column(length = 256, nullable = false)
+ @NotNull
+ @NotEmpty
+ @Length(min=3)
+ private String theme;
+
+ @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "AUTHOR_ID", nullable = false, updatable = false)
@org.hibernate.annotations.ForeignKey(name = "FK_FROM_USERS_ID")
private User author;
@@ -83,4 +94,20 @@
this.owner = owner;
}
+ public boolean isReaded() {
+ return readed;
+ }
+
+ public void setReaded(boolean readed) {
+ this.readed = readed;
+ }
+
+ public String getTheme() {
+ return theme;
+ }
+
+ public void setTheme(String theme) {
+ this.theme = theme;
+ }
+
}
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -116,6 +116,10 @@
@org.hibernate.annotations.OrderBy(clause = "NAME asc")
private List<Album> childAlbums = new ArrayList<Album>();
+ @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+ @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
+ @org.hibernate.annotations.OrderBy(clause = "Date desc")
+ private List<Message> messages = new ArrayList<Message>();
//private Address address;
/**
@@ -222,7 +226,33 @@
album.setOwner(null);
childAlbums.remove(album);
}
+
+ public void removeFriend(User friend) {
+ if (friend == null) {
+ throw new IllegalArgumentException("Null friend");
+ }
+ friends.remove(friend);
+ }
+
+ public void addMessage(Message message) {
+ if (message == null) {
+ throw new IllegalArgumentException("Null Message!");
+ }
+ if (message.getOwner() != null && !this.equals(message.getOwner())) {
+ message.getOwner().getMessages().remove(message);
+ }
+ message.setOwner(this);
+ messages.add(message);
+ }
+ public void removeMessage(Message message) {
+ if (message == null) {
+ throw new IllegalArgumentException("Null message");
+ }
+ message.setOwner(null);
+ messages.remove(message);
+ }
+
public String getConfirmPassword() {
return confirmPassword;
}
@@ -246,4 +276,12 @@
public void setSharedAlbums(List<Album> sharedAlbums) {
this.sharedAlbums = sharedAlbums;
}
+
+ public List<Message> getMessages() {
+ return messages;
+ }
+
+ public void setMessages(List<Message> messages) {
+ this.messages = messages;
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -9,11 +9,6 @@
public interface IImageAction {
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
- */
- public abstract void addAlbum(Album album);
-
public abstract void deleteImage(Image image);
public abstract void editImage(Image image, boolean parentChanged);
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -0,0 +1,22 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+
+import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.Message;
+
+public interface IMessageAction {
+
+ public abstract void sendMessage(Message message);
+
+ public abstract void deleteMessage(Message message);
+
+ @Remove
+ public void remove();
+
+ @Destroy
+ public void destroy();
+
+ public void markAsReaded(Message message);
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -1,5 +1,8 @@
package org.richfaces.realworld.service;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Remove;
@@ -21,4 +24,7 @@
public void updateUser(User user);
public void resetUser(User user);
+ public List<User> getUsers(String suggest);
+ public long countNotReadedMessages(User user);
+ public void removeFromFriends(User owner, User removed);
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -20,18 +20,6 @@
public class ImageAction implements IImageAction {
@PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
EntityManager em;
-
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
- */
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IImageAction#addAlbum(org.richfaces.realworld.domain.Album)
- */
- public void addAlbum(Album album) {
- //em.persist(album);
- //user.addAlbum(album);
- //em.flush();
- }
/* (non-Javadoc)
* @see org.richfaces.realworld.service.IImageAction#deleteImage(org.richfaces.realworld.domain.Image)
@@ -64,14 +52,14 @@
}
public void editImage(Image image, boolean parentChanged) {
- em.merge(image);
+ image = em.merge(image);
if(parentChanged){
- String login = image.getAlbum().getOwner().getLogin();
+ Album albumPrevious = image.getAlbum();
+ String login = albumPrevious.getOwner().getLogin();
String albumName = image.getAlbumName();
- image.getAlbum().removeImage(image);
+ albumPrevious.removeImage(image);
Album album = (Album)em.createQuery("from Album a where a.name=:albumName and a.owner.login=:login").setParameter("albumName", albumName).setParameter("login", login).getSingleResult();
album.addImage(image);
- em.merge(album);
}
em.flush();
}
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -0,0 +1,57 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.Message;
+
+@Stateful
+@Name("messageAction")
+public class MessageAction implements IMessageAction {
+ @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ EntityManager em;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IMessageAction#sendMessage(org.richfaces.realworld.domain.Message)
+ */
+ public void sendMessage(Message message){
+ em.persist(message);
+ em.flush();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IMessageAction#deleteMessage(org.richfaces.realworld.domain.Message)
+ */
+ public void deleteMessage(Message message){
+ message = em.merge(message);
+ message.getOwner().removeMessage(message);
+ em.remove(message);
+ em.flush();
+ }
+
+ public void markAsReaded(Message message){
+ message.setReaded(true);
+ em.flush();
+ }
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#remove()
+ */
+ @Remove
+ public void remove(){
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#destroy()
+ */
+ @Destroy
+ public void destroy(){
+
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -1,5 +1,6 @@
package org.richfaces.realworld.service;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -38,6 +39,7 @@
.setParameter("username", username)
.setParameter("password", password)
.getSingleResult();
+ long result = countNotReadedMessages(user);
return user != null;
}
@@ -78,4 +80,19 @@
}
return true;
}
+
+ public List<User> getUsers(String suggest) {
+ List<User> users = em.createQuery("from User u where u.login like :login").setParameter("login", suggest + "%").setMaxResults(10).getResultList();
+ return users;
+ }
+
+ public long countNotReadedMessages(User user){
+ Long result = (Long)em.createQuery("SELECT count(u) FROM User u JOIN u.messages mg WHERE u.login=:login and mg.readed = false").setParameter("login", user.getLogin()).getSingleResult();
+ return result;
+ }
+
+ public void removeFromFriends(User owner, User removed) {
+ owner.removeFriend(removed);
+ em.flush();
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-02 16:03:29 UTC (rev 11490)
@@ -73,7 +73,7 @@
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (21, 'Cool', 20);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (1, '1985-01-08', 'Hello I am user', 1, 2);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (2, '1985-01-08', 'Hello I am user2', 1, 3);
-INSERT INTO messages(message_id, date, message, author_id, owner_id) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1);
+INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1, false, 'Hello, amarkhel');
INSERT INTO shared_albums(album_id, user_id) VALUES(4, 1);
INSERT INTO shared_albums(album_id, user_id) VALUES(7, 1);
INSERT INTO user_friends(user1_id, user2_id) VALUES(1, 2);
\ No newline at end of file
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -1,6 +1,8 @@
package org.richfaces.realworld.tree;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import javax.faces.model.SelectItem;
@@ -12,10 +14,13 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.IAlbumAction;
import org.richfaces.realworld.service.IImageAction;
+import org.richfaces.realworld.service.IMessageAction;
+import org.richfaces.realworld.service.IUserAction;
@Name("treeActionManager")
@Scope(ScopeType.PAGE)
@@ -24,19 +29,27 @@
@In
private User user;
+ private long countUnreadedMessages;
+
@In(create=true, required=true)
private IAlbumAction albumAction;
@In(create=true, required=true)
+ private IMessageAction messageAction;
+
+ @In(create=true, required=true)
private IImageAction imageAction;
+ @In(create=true, required=true)
+ private IUserAction userAction;
+
@In(create=true, required=true) @Out
private Album album;
@In(create=true)
FileManager fileManager;
- @In TreeRootItem treeRoot;
+ @In(create=true) TreeRootItem treeRoot;
@In(create=true, required=true)
TreeSelectionManager treeSelectionManager;
@@ -52,6 +65,11 @@
}
+ public List<User> availableUsers(Object suggest){
+ List<User> suggestions = userAction.getUsers((String)suggest);
+ return suggestions;
+ }
+
public void editAlbum(Album album){
boolean nameChanged = !album.getName().equals(album.getChangedName());
if(nameChanged){
@@ -138,4 +156,16 @@
comment.setMessage("+1");
imageAction.addComment(comment);
}
+
+ public void sendMessage(Message message) {
+ messageAction.sendMessage(message);
+ }
+
+ public long getCountUnreadedMessages() {
+ return userAction.countNotReadedMessages(user);
+ }
+
+ public void removeFromFriends(User owner, User removed){
+ userAction.removeFromFriends(owner, removed);
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -12,6 +12,7 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.tree.TreeActionManager;
@@ -23,6 +24,16 @@
private String actionName;
+ private boolean sendRequired;
+
+ private boolean searchRequired = false;
+
+ @In
+ private User user;
+
+ @Out(required=false)
+ private Message message;
+
@In(create=true, required=true) @Out
private Album album;
@@ -71,6 +82,54 @@
}
}
+ public void initModalPanelData( String actionName, boolean sendRequired, Message message){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setTheme("Re:" + message.getTheme());
+ this.message.setAuthor(user);
+ this.message.setOwner(message.getAuthor());
+ this.message.setReaded(false);
+ this.searchRequired = false;
+ }
+
+ public void initModalPanelData( String actionName, boolean sendRequired, Message message, boolean userSearchRequired){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.searchRequired = userSearchRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setReaded(false);
+ }
+
+ public void initMessage(boolean sendRequired, Message message){
+ this.sendRequired = sendRequired;
+ this.message = message;
+ this.searchRequired = false;
+ }
+
+ public void initModalPanelData( String actionName, boolean sendRequired, User owner){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setOwner(owner);
+ this.message.setReaded(false);
+ this.searchRequired = false;
+ }
+
+ public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setOwner(owner);
+ this.message.setReaded(false);
+ this.message.setTheme(theme);
+ this.message.setMessage(message);
+ this.searchRequired = false;
+ }
+
public void initModalPanelData( String actionName, String caption, Comment comment, User user, Image image){
this.caption = caption;
this.actionName = actionName;
@@ -111,4 +170,25 @@
public void editImage(ActionEvent event){
treeActionManager.editImage(this.image);
}
+
+ public void sendMessage(ActionEvent event){
+ this.message.setDate(new Date());
+ treeActionManager.sendMessage(this.message);
+ }
+
+ public boolean isSendRequired() {
+ return sendRequired;
+ }
+
+ public void setSendRequired(boolean sendRequired) {
+ this.sendRequired = sendRequired;
+ }
+
+ public boolean isSearchRequired() {
+ return searchRequired;
+ }
+
+ public void setSearchRequired(boolean searchRequired) {
+ this.searchRequired = searchRequired;
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-02 16:03:29 UTC (rev 11490)
@@ -20,4 +20,8 @@
<tag-name>comment</tag-name>
<source>templates/addComment.xhtml</source>
</tag>
+ <tag>
+ <tag-name>message</tag-name>
+ <source>templates/message.xhtml</source>
+ </tag>
</facelet-taglib>
\ No newline at end of file
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
===================================================================
(Binary files differ)
16 years
JBoss Rich Faces SVN: r11489 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-02 10:41:49 -0500 (Tue, 02 Dec 2008)
New Revision: 11489
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
Log:
RF-5126
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 15:33:41 UTC (rev 11488)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 15:41:49 UTC (rev 11489)
@@ -6,60 +6,18 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
-<ui:composition template="#{templateBean.template}">
- <ui:define name="style">
-
+<ui:composition template="messageBase.xhtml">
+ <ui:define name="message">
+ <rich:message id="message" for="inputText"
+ ajaxRendered="#{messageBean.ajaxRendered}"
+ showSummary="#{messageBean.showSummary}"
+ showDetail="#{messageBean.showDetail}"
+ rendered="#{messageBean.rendered}"
+ styleClass="noname"
+ style="color: blue; text-decoration: underline;"
+ >
+ <ui:insert name="facets" />
+ </rich:message>
</ui:define>
- <ui:define name="component">
- <h:form id="attrForm">
- <h:outputText value="rendered" />
- <h:selectBooleanCheckbox id="rendered" value="#{messageBean.rendered}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- <h:outputText value="showSummary" />
- <h:selectBooleanCheckbox id="showSummary" value="#{messageBean.showSummary}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- <h:outputText value="showDetail" />
- <h:selectBooleanCheckbox id="showDetail" value="#{messageBean.showDetail}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- <h:outputText value="ajaxRendered" />
- <h:selectBooleanCheckbox id="ajaxRendered" value="#{messageBean.ajaxRendered}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- </h:form>
- <h:form id="mainForm">
- <h:panelGroup id="panel">
- <h:inputText id="inputText" value="#{messageBean.string}" validator="#{messageBean.validate}"></h:inputText>
- <rich:message id="message" for="inputText"
- ajaxRendered="false"
- showSummary="#{messageBean.showSummary}"
- showDetail="#{messageBean.showDetail}"
- rendered="#{messageBean.rendered}"
- styleClass="noname"
- style="color: blue; text-decoration: underline;"
- >
- <f:facet name="fatalMarker">
- <h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
- </f:facet>
- <f:facet name="errorMarker">
- <h:outputText id="errorMarker" value="errorMarker"></h:outputText>
- </f:facet>
- <f:facet name="warnMarker">
- <h:outputText id="warnMarker" value="warnMarker"></h:outputText>
- </f:facet>
- <f:facet name="infoMarker">
- <h:outputText id="infoMarker" value="infoMarker"></h:outputText>
- </f:facet>
- <f:facet name="passedMarker">
- <h:outputText id="passedMarker" value="passedMarker"></h:outputText>
- </f:facet>
- </rich:message>
- </h:panelGroup>
- <a4j:commandButton id="submit" value="Submit" reRender="panel"></a4j:commandButton>
- <a4j:commandButton id="submitWithoutReRender" value="submitWithoutReRender"></a4j:commandButton>
- </h:form>
- </ui:define>
</ui:composition>
</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <h:form id="attrForm">
+ <h:outputText value="rendered" />
+ <h:selectBooleanCheckbox id="rendered" value="#{messageBean.rendered}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="showSummary" />
+ <h:selectBooleanCheckbox id="showSummary" value="#{messageBean.showSummary}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="showDetail" />
+ <h:selectBooleanCheckbox id="showDetail" value="#{messageBean.showDetail}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="ajaxRendered" />
+ <h:selectBooleanCheckbox id="ajaxRendered" value="#{messageBean.ajaxRendered}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ </h:form>
+ <h:form id="mainForm">
+ <h:panelGroup id="panel">
+ <h:inputText id="inputText" value="#{messageBean.string}" validator="#{messageBean.validate}"></h:inputText>
+ <ui:insert name="message" />
+ </h:panelGroup>
+ <a4j:commandButton id="submit" value="Submit" reRender="panel"></a4j:commandButton>
+ <a4j:commandButton id="submitWithoutReRender" value="submitWithoutReRender"></a4j:commandButton>
+ </h:form>
+ </ui:define>
+ <ui:define name="facets">
+ <f:facet name="fatalMarker">
+ <h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="errorMarker">
+ <h:outputText id="errorMarker" value="errorMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="warnMarker">
+ <h:outputText id="warnMarker" value="warnMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="infoMarker">
+ <h:outputText id="infoMarker" value="infoMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="passedMarker">
+ <h:outputText id="passedMarker" value="passedMarker"></h:outputText>
+ </f:facet>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,23 @@
+<!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="messageBase.xhtml">
+ <ui:define name="message">
+ <rich:messages id="message"
+ ajaxRendered="#{messageBean.ajaxRendered}"
+ showSummary="#{messageBean.showSummary}"
+ showDetail="#{messageBean.showDetail}"
+ rendered="#{messageBean.rendered}"
+ styleClass="noname"
+ style="color: blue; text-decoration: underline;"
+ >
+ <ui:insert name="facets" />
+ </rich:messages>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,124 @@
+package org.richfaces.testng;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public abstract class AbstractMessageTest extends SeleniumTestBase {
+
+ protected String mainForm;
+
+ protected String inputText;
+
+ protected String message;
+
+ private String submit;
+
+ private String rendered;
+
+ private String showDetail;
+
+ private String showSummary;
+
+ protected String ajaxRendered;
+
+ protected String label;
+
+ protected void init(Template template) {
+ renderPage(template, "#{messageBean.init}");
+ mainForm = getParentId() + "mainForm";
+ inputText = mainForm + ":inputText";
+ message = mainForm + ":message";
+ submit = mainForm + ":submit";
+ String attrForm = getParentId() + "attrForm";
+ rendered = attrForm + ":rendered";
+ showDetail = attrForm + ":showDetail";
+ showSummary = attrForm + ":showSummary";
+ ajaxRendered = attrForm + ":ajaxRendered";
+ }
+
+ /**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testHTMLAttributes(Template template) {
+ init(template);
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("color", "blue");
+ styleAttributes.put("text-decoration", "underline");
+ assertClassNames(message,new String [] {"noname"}, "Component's rendering invalid", true);
+ assertStyleAttributes(message, styleAttributes);
+ }
+
+ /**
+ * showDetail and showSummary attributes work
+ */
+ @Test
+ public void testShowDetailAndShowSummary(Template template) {
+ init(template);
+ Assert.assertTrue(selenium.getText(label).length() == 0);
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue("messageDetail".equals(selenium.getText(label)));
+ clickAjaxCommandAndWait(showSummary);
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue("messageSummarymessageDetail".equals(selenium.getText(label)));
+ clickAjaxCommandAndWait(showDetail);
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue("messageSummary".equals(selenium.getText(label)));
+
+ }
+
+ /**
+ * level selects message of respective level
+ */
+ @Test
+ public void testLevel(Template template) {
+ //TODO
+ Assert.fail("This test should be completed after resolving bug RF-5107.");
+ }
+
+ /**
+ * check markers rendering
+ */
+ @Test
+ public void testMarkers(Template template) {
+ init(template);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":passedMarker"));
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
+ selenium.type(inputText, "error");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":errorMarker"));
+ selenium.type(inputText, "warn");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":warnMarker"));
+ selenium.type(inputText, "info");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":infoMarker"));
+ }
+
+ /**
+ * component with rendered = false is not present on the page
+ */
+ @Test
+ public void testRendered(Template template) {
+ init(template);
+ init(template);
+ Assert.assertTrue(selenium.isElementPresent(message), "ListShuttle must be rendered.");
+
+ selenium.click(rendered);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submit);
+
+ Assert.assertFalse(selenium.isElementPresent(message), "ListShuttle mustn't be rendered.");
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 15:33:41 UTC (rev 11488)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 15:41:49 UTC (rev 11489)
@@ -1,89 +1,19 @@
package org.richfaces.testng;
-import java.util.HashMap;
-import java.util.Map;
-
import org.ajax4jsf.template.Template;
-import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
-public class MessageTest extends SeleniumTestBase {
-
- private String mainForm;
- private String inputText;
-
- private String message;
-
- private String submit;
-
- private String rendered;
-
- private String showDetail;
+public class MessageTest extends AbstractMessageTest {
- private String showSummary;
-
- private String ajaxRendered;
-
- private void init(Template template) {
- renderPage(template, "#{messageBean.init}");
- mainForm = getParentId() + "mainForm";
- inputText = mainForm + ":inputText";
- message = mainForm + ":message";
- submit = mainForm + ":submit";
- String attrForm = getParentId() + "attrForm";
- rendered = attrForm + ":rendered";
- showDetail = attrForm + ":showDetail";
- showSummary = attrForm + ":showSummary";
- ajaxRendered = attrForm + ":ajaxRendered";
- }
-
- /**
- * style and classes, standard HTML attributes are output to client
- */
- @Test
- public void testHTMLAttributes(Template template) {
- init(template);
- Map<String, String> styleAttributes = new HashMap<String, String>();
- styleAttributes.put("color", "blue");
- styleAttributes.put("text-decoration", "underline");
- assertClassNames(message,new String [] {"noname"}, "Component's rendering invalid", true);
- assertStyleAttributes(message, styleAttributes);
+ @Override
+ protected void init(Template template) {
+ super.init(template);
+ label = "xpath=id('" + message + "')/span[2]";
}
-
- /**
- * showDetail and showSummary attributes work
- */
- @Test
- public void testShowDetailAndShowSummary(Template template) {
- init(template);
- String locator = "xpath=id('" + message + "')/span[2]";
- Assert.assertTrue(selenium.getText(locator).length() == 0);
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue("messageDetail".equals(selenium.getText(locator)));
- clickAjaxCommandAndWait(showSummary);
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue("messageSummarymessageDetail".equals(selenium.getText(locator)));
- clickAjaxCommandAndWait(showDetail);
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue("messageSummary".equals(selenium.getText(locator)));
-
- }
-
+
/**
- * level selects message of respective level
- */
- @Test
- public void testLevel(Template template) {
- //TODO
- Assert.fail("This test should be completed after resolving bug RF-5107.");
- }
-
- /**
* ajaxRendered message output first message for attached component by ajax request
*/
@Test
@@ -98,44 +28,7 @@
Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
}
- /**
- * check markers rendering
- */
- @Test
- public void testMarkers(Template template) {
- init(template);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":passedMarker"));
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
- selenium.type(inputText, "error");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":errorMarker"));
- selenium.type(inputText, "warn");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":warnMarker"));
- selenium.type(inputText, "info");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":infoMarker"));
- }
-
- /**
- * component with rendered = false is not present on the page
- */
- @Test
- public void testRendered(Template template) {
- init(template);
- init(template);
- Assert.assertTrue(selenium.isElementPresent(message), "ListShuttle must be rendered.");
-
- selenium.click(rendered);
- waitForAjaxCompletion();
- clickAjaxCommandAndWait(submit);
-
- Assert.assertFalse(selenium.isElementPresent(message), "ListShuttle mustn't be rendered.");
- }
-
- @Override
+ @Override
public String getTestUrl() {
return "pages/message/message.xhtml";
}
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,17 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+
+public class MessagesTest extends AbstractMessageTest {
+
+ @Override
+ protected void init(Template template) {
+ super.init(template);
+ label = "xpath=id('" + message + "')/dt[1]/span[2]";
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/message/messages.xhtml";
+ }
+}
16 years
JBoss Rich Faces SVN: r11488 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-12-02 10:33:41 -0500 (Tue, 02 Dec 2008)
New Revision: 11488
Added:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA1.xls
Modified:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA1.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA1.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
===================================================================
(Binary files differ)
16 years
JBoss Rich Faces SVN: r11487 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-02 10:07:57 -0500 (Tue, 02 Dec 2008)
New Revision: 11487
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4836
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-12-02 14:26:19 UTC (rev 11486)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-12-02 15:07:57 UTC (rev 11487)
@@ -27,10 +27,15 @@
private final static String INIT_DRAG_AND_DROP_TEST = "#{treeBean.initDragAndDropTest}";
private final static String DRAG_AND_DROP_TEST_URL = "pages/tree/dragAndDropTest.xhtml";
+ static final Map<String, String> styles = new HashMap<String, String>();
+
static {
params.put("parameter1", "value1");
params.put("parameter2", "value2");
params.put("parameter3", "value3");
+
+ styles.put("font-size", "13px");
+ styles.put("font-weight", "bold");
}
@Test
@@ -503,6 +508,22 @@
assertChildNodesCount(--aguileraSongs, "//*[@id='"+ compId + ":childs']/div[2]/div", "Song is not dropped back");
}
+ @Test
+ public void testStyleAndClassesAreOutputToClient(Template template) {
+ renderPage(template, TEAR_DOWN_METHOD);
+
+ writeStatus("Check style and classes are output to client");
+ String compId = getParentId() + "_form:tree";
+
+ assertClassNames(compId, new String[] { "noclass" }, "Class attribute was not output to client", true);
+ assertStyleAttributes(compId, styles);
+
+ writeStatus("Check css class of highlighted tree node");
+ String aNodeXpath = "//*[@id='"+ compId + ":childs']/table[1]/tbody/tr/td[3]";
+ selenium.mouseOver(aNodeXpath);
+ assertClassAttributeContains(aNodeXpath, "highlighted-class", "highlightedClass attribute was not output to client");
+ }
+
@Override
public void sendAjax() {
AutoTester tester = getAutoTester(this);
16 years
JBoss Rich Faces SVN: r11486 - in trunk/ui/editor/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-02 09:26:19 -0500 (Tue, 02 Dec 2008)
New Revision: 11486
Modified:
trunk/ui/editor/src/main/config/component/editor.xml
trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
Log:
Bug fixing(RF-5055)
Modified: trunk/ui/editor/src/main/config/component/editor.xml
===================================================================
--- trunk/ui/editor/src/main/config/component/editor.xml 2008-12-02 13:26:14 UTC (rev 11485)
+++ trunk/ui/editor/src/main/config/component/editor.xml 2008-12-02 14:26:19 UTC (rev 11486)
@@ -149,7 +149,7 @@
</description>
</property>
<property>
- <name>customplugins</name>
+ <name>customPlugins</name>
<classname>java.lang.String</classname>
<description>
Attribute defines property file name witch contains descriptors of custom plugins
Modified: trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-12-02 13:26:14 UTC (rev 11485)
+++ trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-12-02 14:26:19 UTC (rev 11486)
@@ -112,7 +112,7 @@
public abstract String getCustomPlugins();
- public abstract void setCustomPlugins(String customplugins);
+ public abstract void setCustomPlugins(String customPlugins);
public abstract void setSkin(String skin);
16 years
JBoss Rich Faces SVN: r11485 - trunk/ui/suggestionbox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-02 08:26:14 -0500 (Tue, 02 Dec 2008)
New Revision: 11485
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
Log:
https://jira.jboss.org/jira/browse/RF-4594
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-02 12:05:48 UTC (rev 11484)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-02 13:26:14 UTC (rev 11485)
@@ -117,7 +117,7 @@
Name of the CSS class for a suggestion entry element.
(table row)
</description>
- <defaultvalue>"richfaces_suggestionEntry"</defaultvalue>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>rowClasses</name>
@@ -171,7 +171,7 @@
Name of the CSS class for a selected suggestion entry
element (table cell)
</description>
- <defaultvalue>"richfaces_suggestionSelectValue"</defaultvalue>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>param</name>
16 years
JBoss Rich Faces SVN: r11484 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-02 07:05:48 -0500 (Tue, 02 Dec 2008)
New Revision: 11484
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
Log:
RF-5125
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 11:18:44 UTC (rev 11483)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 12:05:48 UTC (rev 11484)
@@ -37,6 +37,8 @@
showSummary="#{messageBean.showSummary}"
showDetail="#{messageBean.showDetail}"
rendered="#{messageBean.rendered}"
+ styleClass="noname"
+ style="color: blue; text-decoration: underline;"
>
<f:facet name="fatalMarker">
<h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 11:18:44 UTC (rev 11483)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 12:05:48 UTC (rev 11484)
@@ -1,5 +1,8 @@
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -37,6 +40,19 @@
}
/**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testHTMLAttributes(Template template) {
+ init(template);
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("color", "blue");
+ styleAttributes.put("text-decoration", "underline");
+ assertClassNames(message,new String [] {"noname"}, "Component's rendering invalid", true);
+ assertStyleAttributes(message, styleAttributes);
+ }
+
+ /**
* showDetail and showSummary attributes work
*/
@Test
16 years