[jboss-cvs] jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay ...

Shane Bryzak sbryzak at redhat.com
Sat Mar 24 01:38:19 EDT 2007


  User: sbryzak2
  Date: 07/03/24 01:38:19

  Modified:    examples/seambay/src/org/jboss/seam/example/seambay    
                        Auction.java AuctionService.java
                        AuctionServiceRemote.java
  Added:       examples/seambay/src/org/jboss/seam/example/seambay    
                        CategoryAction.java
  Log:
  added a web service test page
  
  Revision  Changes    Path
  1.2       +12 -0     jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Auction.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Auction.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Auction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Auction.java	22 Mar 2007 15:02:47 -0000	1.1
  +++ Auction.java	24 Mar 2007 05:38:19 -0000	1.2
  @@ -1,6 +1,7 @@
   package org.jboss.seam.example.seambay;
   
   import java.io.Serializable;
  +import java.util.Date;
   
   import javax.persistence.Entity;
   import javax.persistence.Id;
  @@ -16,6 +17,7 @@
      private Category category;
      private String title;
      private String description;
  +   private Date endDate;
      
      @Id
      public Integer getAuctionId()
  @@ -69,4 +71,14 @@
      {
         this.description = description;
      }
  +   
  +   public Date getEndDate()
  +   {
  +      return endDate;
  +   }
  +   
  +   public void setEndDate(Date endDate)
  +   {
  +      this.endDate = endDate;
  +   }
   }
  
  
  
  1.2       +20 -0     jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionService.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AuctionService.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- AuctionService.java	22 Mar 2007 15:02:47 -0000	1.1
  +++ AuctionService.java	24 Mar 2007 05:38:19 -0000	1.2
  @@ -19,6 +19,26 @@
         search.setSearchTerm(searchTerm);
         search.queryAuctions();
         
  +      // TODO - trim the result somehow, or use DTOs.  We don't want to send user records
  +      // (including their passwords!!) here, nor do we want to send a huge object graph.
  +      
         return search.getResults().toArray(new Auction[search.getResults().size()]);
      }
  +   
  +   @WebMethod
  +   public Auction getAuctionDetails(Integer auctionId)
  +   {
  +      return null;
  +   }
  +   
  +   @WebMethod
  +   public Category[] listCategories()
  +   {
  +      CategoryAction catAction = (CategoryAction) Component.getInstance(
  +            CategoryAction.class, true);
  +      
  +      catAction.loadCategories();
  +      
  +      return catAction.getCategories().toArray(new Category[catAction.getCategories().size()]);
  +   }
   }
  
  
  
  1.2       +2 -0      jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionServiceRemote.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AuctionServiceRemote.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionServiceRemote.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- AuctionServiceRemote.java	22 Mar 2007 15:02:47 -0000	1.1
  +++ AuctionServiceRemote.java	24 Mar 2007 05:38:19 -0000	1.2
  @@ -6,4 +6,6 @@
   public interface AuctionServiceRemote
   {
      Auction[] findAuctions(String searchTerm);
  +   Auction getAuctionDetails(Integer auctionId);
  +   Category[] listCategories();
   }
  
  
  
  1.1      date: 2007/03/24 05:38:19;  author: sbryzak2;  state: Exp;jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/CategoryAction.java
  
  Index: CategoryAction.java
  ===================================================================
  package org.jboss.seam.example.seambay;
  
  import java.util.List;
  
  import javax.persistence.EntityManager;
  
  import org.jboss.seam.annotations.Factory;
  import org.jboss.seam.annotations.In;
  import org.jboss.seam.annotations.Name;
  import org.jboss.seam.annotations.Out;
  
  @Name("categoryAction")
  public class CategoryAction
  {
     @In
     EntityManager entityManager;
     
     @Out(required = false)
     private List<Category> categories;
     
     @Factory("categories")
     public void loadCategories()
     {
        categories = entityManager.createQuery("from Category order by name")
                     .getResultList();
     }
     
     public List<Category> getCategories()
     {
        return categories;
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list