[richfaces-svn-commits] JBoss Rich Faces SVN: r13522 - in trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld: service and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Apr 13 07:54:10 EDT 2009


Author: amarkhel
Date: 2009-04-13 07:54:10 -0400 (Mon, 13 Apr 2009)
New Revision: 13522

Modified:
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IShelfAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/RealworldException.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java
   trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
Log:


Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -81,9 +81,7 @@
     @NamedQuery(
             name = "tag-suggest",
             query = "select m from MetaTag m where lower(m.tag) like :tag"
-    )
-        }
-)
+    )})
 /**
  * Class for representing Image Entity
  *  EJB3 Entity Bean
@@ -94,7 +92,7 @@
 @Entity
 @Name("image")
 @Table(name = "Images", uniqueConstraints = {
-		@UniqueConstraint(columnNames = "path"),
+		@UniqueConstraint(columnNames = "path")
 		})
 @Scope(ScopeType.CONVERSATION)
 @AutoCreate
@@ -185,22 +183,47 @@
 		this.showMetaInfo = showMetaInfo;
 	}
 
-	public Long getId() {
+    /**
+     * Getter for property id
+     *
+     * @return id of image
+     */
+    public Long getId() {
         return id;
     }
 
+    /**
+     * Getter for property name
+     *
+     * @return name of image
+     */
     public String getName() {
         return name;
     }
 
+    /**
+     * Setter for property name
+     *
+     * @param name - name of image
+     */
     public void setName(String name) {
         this.name = name;
     }
 
+    /**
+     * Getter for property description
+     *
+     * @return description of image
+     */
     public String getDescription() {
         return description;
     }
 
+    /**
+     * Setter for property description
+     *
+     * @param description - description of image
+     */
     public void setDescription(String description) {
         this.description = description;
     }
@@ -217,18 +240,38 @@
         return path;
     }
 
+    /**
+     * Setter for property path
+     *
+     * @param path - relative path to image
+     */
     public void setPath(String path) {
         this.path = path;
     }
 
+    /**
+     * Getter for property created
+     *
+     * @return date of creation of this image
+     */
     public Date getCreated() {
         return created;
     }
 
+    /**
+     * Setter for property created
+     *
+     * @param created - date of creation
+     */
     public void setCreated(Date created) {
         this.created = created;
     }
 
+    /**
+     * Getter for property album
+     *
+     * @return containing album
+     */
     public Album getAlbum() {
         return album;
     }
@@ -261,6 +304,8 @@
     }
 
     /**
+     * Setter for property meta
+     *
      * @param meta - string representation of metatags, associated to image. Used at jsf page.
      */
     public void setMeta(String meta) {
@@ -268,7 +313,8 @@
     }
 
     /**
-     *
+     * Getter for property meta 
+     * 
      * @return string representation of metatags, associated to image. Used at jsf page.
      */
     public String getMetaString(){
@@ -276,6 +322,7 @@
     }
     
     /**
+     * Getter for property cameraModel
      *
      * @return model of camera
      */
@@ -284,6 +331,7 @@
     }
 
     /**
+     * setter for property cameraModel
      *
      * @param cameraModel- model of camera
      */
@@ -292,6 +340,7 @@
     }
 
     /**
+     * Getter for property height
      *
      * @return height of image
      */
@@ -300,6 +349,7 @@
     }
 
     /**
+     * setter for property height
      *
      * @param height - height of image
      */
@@ -308,6 +358,7 @@
     }
 
     /**
+     * Getter for property size
      *
      * @return size of image in KB
      */
@@ -316,6 +367,7 @@
     }
 
     /**
+     * setter for property size
      *
      * @param size - size of image in KB
      */
@@ -324,6 +376,7 @@
     }
 
     /**
+     * Getter for property width
      *
      * @return width of image
      */
@@ -332,6 +385,7 @@
     }
 
     /**
+     * setter for property width
      *
      * @param width - width of image
      */
@@ -340,6 +394,7 @@
     }
 
     /**
+     * Getter for property uploaded
      *
      * @return date of upload to site of this image
      */
@@ -348,6 +403,7 @@
     }
 
     /**
+     * setter for property uploaded
      *
      * @param uploaded - date of upload
      */
@@ -388,6 +444,7 @@
     }
     
     /**
+     * Getter for property visited
      *
      * @return boolean value, that indicated is user visit this image already
      */
