[richfaces-svn-commits] JBoss Rich Faces SVN: r12005 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 14 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Dec 24 07:17:20 EST 2008


Author: amarkhel
Date: 2008-12-24 07:17:19 -0500 (Wed, 24 Dec 2008)
New Revision: 12005

Added:
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
   trunk/test-applications/realworld/web/src/main/webapp/includes/
   trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload/
Removed:
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
   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/templates/addComment.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
   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/navigation.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/userPrefs.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/Image.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/MessageAction.java
   trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
   trunk/test-applications/realworld/ejb/src/main/resources/import.sql
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.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/fileupload/ImageLoader.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java
   trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java
   trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
   trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
   trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
   trunk/test-applications/realworld/web/src/main/webapp/register.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-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -97,17 +97,6 @@
 	 */
     public Album() {
     }
-	
-	/**
-	 * Constructor
-	 * 
-	 * @param name - name of album
-	 * @param parent - link for parent album
-	 */
-    public Album(String name) {
-        this.name = name;
-        //this.parent = parent;
-    }
 
 	// ********************** Accessor Methods ********************** //
 

Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -18,8 +18,6 @@
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;

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-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -19,9 +19,6 @@
 	@In @Out
 	private User user;
 
-	/* (non-Javadoc)
-	 * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
-	 */
 	public void addAlbum(Album album) {
 		if(album.getChangedName() != album.getName()){
 			album.setName(album.getChangedName());

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-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -16,9 +16,6 @@
 	@In(value="entityManager")
 	EntityManager em;
 	
-	/* (non-Javadoc)
-	 * @see org.richfaces.realworld.service.IMessageAction#sendMessage(org.richfaces.realworld.domain.Message)
-	 */
 	public void sendMessage(Message message){
 		if(message.getOwnerLogin() != null){
 			User user = (User)em.createQuery("from User u where u.login = :login")
@@ -34,9 +31,6 @@
 		em.flush();
 	}
 	
-	/* (non-Javadoc)
-	 * @see org.richfaces.realworld.service.IMessageAction#deleteMessage(org.richfaces.realworld.domain.Message)
-	 */
 	public void deleteMessage(Message message){
 		em.remove(message);
 		message.getOwner().removeMessage(message);

Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -37,19 +37,19 @@
 	public List<Image> searchImages(String searchPattern, String additionalParams, Map<String, Object> paramMap){
 		String fullQuery = SEARCH_QUERY_BEGIN + additionalParams + SEARCH_QUERY_END;
 		Query prepared = prepareQuery(fullQuery, searchPattern, additionalParams, paramMap);
-		return initImages(prepared);
+		return prepared.getResultList();
 	}
 	
 	public List<Image> popularImages(String additionalParams, Map<String, Object> paramMap){
 		String fullQuery = SEARCH_RELEVANT_QUERY_BEGIN + additionalParams + SEARCH_POPULAR_QUERY_END;
 		Query prepared = prepareQuery(fullQuery, null, additionalParams, paramMap);
-		return initImages(prepared);
+		return prepared.getResultList();
 	}
 	
 	public List<Image> worstImages(String additionalParams, Map<String, Object> paramMap){
 		String fullQuery = SEARCH_RELEVANT_QUERY_BEGIN + additionalParams + SEARCH_UNPOPULAR_QUERY_END;
 		Query prepared = prepareQuery(fullQuery, null, additionalParams, paramMap);
-		return initImages(prepared);
+		return prepared.getResultList();
 	}
 	
 	private Query prepareQuery(String fullQuery ,String searchPattern, String additionalParams,
@@ -70,12 +70,4 @@
 		prepared.setMaxResults(20);
 		return prepared;
 	}
-	
-	private List<Image> initImages(Query prepared) {
-		List<Image> images = prepared.getResultList();
-		for(Image image:images){
-			image.getAlbum().getOwner().getLogin();
-		}
-		return images;
-	}
 }

Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql	2008-12-24 12:17:19 UTC (rev 12005)
@@ -38,37 +38,37 @@
 INSERT INTO Ranks(rank_id, total, hits) VALUES (30, 100, 30);
 INSERT INTO Ranks(rank_id, total, hits) VALUES (31, 110, 31);
 
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (1, 'Aston Martin', 'aston_martin.jpg', 'Where is the Batman?',  '2008-12-18', 1, 1);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (2,  'Ferrari', 'ferrari_profile.jpg', 'Beauty!',  '2008-12-18', 1, 2);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (3,  'Australian supercar', 'holden-efijy-1809.jpg', 'This one glitters in my garage ;)',  '2008-12-18', 1, 3);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (4,  'Hulme Supercar', 'hulme_supercar_side_parked.jpg', 'Saw it in Germany in summer 2007', '2008-12-18', 1, 4);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (5,  'Pagani Zonda', 'Pagani_Zonda.jpg', 'The picture is provided by my friend photographer',  '2008-12-18', 1, 5);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (6,  'Codatronca (concept)', 'spadaconcept codatronca.jpg', 'Just concept',  '2008-12-18', 1, 6);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (7,  'Unknown supercar', 'supercar.jpg', 'Tell me it name if you know',  '2008-12-18', 1, 7);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (8,  'Audrey Tautou', 'Audrey_Tautou.jpg', 'Pretty girl!',  '2008-12-18', 2, 8);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (9,  'Juliette Binoche', 'Juliette_Binoche.jpg', 'Saw her in "Chocolate" at first',  '2008-12-18', 2, 9);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (10,  'Penelope Cruz', 'Penelope_Cruz.jpg', 'Without comments',  '2008-12-18', 2, 10);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (11,  'Rihanna', 'Rihanna.jpg', 'Was born in Barbados. True or false?',  '2008-12-18', 2, 11);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (12,  'Uma Turman', 'Uma_Turman.jpg', 'Share the delight with Tarantino )',  '2008-12-18', 2, 12);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (13,  'Basketball soccer', 'Basketball_soccer.jpg', 'They never saw camera',  '2008-12-18', 3, 13);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (14,  'bdysch!!!', 'bdysch!!!.jpg', 'Dermo sluchaetsia',  '2008-12-18', 3, 14);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (15,  'Training', 'euro2008_holland_wideweb__470x321,0.jpg', '     )     ',  '2008-12-18', 3, 15);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (16,  'Also football', 'flag_football.jpg', 'This is also football, but I do not understand it at all',  '2008-12-18', 3, 16);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (17,  'Soccer', 'soccer.jpg', 'Soccer differs from football',  '2008-12-18', 3, 17);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (18,  'from birds fly', 'birds_fly.jpg', 'One of the megalopolices',  '2008-12-18', 4, 18);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (19,  'Haruki Murakami', 'Haruki_Murakami.jpg', 'World famous aouthor',  '2008-12-18', 4, 19);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (20,  'Street fashion', 'Japanese_Street_Fashion.jpg', 'Venture to walk in such in our streets?',  '2008-12-18', 4, 20);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (21,  'Kendo Championship', 'Kendo_Championship_2006.jpg', 'Samurais steel alive!',  '2008-12-18', 4, 21);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (22,  'Live in peace', 'live_in_piece.jpg', 'The best place for meditation',  '2008-12-18', 4, 22);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (23,  'Modern family', 'modern_japanesse_family.jpg', 'Where is his mother?!',  '2008-12-18', 4, 23);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (24,  'Zen garden', 'zen-garden_landscape_design.jpg', 'Fen Shui i vsia fignia',  '2008-12-18', 4, 24);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (25,  'Sergei Babkin', 'Babkin.jpg', 'Also plays in theatre',  '2008-12-18', 5, 25);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (26,  'Bob Marley', 'Bob_Marley.jpg', 'Everyone should know him',  '2008-12-18', 5, 26);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (27,  'Infected Mushroom', 'Infected_Mushroom.jpg', 'Famous psyhedelic trance group from Israel',  '2008-12-18', 5, 27);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (28,  'Massive Attack', 'massiveAttack.jpg', 'They play theme to "House"',  '2008-12-18', 5, 28);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (29,  'Street musician', 'StreetMusician.jpg', 'unknown musician',  '2008-12-18', 5, 29);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (30,  'SOAD', 'system-of-a-down.jpg', 'Try not to loose your innervision!',  '2008-12-18', 5, 30);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (31,  'Amon Tobin', 'tobin.jpg', 'Brasilian, works in London. Try his "Supermodified2000" album', '2008-12-18', 5, 31);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (1, 'Aston Martin', 'amarkhel/Cars/aston_martin.jpg', 'Where is the Batman?',  '2008-12-18', 1, 1);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (2,  'Ferrari', 'amarkhel/Cars/ferrari_profile.jpg', 'Beauty!',  '2008-12-18', 1, 2);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (3,  'Australian supercar', 'amarkhel/Cars/holden-efijy-1809.jpg', 'This one glitters in my garage ;)',  '2008-12-18', 1, 3);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (4,  'Hulme Supercar', 'amarkhel/Cars/hulme_supercar_side_parked.jpg', 'Saw it in Germany in summer 2007', '2008-12-18', 1, 4);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (5,  'Pagani Zonda', 'amarkhel/Cars/Pagani_Zonda.jpg', 'The picture is provided by my friend photographer',  '2008-12-18', 1, 5);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (6,  'Codatronca (concept)', 'amarkhel/Cars/spadaconcept codatronca.jpg', 'Just concept',  '2008-12-18', 1, 6);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (7,  'Unknown supercar', 'amarkhel/Cars/supercar.jpg', 'Tell me it name if you know',  '2008-12-18', 1, 7);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (8,  'Audrey Tautou', 'amarkhel/Tetki/Audrey_Tautou.jpg', 'Pretty girl!',  '2008-12-18', 2, 8);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (9,  'Juliette Binoche', 'amarkhel/Tetki/Juliette_Binoche.jpg', 'Saw her in "Chocolate" at first',  '2008-12-18', 2, 9);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (10,  'Penelope Cruz', 'amarkhel/Tetki/Penelope_Cruz.jpg', 'Without comments',  '2008-12-18', 2, 10);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (11,  'Rihanna', 'amarkhel/Tetki/Rihanna.jpg', 'Was born in Barbados. True or false?',  '2008-12-18', 2, 11);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (12,  'Uma Turman', 'amarkhel/Tetki/Uma_Turman.jpg', 'Share the delight with Tarantino )',  '2008-12-18', 2, 12);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (13,  'Basketball soccer', 'root/Football/Basketball_soccer.jpg', 'They never saw camera',  '2008-12-18', 3, 13);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (14,  'bdysch!!!', 'root/Football/bdysch!!!.jpg', 'Dermo sluchaetsia',  '2008-12-18', 3, 14);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (15,  'Training', 'root/Football/euro2008_holland_wideweb__470x321,0.jpg', '     )     ',  '2008-12-18', 3, 15);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (16,  'Also football', 'root/Football/flag_football.jpg', 'This is also football, but I do not understand it at all',  '2008-12-18', 3, 16);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (17,  'Soccer', 'root/Football/soccer.jpg', 'Soccer differs from football',  '2008-12-18', 3, 17);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (18,  'from birds fly', 'qqqq/Japan/birds_fly.jpg', 'One of the megalopolices',  '2008-12-18', 4, 18);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (19,  'Haruki Murakami', 'qqqq/Japan/Haruki_Murakami.jpg', 'World famous aouthor',  '2008-12-18', 4, 19);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (20,  'Street fashion', 'qqqq/Japan/Japanese_Street_Fashion.jpg', 'Venture to walk in such in our streets?',  '2008-12-18', 4, 20);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (21,  'Kendo Championship', 'qqqq/Japan/Kendo_Championship_2006.jpg', 'Samurais steel alive!',  '2008-12-18', 4, 21);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (22,  'Live in peace', 'qqqq/Japan/live_in_piece.jpg', 'The best place for meditation',  '2008-12-18', 4, 22);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (23,  'Modern family', 'qqqq/Japan/modern_japanesse_family.jpg', 'Where is his mother?!',  '2008-12-18', 4, 23);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (24,  'Zen garden', 'qqqq/Japan/zen-garden_landscape_design.jpg', 'Fen Shui i vsia fignia',  '2008-12-18', 4, 24);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (25,  'Sergei Babkin', 'qqqq/Music/Babkin.jpg', 'Also plays in theatre',  '2008-12-18', 5, 25);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (26,  'Bob Marley', 'qqqq/Music/Bob_Marley.jpg', 'Everyone should know him',  '2008-12-18', 5, 26);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (27,  'Infected Mushroom', 'qqqq/Music/Infected_Mushroom.jpg', 'Famous psyhedelic trance group from Israel',  '2008-12-18', 5, 27);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (28,  'Massive Attack', 'qqqq/Music/massiveAttack.jpg', 'They play theme to "House"',  '2008-12-18', 5, 28);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (29,  'Street musician', 'qqqq/Music/StreetMusician.jpg', 'unknown musician',  '2008-12-18', 5, 29);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (30,  'SOAD', 'qqqq/Music/system-of-a-down.jpg', 'Try not to loose your innervision!',  '2008-12-18', 5, 30);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (31,  'Amon Tobin', 'qqqq/Music/tobin.jpg', 'Brasilian, works in London. Try his "Supermodified2000" album', '2008-12-18', 5, 31);
 INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (1, 'Cool', 1);
 INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (2, 'Cool2', 1);
 INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (3, 'richfaces', 2);
@@ -94,7 +94,7 @@
 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, readed, theme, friendshipRequest) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1, false, 'Hello, amarkhel', false);
 INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme, friendshipRequest) VALUES (2, '1985-01-08', 'Please, add meto your friends', 3, 1, false, 'Request for friendship', true);
