Author: amarkhel
Date: 2009-05-05 12:29:24 -0400 (Tue, 05 May 2009)
New Revision: 14022
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java
trunk/examples/photoalbum/source/web/src/main/resources/messages_en.properties
trunk/examples/photoalbum/source/web/src/main/webapp/includes/album/createAlbum.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageEditInfo.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/index/menu.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/confirmation.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/search.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/shelf/createShelf.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
Log:
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java 2009-05-05
16:29:24 UTC (rev 14022)
@@ -125,6 +125,7 @@
albumAction.editAlbum(album);
}catch(Exception e){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.ALBUM_SAVING_ERROR);
+ albumAction.resetAlbum(album);
return;
}
//Reset 'album' component in conversation scope
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-05-05
16:29:24 UTC (rev 14022)
@@ -287,6 +287,14 @@
return image.isOwner(user);
}
+ public boolean isUserHaveShelves(){
+ return user.getShelves().size() > 0 ;
+ }
+
+ public boolean isUserHaveAlbums(){
+ return user.getAlbums().size() > 0 ;
+ }
+
public boolean isUserShelf(Shelf shelf){
return shelf != null && shelf.isOwner(user);
}
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java 2009-05-05
16:29:24 UTC (rev 14022)
@@ -85,6 +85,7 @@
imageAction.editImage(image, metatagsChanged);
}catch(Exception e){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.IMAGE_SAVING_ERROR);
+ imageAction.resetImage(image);
return;
}
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT,
NavigationEnum.ALBUM_IMAGE_PREVIEW);
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java 2009-05-05
16:29:24 UTC (rev 14022)
@@ -98,6 +98,7 @@
shelfAction.editShelf(shelf);
}catch(Exception e){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.SHELF_SAVING_ERROR);
+ shelfAction.resetShelf(shelf);
return;
}
Events.instance().raiseEvent(Constants.SHELF_EDITED_EVENT, shelf);
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java 2009-05-05
16:29:24 UTC (rev 14022)
@@ -1,5 +1,7 @@
package org.richfaces.photoalbum.util;
+import java.util.List;
+
import javax.persistence.EntityManager;
import org.jboss.seam.ScopeType;
@@ -11,8 +13,10 @@
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.core.Events;
+import org.richfaces.photoalbum.domain.Comment;
import org.richfaces.photoalbum.domain.User;
import org.richfaces.photoalbum.service.Constants;
+import org.richfaces.photoalbum.service.IImageAction;
@Scope(ScopeType.SESSION)
@Name("sessionListener")
@@ -21,12 +25,18 @@
@In(required=false) User user;
+ @In IImageAction imageAction;
+
@In(value="entityManager") EntityManager em;
@Destroy @Transactional @Observer("org.jboss.seam.sessionExpired")
public void onDestroy(){
if(user.getId() != null && !user.isPreDefined()){
user = em.merge(user);
+ List<Comment> userComments = imageAction.findAllUserComments(user);
+ for(Comment c : userComments){
+ em.remove(c);
+ }
em.remove(user);
em.flush();
Events.instance().raiseEvent(Constants.USER_DELETED_EVENT, user);
Modified: trunk/examples/photoalbum/source/web/src/main/resources/messages_en.properties
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/resources/messages_en.properties 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/resources/messages_en.properties 2009-05-05
16:29:24 UTC (rev 14022)
@@ -260,7 +260,7 @@
search_criteria=Search criteria:
keywords=Keywords:
user_profile_=User profile
-
+message_authorHeader=Author
all_new_images=All new images
in_album=in album
public_shelves=Pre-defined Shelves
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/album/createAlbum.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageEditInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml 2009-05-05
14:38:33 UTC (rev 14021)
+++
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml 2009-05-05
16:29:24 UTC (rev 14022)
@@ -8,7 +8,7 @@
<div><rich:inputNumberSlider enableManualInput="false"
value="#{imageSizeHelper.value}" minValue="80"
maxValue="200"
showArrows="false" showBoundaryValues="true"
showInput="false"
- step="40">
+ step="40" width="100">
<a4j:support event="onchange" reRender="userAlbumImages" />
</rich:inputNumberSlider></div>
</ui:composition>
\ No newline at end of file
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/index/menu.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/confirmation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/search.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/shelf/createShelf.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
===================================================================
(Binary files differ)
Show replies by date