Author: amarkhel
Date: 2009-04-23 11:43:46 -0400 (Thu, 23 Apr 2009)
New Revision: 13801
Modified:
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
trunk/examples/photoalbum/web/src/main/resources/messages_en.properties
trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageInfo.xhtml
Log:
Modified:
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java
===================================================================
---
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java 2009-04-23
14:39:22 UTC (rev 13800)
+++
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java 2009-04-23
15:43:46 UTC (rev 13801)
@@ -126,7 +126,7 @@
public void goToRegister(){
Contexts.getSessionContext().set("user", new User());
- Contexts.getConversationContext().set("avatarUpload", null);
+ Contexts.getConversationContext().set("avatarData", null);
setLoginFailed(false);
Events.instance().raiseEvent(Constants.START_REGISTER_EVENT);
}
Modified:
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
===================================================================
---
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-04-23
14:39:22 UTC (rev 13800)
+++
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-04-23
15:43:46 UTC (rev 13801)
@@ -202,15 +202,27 @@
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().getShelves().size() > 0 &&
model.getSelectedUser().getShelves().get(0).getAlbums().size() > 0)
- a = model.getSelectedUser().getShelves().get(0).getAlbums().get(0);
+ Album alb = null;
+ if(isUserAlbum(model.getSelectedAlbum())){
+ alb = model.getSelectedAlbum();
}
- model.resetModel(NavigationEnum.FILE_UPLOAD, a.getOwner(), a.getShelf(), a,
model.getSelectedImage(), model.getImages());
+ if(alb == null){
+ if(user != null && user.getShelves().size() > 0 &&
user.getShelves().get(0).getAlbums().size() > 0)
+ for(Shelf s : user.getShelves()){
+ if(s.getAlbums().size() > 0){
+ alb = s.getAlbums().get(0);
+ break;
+ }
+ }
+ }
+ model.resetModel(NavigationEnum.FILE_UPLOAD, user, alb.getShelf(), alb, null,
alb.getImages());
}
public void showFileUpload(Album album){
+ if(!isUserAlbum(album)){
+ showError(Constants.YOU_CAN_T_ADD_IMAGES_TO_THAT_ALBUM_ERROR);
+ return;
+ }
model.resetModel(NavigationEnum.FILE_UPLOAD, album.getShelf().getOwner(),
album.getShelf(), album, null, album.getImages());
}
@@ -224,6 +236,7 @@
public void showUser(User user){
model.resetModel(NavigationEnum.USER_PREFS, user, null, null, null, null);
+ Contexts.getConversationContext().set("avatarData", null);
}
public void showUnvisitedImages(Shelf shelf){
Modified: trunk/examples/photoalbum/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/examples/photoalbum/web/src/main/resources/messages_en.properties 2009-04-23
14:39:22 UTC (rev 13800)
+++ trunk/examples/photoalbum/web/src/main/resources/messages_en.properties 2009-04-23
15:43:46 UTC (rev 13801)
@@ -243,11 +243,11 @@
popular_tags=Popular tags
direct_link=Direct link
use_this_photo_like_current_album_cover=Use this image like current album cover
-allow_commennts=Allow commennts
+allow_commennts=Allow comments
terms_and_conditions=Terms And Conditions
privacy_statement=Privacy Statement
error_occurred=Error occurred
-error_occured_during_request=Error occured during request:
+error_occured_during_request=Error occur during request:
how_it_works=How it works?
no_results_found=No results found
options=Options
Modified: trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml 2009-04-23 14:39:22 UTC
(rev 13800)
+++ trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml 2009-04-23 15:43:46 UTC
(rev 13801)
@@ -4,8 +4,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
-
-
<listener>
<listener-class>
org.jboss.seam.servlet.SeamListener
@@ -15,18 +13,6 @@
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>Seam Filter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-<!-- Ajax4jsf -->
- <filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
@@ -38,8 +24,8 @@
</filter>
<filter-mapping>
- <filter-name>ajax4jsf</filter-name>
- <url-pattern>*.seam</url-pattern>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
@@ -79,11 +65,6 @@
<param-value>.xhtml</param-value>
</context-param>
- <context-param>
- <param-name>storeStrategy</param-name>
- <param-value>database</param-value>
- </context-param>
-
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/tags/photoalbum-taglib.xml</param-value>
@@ -124,4 +105,4 @@
<auth-constraint />
</security-constraint>
-</web-app>
+</web-app>
\ No newline at end of file
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)