Author: amarkhel
Date: 2009-04-10 09:37:47 -0400 (Fri, 10 Apr 2009)
New Revision: 13492
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
Removed:
trunk/test-applications/realworld2/web/src/main/webapp/includes/images.xhtml
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/Controller.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumEditInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/albumEdit.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageEditInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml
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/workArea.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbums.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/avatar.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
Log:
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-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -118,6 +118,7 @@
return Constants.INDEX_OUTCOME;
}
+ @End
public String goToIndex(){
return Constants.INDEX_OUTCOME;
}
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-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -70,8 +70,8 @@
model.resetModel(NavigationEnum.SHELF_EDIT, shelf.getOwner(), shelf, null, null,
null);
}
- public void cancelEditShelf(Shelf shelf){
- model.resetModel(NavigationEnum.SHELF_EDIT, shelf.getOwner(), shelf, null, null,
null);
+ public void cancelEditShelf(){
+ model.resetModel(NavigationEnum.SHELF_PREVIEW, model.getSelectedShelf().getOwner(),
model.getSelectedShelf(), null, null, null);
}
public void showAlbum(Album album){
@@ -82,6 +82,7 @@
FileManager fileManager =
(FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
if(!fileManager.isDirectoryPresent(album.getPath())){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.ALBUM_RECENTLY_DELETED_ERROR);
+ model.resetModel(NavigationEnum.SHELF_PREVIEW, album.getOwner(), album.getShelf(),
null, null, null);
return;
}
model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(),
album, null, album.getImages());
@@ -95,24 +96,13 @@
FileManager fileManager =
(FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
if(!fileManager.isFilePresent(image.getFullPath())){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
+ model.resetModel(NavigationEnum.ALBUM_PREVIEW, image.getAlbum().getOwner(),
image.getAlbum().getShelf(), image.getAlbum(), null, image.getAlbum().getImages());
return;
}
model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, image.getAlbum().getOwner(),
image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
image.getAlbum().visitImage(image, true);
}
- public void scroll(DataScrollerEvent e){
- Integer index = e.getPage();
- Image image = model.getSelectedAlbum().getImages().get(index - 1);
- FileManager fileManager =
(FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
- if(!fileManager.isFilePresent(image.getFullPath())){
- pushEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
- return;
- }
- model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, image.getAlbum().getOwner(),
image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
- image.getAlbum().visitImage(image, true);
- }
-
@Restrict("#{s:hasRole('admin')}")
public void startEditImage(Image image){
if(!canViewImage(image)){
@@ -133,14 +123,15 @@
model.resetModel(NavigationEnum.ALL_SHELFS, user, model.getSelectedShelf(),
model.getSelectedAlbum(), model.getSelectedImage(), model.getImages());
}
- public void cancelEditImage(Image image){
- model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,
image.getAlbum().getShelf().getOwner(), image.getAlbum().getShelf(), image.getAlbum(),
image, image.getAlbum().getImages() );
+ public void cancelEditImage(){
+ model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,
model.getSelectedImage().getAlbum().getShelf().getOwner(),
model.getSelectedImage().getAlbum().getShelf(), model.getSelectedImage().getAlbum(),
model.getSelectedImage(), model.getSelectedImage().getAlbum().getImages() );
}
public void showShelf(Shelf shelf){
FileManager fileManager =
(FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
if(!fileManager.isDirectoryPresent(shelf.getPath())){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.SHELF_RECENTLY_DELETED_ERROR);
+ model.resetModel(NavigationEnum.ANONYM, shelf.getOwner(), null, null, null, null);
return;
}
model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null, null,
null);
@@ -155,8 +146,8 @@
model.resetModel(NavigationEnum.ALBUM_EDIT, album.getShelf().getOwner(),
album.getShelf(), album, null, album.getImages());
}
- public void cancelEditAlbum(Album album){
- model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getShelf().getOwner(),
album.getShelf(), album, null, album.getImages());
+ public void cancelEditAlbum(){
+ model.resetModel(NavigationEnum.ALBUM_PREVIEW,
model.getSelectedAlbum().getShelf().getOwner(), model.getSelectedAlbum().getShelf(),
model.getSelectedAlbum(), null, model.getSelectedAlbum().getImages());
}
@Observer(Constants.ALBUM_ADDED_EVENT)
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -93,7 +93,7 @@
return;
}
fileWrapper.getFiles().add(image);
- Events.instance().raiseEvent(Constants.IMAGE_ADDED_EVENT);
+ Events.instance().raiseEvent(Constants.IMAGE_ADDED_EVENT, image);
item.getFile().delete();
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -31,7 +31,7 @@
ALL_SHELFS("/includes/userShelves.xhtml"),
TAGS("includes/tag.xhtml"),
ALL_ALBUMS("/includes/userAlbums.xhtml"),
- ALL_IMAGES("/includes/images.xhtml"),
+ ALL_IMAGES("/includes/userImages.xhtml"),
ALBUM_IMAGE_EDIT("/includes/imageEdit.xhtml"),
ALBUM_EDIT("/includes/albumEdit.xhtml"),
SHELF_EDIT("/includes/shelfEdit.xhtml"),
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -78,6 +78,7 @@
if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.IMAGE_RECENTLY_DELETED_ERROR);
active = false;
+ model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,
this.selectedImage.getAlbum().getOwner(), this.selectedImage.getAlbum().getShelf(),
this.selectedImage.getAlbum(), null, this.selectedImage.getAlbum().getImages());
return;
}
}
@@ -96,6 +97,7 @@
if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.IMAGE_RECENTLY_DELETED_ERROR);
active = false;
+ model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,
this.selectedImage.getAlbum().getOwner(), this.selectedImage.getAlbum().getShelf(),
this.selectedImage.getAlbum(), null, this.selectedImage.getAlbum().getImages());
return;
}
}
@@ -137,6 +139,7 @@
if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
Constants.IMAGE_RECENTLY_DELETED_ERROR);
active = false;
+ model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW,
this.selectedImage.getAlbum().getOwner(), this.selectedImage.getAlbum().getShelf(),
this.selectedImage.getAlbum(), null, this.selectedImage.getAlbum().getImages());
return;
}
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -53,13 +53,6 @@
@In(required=false, scope=ScopeType.CONVERSATION) @Out(required=false,
scope=ScopeType.CONVERSATION) File avatarData;
@In IUserAction userAction;
-
- public Long countImages() {
- if(null == user.getCountImages() ){
- user.setCountImages(userAction.countImages());
- }
- return user.getCountImages();
- }
public Long countSharedImages(User u) {
return userAction.countSharedImages(u);
@@ -69,13 +62,6 @@
return userAction.countSharedAlbums(u);
}
- public Long countAlbums() {
- if(null == user.getCountAlbums() ){
- user.setCountAlbums(userAction.countAlbums());
- }
- return user.getCountAlbums();
- }
-
public List<Album> getSharedAlbums(User user){
return userAction.getSharedAlbums(user);
}
@@ -108,27 +94,22 @@
}
@Observer(Constants.IMAGE_ADDED_EVENT)
- public void onImageAdded() {
- user.updateStatistics();
+ public void onImageAdded(Image image) {
+ user.addImage(image);
}
@Observer(Constants.IMAGE_DELETED_EVENT)
public void onImageDeleted(Image image, String path){
- user.updateStatistics();
+ user.removeImage(image);
}
@Observer(Constants.ALBUM_DELETED_EVENT)
public void onAlbumDeleted(Album album, String path){
- user.updateStatistics();
+ user.removeAlbum(album);
}
@Observer(Constants.ALBUM_ADDED_EVENT)
public void onAlbumAdded(Album album){
- user.updateStatistics();
+ user.addAlbum(album);
}
-
- @Observer(Constants.SHELF_DELETED_EVENT)
- public void onShelfDeleted(Shelf shelf, String path){
- user.updateStatistics();
- }
}
\ No newline at end of file
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java 2009-04-10
13:37:47 UTC (rev 13492)
@@ -77,7 +77,7 @@
}else{
String prefix = excludeFilePrefix(imageResource.getPath());
- paintImage(out, fileManager.transformPath(Constants.DEFAULT_PICTURE, prefix));
+ paintImage(out, fileManager.transformPath(Constants.DEFAULT_ORIGINAL_PICTURE,
prefix));
return;
}
}
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumEditInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/albumEdit.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageEditInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml
===================================================================
---
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml 2009-04-10
13:37:47 UTC (rev 13492)
@@ -20,7 +20,6 @@
<a4j:mediaOutput element="img"
createContent="#{imageLoader.paintImage}"
value="#{fileManager.transformPath(img.fullPath,
'_small80')}">
- <f:param value="#{imageSizeHelper.currentDimension.x}"
name="x" />
</a4j:mediaOutput>
<br />
</h:panelGroup>
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/images.xhtml
===================================================================
(Binary files differ)
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/workArea.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
===================================================================
---
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-10
13:37:27 UTC (rev 13491)
+++
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-10
13:37:47 UTC (rev 13492)
@@ -42,7 +42,7 @@
</td>
<td width="100%" valign="top" align="right"
colspan="2" style="padding : 10px;">
- <richx:commandButton id="cancelButton" value="Cancel"
style="float: left" immediate="true"
actionListener="#{controller.cancelEditShelf(shelf)}"
reRender="mainArea" />
+ <richx:commandButton id="cancelButton" value="Cancel"
style="float: left" immediate="true"
actionListener="#{controller.cancelEditShelf()}" reRender="mainArea"
/>
<richx:commandButton id="saveButton" value="Save"
actionListener="#{shelfManager.editShelf(shelf)}" reRender="mainArea"
/>
</td>
</tr>
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbums.xhtml
===================================================================
(Binary files differ)
Copied: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
(from rev 13477,
trunk/test-applications/realworld2/web/src/main/webapp/includes/images.xhtml)
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/avatar.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)