@@ -396,6 +453,7 @@
 	}
 
     /**
+     * Setter for property visited
      *
      * @param visited - boolean value, that indicated is user visit this image already
      */
@@ -404,6 +462,7 @@
 	}
 	
 	/**
+     * Determine if this image should be marked as new(on jsf page, for example in tree)
      *
      * @return boolean value, that indicated is this image should be marked as new
      */
@@ -416,6 +475,11 @@
     
     //---------------------------Business methods
 
+    /**
+     * Add comment to this image.
+     *
+     * @param comment - comment to add
+     */
     public void addComment(Comment comment) {
         if (comment == null) {
             throw new IllegalArgumentException("Null comment!");
@@ -424,6 +488,11 @@
         comments.add(comment);
     }
 
+    /**
+     * Remove comment from list of comments, belongs to that image.
+     *
+     * @param comment - comment to delete
+     */
     public void removeComment(Comment comment) {
         if (comment == null) {
             throw new IllegalArgumentException("Null comment");
@@ -436,6 +505,11 @@
         }
     }
 
+    /**
+     * Add metatag to this image.
+     *
+     * @param metatag - metatag to add
+     */
     public void addMetaTag(MetaTag metatag) {
         if (metatag == null) {
             throw new IllegalArgumentException("Null metatag!");
@@ -446,6 +520,11 @@
         }
     }
 
+    /**
+     * Remove metatag from list of metatag, associated to that image.
+     *
+     * @param metatag - metatag to delete
+     */
     public void removeMetaTag(MetaTag metatag) {
         if (metatag == null) {
             throw new IllegalArgumentException("Null metatag!");

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -48,8 +48,9 @@
 	/**
      * Persist album entity to database
      * @param album - album to add
+	 * @throws RealworldException 
      */
-	public void addAlbum(Album album) {
+	public void addAlbum(Album album) throws RealworldException {
 		try{
 		em.persist(album);
 		//Add to shelf
@@ -64,8 +65,9 @@
 	/**
      * Remove album entity from database
      * @param album - album to delete
+	 * @throws RealworldException 
      */
-	public void deleteAlbum(Album album){
+	public void deleteAlbum(Album album) throws RealworldException{
 		try{
 		if(album.getShelf() == null){
 			return;
@@ -83,8 +85,9 @@
 	/**
      * Synchronize state of album entity with database
      * @param album - album to Synchronize
+	 * @throws RealworldException 
      */
-	public void editAlbum(Album album){
+	public void editAlbum(Album album) throws RealworldException{
 		try{
 		em.flush();
 		}

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -36,10 +36,10 @@
 @Local
 public interface IAlbumAction {
 
-	void addAlbum(Album album);
+	void addAlbum(Album album) throws RealworldException;
 	
-	void deleteAlbum(Album album);
+	void deleteAlbum(Album album) throws RealworldException;
 	
-	void editAlbum(Album album);
+	void editAlbum(Album album) throws RealworldException;
 
 }
\ No newline at end of file

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -37,15 +37,15 @@
 @Local
 public interface IImageAction {
 
-	public void deleteImage(Image image);
+	public void deleteImage(Image image) throws RealworldException;
 
-	public void editImage(Image image, boolean metatagsChanged);
+	public void editImage(Image image, boolean metatagsChanged) throws RealworldException;
 
-	public void addImage(Image image);
+	public void addImage(Image image) throws RealworldException;
 	
-	public void deleteComment(Comment comment);
+	public void deleteComment(Comment comment) throws RealworldException;
 	
-	public void addComment(Comment comment);
+	public void addComment(Comment comment) throws RealworldException;
 
 	public MetaTag getTagByName(String tag);
 

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IShelfAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IShelfAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IShelfAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -37,11 +37,11 @@
 @Local
 public interface IShelfAction {
 
-	void addShelf(Shelf shelf);
-
-	void deleteShelf(Shelf shelf);
-
-	void editShelf(Shelf shelf);
-
+	void addShelf(Shelf shelf) throws RealworldException;
+	
+	void deleteShelf(Shelf shelf) throws RealworldException;
+	
+	void editShelf(Shelf shelf) throws RealworldException;
+	
 	List<Shelf> getShelfs(User user);
 }

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -33,7 +33,7 @@
 @Local
 public interface IUserAction {
 	public User login(String username, String password);
-	public void register(User user);
-	public boolean isUserExist(String login);
-	public User updateUser();
+	public void register(User user) throws RealworldException;
+	public boolean isUserExist(String login) ;
+	public User updateUser() throws RealworldException;
 }
\ No newline at end of file

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -52,8 +52,9 @@
     /**
      * Remove image entity from database
      * @param image - image to delete
+     * @throws RealworldException 
      */
-    public void deleteImage(Image image) {
+    public void deleteImage(Image image) throws RealworldException {
     	try{
     	if(image.getAlbum().getCoveringImage().equals(image)){
     		image.getAlbum().setCoveringImage(null);
@@ -71,8 +72,9 @@
      * Synchronize state of image entity with database
      * @param image - image to Synchronize
      * @param metatagsChanged - boolean value, that indicates is metatags of this image were changed(add new or delete older)
+     * @throws RealworldException 
      */
-    public void editImage(Image image, boolean metatagsChanged) {
+    public void editImage(Image image, boolean metatagsChanged) throws RealworldException {
     	try{
     	if(metatagsChanged){
     		//Create cash of metatags early associated with image
@@ -131,8 +133,9 @@
     /**
      * Persist image entity to database
      * @param image - image to add
+     * @throws RealworldException 
      */
-    public void addImage(Image image) {
+    public void addImage(Image image) throws RealworldException {
     	try{
     		 em.persist(image);
     	     image.getAlbum().addImage(image);
@@ -146,8 +149,9 @@
     /**
      * Remove comment from image
      * @param comment - comment to remove
+     * @throws RealworldException 
      */
-    public void deleteComment(Comment comment) {
+    public void deleteComment(Comment comment) throws RealworldException {
     	try{
     		comment.getImage().removeComment(comment);
     		em.flush();
@@ -160,8 +164,9 @@
     /**
      * Add comment from image
      * @param comment - comment to add
+     * @throws RealworldException 
      */
-    public void addComment(Comment comment) {
+    public void addComment(Comment comment) throws RealworldException {
     	try{
     		comment.getImage().addComment(comment);
     		em.flush();

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/RealworldException.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/RealworldException.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/RealworldException.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -1,9 +1,10 @@
 package org.richfaces.realworld.service;
 
-import org.jboss.seam.annotations.ApplicationException;
+import javax.ejb.ApplicationException;
 
+
 @ApplicationException(rollback=false)
-public class RealworldException extends RuntimeException {
+public class RealworldException extends Exception {
 	
 	 public RealworldException()
 	   {

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -54,8 +54,9 @@
 	/**
      * Persist shelf entity to database
      * @param shelf - shelf to add
+	 * @throws RealworldException 
      */
-	public void addShelf(Shelf shelf) {
+	public void addShelf(Shelf shelf) throws RealworldException {
 		try{
 		em.persist(shelf);
 		//Add reference to user
@@ -70,8 +71,9 @@
 	/**
      * Remove shelf entity from database
      * @param shelf - shelf to delete
+	 * @throws RealworldException 
      */
-	public void deleteShelf(Shelf shelf) {
+	public void deleteShelf(Shelf shelf) throws RealworldException {
 		//Remove reference from user
 		try{
 		user.removeShelf(shelf);
@@ -86,8 +88,9 @@
 	/**
      * Synchronize state of shelf entity with database
      * @param shelf - shelf to Synchronize
+	 * @throws RealworldException 
      */
-	public void editShelf(Shelf shelf) {
+	public void editShelf(Shelf shelf) throws RealworldException {
 		try{
 		em.flush();
 		}

Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java	2009-04-13 11:29:41 UTC (rev 13521)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java	2009-04-13 11:54:10 UTC (rev 13522)
@@ -61,8 +61,9 @@
 	/**
      * Persist user entity to database
      * @param user - user to register
+	 * @throws RealworldException 
      */
-	public void register(User user) {
+	public void register(User user) throws RealworldException {
 		try{
 		em.persist(user);
 		em.flush();
@@ -75,8 +76,9 @@
 	/**
      * Synchronize state of user entity with database
      * @return user if success
+	 * @throws RealworldException 
      */
-	public User updateUser() {
+	public User updateUser() throws RealworldException {
 		try{
 		em.flush();
 		}




More information about the richfaces-svn-commits mailing list