-INSERT INTO shared_albums(album_id, user_id) VALUES(1, 1);
-INSERT INTO shared_albums(album_id, user_id) VALUES(2, 1);
+INSERT INTO shared_albums(album_id, user_id) VALUES(4, 1);
+INSERT INTO shared_albums(album_id, user_id) VALUES(5, 1);
 INSERT INTO user_friends(user1_id, user2_id) VALUES(1, 2);
 INSERT INTO friendship_requests(REQUEST_ID, USER_ID, FRIEND_ID) VALUES(1, 3, 1);
\ No newline at end of file

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -73,14 +73,14 @@
 		}
 	}
 
-	public void renameDirectory(String directoryOld, String directoryNew) throws Exception {
+	public void renameDirectory(String directoryOld, String directoryNew){
 		String fullPath = getAbsolutePath(directoryOld);
 		File fileOld = new File(fullPath);
 		File fileNew = new File(getUploadRoot() + directoryNew);
 		createDirectoryIfNotExist(directoryNew);
 		if(fileNew.exists())
 			if( fileNew.isDirectory() ){
-				throw new Exception("exc");
+				//throw new Exception("exc");
 			}else{
 				fileNew.delete();
 			}
@@ -159,4 +159,15 @@
 	private String getAbsolutePath(String fileName) {
 		return getUploadRoot() + fileName;
 	}
+	
+	public String transformToServerPath(String filename){
+		String[] res = filename.split("/");
+		StringBuilder sb = new StringBuilder();
+		sb.append(res[0]);
+		for(int i = 1; i < res.length; i++){
+			sb.append(this.getFileSeparator() + res[i]);
+		}
+		String string = sb.toString();
+		return string;
+	}
 }

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-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -35,9 +35,9 @@
 import org.jboss.seam.core.Events;
 import org.richfaces.event.UploadEvent;
 import org.richfaces.model.UploadItem;
-import org.richfaces.realworld.domain.Album;
 import org.richfaces.realworld.domain.Image;
 import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.util.SelectionHelper;
 
 /**
  * @author $Autor$
@@ -48,9 +48,9 @@
 
 public class FileUploadBean implements Serializable{
 	
-	private static final String SAMPLE_NAME = "Sample Name";
+	@In("#{messages['samplename']}") private String SAMPLE_NAME;
 
-	private static final String SAMPLE_DESCRIPTION = "Sample Description";
+	@In("#{messages['sampledesc']}") private String SAMPLE_DESCRIPTION;
 
 	private static final String ADD_IMAGE_EVENT = "addImage";
 
@@ -61,12 +61,12 @@
 	
 	@In(create=true) @Out
 	FileWrapper fileWrapper;
-
-	@In(required=false) 
-	private Album selectedAlbum;
 	
 	@In(create=true)
 	private FileManager fileManager;
+	
+	@In @Out
+	private SelectionHelper selectionHelper;
 
 	public synchronized void listener(UploadEvent event) throws Exception{
 	    UploadItem item = event.getUploadItem();
@@ -78,9 +78,9 @@
 	    image.setCreated(new Date());
 	    image.setDescription(SAMPLE_DESCRIPTION);
 	    image.setName(SAMPLE_NAME);
-	    image.setPath(item.getFileName());
-	    image.setAlbumName(selectedAlbum.getName());
-	    image.setAlbum(selectedAlbum);
+	    image.setPath(user.getLogin() + "/" + selectionHelper.getSelectedAlbum().getName() + "/" + item.getFileName());
+	    image.setAlbumName(selectionHelper.getSelectedAlbum().getName());
+	    image.setAlbum(selectionHelper.getSelectedAlbum());
 	    file.setImage(image);
 	    fileWrapper.getFiles().add(file);
 	}
@@ -102,7 +102,7 @@
 		for(FileItem file:fileWrapper.getFiles()){
 			if(file.isSelected()){
 				//Save file to disk
-				String fileName = user.getLogin() + fileManager.getFileSeparator() + selectedAlbum.getName() + fileManager.getFileSeparator() + file.getImage().getPath();
+				String fileName = fileManager.transformToServerPath(file.getImage().getPath());
 				try {
 					fileManager.addImage(fileName , file.getData());
 				} catch (IOException e) {
@@ -121,7 +121,7 @@
 	public void storeAll() {
 		for(FileItem file:fileWrapper.getFiles()){
 			//Save file to disk
-			String fileName = user.getLogin() + fileManager.getFileSeparator() + selectedAlbum.getName() + fileManager.getFileSeparator() + file.getImage().getPath();
+			String fileName = fileManager.transformToServerPath(file.getImage().getPath());
 			try {
 				fileManager.addImage(fileName , file.getData());
 			} catch (IOException e) {

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -55,7 +55,7 @@
 	public synchronized void paintSearchImage(OutputStream stream, Object object) throws IOException {
 		Image painted = (Image)object;
 		
-		File image = fileManager.getImage(painted.getAlbum().getOwner().getLogin() + fileManager.getFileSeparator() + painted.getAlbum().getName()+ fileManager.getFileSeparator() + painted.getPath());
+		File image = fileManager.getImage(fileManager.transformToServerPath(painted.getPath()));
 	    InputStream paintData = null;
 	    byte[] data = new byte[(int)image.length() - 1];
 	    FileInputStream fileInputStream = null;
@@ -102,7 +102,7 @@
 			return;
 		}
 		Image image = (Image)data;
-		File imageResource = fileManager.getImage(image.getAlbum().getOwner().getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath());
+		File imageResource = fileManager.getImage(fileManager.transformToServerPath(image.getPath()));;
 		if (imageResource != null) {
 			FileInputStream fileInputStream = new FileInputStream(imageResource);
 			BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);

Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java	                        (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,105 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.realworld.manager;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.IAlbumAction;
+import org.richfaces.realworld.tree.TreeAlbumItem;
+import org.richfaces.realworld.tree.TreeRootItem;
+import org.richfaces.realworld.util.SelectionHelper;
+
+ at Name("albumManager")
+ at Scope(ScopeType.CONVERSATION)
+public class AlbumManager {
+
+	@In(create=true, required=true)
+	private IAlbumAction albumAction;
+	
+	@In(create=true) @Out TreeRootItem treeRoot;
+	
+	@In(create=true, required=true) @Out
+	private Album album;
+	
+	@In
+	private User user;
+	
+	@In(create=true)
+	FileManager fileManager;
+	
+	@In @Out
+	private SelectionHelper selectionHelper;
+	
+	public void addAlbum(){
+		albumAction.addAlbum(album);
+		treeRoot.getAvailableAlbums().add(new SelectItem(album.getName()));
+		TreeAlbumItem albumItem = new TreeAlbumItem(album.getId(), treeRoot, album);
+		treeRoot.addAlbumToTree(albumItem);
+		fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + album.getName());
+		selectionHelper.setSelectedImage(null);
+		selectionHelper.setSelectedAlbum(albumItem.getAlbum());
+		
+	}
+
+	public void editAlbum(Album album){
+		boolean nameChanged = !album.getName().equals(album.getChangedName());
+		if(nameChanged){
+			String directoryOld = user.getLogin() + fileManager.getFileSeparator() + album.getName();
+			String directoryNew = user.getLogin() + fileManager.getFileSeparator() + album.getChangedName();
+			try {
+				fileManager.renameDirectory(directoryOld, directoryNew);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			album.setName(album.getChangedName());
+			album.setChangedName(null);
+		}
+		albumAction.editAlbum(album);
+		treeRoot.updateChild(album);
+	}
+
+	public void deleteAlbum(Album album){
+		String albumName = album.getName();
+		albumAction.deleteAlbum(album);
+		SelectItem item = treeRoot.getSelectItemByName(album.getName());
+		treeRoot.getAvailableAlbums().remove(item);
+		treeRoot.removeChild(album.getId());
+		fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
+		selectionHelper.setSelectedAlbum(user.getChildAlbums().get(0));
+		selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+	}
+	
+	public void updateSelectedAlbum(){
+		selectionHelper.setSelectedAlbum(user.getAlbumByName(selectionHelper.getSelectedAlbum().getName()));
+		selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+		selectionHelper.setSelectedImageIndex(1);
+		selectionHelper.setUserAlbumSelected(true);
+	}
+}


Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Author Id Revision Date
Name: svn:eol-style
   + native

Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java	                        (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,157 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.realworld.manager;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Identity;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.AvatarUpload;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.IUserAction;
+import org.richfaces.realworld.util.SelectionHelper;
+
+ at Name("authenticator")
+ at Scope(ScopeType.CONVERSATION)
+public class Authenticator implements Serializable
+{
+
+	@In("#{messages['user.exist']}") private String USER_WITH_THIS_LOGIN_ALREADY_EXIST;
+
+	@In("#{messages['user.confirm.error']}") private String CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD;
+
+	private static final String REGISTER_LOGIN_NAME_ID = "register:loginName";
+
+	private static final String REGISTER_CONFIRM_PASSWORD_ID = "register:confirmPassword";
+
+	private static final String INDEX_OUTCOME = "index";
+
+	private static final String ADMIN_ROLE = "admin";
+
+	private static final String GUEST_ROLE = "guest";
+
+	private static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
+
+	private static final long serialVersionUID = -4585673256547342140L;
+
+	@Logger Log log;
+    
+    @In Identity identity;
+	
+    @In FacesMessages facesMessages;
+    
+    @In(create = true)
+    IUserAction userAction;
+    
+    @In(create = true)
+    FileManager fileManager;
+    
+    @In(create = true)
+    AvatarUpload avatarUpload;
+    
+	@In(create=true) @Out
+	private SelectionHelper selectionHelper;
+    
+    /* (non-Javadoc)
+	 * @see org.richfaces.realworld.service.IAuthenticator#authenticate()
+	 */
+    public boolean authenticate()
+    {
+    	if(null == identity.getUsername() || identity.getUsername().equals("")){
+    		identity.addRole(GUEST_ROLE);
+        	Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.SEARCH);
+        	userAction.loginAnonymous();
+        	return true;
+    	}
+        try{
+        	User user = userAction.login(identity.getUsername(), identity.getPassword());
+        if(user != null){
+        	identity.addRole(ADMIN_ROLE);
+        	if(!fileManager.isDirectoryPresent(identity.getUsername())){
+        		fileManager.addDirectory(identity.getUsername());
+        	}
+        	if(user.getChildAlbums().size() > 0){
+        		selectionHelper.setSelectedAlbum(user.getChildAlbums().get(0));
+        		if(selectionHelper.getSelectedAlbum().getImages().size() > 0){
+        			selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+        		}
+        	}
+        	Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
+        	return true;
+        }
+        }catch(Exception nre){
+        	facesMessages.add("Invalid login or password");
+        	return false;
+        }
+        return false; 
+    }
+    
+    @End
+    public String register(User user){
+    	boolean errorHappened = false;
+    	if(!user.getPassword().equals(user.getConfirmPassword())){
+    		UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
+    		UIComponent component = root.findComponent(REGISTER_CONFIRM_PASSWORD_ID);
+			FacesContext.getCurrentInstance().addMessage(component.getClientId(FacesContext.getCurrentInstance()), new FacesMessage(
+					FacesMessage.SEVERITY_ERROR, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD , CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD));
+			errorHappened = true;
+    	}
+    	if(userAction.isUserExist(user.getLogin())){
+    		UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
+    		UIComponent component = root.findComponent(REGISTER_LOGIN_NAME_ID);
+			FacesContext.getCurrentInstance().addMessage(component.getClientId(FacesContext.getCurrentInstance()), new FacesMessage(
+					FacesMessage.SEVERITY_ERROR, USER_WITH_THIS_LOGIN_ALREADY_EXIST , USER_WITH_THIS_LOGIN_ALREADY_EXIST));
+			errorHappened = true;
+    	}
+    	if(errorHappened){
+    		return "";
+    	}
+    	userAction.register(user);
+    	if(avatarUpload.getAvatarItem() != null){
+    		user.setAvatarPath(avatarUpload.getAvatarItem().getImage().getName());
+    		fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + "avatars");
+    		fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + "avatars");
+    		try {
+				fileManager.addImage(user.getLogin() + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + user.getAvatarPath(), avatarUpload.getAvatarItem().getData());
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+    	}
+    	return INDEX_OUTCOME;
+    }
+}


Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Author Id Revision Date
Name: svn:eol-style
   + native

Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java	                        (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,134 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.realworld.manager;
+
+import java.util.Date;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.IImageAction;
+import org.richfaces.realworld.tree.TreeAlbumItem;
+import org.richfaces.realworld.tree.TreeImageItem;
+import org.richfaces.realworld.tree.TreeRootItem;
+import org.richfaces.realworld.util.RatingBinder;
+import org.richfaces.realworld.util.SelectionHelper;
+
+ at Name("imageManager")
+ at Scope(ScopeType.CONVERSATION)
+public class ImageManager {
+
+	@In(create=true, required=true)
+	private IImageAction imageAction;
+	
+	@In(create=true)
+	FileManager fileManager;
+	
+	@In(create=true) @Out TreeRootItem treeRoot;
+	
+	@In(create=true) @Out
+	private SelectionHelper selectionHelper;
+	
+	@In
+	private User user;
+	
+	@In(create=true, required=true)
+	private RatingBinder ratingBinder;
+	
+	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(fileManager.transformToServerPath(imagePath));
+		if(selectionHelper.getSelectedAlbum().getImages().size() > index){
+			selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(index));
+		}else{
+			selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(index-1));
+		}
+	}
+
+	public void editImage(Image image){
+		TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
+		boolean parentChanged = !parent.getAlbum().getName().equals(image.getAlbumName());
+		
+		if(parentChanged){
+			parent.removeChild(image.getId());
+			TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
+			TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
+			albumItem.addChild(image.getId(), imageItem);
+			String fileNameOld = fileManager.transformToServerPath(image.getPath());
+			int lastIndexOf = image.getPath().lastIndexOf("/");
+			String prevPathEnd = image.getPath().substring(lastIndexOf);
+			String fileNameNew = user.getLogin() + fileManager.getFileSeparator() + image.getAlbumName() + fileManager.getFileSeparator() + prevPathEnd;
+			String newPath = user.getLogin() + "/" + image.getAlbumName() + "/" + prevPathEnd;
+			image.setPath(newPath);
+			fileManager.renameImage(fileNameOld, fileNameNew);
+			selectionHelper.setSelectedImage(imageItem.getImage());
+			selectionHelper.setSelectedAlbum(albumItem.getAlbum());
+		}else{
+			TreeImageItem imageItem = (TreeImageItem)parent.getChild(image.getId());
+			imageItem.setImage(image);
+		}
+		imageAction.editImage(image, parentChanged);
+	}
+
+	@Observer("addImage")
+	public void addImage(Image image) {
+		imageAction.addImage(image);
+		TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
+		TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
+		albumItem.addChild(image.getId(), imageItem);
+		selectionHelper.setSelectedImage(imageItem.getImage());
+		selectionHelper.setSelectedAlbum(albumItem.getAlbum());
+	}
+	
+
+	public void editComment(Comment comment) {
+		imageAction.editComment(comment);
+	}
+
+	public void addComment(Comment comment) {
+		imageAction.addComment(comment);
+	}
+	
+	public void addAutoComment(Image image) {
+		Comment comment = new Comment();
+		comment.setAuthor(user);
+		comment.setDate(new Date());
+		comment.setImage(image);
+		comment.setMessage("+1");
+		imageAction.addComment(comment);
+	}
+	
+	public void vote(Image image){
+		imageAction.vote(image, (Long)Long.valueOf(ratingBinder.getInputSlider().getValue().toString()));
+	}
+}


Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Author Id Revision Date
Name: svn:eol-style
   + native

Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java	                        (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,148 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+package org.richfaces.realworld.manager;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+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.core.Events;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.FriendshipRequest;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Message;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.IMessageAction;
+import org.richfaces.realworld.service.IUserAction;
+import org.richfaces.realworld.util.SelectionHelper;
+
+ at Name("userManager")
+ at Scope(ScopeType.CONVERSATION)
+public class UserManager implements Serializable{
+	
+	@In("#{messages['addedtofriends']}") private String ADDED_TO_FRIENDS_MESSAGE_THEME;
+	@In("#{messages['addedtofriendsby']}") private String ADDED_TO_FRIENDS_MESSAGE;
+	@In("#{messages['removedfromfriends']}") private String REMOVED_FROM_FRIENDS_MESSAGE_THEME;
+	@In("#{messages['removedfromfriendsby']}") private String YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE;
+
+	private static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
+	
+	private static final long serialVersionUID = 6027103521084558931L;
+
+	@In
+	private User user;
+	
+	private Long countUnreadedMessages;
+	
+	@In(create=true, required=true)
+	private IMessageAction messageAction;
+	
+	@In(create=true, required=true)
+	private IUserAction userAction;
+	
+	@In(create=true) @Out
+	private SelectionHelper selectionHelper;
+
+	public List<String> availableUserLogins(Object suggest){
+		List<String> suggestions = userAction.getUsers((String)suggest);
+		return suggestions;
+	}
+
+	public void sendMessage(Message message) {
+		messageAction.sendMessage(message);
+	}
+
+	public Long getCountUnreadedMessages() {
+		if(null == countUnreadedMessages){
+			countUnreadedMessages = userAction.countNotReadedMessages(user);
+		}
+		return countUnreadedMessages != null ? countUnreadedMessages : 0;
+	}
+	
+	public void setCountUnreadedMessages(Long count){
+		countUnreadedMessages = null;
+	}
+
+	public void removeFromFriends(User owner, User removed){
+		userAction.removeFromFriends(owner, removed);
+		Message message = new Message();
+		message.setAuthor(user);
+		message.setDate(new Date());
+		message.setOwner(removed);
+		message.setFriendshipRequest(false);
+		message.setReaded(false);
+		message.setMessage(YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE+ user.getLogin());
+		message.setTheme(REMOVED_FROM_FRIENDS_MESSAGE_THEME);
+		messageAction.sendMessage(message);
+	}
+
+	public void addToFriends(User friend){
+		FriendshipRequest request = friend.getFriendshipRequest(user, friend);
+		if(request != null){
+			if(!userAction.friendExist(user, friend)){
+				userAction.addFriend(user, friend, request);
+				Message message = new Message();
+				message.setAuthor(user);
+				message.setDate(new Date());
+				message.setOwner(friend);
+				message.setFriendshipRequest(false);
+				message.setReaded(false);
+				message.setMessage(ADDED_TO_FRIENDS_MESSAGE+ user.getLogin());
+				message.setTheme(ADDED_TO_FRIENDS_MESSAGE_THEME);
+				messageAction.sendMessage(message);
+			}	
+		}/*else{
+			throw new Exception("This user won't be your friend!");
+		}*/
+	}
+
+	public void addToSharedAlbums(Image image){
+		userAction.addSharedAlbum(image.getAlbum());
+	}
+	
+	public void removeFromSharedAlbums(Album album){
+		userAction.removeFromSharedAlbums(user, album);
+	}
+
+	public void showSharedAlbum(Image image){
+		Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
+		selectionHelper.setSelectedAlbum(image.getAlbum());
+		selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+		selectionHelper.setSelectedImageIndex(1);
+		selectionHelper.setUserAlbumSelected(false);
+	}
+	
+	public void markAsReaded(Message message){
+		messageAction.markAsReaded(message);
+		this.setCountUnreadedMessages(null);
+	}
+	
+	public void deleteMessage(Message message){
+		messageAction.deleteMessage(message);
+		this.setCountUnreadedMessages(null);
+	}
+}


Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.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/search/SearchBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -41,14 +41,11 @@
 @Scope(ScopeType.CONVERSATION)
 public class SearchBean implements Serializable {
 
-	private static final String EQUALS_CHOICE = "Equals";
+	@In("#{messages['equals']}") private String EQUALS_CHOICE;
+	@In("#{messages['less']}") private String LESS_CHOICE;
+	@In("#{messages['more']}") private String MORE_CHOICE;
+	@In("#{messages['nomatter']}") private String NO_MATTER_CHOICE;
 
-	private static final String LESS_CHOICE = "Less";
-
-	private static final String MORE_CHOICE = "More";
-
-	private static final String NO_MATTER_CHOICE = "No Matter";
-
 	private static final String EQUALS = "= ";
 
 	private static final String LESSTHEN = "< ";

Deleted: 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-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,291 +0,0 @@
-/**
- * License Agreement.
- *
- *  JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007  Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- */
-package org.richfaces.realworld.tree;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import javax.faces.model.SelectItem;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Comment;
-import org.richfaces.realworld.domain.FriendshipRequest;
-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.navigation.NavigationEnum;
-import org.richfaces.realworld.service.IAlbumAction;
-import org.richfaces.realworld.service.IImageAction;
-import org.richfaces.realworld.service.IMessageAction;
-import org.richfaces.realworld.service.IUserAction;
-import org.richfaces.realworld.util.RatingBinder;
-import org.richfaces.realworld.util.SelectionHelper;
-
- at Name("treeActionManager")
- at Scope(ScopeType.CONVERSATION)
-public class TreeActionManager implements Serializable{
-	
-	private static final String ADDED_TO_FRIENDS_MESSAGE_THEME = "You are were added to friends";
-
-	private static final String ADDED_TO_FRIENDS_MESSAGE = "You are were added to friends by User ";
-
-	private static final String REMOVED_FROM_FRIENDS_MESSAGE_THEME = "You are were removed from friends";
-
-	private static final String YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE = "You are were removed from friends of ";
-
-	private static final long serialVersionUID = 6027103521084558931L;
-
-	@In
-	private User user;
-	
-	@In(create=true, required=true)
-	private IAlbumAction albumAction;
-	
-	@In(create=true, required=true)
-	private RatingBinder ratingBinder;
-	
-	@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) @Out
-	private SelectionHelper selectionHelper;
-	
-	@In(create=true)
-	FileManager fileManager;
-	
-	@In(create=true)  @Out(required=false)
-	private Image selectedImage;
-
-	@In(create=true)  @Out
-	private Album selectedAlbum;
-	
-	@In(create=true) TreeSelectionManager treeSelectionManager;
-	
-	@In(create=true) @Out TreeRootItem treeRoot;
-	
-	private String selectedAlbumName;
-	
-	public String getSelectedAlbumName() {
-		return selectedAlbumName;
-	}
-
-	public void setSelectedAlbumName(String selectedAlbumName) {
-		this.selectedAlbumName = selectedAlbumName;
-	}
-
-	public void addAlbum(){
-		albumAction.addAlbum(album);
-		treeRoot.getAvailableAlbums().add(new SelectItem(album.getName()));
-		TreeAlbumItem albumItem = new TreeAlbumItem(album.getId(), treeRoot, album);
-		treeRoot.addAlbumToTree(albumItem);
-		fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + album.getName());
-		selectedImage = null;
-		selectedAlbum = albumItem.getAlbum();
-		
-	}
-
-	public List<String> availableUserLogins(Object suggest){
-		List<String> suggestions = userAction.getUsers((String)suggest);
-		return suggestions;
-	}
-
-	public void editAlbum(Album album){
-		boolean nameChanged = !album.getName().equals(album.getChangedName());
-		if(nameChanged){
-			String directoryOld = user.getLogin() + fileManager.getFileSeparator() + album.getName();
-			String directoryNew = user.getLogin() + fileManager.getFileSeparator() + album.getChangedName();
-			try {
-				fileManager.renameDirectory(directoryOld, directoryNew);
-			} catch (Exception e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			album.setName(album.getChangedName());
-			album.setChangedName(null);
-		}
-		albumAction.editAlbum(album);
-		treeRoot.updateChild(album);
-		
-	}
-
-	public void deleteAlbum(Album album){
-		String albumName = album.getName();
-		albumAction.deleteAlbum(album);
-		SelectItem item = treeRoot.getSelectItemByName(album.getName());
-		treeRoot.getAvailableAlbums().remove(item);
-		treeRoot.removeChild(album.getId());
-		fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
-		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);
-		if(selectedAlbum.getImages().size() > index){
-			selectedImage = selectedAlbum.getImages().get(index);
-		}else{
-			selectedImage = selectedAlbum.getImages().get(index-1);
-		}
-	}
-
-	public void editImage(Image image){
-		TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
-		boolean parentChanged = !parent.getAlbum().getName().equals(image.getAlbumName());
-		imageAction.editImage(image, parentChanged);
-		
-		if(parentChanged){
-			parent.removeChild(image.getId());
-			TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
-			TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
-			albumItem.addChild(image.getId(), imageItem);
-			String fileNameOld = user.getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath();
-			String fileNameNew = user.getLogin() + fileManager.getFileSeparator() + image.getAlbumName() + fileManager.getFileSeparator() + image.getPath();
-			fileManager.renameImage(fileNameOld, fileNameNew);
-			selectedImage = imageItem.getImage();
-			selectedAlbum = albumItem.getAlbum();
-		}else{
-			TreeImageItem imageItem = (TreeImageItem)parent.getChild(image.getId());
-			imageItem.setImage(image);
-		}	
-	}
-
-	@Observer("addImage")
-	public void addImage(Image image) {
-		imageAction.addImage(image);
-		TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
-		TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
-		albumItem.addChild(image.getId(), imageItem);
-		selectedImage = imageItem.getImage();
-		selectedAlbum = albumItem.getAlbum();
-	}
-
-	public void editComment(Comment comment) {
-		imageAction.editComment(comment);
-	}
-
-	public void addComment(Comment comment) {
-		imageAction.addComment(comment);
-	}
-
-	public void addAutoComment(Image image) {
-		Comment comment = new Comment();
-		comment.setAuthor(user);
-		comment.setDate(new Date());
-		comment.setImage(image);
-		comment.setMessage("+1");
-		imageAction.addComment(comment);
-	}
-
-	public void sendMessage(Message message) {
-		messageAction.sendMessage(message);
-	}
-
-	public Long getCountUnreadedMessages() {
-		Long count = userAction.countNotReadedMessages(user);
-		return count!= null? count:0;
-	}
-
-	public void removeFromFriends(User owner, User removed){
-		userAction.removeFromFriends(owner, removed);
-		Message message = new Message();
-		message.setAuthor(user);
-		message.setDate(new Date());
-		message.setOwner(removed);
-		message.setFriendshipRequest(false);
-		message.setReaded(false);
-		message.setMessage(YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE+ user.getLogin());
-		message.setTheme(REMOVED_FROM_FRIENDS_MESSAGE_THEME);
-		messageAction.sendMessage(message);
-	}
-
-	public void addToFriends(User friend){
-		FriendshipRequest request = friend.getFriendshipRequest(user, friend);
-		if(request != null){
-			if(!userAction.friendExist(user, friend)){
-				userAction.addFriend(user, friend, request);
-				Message message = new Message();
-				message.setAuthor(user);
-				message.setDate(new Date());
-				message.setOwner(friend);
-				message.setFriendshipRequest(false);
-				message.setReaded(false);
-				message.setMessage(ADDED_TO_FRIENDS_MESSAGE+ user.getLogin());
-				message.setTheme(ADDED_TO_FRIENDS_MESSAGE_THEME);
-				messageAction.sendMessage(message);
-			}	
-		}/*else{
-			throw new Exception("This user won't be your friend!");
-		}*/
-	}
-
-	public void addToSharedAlbums(Image image){
-		userAction.addSharedAlbum(image.getAlbum());
-	}
-	
-
-	public void removeFromSharedAlbums(Album album){
-		userAction.removeFromSharedAlbums(user, album);
-	}
-
-	public void vote(Image image){
-		imageAction.vote(image, (Long)Long.valueOf(ratingBinder.getInputSlider().getValue().toString()));
-	}
-
-	public void showSharedAlbum(Image image){
-		NavigationEnum mainArea = NavigationEnum.IMAGE_PREVIEW;
-		treeSelectionManager.setMainArea(mainArea);
-		selectedAlbum = image.getAlbum();
-		selectedImage = selectedAlbum.getImages().get(0);
-		selectionHelper.setSelectedImageIndex(1);
-		selectionHelper.setUserAlbumSelected(false);
-	}
-	
-
-	public void updateSelectedAlbum(){
-		selectedAlbum = user.getAlbumByName(this.getSelectedAlbumName());
-		selectedImage = selectedAlbum.getImages().get(0);
-		selectionHelper.setSelectedImageIndex(1);
-		selectionHelper.setUserAlbumSelected(true);
-	}
-}

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -22,8 +22,6 @@
 
 import java.util.Iterator;
 
