JBoss Rich Faces SVN: r11803 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-16 07:30:50 -0500 (Tue, 16 Dec 2008)
New Revision: 11803
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileLoader.java
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/User.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.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/ImageAction.java
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/UserAction.java
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
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/components.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
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/readMessages.xhtml
trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
Log:
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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -48,7 +48,7 @@
private String theme;
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "AUTHOR_ID", nullable = false, updatable = false)
+ @JoinColumn(name = "AUTHOR_ID", updatable = false)
@org.hibernate.annotations.ForeignKey(name = "FK_FROM_USERS_ID")
private User author;
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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -93,9 +93,6 @@
private String password;
@Transient
- @NotNull
- @NotEmpty
- @Length(min=3)
private String confirmPassword;
@ManyToMany(mappedBy = "sharedOwners")
@@ -112,7 +109,7 @@
@Temporal(TemporalType.TIMESTAMP)
private Date birthDate;
- @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+ @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")
private List<Album> childAlbums = new ArrayList<Album>();
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -59,4 +59,9 @@
public void destroy(){
}
+
+ public Album resetAlbum(Album album) {
+ em.refresh(album);
+ return album;
+ }
}
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -19,4 +19,6 @@
@Destroy
public abstract void destroy();
+ public abstract Album resetAlbum(Album album);
+
}
\ 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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -35,4 +35,6 @@
public abstract void vote(Image image, Long value);
+ public abstract Image resetImage(Image image);
+
}
\ 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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -66,6 +66,7 @@
public void addImage(Image image) {
em.persist(image);
+ image.getAlbum().addImage(image);
em.flush();
}
@@ -94,4 +95,9 @@
image.getRank().setTotal(total);
em.flush();
}
+
+ public Image resetImage(Image image) {
+ em.refresh(image);
+ return image;
+ }
}
Modified: 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 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -9,6 +9,8 @@
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.TransactionPropagationType;
+import org.jboss.seam.annotations.Transactional;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
@@ -22,6 +24,7 @@
/* (non-Javadoc)
* @see org.richfaces.realworld.service.IMessageAction#sendMessage(org.richfaces.realworld.domain.Message)
*/
+ @Transactional(TransactionPropagationType.REQUIRED)
public void sendMessage(Message message){
if(message.getOwnerLogin() != null){
User user = (User)em.createQuery("from User u where u.login = :login")
@@ -40,9 +43,10 @@
/* (non-Javadoc)
* @see org.richfaces.realworld.service.IMessageAction#deleteMessage(org.richfaces.realworld.domain.Message)
*/
+ @Transactional(TransactionPropagationType.REQUIRED)
public void deleteMessage(Message message){
- message = em.merge(message);
- em.remove(message);
+ //message = em.merge(message);
+ //em.remove(message);
message.getOwner().removeMessage(message);
em.flush();
}
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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -57,7 +57,7 @@
}
public void updateUser(User user) {
- em.merge(user);
+ //em.merge(user);
em.flush();
this.user = user;
}
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-16 12:30:50 UTC (rev 11803)
@@ -1,7 +1,7 @@
INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (1, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'amarkhel', '12345', '1985-01-08');
INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (2, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'root', '12345', '1985-01-08');
INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (3, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'qqqq', '12345', '1985-01-08');
-INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (1, 0, 'Album 1', 'Simple Album', true, 1);
+INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (1, 0, 'My dog', 'Photo of my dog', true, 1);
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (2, 0, 'Album 2', 'Simple Album 2', false, 1);
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (3, 0, 'Album 3', 'Simple Album 3', false, 1);
INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (4, 0, 'Album 1', 'Simple Album', true, 2);
@@ -29,9 +29,9 @@
INSERT INTO Ranks(rank_id, total, hits) VALUES (19, 110, 13);
INSERT INTO Ranks(rank_id, total, hits) VALUES (20, 160, 21);
INSERT INTO Ranks(rank_id, total, hits) VALUES (21, 100, 21);
-INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (1, 0, 'Picture 1', 'pic1.jpg', 'Just picture', true, '1985-01-08', 1, 1);
-INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (2, 0, 'Picture 2', 'pic2.jpg', 'Just picture', true, '1985-01-08', 1, 2);
-INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (3, 0, 'Picture 33', 'pic3.jpg', 'Just picture', true, '1985-01-08', 1, 3);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (1, 0, 'Funny dog', 'cherri1.jpg', 'Funny dog', true, '1985-01-08', 1, 1);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (2, 0, 'Beauty', 'cherri2.jpg', 'Beauty', true, '1985-01-08', 1, 2);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (3, 0, 'Toy of my dog', 'cherri3.jpg', 'Toy of my dog', true, '1985-01-08', 1, 3);
INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (4, 0, 'Picture 2', 'pic4.jpg', 'Just picture', true, '1985-01-08', 2, 4);
INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (5, 0, 'Picture 3', 'pic5.jpg', 'Just picture', true, '1985-01-08', 2, 5);
INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id, rank_id) VALUES (6, 0, 'Picture 4', 'pic6.jpg', 'Just picture', true, '1985-01-08', 2, 6);
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -20,7 +20,7 @@
import org.richfaces.realworld.domain.User;
@Name("avatarUpload")
-(a)Scope(ScopeType.CONVERSATION)
+(a)Scope(ScopeType.SESSION)
public class AvatarUpload implements Serializable{
@In(create=true)
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileLoader.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileLoader.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -0,0 +1,21 @@
+package org.richfaces.realworld.fileupload;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("fileLoader")
+(a)Scope(ScopeType.SESSION)
+public class FileLoader {
+
+ @In FileUploadBean fileUploadBean;
+ @Begin(join=true)
+ public synchronized void paint(OutputStream stream, Object object) throws IOException {
+ stream.write(fileUploadBean.getFiles().get((Integer)object).getData());
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -26,13 +26,17 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Synchronized;
+import org.jboss.seam.core.Events;
import org.jboss.seam.faces.FacesMessages;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
@@ -41,33 +45,30 @@
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.tree.TreeActionManager;
import org.richfaces.realworld.tree.TreeSelectionManager;
+import org.richfaces.realworld.util.NavigationEnum;
+import org.richfaces.realworld.util.SelectedImageIndex;
/**
* @author $Autor$
*
*/
@Name("fileUploadBean")
-(a)Scope(ScopeType.CONVERSATION)
-@Synchronized(timeout=2000)
+(a)Scope(ScopeType.SESSION)
+@Synchronized(timeout=5000)
public class FileUploadBean implements Serializable{
- @In @Out
+ @In
private User user;
- @In(create=true)
+ @In(required=false)
private Image selectedImage;
- @In(create=true)
+ @In(required=false)
private Album selectedAlbum;
-
- @In(create=true)
- TreeActionManager treeActionManager;
@In(create=true)
private FileManager fileManager;
- @In FacesMessages facesMessages;
-
private ArrayList<FileItem> files = new ArrayList<FileItem>();
private boolean autoUpload = false;
public int getSize() {
@@ -79,10 +80,8 @@
}
}
- public synchronized void paint(OutputStream stream, Object object) throws IOException {
- stream.write(getFiles().get((Integer)object).getData());
- }
+ @Begin(join=true)
public synchronized void listener(UploadEvent event) throws Exception{
UploadItem item = event.getUploadItem();
FileItem file = new FileItem();
@@ -113,6 +112,7 @@
}
public void storeSelectedData() {
+ List<FileItem> temp = new ArrayList<FileItem>();
for(FileItem file:files){
if(file.isSelected()){
//Save file to disk
@@ -123,9 +123,14 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- treeActionManager.addImage(file.getImage());
+ Events.instance().raiseEvent("addImage", file.getImage());
+ //files.remove(file);
+ }else{
+ temp.add(file);
}
}
+ files.clear();
+ files.addAll(temp);
}
public void storeAll() {
@@ -139,8 +144,10 @@
e.printStackTrace();
}
//Update domain model
- treeActionManager.addImage(file.getImage());
+ Events.instance().raiseEvent("addImage", file.getImage());
+ //files.remove(file);
}
+ files.clear();
}
public long getTimeStamp(){
@@ -162,6 +169,7 @@
public void setAutoUpload(boolean autoUpload) {
this.autoUpload = autoUpload;
}
+
}
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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -9,8 +9,10 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
@@ -70,7 +72,7 @@
@In(create=true) TreeSelectionManager treeSelectionManager;
- @In(create=true) TreeRootItem treeRoot;
+ @In(create=true) @Out TreeRootItem treeRoot;
private String selectedAlbumName;
@@ -124,18 +126,23 @@
treeRoot.getAvailableAlbums().remove(item);
treeRoot.removeChild(album.getId());
fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
- selectedImage = null;
- selectedAlbum = null;
+ selectedAlbum = user.getChildAlbums().get(0);
+ selectedImage = selectedAlbum.getImages().get(0);
}
public void deleteImage(Image image){
+ int index = image.getAlbum().getIndex(image);
String albumName = image.getAlbum().getName();
String imagePath = image.getPath();
TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
imageAction.deleteImage(image);
parent.removeChild(image.getId());
fileManager.deleteImage(user.getLogin() + fileManager.getFileSeparator() + albumName + fileManager.getFileSeparator() + imagePath);
- selectedImage = null;
+ if(selectedAlbum.getImages().size() > index){
+ selectedImage = selectedAlbum.getImages().get(index);
+ }else{
+ selectedImage = selectedAlbum.getImages().get(index-1);
+ }
}
public void editImage(Image image){
@@ -158,7 +165,18 @@
imageItem.setImage(image);
}
}
+
+ public void resetImage(Image image){
+ image = imageAction.resetImage(image);
+ selectedImage = image;
+ }
+
+ public void resetAlbum(Album album){
+ album = albumAction.resetAlbum(album);
+ selectedAlbum = album;
+ }
+ @Observer("addImage")
public void addImage(Image image) {
imageAction.addImage(image);
TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
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-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-16 12:30:50 UTC (rev 11803)
@@ -6,6 +6,8 @@
import javax.faces.event.ActionEvent;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
@@ -94,7 +96,7 @@
this.searchRequired = false;
}
- public void initModalPanelData( String actionName, boolean sendRequired, Message message, boolean userSearchRequired){
+ public void initMessage( String actionName, boolean sendRequired, Message message, boolean userSearchRequired){
this.actionName = actionName;
this.sendRequired = sendRequired;
this.searchRequired = userSearchRequired;
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2008-12-16 11:50:16 UTC (rev 11802)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2008-12-16 12:30:50 UTC (rev 11803)
@@ -20,7 +20,7 @@
<core:init debug="true" jndi-pattern="@jndiPattern@"/>
- <core:manager concurrent-request-timeout="500"
+ <core:manager concurrent-request-timeout="2000"
conversation-timeout="120000"
conversation-id-parameter="cid"/>
<persistence:managed-persistence-context name="entityManager"
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
===================================================================
(Binary files differ)
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/readMessages.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r11802 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-16 06:50:16 -0500 (Tue, 16 Dec 2008)
New Revision: 11802
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
https://jira.jboss.org/jira/browse/RF-2835
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-12-16 11:42:39 UTC (rev 11801)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-12-16 11:50:16 UTC (rev 11802)
@@ -2096,6 +2096,7 @@
{
this.selectedDate = date;
this.renderHF();
+ if (!this.params.popup) this.setInputField(this.getSelectedDateString(this.params.datePattern), null);
this.invokeEvent("timeselected",null, null, this.selectedDate);
}
}
17 years, 5 months
JBoss Rich Faces SVN: r11801 - 3 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-16 06:42:39 -0500 (Tue, 16 Dec 2008)
New Revision: 11801
Added:
trunk/test-applications/realworld/Upload/amarkhel/Album 3/aston_martin.jpg
Log:
RF-4494: Tutorial about developing this sample application
Added: trunk/test-applications/realworld/Upload/amarkhel/Album 3/aston_martin.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/Upload/amarkhel/Album 3/aston_martin.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 5 months
JBoss Rich Faces SVN: r11800 - in trunk/docs/cdkguide/en/src/main/docbook: tags and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-12-16 06:09:26 -0500 (Tue, 16 Dec 2008)
New Revision: 11800
Added:
trunk/docs/cdkguide/en/src/main/docbook/tags/jspscriptlettag.xml
Modified:
trunk/docs/cdkguide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-3692 - Template Tags were added
Modified: trunk/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-12-16 11:04:08 UTC (rev 11799)
+++ trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-12-16 11:09:26 UTC (rev 11800)
@@ -44,7 +44,7 @@
<!ENTITY cobject SYSTEM "tags/cobject.xml">
<!ENTITY hscripts SYSTEM "tags/hscripts.xml">
<!ENTITY hstyles SYSTEM "tags/hstyles.xml">
-<!ENTITY jspscriptlet SYSTEM "tags/jspscriptlet.xml">
+<!ENTITY jspscriptlet SYSTEM "tags/jspscriptlettag.xml">
<!ENTITY jspdirectivepage SYSTEM "tags/jspdirectivepage.xml">
<!ENTITY jspdeclaration SYSTEM "tags/jspdeclaration.xml">
]>
Added: trunk/docs/cdkguide/en/src/main/docbook/tags/jspscriptlettag.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/tags/jspscriptlettag.xml (rev 0)
+++ trunk/docs/cdkguide/en/src/main/docbook/tags/jspscriptlettag.xml 2008-12-16 11:09:26 UTC (rev 11800)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="jspscriptlet" xreflabel="jspscriptlet">
+ <?dbhtml filename="jspscriptlet.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>jsp:scriptlet</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><jsp:scriptlet></title>
+ <para>
+ The <emphasis role="bold"><property><jsp:scriptlet></property></emphasis> tag inserts its content into the main rendering method.
+ </para>
+</section>
Property changes on: trunk/docs/cdkguide/en/src/main/docbook/tags/jspscriptlettag.xml
___________________________________________________________________
Name: svn:executable
+ *
17 years, 5 months
JBoss Rich Faces SVN: r11799 - in trunk/docs/cdkguide/en/src/main/docbook: tags and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-12-16 06:04:08 -0500 (Tue, 16 Dec 2008)
New Revision: 11799
Added:
trunk/docs/cdkguide/en/src/main/docbook/tags/hscripts.xml
trunk/docs/cdkguide/en/src/main/docbook/tags/hstyles.xml
trunk/docs/cdkguide/en/src/main/docbook/tags/jspdeclaration.xml
trunk/docs/cdkguide/en/src/main/docbook/tags/jspdirectivepage.xml
Removed:
trunk/docs/cdkguide/en/src/main/docbook/tags/fverbatim.xml
Modified:
trunk/docs/cdkguide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-3692 - Template Tags were added
Modified: trunk/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-12-16 11:00:32 UTC (rev 11798)
+++ trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-12-16 11:04:08 UTC (rev 11799)
@@ -42,6 +42,11 @@
<!ENTITY vcpmock SYSTEM "tags/vcpmock.xml">
<!ENTITY ajaxupdate SYSTEM "tags/ajaxupdate.xml">
<!ENTITY cobject SYSTEM "tags/cobject.xml">
+<!ENTITY hscripts SYSTEM "tags/hscripts.xml">
+<!ENTITY hstyles SYSTEM "tags/hstyles.xml">
+<!ENTITY jspscriptlet SYSTEM "tags/jspscriptlet.xml">
+<!ENTITY jspdirectivepage SYSTEM "tags/jspdirectivepage.xml">
+<!ENTITY jspdeclaration SYSTEM "tags/jspdeclaration.xml">
]>
<book>
@@ -221,5 +226,12 @@
&vcpbody;
&vcpmock;
+&hscripts;
+&hstyles;
+
+&jspdeclaration;
+&jspdirectivepage;
+&jspscriptlet;
+
</chapter>
</book>
Deleted: trunk/docs/cdkguide/en/src/main/docbook/tags/fverbatim.xml
===================================================================
Added: trunk/docs/cdkguide/en/src/main/docbook/tags/hscripts.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/tags/hscripts.xml (rev 0)
+++ trunk/docs/cdkguide/en/src/main/docbook/tags/hscripts.xml 2008-12-16 11:04:08 UTC (rev 11799)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="hscripts" xreflabel="hscripts">
+ <?dbhtml filename="hscripts.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>h:scripts</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><h:scripts></title>
+ <para>
+ The <emphasis role="bold"><property><h:scripts></property></emphasis> tag defines a static resource or class for JavaScript that is added to a page at rendering time.
+ </para>
+</section>
Property changes on: trunk/docs/cdkguide/en/src/main/docbook/tags/hscripts.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/docs/cdkguide/en/src/main/docbook/tags/hstyles.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/tags/hstyles.xml (rev 0)
+++ trunk/docs/cdkguide/en/src/main/docbook/tags/hstyles.xml 2008-12-16 11:04:08 UTC (rev 11799)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="hstyles" xreflabel="hstyles">
+ <?dbhtml filename="hstyles.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>h:styles</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><h:styles></title>
+ <para>
+ The <emphasis role="bold"><property><h:styles></property></emphasis> tag defines a CSS or XCSS resource that is added to a page at rendering time.
+ </para>
+</section>
Property changes on: trunk/docs/cdkguide/en/src/main/docbook/tags/hstyles.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/docs/cdkguide/en/src/main/docbook/tags/jspdeclaration.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/tags/jspdeclaration.xml (rev 0)
+++ trunk/docs/cdkguide/en/src/main/docbook/tags/jspdeclaration.xml 2008-12-16 11:04:08 UTC (rev 11799)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="jspdeclaration" xreflabel="jspdeclaration">
+ <?dbhtml filename="jspdeclaration.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>jsp:declaration</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><jsp:declaration /></title>
+ <para>
+ The <emphasis role="bold"><property><jsp:declaration /></property></emphasis> tag declares a Java code that is inserted in a renderer class.
+ </para>
+</section>
Property changes on: trunk/docs/cdkguide/en/src/main/docbook/tags/jspdeclaration.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/docs/cdkguide/en/src/main/docbook/tags/jspdirectivepage.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/tags/jspdirectivepage.xml (rev 0)
+++ trunk/docs/cdkguide/en/src/main/docbook/tags/jspdirectivepage.xml 2008-12-16 11:04:08 UTC (rev 11799)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="jspdirectivepage" xreflabel="jspdirectivepage">
+ <?dbhtml filename="jspdirectivepage.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>jsp:directive.page</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title><jsp:directive.page /></title>
+ <para>
+ The <emphasis role="bold"><property><jsp:directive.page /></property></emphasis> tag allows you to import classes or packages in a renderer class.
+ </para>
+ <table>
+ <title>The <jsp:directive.page /> attributes</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Attribute Name</entry>
+ <entry>Description</entry>
+ <entry>Required</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>extends</entry>
+ <entry>Defines a base class for the imported classes</entry>
+ <entry>False</entry>
+ </row>
+ <row>
+ <entry>import</entry>
+ <entry>Defines classes or packages that are imported in a renderer class</entry>
+ <entry>True</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+</section>
Property changes on: trunk/docs/cdkguide/en/src/main/docbook/tags/jspdirectivepage.xml
___________________________________________________________________
Name: svn:executable
+ *
17 years, 5 months
JBoss Rich Faces SVN: r11798 - trunk/samples/extendedDataTable-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-12-16 06:00:32 -0500 (Tue, 16 Dec 2008)
New Revision: 11798
Modified:
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
Log:
removed column with select input
Modified: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-12-16 10:58:52 UTC (rev 11797)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-12-16 11:00:32 UTC (rev 11798)
@@ -92,16 +92,6 @@
</f:facet>
<h:outputText value="#{patient.admissionDate}" />
</rich:column>
- <rich:column>
- <f:facet name="header">
- <h:outputText value="#{msg['select']}" />
- </f:facet>
- <h:selectOneMenu onclick="Event.stop(event);">
- <f:selectItem itemValue="1" itemLabel="1" />
- <f:selectItem itemValue="2" itemLabel="2" />
- <f:selectItem itemValue="3" itemLabel="3" />
- </h:selectOneMenu>
- </rich:column>
<f:facet name="footer">
<rich:datascroller
17 years, 5 months
JBoss Rich Faces SVN: r11797 - trunk/ui/dataTable/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-12-16 05:58:52 -0500 (Tue, 16 Dec 2008)
New Revision: 11797
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java
Log:
https://jira.jboss.org/jira/browse/RF-5041
changed methods for "rendered" attribute
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java 2008-12-16 10:57:02 UTC (rev 11796)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java 2008-12-16 10:58:52 UTC (rev 11797)
@@ -66,12 +66,22 @@
//This code block adds support for visible attribute of the column component
@Override
public boolean isRendered() {
- return super.isRendered() && isVisible();
+ return isRendered(true);
}
- @Override
- public void setRendered(boolean rendered) {
- super.setRendered(rendered);
+ /**
+ * Check if component is rendered.
+ * Consider "rendered" attribute and optionally depend on parameter consider "visible" attribute.
+ * @author PGolawski
+ * @param considerVisible consider "visible" attribute
+ * @return attribute "rendered" value
+ */
+ public boolean isRendered(boolean considerVisible) {
+ boolean rendered = super.isRendered();
+ if (considerVisible) {
+ rendered = (rendered && isVisible());
+ }
+ return rendered;
}
//
17 years, 5 months
JBoss Rich Faces SVN: r11796 - in trunk/ui/extendedDataTable/src/main/java/org/richfaces: renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-12-16 05:57:02 -0500 (Tue, 16 Dec 2008)
New Revision: 11796
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-5041
https://jira.jboss.org/jira/browse/RF-5279
https://jira.jboss.org/jira/browse/RF-5171
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java 2008-12-16 10:43:14 UTC (rev 11795)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java 2008-12-16 10:57:02 UTC (rev 11796)
@@ -260,31 +260,25 @@
private static final String DEFAULT_WIDTH = "100";
- private JSONMap value;
+ private JSONObject value;
private ColumnsSizeState() {
super();
}
- static ColumnsSizeState getColumnsSize(UIExtendedDataTable extendedDataTable, JSONMap map){
+ static ColumnsSizeState getColumnsSize(UIExtendedDataTable extendedDataTable, JSONMap state){
ColumnsSizeState columnsSize = new ColumnsSizeState();
- columnsSize.init(extendedDataTable, map);
+ columnsSize.init(extendedDataTable, state);
return columnsSize;
}
/**
* Converts its state from String representation or create default state if it is not set.
*/
- private void init(UIExtendedDataTable extendedDataTable, JSONMap map){
+ private void init(UIExtendedDataTable extendedDataTable, JSONMap state){
value = null;
- if ((map != null) && (map.size()>0)){
-// //try to restore state from string
- value = map;
-// try {
-// value = new JSONMap(val);
-// } catch (JSONException e) {
-// e.printStackTrace();
-// }
+ if ((state != null) && (state.size()>0)){
+ value = new JSONObject(state);
}
if (value == null){
@@ -307,7 +301,7 @@
* @return JSON object contains state
*/
public JSONMap toJSON(){
- return value;
+ return new JSONMap(value);
}
/**
@@ -320,7 +314,7 @@
UIColumn col = iter.next();
writer.key(col.getId()).value(getDefaultColumnSize(col));
}
- value = new JSONMap(writer.endObject().toString());
+ value = new JSONObject(writer.endObject().toString());
} catch (JSONException e) {
e.printStackTrace();
}
@@ -334,7 +328,7 @@
public String getColumnSize(UIComponent column){
if (value == null)
return getDefaultColumnSize(column);
- String res = (String)value.get(column.getId());
+ String res = (String)value.opt(column.getId());
if (res == null){
res = getDefaultColumnSize(column);
}
@@ -348,15 +342,19 @@
public void changeColumnSize(UIExtendedDataTable extendedDataTable, String newValue){
if (value == null)
return;
- String[] newWidths = newValue.split(";");
- int index = 0;
- for (Iterator<UIColumn> iter = extendedDataTable.getSortedColumns(); iter.hasNext();) {
- UIComponent col = (UIComponent) iter.next();
- if (col.isRendered()){
- String colId = col.getId();
- value.put(colId, newWidths[index++]);
- }//if
- }//for
+ try {
+ String[] newWidths = newValue.split(";");
+ int index = 0;
+ for (Iterator<UIColumn> iter = extendedDataTable.getSortedColumns(); iter.hasNext();) {
+ UIComponent col = (UIComponent) iter.next();
+ if (col.isRendered()){
+ String colId = col.getId();
+ value.put(colId, newWidths[index++]);
+ }//if
+ }//for
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
}//changeColumnSize
}//ColumnsSizeState
@@ -389,13 +387,8 @@
private void init(UIExtendedDataTable extendedDataTable, JSONCollection collection){
value = null;
if ((collection != null) && (collection.size()>0)){
- //try to restore state from string
+ //try to restore state from collection
value = new JSONArray(collection);
-// try {
-// value = new JSONArray(val);
-// } catch (JSONException e) {
-// e.printStackTrace();
-// }
}
if (value == null){
@@ -511,12 +504,10 @@
private static final long serialVersionUID = -3923409650272094713L;
- //private static final String SEP = ";";
-
private static final String TRUE = "1";
private static final String FALSE = "0";
- private JSONMap value;
+ private JSONObject value;
private ColumnsVisibility() {
super();
@@ -528,32 +519,24 @@
return columnsVisibility;
}
- static ColumnsVisibility getColumnsVisibility(UIExtendedDataTable extendedDataTable, JSONMap map){
+ static ColumnsVisibility getColumnsVisibility(UIExtendedDataTable extendedDataTable, JSONMap state){
ColumnsVisibility columnsVisibility = new ColumnsVisibility();
- columnsVisibility.init(extendedDataTable, map);
+ columnsVisibility.init(extendedDataTable, state);
return columnsVisibility;
}
/**
* Converts its state from String representation or create default state if it is not set.
*/
- private void init(UIExtendedDataTable extendedDataTable, JSONMap map){
+ private void init(UIExtendedDataTable extendedDataTable, JSONMap state){
value = null;
- if ((map != null) && (map.size()>0)){
- value = map;
+ if ((state != null) && (state.size()>0)){
+ value = new JSONObject(state);
}
if (value == null){
createDefaultColumnsVisibility(extendedDataTable);
}
- //set visibility flag for all columns
- for (Iterator<UIColumn> iter = extendedDataTable.getChildColumns(); iter.hasNext();) {
- UIColumn child = iter.next();
- if (child instanceof UIColumn) {
- UIColumn dataColumn = (UIColumn) child;
- dataColumn.setVisible(isVisible(dataColumn.getId()));
- }//if
- }//for
}//init
/**
@@ -571,7 +554,7 @@
* @return JSON object contains state
*/
public JSONMap toJSON(){
- return value;
+ return new JSONMap(value);
}
/**
@@ -582,9 +565,9 @@
JSONWriter writer = new JSONStringer().object();
for (Iterator<UIColumn> iter = extendedDataTable.getChildColumns(); iter.hasNext();) {
UIColumn col = iter.next();
- writer.key(col.getId()).value(TRUE);
+ writer.key(col.getId()).value(col.isVisible() ? TRUE : FALSE);
}
- value = new JSONMap(writer.endObject().toString());
+ value = new JSONObject(writer.endObject().toString());
} catch (JSONException e) {
e.printStackTrace();
}
@@ -598,7 +581,7 @@
boolean isVisible(String columnId){
if (value == null)
return true;
- return TRUE.equals(value.get(columnId));
+ return !FALSE.equals(value.opt(columnId));
}//isVisible
/**
@@ -614,9 +597,7 @@
for (Iterator<UIColumn> iter = extendedDataTable.getChildColumns(); iter.hasNext();) {
UIColumn col = iter.next();
if (col.getId().equalsIgnoreCase(columnId)){
- if (col instanceof UIColumn){
- column = (UIColumn) col;
- }
+ column = (UIColumn) col;
break;
}//if
}//for
@@ -625,9 +606,13 @@
boolean visible = column.isVisible();
//toggle visibility
visible = !visible;
- //set visibility flag for column
- column.setVisible(visible);
- value.put(columnId, (visible ? TRUE : FALSE));
+ try {
+ value.put(columnId, (visible ? TRUE : FALSE));
+ //set visibility flag for column
+ column.setVisible(visible);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
}//changeVisibility
}//ColumnsVisibility
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2008-12-16 10:43:14 UTC (rev 11795)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2008-12-16 10:57:02 UTC (rev 11796)
@@ -331,8 +331,8 @@
for (Iterator<UIComponent> iterator = list.iterator(); iterator
.hasNext();) {
UIComponent component = iterator.next();
- if (component instanceof org.richfaces.component.UIColumn) {
- org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
+ if (component instanceof UIColumn) {
+ UIColumn column = (UIColumn) component;
FilterField filterField = column.getFilterField();
if (filterField != null) {
filterFields.add(filterField);
@@ -417,4 +417,25 @@
return chain;
}
+ @Override
+ public void beforeRenderResponse(FacesContext context) {
+ super.beforeRenderResponse(context);
+
+ for (Iterator<UIColumn> columns = getChildColumns(); columns
+ .hasNext();) {
+ UIColumn column = columns.next();
+ column.setId(column.getId());
+ column.setVisible(isColumnVisible(column));
+ }
+
+ UIColumn groupingColumn = getGroupByColumn();
+ if (groupingColumn != null) {// grouping is on
+ if (groupingColumn.getSortOrder().equals(Ordering.UNSORTED)) {
+ groupingColumn.setSortOrder(Ordering.ASCENDING);
+ }
+ }
+ }
+
+
+
}
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-12-16 10:43:14 UTC (rev 11795)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-12-16 10:57:02 UTC (rev 11796)
@@ -265,15 +265,12 @@
boolean enabled = false;
while (columns.hasNext()) {
UIColumn col = columns.next();
- if (col instanceof UIColumn) {
- UIColumn dataColumn = (UIColumn) col;
- if ((internalFilterEnabledColumn(dataColumn) || (dataColumn.getFacet("filter") != null)) &&
- dataColumn.isRendered()
- ) {
- enabled = true;
- break;
- }
- }
+ if ((internalFilterEnabledColumn(col) || (col.getFacet("filter") != null)) &&
+ col.isRendered()
+ ) {
+ enabled = true;
+ break;
+ }
}
return enabled;
}
@@ -1078,35 +1075,6 @@
+ ".preSendAjaxRequest");
}
- protected void preDecode(FacesContext context, UIComponent component) {
- if (component instanceof UIExtendedDataTable) {
- UIExtendedDataTable table = (UIExtendedDataTable) component;
- table.ensureTableStateInitialized();
- }
- super.preDecode(context, component);
- }
-
- protected void preEncodeBegin(FacesContext context, UIComponent component)
- throws IOException {
- if (component instanceof UIExtendedDataTable) {
- UIExtendedDataTable table = (UIExtendedDataTable) component;
-
- for (Iterator<UIColumn> columns = table.getChildColumns(); columns
- .hasNext();) {
- UIColumn column = columns.next();
- column.setId(column.getId());
- }
-
- if (table.isGroupingOn()) {// grouping is on
- UIColumn column = table.getGroupByColumn();
- if (column.getSortOrder().equals(Ordering.UNSORTED)){
- column.setSortOrder(Ordering.ASCENDING);
- }
- }
- }
- super.preEncodeBegin(context, component);
- }
-
protected void doDecode(FacesContext context, UIComponent component) {
super.doDecode(context, component);
composite.decode(context, component);
@@ -1788,13 +1756,10 @@
for (Iterator<UIColumn> colums = table.getSortedColumns(); colums
.hasNext();) {
UIColumn col = colums.next();
- if (col instanceof UIColumn) {
- UIColumn column = (UIColumn) col;
- // if (column.isRendered()){
- String menuId = menuRenderer.renderMenu(context, table, column);
- ajaxContext.addRenderedArea(menuId);
- // }
- }
+ if (col.isRendered()) {
+ String menuId = menuRenderer.renderMenu(context, table, col);
+ ajaxContext.addRenderedArea(menuId);
+ }
}// for
table.setRowKey(key);
}
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java 2008-12-16 10:43:14 UTC (rev 11795)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java 2008-12-16 10:57:02 UTC (rev 11796)
@@ -56,7 +56,7 @@
groupingColumnLabel = "";
if (groupingOn){
groupingColumn = table.getGroupByColumn();
- if ((groupingColumn != null) && (groupingColumn instanceof UIColumn)){
+ if (groupingColumn != null){
groupingColumnLabel = (String)groupingColumn.getAttributes().get("label");;
}
}
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java 2008-12-16 10:43:14 UTC (rev 11795)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java 2008-12-16 10:57:02 UTC (rev 11796)
@@ -300,14 +300,13 @@
*/
protected void buildMenuItem(UIComponent parent, UIColumn col)
throws IOException {
- if (((Boolean)col.getAttributes().get("rendered")) && (col instanceof UIColumn)) {
- UIColumn dataColumn = (UIColumn) col;
+
+ if (col.isRendered(false)) {
UIMenuItem menuItem = (UIMenuItem) context.getApplication()
.createComponent(UIMenuItem.COMPONENT_TYPE);
menuItem.setSubmitMode("none");
- Boolean v = dataColumn.isVisible();
- boolean columnVisible = (v == null ? Boolean.TRUE : v);
+ boolean columnVisible = col.isVisible();
String actionScript = null;
StringBuilder actionScriptBuilder = new StringBuilder();
@@ -324,10 +323,10 @@
actionScript = actionScriptBuilder.toString();
if (actionScript.contains("{columnId}"))
actionScript = actionScript.replace("{columnId}",
- dataColumn.getId());
+ col.getId());
}
}// if
- String label = (String)dataColumn.getAttributes().get("label");
+ String label = (String)col.getAttributes().get("label");
menuItem.setValue(label == null ? "" : label);
menuItem.setIcon(columnVisible ? iconCheckedURI : iconUncheckedURI);
if (menuItem instanceof HtmlMenuItem) {
17 years, 5 months
JBoss Rich Faces SVN: r11795 - in trunk/test-applications/seleniumTest/richfaces/src: main/java/org/ajax4jsf/listener and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-16 05:43:14 -0500 (Tue, 16 Dec 2008)
New Revision: 11795
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/successNavigation.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testByPassList.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEvents.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testLimitToList.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testTemplate.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
Log:
RF-5314, RF-5315, RF-5316, RF-5317
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java 2008-12-16 10:43:14 UTC (rev 11795)
@@ -26,6 +26,12 @@
private String data = null;
+ private boolean checkboxValue1;
+
+ private boolean checkboxValue2;
+
+ private String status = Messages.IDLE_STATUS;
+
/** property for testUpdatingValue */
private String inputValue = A4JSupport.Messages.INPUT_VALUE;
@@ -49,14 +55,20 @@
public static final String VALID_MESSAGE = "field is required";
public static final String INPUT_VALUE = "test";
+
+ public static final String IDLE_STATUS = "idle";
+
+ public static final String PROCESSING_STATUS = "process";
}
public void linkListener (ActionEvent event) {
data = Messages.TEST_PASSED;
+ status = Messages.PROCESSING_STATUS;
}
public void checkBoxListener (ActionEvent event) {
data = Messages.TEST_PASSED;
+ status = Messages.PROCESSING_STATUS;
}
public void commandListener (ActionEvent event) {
@@ -93,4 +105,48 @@
this.inputValue = inputValue;
}
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @param status the status to set
+ */
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ /**
+ * @return the checkboxValue1
+ */
+ public boolean isCheckboxValue1() {
+ return checkboxValue1;
+ }
+
+ /**
+ * @param checkboxValue1 the checkboxValue1 to set
+ */
+ public void setCheckboxValue1(boolean checkboxValue1) {
+ this.checkboxValue1 = checkboxValue1;
+ }
+
+ /**
+ * @return the checkboxValue2
+ */
+ public boolean isCheckboxValue2() {
+ return checkboxValue2;
+ }
+
+ /**
+ * @param checkboxValue2 the checkboxValue2 to set
+ */
+ public void setCheckboxValue2(boolean checkboxValue2) {
+ this.checkboxValue2 = checkboxValue2;
+ }
+
+
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java 2008-12-16 10:43:14 UTC (rev 11795)
@@ -43,6 +43,7 @@
A4JSupport bean = (A4JSupport) FacesUtils.getFacesBean(A4JSupport.BEAN_NAME);
if (bean != null) {
bean.setData(str);
+ bean.setStatus(Messages.PROCESSING_STATUS);
}
}
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-12-16 10:43:14 UTC (rev 11795)
@@ -306,4 +306,11 @@
<to-view-id>/pages/ajaxInclude/step1.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>navigate</from-outcome>
+ <to-view-id>/pages/ajaxSupport/successNavigation.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
</faces-config>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/successNavigation.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/successNavigation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testByPassList.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testByPassList.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEvents.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEvents.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testLimitToList.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testLimitToList.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testTemplate.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testTemplate.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-12-16 10:43:14 UTC (rev 11795)
@@ -20,7 +20,11 @@
*/
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.List;
+
import org.ajax4jsf.bean.A4JSupport;
+import org.ajax4jsf.bean.A4JSupport.Messages;
import org.ajax4jsf.template.Template;
import org.bouncycastle.asn1.pkcs.KeyDerivationFunc;
import org.richfaces.SeleniumTestBase;
@@ -50,6 +54,8 @@
private static final String AJAXSINGLE_ATTRIBUTE2_PAGE = "testAjaxSingleAttribute2.xhtml";
+ private static final String AJAXSINGLE_ATTRIBUTE3_PAGE = "testAjaxSingleAttribute3.xhtml";
+
private static final String RERENDER_ATTRIBUTE_PAGE = "testRerenderFunctionality.xhtml";
private static final String ENABLED_ATTRIBUTE_PAGE = "testEnabledAttribute.xhtml";
@@ -58,6 +64,12 @@
private static final String UPDATING_VALUE = "testUpdatingValue.xhtml";
+ private static final String EVENTS_PAGE = "testEvents.xhtml";
+
+ private static final String LIMIT_TO_LIST_ATTRIBUTE_PAGE = "testLimitToList.xhtml";
+
+ private static final String BY_PASS_UPDATES_ATTRIBUTE_PAGE = "testByPassList.xhtml";
+
private static final String DEFAULT_BEHAVIOUR_ID_PREFIX = "_db";
private static final String VALIDATION_FAILED_ID_PREFIX = "_vf";
@@ -196,20 +208,32 @@
//
// }
//
-// /** component with bypassUpdates = true skips update model values phase */
-// @Test
-// public void testByPassAttribute() {
-//
-// }
-//
-//
-//
-// /** component with limitToList = true skips ajaxRendered areas update */
-// @Test
-// public void testLimitToListAttribute() {
-//
-// }
-//
+ /** component with bypassUpdates = true skips update model values phase */
+ @Test
+ public void testByPassAttribute(Template template) {
+ setTestUrl(BY_PASS_UPDATES_ATTRIBUTE_PAGE);
+ init(template);
+ passExternalValidation();
+ processingElement(checkboxId, dataId2, false);
+ AssertTextEquals(dataId2 + "_ch", "false", "By pass updates attribute not work" );
+ processingElement(checkboxId + COMMON_ALISTENER_PREFIX, dataId2 + COMMON_ALISTENER_PREFIX, false);
+ AssertTextEquals(dataId2 + COMMON_ALISTENER_PREFIX + "_ch", "false", "By pass updates attribute not work" );
+
+ }
+
+
+
+ /** component with limitToList = true skips ajaxRendered areas update */
+ @Test
+ public void testLimitToListAttribute(Template template) {
+ setTestUrl(LIMIT_TO_LIST_ATTRIBUTE_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, "", false);
+ AssertTextEquals(parentFormId + "ajax_status", Messages.IDLE_STATUS,
+ "Limit to list attribute not work");
+ }
+
/** component with rendered = false is not present on the page */
@Test
public void testRenderedAttribute(Template template) {
@@ -221,15 +245,35 @@
checkOnclickAttr(checkboxId + RENDERED_ATTRIBUTE_ID_PREFIX);
checkOnclickAttr(checkboxId + COMMON_ALISTENER_PREFIX + RENDERED_ATTRIBUTE_ID_PREFIX);
}
-//
-// /**
-// * onsubmit event fires on component activation then
-// * oncomplete with proper request data
-// */
-// @Test
-// public void testOnSubmitEvent1() {
-//
-// }
+
+ /**
+ * onsubmit event fires on component activation then
+ * oncomplete with proper request data
+ */
+ @Test
+ public void testOnSubmitAndOnCOmpleteEvents(Template template) {
+ setTestUrl(EVENTS_PAGE);
+ init(template);
+ passExternalValidation();
+ processingElement(linkId, dataId1, false);
+ assertEvents();
+ processingElement(linkId + COMMON_ALISTENER_PREFIX, dataId1 + COMMON_ALISTENER_PREFIX, false);
+ assertEvents();
+ processingElement(checkboxId, dataId2, false);
+ assertEvents();
+ processingElement(checkboxId + COMMON_ALISTENER_PREFIX, dataId2 + COMMON_ALISTENER_PREFIX, false);
+ assertEvents();
+
+ }
+
+ private void assertEvents(){
+ List<String> eventsExpected = new ArrayList<String>();
+
+ eventsExpected.add("onsubmit");
+ eventsExpected.add("oncomplete");
+ assertEvents(eventsExpected);
+ }
+
/** component with disabled = true do not fire ajax requests */
@Test
public void testEnabledAttribute(Template template) {
@@ -257,17 +301,21 @@
writeStatus(CommonUtils.getSuccessfulTestMessage(iid));
}
-// /**
-// * @see #testAjaxSupportComponent()
-// *
-// * the same for ajaxSingle = true component for the case
-// * of external validation failure + process for validation failed
-// * field - listeners and navigation do not work
-// */
-// @Test
-// public void testAjaxSingleAttribute3() {
-//
-// }
+ /**
+ * @see #testAjaxSupportComponent()
+ *
+ * the same for ajaxSingle = true component for the case
+ * of external validation failure + process for validation failed
+ * field - listeners and navigation do not work
+ */
+ @Test
+ public void testAjaxSingleAttribute3(Template template) {
+ setTestUrl(AJAXSINGLE_ATTRIBUTE3_PAGE);
+ init(template);
+ breakExternalValidation();
+ checkBasicFunctionality(template, "", false);
+ AssertNotPresent(getParentId() + "successNavigationTextId", "Navigation shouldn't work");
+ }
private void checkOnclickAttr(String elementId) {
17 years, 5 months
JBoss Rich Faces SVN: r11794 - trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-16 05:33:32 -0500 (Tue, 16 Dec 2008)
New Revision: 11794
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java
Log:
Fix compilation error
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java 2008-12-15 19:48:41 UTC (rev 11793)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/MessageBean2.java 2008-12-16 10:33:32 UTC (rev 11794)
@@ -35,10 +35,6 @@
private String string3;
- private String string2;
-
- private String string3;
-
private Boolean rendered;
private Boolean showDetail;
@@ -69,14 +65,6 @@
return null;
}
- public String addGlobalMessage() {
- FacesContext.getCurrentInstance().addMessage(
- null,
- new FacesMessage(FacesMessage.SEVERITY_INFO, "globalMessageSummary",
- "globalMessageDetail"));
- return null;
- }
-
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
Severity severity = null;
17 years, 5 months