Author: amarkhel
Date: 2009-05-05 04:19:49 -0400 (Tue, 05 May 2009)
New Revision: 14016
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/ShelfManager.java
Log:
Fix RF-7008
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
00:24:43 UTC (rev 14015)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java 2009-05-05
08:19:49 UTC (rev 14016)
@@ -71,6 +71,11 @@
Contexts.getConversationContext().set(Constants.ALBUM_VARIABLE, album);
return;
}
+ //Album name must be unique in shelf
+ if(user.hasAlbumWithName(album.getName())){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.SAME_ALBUM_EXIST_ERROR);
+ return;
+ }
//All data is valid
validationSuccess = true;
try{
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
00:24:43 UTC (rev 14015)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java 2009-05-05
08:19:49 UTC (rev 14016)
@@ -73,6 +73,10 @@
*/
@Restrict("#{s:hasRole('admin')}")
public void addShelf(Shelf shelf) {
+ if(user.hasShelfWithName(shelf.getName())){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.SAME_SHELF_EXIST_ERROR);
+ return;
+ }
validationSuccess = true;
try{
shelfAction.addShelf(shelf);
Show replies by date