-import javax.faces.component.UIGraphic;
-
 import org.richfaces.model.TreeNode;
 import org.richfaces.realworld.domain.Image;
 
@@ -34,15 +32,12 @@
 	private long id;
 	private Image image;
 	
-	private UIGraphic uiImage;
 	private TreeAlbumItem album;
 
 	public TreeImageItem(long id, TreeAlbumItem album, Image image) {
 		this.id = id;
 		this.album = album;
 		this.image = image;
-		this.uiImage = new UIGraphic();
-		this.uiImage.setUrl(image.getPath());
 	}
 	
 	public void addChild(Object identifier, TreeNode child) {
@@ -95,13 +90,5 @@
 	public void setImage(Image image) {
 		this.image = image;
 	}
-
-	public UIGraphic getUiImage() {
-		return uiImage;
-	}
-
-	public void setUiImage(UIGraphic uiImage) {
-		this.uiImage = uiImage;
-	}
 	
 }

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -52,6 +52,7 @@
 import org.richfaces.realworld.domain.Album;
 import org.richfaces.realworld.domain.Image;
 import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.manager.ImageManager;
 import org.richfaces.realworld.navigation.NavigationEnum;
 import org.richfaces.realworld.util.SelectionHelper;
 
@@ -60,9 +61,9 @@
 @Synchronized(timeout=200000)
 public class TreeSelectionManager implements Serializable{
 
-	private static final String DATASCROLLER_ID = "mainform:sc1";
+	private static final String DATASCROLLER_ID = "mainform:imageScroller";
 
-	private static final String IMAGE_DATATABLE_ID = "mainform:imageList";
+	private static final String IMAGE_DATATABLE_ID = "mainform:mainImage";
 
 	private static final String FIRST = "first";
 
@@ -76,12 +77,6 @@
 	
 	private NavigationEnum mainArea;
 	
-	@In(required=false)  @Out(required=false)
-	private Image selectedImage;
-
-	@In(required=false)  @Out(required=false)
-	private Album selectedAlbum;
-	
 	@In(required=false) @Out(required=false)
 	private SelectionHelper selectionHelper;
 	
@@ -89,16 +84,16 @@
 	FileManager fileManager;
 	
 	@In(required=false)
-	TreeActionManager treeActionManager;
+	ImageManager imageManager;
 
 	private String nodeTitle;
 
 	public void showFileUpload(TreeAlbumItem item){
-		selectedAlbum = item.getAlbum();
+		selectionHelper.setSelectedAlbum(item.getAlbum());
 		if(item.isLeaf()){
-			selectedImage=null;
+			selectionHelper.setSelectedImage(null);
 		}else{
-			selectedImage = ((TreeImageItem)(item.getImages().get(0))).getImage();
+			selectionHelper.setSelectedImage(((TreeImageItem)(item.getImages().get(0))).getImage());
 		}
 		this.setMainArea(NavigationEnum.FILE_UPLOAD);
 	}
@@ -109,27 +104,27 @@
     }
 
 	public void scrollerListener(DataScrollerEvent event) {
-		List<Image> images = selectedAlbum.getImages();
+		List<Image> images = selectionHelper.getSelectedAlbum().getImages();
 		if (event.getNewScrolVal().equals(PREVIOUS)) {
 			for(int index = 0 ; index < images.size(); index++){
-				if(images.get(index) == selectedImage){
-					selectedImage = images.get(index - 1);
+				if(images.get(index) == selectionHelper.getSelectedImage()){
+					selectionHelper.setSelectedImage(images.get(index - 1));
 					selectionHelper.setSelectedImageIndex(index);
 				}
 			}
 		} else if (event.getNewScrolVal().equals(LAST)) {
-			selectedImage = images.get(images.size() - 1);
+			selectionHelper.setSelectedImage(images.get(images.size() - 1));
 			selectionHelper.setSelectedImageIndex(images.size());
 		} else if (event.getNewScrolVal().equals(NEXT)) {
 			for(int index = 0 ; index < images.size(); index++){
-				if(images.get(index) == selectedImage){
-						selectedImage = images.get(index + 1);
+				if(images.get(index) == selectionHelper.getSelectedImage()){
+					selectionHelper.setSelectedImage(images.get(index + 1));
 						selectionHelper.setSelectedImageIndex(index + 2);
 						return;
 				}
 			}
 		} else if (event.getNewScrolVal().equals(FIRST)) {
-			selectedImage = images.get(0);
+			selectionHelper.setSelectedImage(images.get(0));
 			selectionHelper.setSelectedImageIndex(1);
 		}
 
@@ -194,7 +189,7 @@
 		ac.addRenderedArea(IMAGE_DATATABLE_ID);
 		Image draggedImage = ((TreeImageItem)draggedNode).getImage();
 		draggedImage.setAlbumName(((TreeAlbumItem)droppedInNode).getAlbum().getName());
-		treeActionManager.editImage(draggedImage);
+		imageManager.editImage(draggedImage);
 		// Add destination tree to reRender
 		try {
 		    ac.addComponentToAjaxRender(destTree);
@@ -224,9 +219,9 @@
 		TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
 		if (treeNode instanceof TreeAlbumItem) {
 			TreeAlbumItem currentNode = (TreeAlbumItem) treeNode;
-			return currentNode.getAlbum() == selectedAlbum;
+			return currentNode.getAlbum() == selectionHelper.getSelectedAlbum();
 		} else if (treeNode instanceof TreeImageItem) {
-			return ((TreeImageItem) treeNode).getImage() == selectedImage;
+			return ((TreeImageItem) treeNode).getImage() == selectionHelper.getSelectedImage();
 		}
 		return null;
 	}
@@ -236,7 +231,7 @@
 		TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
 		if (treeNode instanceof TreeAlbumItem) {
 			TreeAlbumItem currentNode = (TreeAlbumItem) treeNode;
-			return currentNode.getAlbum() == selectedAlbum;
+			return currentNode.getAlbum() == selectionHelper.getSelectedAlbum();
 		}
 		return null;
 	}
@@ -252,12 +247,13 @@
 					.getName();
 		}
 		TreeNode<String> currentNode = tree.getModelTreeNode(tree.getRowKey());
+		selectionHelper.setUserAlbumSelected(true);
 		if(currentNode instanceof TreeImageItem){
 				Image image = ((TreeImageItem)currentNode).getImage();
-				selectedImage = image;
+				selectionHelper.setSelectedImage(image);
 				Album album = ((TreeAlbumItem)currentNode.getParent()).getAlbum();
-				if(album != selectedAlbum){
-					selectedAlbum = album;
+				if(album != selectionHelper.getSelectedAlbum()){
+					selectionHelper.setSelectedAlbum(album);
 				}
 				int index = album.getIndex(image);
 				setDataScrollerIndex(index);
@@ -266,19 +262,18 @@
 			TreeAlbumItem node = (TreeAlbumItem)currentNode;
 			setDataScrollerIndex(0);
 			if (node.isLeaf()) {
-				selectedImage = null;
+				selectionHelper.setSelectedImage(null);
 				Album album = node.getAlbum();
-				selectedAlbum = album;
+				selectionHelper.setSelectedAlbum(album);
 			}else{
-				if(node.getAlbum() == selectedAlbum){
+				if(node.getAlbum() == selectionHelper.getSelectedAlbum()){
 					return;
 				}else{
-					selectedAlbum = node.getAlbum();
-						selectedImage = node.getAlbum().getImages().get(0);
+					selectionHelper.setSelectedAlbum(node.getAlbum());
+					selectionHelper.setSelectedImage(node.getAlbum().getImages().get(0));
 				}		
 			}
 		}
-		selectionHelper.setUserAlbumSelected(true);
 		}
 		catch(Exception e){
 			//Bla-bla-bla
@@ -298,11 +293,11 @@
 	}
 	
 	public void incrementSlideshowIndex() {
-		int index = selectedAlbum.getIndex(selectedImage);
-		if(selectedAlbum.getImages().size() == index +1){
+		int index = selectionHelper.getSelectedAlbum().getIndex(selectionHelper.getSelectedImage());
+		if(selectionHelper.getSelectedAlbum().getImages().size() == index +1){
 			index = -1;
 		}
-		selectedImage = selectedAlbum.getImages().get(index +1);
+		selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(index +1));
 		UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
 		UIDatascroller scroller = (UIDatascroller)component.findComponent(DATASCROLLER_ID);
 		Map<String, Object> attributes = scroller.getDataTable().getAttributes();
@@ -327,16 +322,16 @@
 	}
 	
 	public SelectItem[] getAvailableIndexOfImages(){
-		SelectItem[] group = new SelectItem[selectedAlbum.getImages().size()];
-		for(int i = 0; i < selectedAlbum.getImages().size(); i++){
+		SelectItem[] group = new SelectItem[selectionHelper.getSelectedAlbum().getImages().size()];
+		for(int i = 0; i < selectionHelper.getSelectedAlbum().getImages().size(); i++){
 			group[i] = new SelectItem(i+1);
 		}
 		return group;
 	}
 	
 	public void updateSelectedItems(Image image){
-		selectedImage = image;
-		Integer index = selectedAlbum.getIndex(selectedImage);
+		selectionHelper.setSelectedImage(image);
+		Integer index = selectionHelper.getSelectedAlbum().getIndex(selectionHelper.getSelectedImage());
 		setDataScrollerIndex(index);
 	}
 }

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
 package org.richfaces.realworld.util;
 
 import java.io.Serializable;
@@ -10,7 +30,7 @@
 import org.jboss.seam.annotations.Out;
 import org.jboss.seam.annotations.Scope;
 import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.AlbumManager;
 
 @Name("albumPopupHelper")
 @Scope(ScopeType.CONVERSATION)
@@ -26,7 +46,7 @@
 	private Album album;
 	
 	@In(create=true, required=true)
-	private TreeActionManager treeActionManager;
+	private AlbumManager albumManager;
 	
 	public void initAlbumData( String actionName, String caption, Album album){
 		this.caption = caption;
@@ -39,7 +59,7 @@
 	}
 	
 	public void editAlbum(ActionEvent event){
-		treeActionManager.editAlbum(this.album);
+		albumManager.editAlbum(this.album);
 	}
 	
 	public String getCaption() {
@@ -59,6 +79,6 @@
 	}
 
 	public void addAlbum(ActionEvent event){
-		treeActionManager.addAlbum();
+		albumManager.addAlbum();
 	}
 }

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
 package org.richfaces.realworld.util;
 
 import java.io.Serializable;
@@ -13,7 +33,7 @@
 import org.richfaces.realworld.domain.Comment;
 import org.richfaces.realworld.domain.Image;
 import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.ImageManager;
 
 @Name("commentPopupHelper")
 @Scope(ScopeType.CONVERSATION)
@@ -32,7 +52,7 @@
 	private User user; 
 	
 	@In(create=true, required=true)
-	private TreeActionManager treeActionManager;
+	private ImageManager imageManager;
 	
 	public String getCaption() {
 		return caption;
@@ -64,10 +84,10 @@
 	}
 	
 	public void editComment(ActionEvent event){
-		treeActionManager.editComment(this.comment);
+		imageManager.editComment(this.comment);
 	}
 	
 	public void addComment(ActionEvent event){
-		treeActionManager.addComment(this.comment);
+		imageManager.addComment(this.comment);
 	}
 }

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
 package org.richfaces.realworld.util;
 
 import java.io.Serializable;
