[richfaces-svn-commits] JBoss Rich Faces SVN: r14393 - in branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum: service and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu May 28 09:03:11 EDT 2009


Author: amarkhel
Date: 2009-05-28 09:03:11 -0400 (Thu, 28 May 2009)
New Revision: 14393

Modified:
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/IUserAction.java
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/PhotoAlbumException.java
   branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/UserAction.java
Log:


Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -44,6 +44,8 @@
 import javax.persistence.OneToOne;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
 import java.io.File;
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -79,7 +81,10 @@
 
 	@OneToOne(fetch = FetchType.LAZY)
 	private Image coveringImage;
-
+	
+	@Transient
+	private boolean showAfterCreate;
+	
 	@Temporal(TemporalType.DATE)
 	private Date created;
 
@@ -307,4 +312,12 @@
 	public String toString() {
 		return "{id : "+getId()+", name : "+getName()+"}";
 	}
+
+	public boolean isShowAfterCreate() {
+		return showAfterCreate;
+	}
+
+	public void setShowAfterCreate(boolean showAfterCreate) {
+		this.showAfterCreate = showAfterCreate;
+	}
 }
\ No newline at end of file

Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
 package org.richfaces.photoalbum.domain;
 
 import java.io.File;

Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -234,10 +234,6 @@
 		return shelves;
 	}
 
-	public void setShelves(List<Shelf> shelves) {
-		this.shelves = shelves;
-	}
-
 	public Sex getSex() {
 		return sex;
 	}

Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -29,6 +29,7 @@
 public class Constants {
 
 	//Events
+	public static final String CHECK_USER_EXPIRED_EVENT = "checkUserExpiredEvent";
 	public static final String ADD_ERROR_EVENT = "addErrorEvent";
 	public static final String ALBUM_DELETED_EVENT = "albumDeleted";
 	public static final String ALBUM_EDITED_EVENT = "albumEdited";
@@ -159,19 +160,19 @@
 	public static final String TAG_BY_NAME_QUERY = "tag-byName";
 	public static final String SEARCH_SHELF_SHARED_ADDON = " and sh.shared=true";
 	public static final String SEARCH_SHELF_MY_ADDON = " and sh.owner.login=:login";
-	public static final String SEARCH_SHELF_BOTH_ADDON = " and sh.shared=true or sh.owner.login=:login";
+	public static final String SEARCH_SHELF_BOTH_ADDON = " and (sh.shared=true or sh.owner.login=:login)";
 	public static final String SEARCH_SHELVES_QUERY = "from Shelf sh where (lower(sh.name) like :queryString or lower(sh.description) like :queryString) ";
 	public static final String SEARCH_METATAG_QUERY = "from MetaTag t where lower(t.tag) like :queryString";
 	public static final String SEARCH_USERS_QUERY = "select  u from User u where (lower(u.login) like :queryString or lower(u.firstName) like :queryString or lower(u.secondName) like :queryString) ";
 	public static final String SEARCH_IMAGE_SHARED_ADDON = " and i.album.shelf.shared=true";
 	public static final String SEARCH_IMAGE_MY_ADDON = " and i.album.shelf.owner.login=:login";
-	public static final String SEARCH_IMAGE_BOTH_ADDON = "  and i.album.shelf.shared=true or i.album.shelf.owner.login=:login";
+	public static final String SEARCH_IMAGE_BOTH_ADDON = "  and (i.album.shelf.shared=true or i.album.shelf.owner.login=:login)";
 	public static final String SEARCH_IMAGE_QUERY = "from Image i where (lower(i.name) like :queryString or lower(i.description) like :queryString or lower(i.cameraModel) like :queryString) ";
 	public static final String SHARED_PARAMETER = "shared";
 	public static final String QUERY_PARAMETER = "queryString";
 	public static final String SEARCH_ALBUM_SHARED_ADDON = " and a.shelf.shared=true";
 	public static final String SEARCH_ALBUM_MY_ADDON = " and a.shelf.owner.login=:login";
-	public static final String SEARCH_ALBUM_BOTH_ADDON = " and a.shelf.shared=true or a.shelf.owner.login=:login";
+	public static final String SEARCH_ALBUM_BOTH_ADDON = " and (a.shelf.shared=true or a.shelf.owner.login=:login)";
 	public static final String SEARCH_ALBUM_QUERY = "from Album a where (lower(a.name) like :queryString or lower(a.description) like :queryString)";
 	public static final String USER_SHELVES_QUERY = "user-shelves";
 	public static final String SHELF_PARAMETER = "shelf";

Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/IUserAction.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/IUserAction.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/IUserAction.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -36,5 +36,6 @@
 	public void register(User user) throws PhotoAlbumException;
 	public boolean isUserExist(String login) ;
 	public User updateUser() throws PhotoAlbumException;
+	public User refreshUser();
 	public boolean isEmailExist(String email);
 }
\ No newline at end of file

Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/PhotoAlbumException.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/PhotoAlbumException.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/PhotoAlbumException.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
 package org.richfaces.photoalbum.service;
 
 import javax.ejb.ApplicationException;

Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/UserAction.java
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/UserAction.java	2009-05-28 12:48:06 UTC (rev 14392)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/java/org/richfaces/photoalbum/service/UserAction.java	2009-05-28 13:03:11 UTC (rev 14393)
@@ -89,6 +89,18 @@
 	}
 	
 	/**
+     * Refresh state of user entity with database
+     * @Param user - user to refresh
+     * @return user if success
+	 * @throws PhotoAlbumException
+     */
+	public User refreshUser(){
+		user = em.find(User.class, user.getId());
+		em.refresh(user);
+		return user;
+	}
+	
+	/**
      * Check if user with specified login already exist
      * @return is user with specified login already exist
      */




More information about the richfaces-svn-commits mailing list