Author: amarkhel
Date: 2009-01-29 12:47:57 -0500 (Thu, 29 Jan 2009)
New Revision: 12501
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchParamHolder.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/index/login.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/template2.xhtml
Log:
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-01-29
17:24:46 UTC (rev 12500)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-01-29
17:47:57 UTC (rev 12501)
@@ -173,6 +173,9 @@
public void showFileUpload(boolean result) {
this.setFileUploadRendered(result);
clearUploadData();
+ setFileQuantity(Constants.MULTY_MODE_FILE_QUANTITY);
+ setImmediateUpload(false);
+ setSelectedMode("multy");
}
public void changeMode() {
@@ -207,6 +210,7 @@
@Observer(Constants.CHANGE_MODE_FILE_UPLOAD_EVENT)
public void setSelectedMode(String selectedMode) {
this.selectedMode = selectedMode;
+ changeMode();
}
private Image constructImage(UploadItem item, FileItem file) {
@@ -278,6 +282,8 @@
if (exifDirectory.containsTag(ExifDirectory.TAG_MODEL)) {
String cameraModel = exifDirectory.getString(ExifDirectory.TAG_MODEL);
image.setCameraModel(cameraModel);
+ }else{
+ image.setCameraModel("");
}
}
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-01-29
17:24:46 UTC (rev 12500)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-01-29
17:47:57 UTC (rev 12501)
@@ -25,6 +25,7 @@
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.security.auth.login.LoginException;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.End;
@@ -38,6 +39,7 @@
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Credentials;
import org.jboss.seam.security.Identity;
+import org.jboss.seam.web.Session;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.navigation.NavigationEnum;
@@ -112,10 +114,32 @@
return Constants.INDEX_OUTCOME;
}
+ public String logout(){
+ identity.logout();
+ identity.unAuthenticate();
+ credentials.clear();
+ credentials.invalidate();
+ Session.instance().invalidate();
+ return "logout";
+ }
+
+ public String goToRegister(){
+ identity.logout();
+ identity.unAuthenticate();
+ credentials.clear();
+ credentials.invalidate();
+ return "register";
+ }
+
public String loginAnonymous(){
credentials.setUsername(null);
credentials.setPassword(null);
- this.authenticate();
+ try {
+ identity.authenticate();
+ } catch (LoginException e) {
+ facesMessages.add(INVALID_LOGIN_OR_PASSWORD);
+ return "";
+ }
return Constants.MAIN_OUTCOME;
}
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchParamHolder.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchParamHolder.java 2009-01-29
17:24:46 UTC (rev 12500)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchParamHolder.java 2009-01-29
17:47:57 UTC (rev 12501)
@@ -81,11 +81,11 @@
}
public String getSearchPattern() {
- return searchPattern;
+ return searchPattern != null? searchPattern:"";
}
public void setSearchPattern(String searchPattern) {
- this.searchPattern = searchPattern;
+ this.searchPattern = searchPattern!=null?searchPattern:"";
}
public Long getSpinnerChoice() {
@@ -129,11 +129,11 @@
}
public String getCamera() {
- return camera;
+ return camera != null? camera:"";
}
public void setCamera(String camera) {
- this.camera = camera;
+ this.camera = camera!=null?camera:"";
}
public int getHeight() {
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2009-01-29
17:24:46 UTC (rev 12500)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2009-01-29
17:47:57 UTC (rev 12501)
@@ -25,13 +25,22 @@
<page view-id="/index.xhtml"
action="#{conversation.begin}">
- <navigation>
- <rule if="#{identity.loggedIn}">
+ <navigation from-action="#{identity.login}">
+ <rule if="#{identity.loggedIn and
identity.hasRole('admin')}">
<redirect view-id="/main.xhtml"/>
</rule>
</navigation>
</page>
+
+ <page view-id="/main.xhtml" login-required="true">
+ <navigation from-action="#{authenticator.logout}">
+ <rule if-outcome="logout">
+ <end-conversation />
+ <redirect view-id="/index.xhtml" />
+ </rule>
+ </navigation>
+ </page>
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
Modified:
trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld/web/src/main/webapp/includes/index/login.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/template2.xhtml
===================================================================
(Binary files differ)
Show replies by date