@@ -12,7 +32,8 @@
 import org.richfaces.realworld.domain.Album;
 import org.richfaces.realworld.domain.Image;
 import org.richfaces.realworld.domain.MetaTag;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.AlbumManager;
+import org.richfaces.realworld.manager.ImageManager;
 
 @Name("confirmationPopupHelper")
 @Scope(ScopeType.CONVERSATION)
@@ -24,15 +45,18 @@
 	
 	private String actionName;
 	
-	@In(required=true)
+	@In(create=true, required=true)
 	private Image image;
 	
-	@In(required=true)
+	@In(create=true, required=true)
 	private Album album;
 	
-	@In(required=true)
-	private TreeActionManager treeActionManager;
+	@In(create=true, required=true)
+	private AlbumManager albumManager;
 	
+	@In(create=true, required=true)
+	private ImageManager imageManager;
+	
 	public void initImagePopup( String actionName, String caption, Image image){
 		this.caption = caption;
 		this.actionName = actionName;
@@ -55,7 +79,7 @@
 	}
 	
 	public void deleteAlbum(ActionEvent event){
-		treeActionManager.deleteAlbum(this.album);
+		albumManager.deleteAlbum(this.album);
 	}
 	
 	public String getCaption() {
@@ -75,7 +99,7 @@
 	}
 	
 	public void deleteImage(ActionEvent event){
-		treeActionManager.deleteImage(this.image);
+		imageManager.deleteImage(this.image);
 	}
 	
 }

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -28,7 +28,6 @@
 import org.jboss.seam.annotations.Out;
 import org.jboss.seam.annotations.Scope;
 import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
 import org.richfaces.realworld.domain.User;
 
 @Name("friendHelper")
