Author: amarkhel
Date: 2009-04-17 09:38:22 -0400 (Fri, 17 Apr 2009)
New Revision: 13635
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/menu.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/tree.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/publicShelves.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/shelfResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelvesList.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelves.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
Log:
Fix bugs
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-04-17
13:38:22 UTC (rev 13635)
@@ -68,15 +68,14 @@
}
Contexts.getConversationContext().set(Constants.ALBUM_VARIABLE, null);
Events.instance().raiseEvent(Constants.ALBUM_ADDED_EVENT, album);
- Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
@Restrict("#{s:hasRole('admin')}")
public void createAlbum(Shelf shelf){
Album album = new Album();
if(shelf == null){
- if(user.getShelfs().size() > 0){
- shelf = user.getShelfs().get(0);
+ if(user.getShelves().size() > 0){
+ shelf = user.getShelves().get(0);
}
if(shelf == null){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_SHELF_ERROR);
@@ -108,7 +107,6 @@
return;
}
Events.instance().raiseEvent(Constants.ALBUM_DELETED_EVENT, album, pathToDelete);
- Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
public boolean isValidationSuccess() {
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-17
13:38:22 UTC (rev 13635)
@@ -85,9 +85,9 @@
}
}
- public String login(){
+ public void login(){
if(identity.hasRole(Constants.ADMIN_ROLE)){
- return null;
+ return;
}
String password = credentials.getPassword();
String username = credentials.getUsername();
@@ -105,7 +105,6 @@
facesMessages.add(Constants.INVALID_LOGIN_OR_PASSWORD);
FacesContext.getCurrentInstance().renderResponse();
}
- return Constants.MAIN_OUTCOME;
}
@End
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-04-17
13:38:22 UTC (rev 13635)
@@ -123,7 +123,7 @@
public void cancelEditUser(){
pushEvent(Constants.CANCEL_EDIT_USER_EVENT);
- model.resetModel(NavigationEnum.ALL_SHELFS, user, model.getSelectedShelf(),
model.getSelectedAlbum(), model.getSelectedImage(), model.getImages());
+ model.resetModel(NavigationEnum.ANONYM, user, null, null, null, null);
}
public void cancelEditImage(){
@@ -194,14 +194,14 @@
}
public void showFileUpload(){
- if(!(user.getShelfs().size() > 0)){
+ if(!(user.getShelves().size() > 0)){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_UPLOAD_SHOW_ERROR);
return;
}
Album a = model.getSelectedAlbum();
if(model.getSelectedAlbum() == null){
- if(model.getSelectedUser() != null &&
model.getSelectedUser().getShelfs().size() > 0 &&
model.getSelectedUser().getShelfs().get(0).getAlbums().size() > 0)
- a = model.getSelectedUser().getShelfs().get(0).getAlbums().get(0);
+ if(model.getSelectedUser() != null &&
model.getSelectedUser().getShelves().size() > 0 &&
model.getSelectedUser().getShelves().get(0).getAlbums().size() > 0)
+ a = model.getSelectedUser().getShelves().get(0).getAlbums().get(0);
}
model.resetModel(NavigationEnum.FILE_UPLOAD, a.getOwner(), a.getShelf(), a,
model.getSelectedImage(), model.getImages());
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-04-17
13:38:22 UTC (rev 13635)
@@ -20,6 +20,10 @@
*/
package org.richfaces.realworld.manager;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.security.Restrict;
@@ -73,7 +77,7 @@
return;
}
Events.instance().raiseEvent(Constants.ALBUM_DRAGGED_EVENT, dragValue, pathOld);
- Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
+ addTreeToRerender();
}
private void handleImage(Image dragValue, Album dropValue) {
@@ -89,5 +93,17 @@
return;
}
Events.instance().raiseEvent(Constants.IMAGE_DRAGGED_EVENT, dragValue, pathOld);
+ addTreeToRerender();
}
+
+ private void addTreeToRerender() {
+ try {
+ FacesContext fc = FacesContext.getCurrentInstance();
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ UIComponent destTree = fc.getViewRoot().findComponent(Constants.TREE_ID);
+ ac.addComponentToAjaxRender(destTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
}
+}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-04-17
13:38:22 UTC (rev 13635)
@@ -46,7 +46,7 @@
private boolean validationSuccess = false;
- private List<Shelf> shelfs;
+ private List<Shelf> shelves;
@In IShelfAction shelfAction;
@@ -68,11 +68,10 @@
return;
}
Events.instance().raiseEvent(Constants.SHELF_ADDED_EVENT, shelf);
- Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
public List<Shelf> getAvailableShelfs(User user) {
- return user.getShelfs();
+ return user.getShelves();
}
@Restrict("#{s:hasRole('admin')}")
@@ -96,19 +95,17 @@
return;
}
Events.instance().raiseEvent(Constants.SHELF_DELETED_EVENT, shelf,
pathToDelete);
- Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
- public List<Shelf> getShelfs() {
- if (shelfs == null) {
- shelfs = shelfAction.getShelfs(user);
+ public List<Shelf> getPredefinedShelves() {
+ if (shelves == null) {
+ shelves = shelfAction.getPredefinedShelves(user);
}
- return shelfs;
+ return shelves;
}
-
- @Observer(Constants.CLEAR_TREE_EVENT)
- public void clearShelfs() {
- shelfs = null;
+
+ public List<Shelf> getUserShelves(){
+ return user.getShelves();
}
public boolean isValidationSuccess() {
Modified:
trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
===================================================================
---
trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-04-17
13:38:22 UTC (rev 13635)
@@ -213,7 +213,7 @@
show_albums=Show albums
author=Author
close=Close
-myAlbumShelfs=My album shelfs
+myAlbumShelfs=My album shelves
newPhotos=New photos
created.shelf=Created
created.album=Created
@@ -261,7 +261,7 @@
all_new_images=All new images
in_album=in album
-public_shelfs=Public Shelfs
+public_shelves=Public Shelves
all_images=All images
related_to_tag=related to tag
my_all_albums=My all albums
@@ -270,7 +270,7 @@
all_shared_albums=All shared albums
of_user=of user
all_shared_images=All shared images
-my_album_shelfs=My album shelfs
+my_album_shelves=My album shelves
cancel=Cancel
save=Save
add_album=Add album
Modified:
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
===================================================================
---
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-04-17
13:38:22 UTC (rev 13635)
@@ -183,13 +183,13 @@
all_new_images=\u0412\u0441\u0435 \u043D\u043E\u0432\u044B\u0435
\u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F
in_album=\u0432 \u0430\u043B\u044C\u0431\u043E\u043C\u0435
-public_shelfs=\u041E\u0442\u043A\u0440\u044B\u0442\u044B\u0435
\u043F\u043E\u043B\u043A\u0438
+public_shelves=\u041E\u0442\u043A\u0440\u044B\u0442\u044B\u0435
\u043F\u043E\u043B\u043A\u0438
all_images=\u0432\u0441\u0435
\u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F
my_all_albums=\u0412\u0441\u0435 \u043C\u043E\u0438
\u0430\u043B\u044C\u0431\u043E\u043C\u044B
my_all_photos=\u0412\u0441\u0435 \u043C\u043E\u0438
\u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438
all_shared_albums=\u0412\u0441\u0435
\u043E\u0431\u0449\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435
\u0430\u043B\u044C\u0431\u043E\u043C\u044B
all_shared_images=\u0412\u0441\u0435
\u043E\u0431\u0449\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435
\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438
-my_album_shelfs=\u041C\u043E\u0438 \u043F\u043E\u043B\u043A\u0438
\u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
+my_album_shelves=\u041C\u043E\u0438 \u043F\u043E\u043B\u043A\u0438
\u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
cancel=\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C
save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
add_album=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C
\u0430\u043B\u044C\u0431\u043E\u043C
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-04-17
13:38:02 UTC (rev 13634)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-04-17
13:38:22 UTC (rev 13635)
@@ -8,9 +8,6 @@
<rule if-outcome="register">
<redirect view-id="/register.xhtml"/>
</rule>
- <rule if-outcome="main">
- <redirect view-id="/index.xhtml"/>
- </rule>
<rule if-outcome="index">
<redirect view-id="/index.html"/>
</rule>
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/menu.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/tree.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/publicShelves.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/shelfResult.xhtml
===================================================================
---
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/shelfResult.xhtml 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/shelfResult.xhtml 2009-04-17
13:38:22 UTC (rev 13635)
@@ -6,7 +6,7 @@
xmlns:rich="http://richfaces.org/rich">
<a4j:outputPanel rendered="#{result.size() > 0}">
<ui:decorate template="/includes/shelf/shelvesList.xhtml">
- <ui:param name="shelfs" value="#{result}" />
+ <ui:param name="shelves" value="#{result}" />
<ui:define name="header" />
</ui:decorate>
</a4j:outputPanel>
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelvesList.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelves.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
===================================================================
---
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-04-17
13:38:02 UTC (rev 13634)
+++
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-04-17
13:38:22 UTC (rev 13635)
@@ -313,48 +313,6 @@
top: 40px;
}
-.tag-cloud-rank1 {
- text-decoration: none;
- font-size: 8px;
- color: gray;
-}
-
-.tag-cloud-rank2 {
- text-decoration: none;
- font-size: 9px;
- color: yellow;
-}
-
-.tag-cloud-rank3 {
- text-decoration: none;
- font-size: 10px;
- color: blue;
-}
-
-.tag-cloud-rank4 {
- text-decoration: none;
- font-size: 11px;
- color: green;
-}
-
-.tag-cloud-rank5 {
- text-decoration: none;
- font-size: 12px;
- color: brown;
-}
-
-.tag-cloud-rank6 {
- text-decoration: none;
- font-size: 14px;
- color: red;
-}
-
-.tag-cloud-rank7 {
- text-decoration: none;
- font-size: 18px;
- color: black;
-}
-
a{color : #DF6400;}
h1{font-size : 175%; font-weight : normal; margin : 0px;}
.h1-style{