@@ -36,12 +35,6 @@
 public class FriendHelper implements Serializable{
 	
 	private static final long serialVersionUID = 4735350615108906608L;
-
-	@In(required=false) @Out(required=false)
-	private Image selectedImage;
-
-	@In(required=false)  @Out(required=false)
-	private Album selectedAlbum;
 	
 	@In(required=false) @Out(required=false)
 	private SelectionHelper selectionHelper;
@@ -50,15 +43,15 @@
 	ComboboxHelper comboboxHelper;
 	
 	public void chooseAlbum(User friend){
-		selectedAlbum = friend.getAlbumByName(comboboxHelper.getAlbumName());
-		selectedImage = selectedAlbum.getImages().get(0);
+		selectionHelper.setSelectedAlbum(friend.getAlbumByName(comboboxHelper.getAlbumName()));
+		selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
 		selectionHelper.setSelectedImageIndex(1);
 		selectionHelper.setUserAlbumSelected(false);
 	}
 	
 	public void chooseAlbum(Album album){
-		selectedAlbum = album;
-		selectedImage = selectedAlbum.getImages().get(0);
+		selectionHelper.setSelectedAlbum(album);
+		selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
 		selectionHelper.setSelectedImageIndex(1);
 		selectionHelper.setUserAlbumSelected(false);
 	}

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
 package org.richfaces.realworld.util;
 
 import java.io.Serializable;
@@ -12,7 +32,7 @@
 import org.jboss.seam.annotations.Scope;
 import org.richfaces.realworld.domain.Image;
 import org.richfaces.realworld.domain.MetaTag;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.ImageManager;
 
 @Name("imagePopupHelper")
 @Scope(ScopeType.CONVERSATION)
@@ -24,7 +44,7 @@
 	private Image image;
 	
 	@In(create=true, required=true)
-	private TreeActionManager treeActionManager;
+	private ImageManager imageManager;
 	
 	public void initImagePopup(Image image){
 		if(null != image){
@@ -36,6 +56,6 @@
 	}
 	
 	public void editImage(ActionEvent event){
-		treeActionManager.editImage(this.image);
+		imageManager.editImage(this.image);
 	}
 }

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -21,7 +21,6 @@
 package org.richfaces.realworld.util;
 
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.Date;
 
 import javax.faces.event.ActionEvent;
@@ -31,24 +30,16 @@
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Out;
 import org.jboss.seam.annotations.Scope;
-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.MetaTag;
 import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.UserManager;
 
- at Name("modalPanelHelper")
+ at Name("messagePanelHelper")
 @Scope(ScopeType.CONVERSATION)
 public class MessagePanelHelper implements Serializable{
 
 	private static final long serialVersionUID = 2561824019376412988L;
-
-	private String caption;
 	
-	private String actionName;
-	
 	private boolean sendRequired;
 	
 	private boolean searchRequired = false;
@@ -59,27 +50,10 @@
 	@Out(required=false)
 	private Message message;
 	
-	@In(create=true, required=true)
-	private TreeActionManager treeActionManager;
-
-	public String getCaption() {
-		return caption;
-	}
-
-	public void setCaption(String caption) {
-		this.caption = caption;
-	}
-
-	public String getActionName() {
-		return actionName;
-	}
-
-	public void setActionName(String actionName) {
-		this.actionName = actionName;
-	}
+	@In(create=true, required=true) @Out
+	private UserManager userManager;
 	
-	public void initModalPanelData( String actionName, boolean sendRequired, Message message){
-		this.actionName = actionName;
+	public void initReMessage(boolean sendRequired, Message message){
 		this.sendRequired = sendRequired;
 		this.message = new Message();
 		this.message.setTheme("Re:" + message.getTheme());
@@ -89,8 +63,7 @@
 		this.searchRequired = false;
 	}
 	
-	public void initMessage( String actionName, boolean sendRequired, Message message, boolean userSearchRequired){
-		this.actionName = actionName;
+	public void initMessage(boolean sendRequired, Message message, boolean userSearchRequired){
 		this.sendRequired = sendRequired;
 		this.searchRequired = userSearchRequired;
 		this.message = new Message();
@@ -103,10 +76,10 @@
 		this.message = message;
 		this.message.setReaded(true);
 		this.searchRequired = false;
+		userManager.setCountUnreadedMessages(null);
 	}
 	
-	public void initModalPanelData( String actionName, boolean sendRequired, User owner){
-		this.actionName = actionName;
+	public void initMessage(boolean sendRequired, User owner){
 		this.sendRequired = sendRequired;
 		this.message = new Message();
 		this.message.setAuthor(user);
@@ -115,8 +88,7 @@
 		this.searchRequired = false;
 	}
 	
-	public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message){
-		this.actionName = actionName;
+	public void initMessage(boolean sendRequired, User owner, String theme, String message){
 		this.sendRequired = sendRequired;
 		this.message = new Message();
 		this.message.setAuthor(user);
@@ -127,8 +99,7 @@
 		this.searchRequired = false;
 	}
 	
-	public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message, boolean friendshipRequest){
-		this.actionName = actionName;
+	public void initMessage(boolean sendRequired, User owner, String theme, String message, boolean friendshipRequest){
 		this.sendRequired = sendRequired;
 		this.message = new Message();
 		this.message.setAuthor(user);
@@ -142,7 +113,7 @@
 	
 	public void sendMessage(ActionEvent event){
 		this.message.setDate(new Date());
-		treeActionManager.sendMessage(this.message);
+		userManager.sendMessage(this.message);
 	}
 
 	public boolean isSendRequired() {

Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java	2008-12-24 12:17:19 UTC (rev 12005)
@@ -25,14 +25,21 @@
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
 
 @Name("selectionHelper")
 @Scope(ScopeType.CONVERSATION)
 public class SelectionHelper implements Serializable{
 
 	private static final long serialVersionUID = 5656562187249324512L;
+	
 	private Integer selectedImageIndex = 1;
 	
+	private Image selectedImage;
+
+	private Album selectedAlbum;
+	
 	private boolean userAlbumSelected = true;
 
 	public boolean isUserAlbumSelected() {
@@ -50,4 +57,20 @@
 	public void setSelectedImageIndex(Integer selectedImageIndex) {
 		this.selectedImageIndex = selectedImageIndex;
 	}
+
+	public Image getSelectedImage() {
+		return selectedImage;
+	}
+
+	public void setSelectedImage(Image selectedImage) {
+		this.selectedImage = selectedImage;
+	}
+
+	public Album getSelectedAlbum() {
+		return selectedAlbum;
+	}
+
+	public void setSelectedAlbum(Album selectedAlbum) {
+		this.selectedAlbum = selectedAlbum;
+	}
 }

Modified: trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld/web/src/main/resources/messages_en.properties	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/resources/messages_en.properties	2008-12-24 12:17:19 UTC (rev 12005)
@@ -90,7 +90,8 @@
 
 error=Error
 errorStub=Something bad happened :-(
-fileUpload.header=You will upload files in album: #{selectedAlbum.name}. If you want upload in another album, select it.
+
+fileUpload.header=You will upload files in album: #{selectionHelper.selectedAlbum.name}. If you want upload in another album, select it.
 fileUpload.header2=Choose album:
 fileUpload.uploadedPanelHeader=Uploaded Files Info
 fileUpload.fileNameLabel=File Name:
@@ -101,4 +102,155 @@
 fileUpload.clearLabel=Clear Uploaded Data
 fileUpload.clearSelectedLabel=Clear Selected
 
-image.panelHeader=Image Preview\: Selected Album\: \#{selectedAlbum.name}
\ No newline at end of file
+comment.label=View comments(#{selectionHelper.selectedImage.comments.size})
+comment.author=Author: #{record.author.login}
+comment.askForFriend=Ask for friendship
+comment.askForFriend.message=Please, add me to your friends
+comment.date=Date: #{record.date}
+comment.delete=Delete comment
+comment.edit=Edit Comment
+comment.noComments=No Comments for this image
+comment.add=Add comment
+comment.save=Save
+comment.cancel=Cancel
+
+message.sendMessage=Send message
+message.sendToUser=Send message for this user
+message.readed=Mark as read
+message.authorHeader=Author
+message.themeHeader=Theme
+message.dateHeader=Date
+message.theme=Theme: #{record.theme}
+message.author=Author: 
+message.date=Date: #{record.date}
+message.delete=Delete
+message.read=Read
+message.re=Re:
+message.message=Message
+message.owner=Owner: 
+message.content=Content: 
+message.addFriend=Add to friends
+message.friendRequest=It is request for friendship message. You may add this user to your friends by clicking on the 'Add to Friends button'
+message.send=Send
+message.close=Close
+message.theme=Theme: 
+
+confirm.confirm=Confirmation:
+confirm.ok=OK
+confirm.cancel=Cancel
+
+shared.delete=Delete From shared
+
+album.edit=Edit
+album.delete=Delete
+album.delete.confirm=Are you sure? All images associated with this album will also dropped! Click OK to proceed, else click Cancel.
+album.add=Add album
+album.edit.long=Edit Album:
+album.addImages=Add images
+album.name=Name:
+album.shared=Shared:
+album.owner=Owner:
+album.desc=Short description:
+album.store=Store
+album.cancel=Cancel
+
+scroller.first=First
+scroller.last=Last
+scroller.prev=Prev
+scroller.next=Next
+scroller.pager.begin=Image 
+scroller.pager.end=of  #{selectionHelper.selectedAlbum.images.size}
+
+image.rating=Current Rating: #{record.rank.rating}
+image.numberVotes=Number of votes: #{record.rank.hits}
+image.vote=Vote for this picture
+image.vote.short=Vote
+image.panelHeader=Image Preview: Selected Album: #{selectionHelper.selectedAlbum.name}
+image.delete=Delete
+image.delete.confirm=Are you sure?  Click OK to proceed, else click Cancel.
+image.edit=Edit Properties
+image.prop=Image Properties:
+image.name=Name:
+image.desc=Short Description:
+image.album=Album
+image.date=Created Date:
+image.meta=Image Meta-information:
+image.store=Store
+image.cancel=Cancel
+
+slideshow.start=Start Slideshow
+slideshow.stop=Stop slideshow
+slideshow.interval=Interval in sec
+
+index.header=Welcome!
+
+login.header=Please login here
+login.login=Login
+login.userName=Username
+login.password=Password
+login.register=Register
+login.anonymous=Anonymous
+
+friends.delete=Delete from friends
+friends.choose=Choose album for preview:
+
+search.advanced=Advanced search:
+search.rank=Rank:
+search.numberVotes=Number of votes:
+search.date=Date created
+search.addShared=Add to shared Albums
+search.preview=Preview
+search.search=Search
+search.popular=Popular Images
+search.unpopular=UnPopular Images
+search.nofound=No images found
+
+user.loginPrefs=Login Preferences
+user.registration=Registration
+user.reginfo=Registration Info:
+user.firstname=First name
+user.secondname=Second Name
+user.login=Login
+user.password=Password
+user.email=Email
+user.birthdate=Birth Date
+user.avatar=Avatar
+user.userPrefs=User preferences
+user.save=Save
+user.reset=Reset
+user.confirm=Confirm Password
+user.avatar.info=Uploaded File Info
+user.avatar.name=File Name:
+user.avatar.length=File Length(bytes):
+user.register=Register
+user.cancel=Cancel
+user.exist=User with this login already exist;
+user.confirm.error=Confirm Password not equals password
+
+menu.welcome=Welcome, #{identity.username}!
+menu.welcome.guest=Welcome, guest! If you want access to full version of application, please register or login.
+menu.message.tooltip=You have #{userManager.countUnreadedMessages} not-readed messages
+menu.messages=Read Messages
+menu.search=Search
+menu.image=Image Preview
+menu.user=User Prefs
+menu.file=File Upload
+menu.logout=Logout
+menu.login=Login
+
+realworld=RealWorld Demo application
+panel.albumHeader=Album Management
+panel.my=My albums
+panel.friend=Friend Albums
+panel.shared=Shared albums
+
+samplename=Sample Name
+sampledesc=Sample Description
+addedtofriends=You are were added to friends
+addedtofriendsby=You are were added to friends by User 
+removedfromfriends=You are were removed from friends
+removedfromfriendsby=You are were removed from friends of 
+equals=Equals
+more=More
+less=Less
+nomatter=No Matter
\ No newline at end of file

Deleted: 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-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml	2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE facelet-taglib PUBLIC
-  "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
-  "facelet-taglib_1_0.dtd">
-<facelet-taglib>
-   <namespace>http://richfaces.org/richx</namespace>
-	<tag>
-	   <tag-name>albumModalPanel</tag-name>
-	   <source>templates/albumModalPanel.xhtml</source>
-	</tag>
-	<tag>
-	   <tag-name>confirm</tag-name>
-	   <source>templates/confirmation.xhtml</source>
-	</tag>
-	<tag>
-	   <tag-name>imagePrefs</tag-name>
-	   <source>templates/imagePrefs.xhtml</source>
-	</tag>
-	<tag>
-	   <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

Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/addComment.xhtml
===================================================================
(Binary files differ)

Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
===================================================================
(Binary files differ)

Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
===================================================================
(Binary files differ)

Deleted: 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/WEB-INF/tags/templates/message.xhtml
===================================================================
(Binary files differ)

Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml	2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml	2008-12-24 12:17:19 UTC (rev 12005)
@@ -32,7 +32,7 @@
     <context-param>
    <param-name>facelets.LIBRARIES</param-name>
    <param-value>
-	/WEB-INF/tags/albumModalPanel-taglib.xml
+	/WEB-INF/tags/realWorld-taglib.xml
    </param-value>
 	</context-param>
  

Deleted: trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
===================================================================
(Binary files differ)

Deleted: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)

Added: trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
===================================================================
(Binary files differ)


Property changes on: trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
___________________________________________________________________
Name: svn:mime-type
   + application/xhtml+xml

Modified: trunk/test-applications/realworld/web/src/main/webapp/index.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/layout/template.xhtml
===================================================================
(Binary files differ)

Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)

Deleted: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)

Deleted: 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)

Deleted: trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
===================================================================
(Binary files differ)

Deleted: trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
===================================================================
(Binary files differ)

Deleted: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
===================================================================
(Binary files differ)




More information about the richfaces-svn-commits mailing list