rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlu...@apache.org
Subject svn commit: r1235367 - in /incubator/rave/trunk: rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ rave-components/rave-core/src/main/java/org/apache/rave/po...
Date Tue, 24 Jan 2012 17:32:46 GMT
Author: carlucci
Date: Tue Jan 24 17:32:46 2012
New Revision: 1235367

URL: http://svn.apache.org/viewvc?rev=1235367&view=rev
Log:
RAVE-433: refactored "WidgetCategory" model to "Category" in anticipation of a future "WidgetCategory" join table to be needed by Rave-434.  This matches our current naming conventions for many to many tables (Widget - WidgetTag - Tag for example)

Added:
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Category.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/WidgetCategory.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/CategoryRepository.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetCategoryRepository.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaCategoryRepository.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepository.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluator.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluator.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/CategoryService.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetCategoryService.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultCategoryService.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryService.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaCategoryRepositoryTest.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepositoryTest.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluatorTest.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluatorTest.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultCategoryServiceTest.java
      - copied, changed from r1235358, incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryServiceTest.java
Removed:
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/WidgetCategory.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetCategoryRepository.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepository.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluator.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetCategoryService.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryService.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepositoryTest.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluatorTest.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryServiceTest.java
Modified:
    incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql

Copied: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Category.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/WidgetCategory.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Category.java?p2=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Category.java&p1=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/WidgetCategory.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/WidgetCategory.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Category.java Tue Jan 24 17:32:46 2012
@@ -26,20 +26,20 @@ import java.util.Date;
  * A category for a widget.
  */
 @Entity
-@Table(name = "widget_category")
+@Table(name = "category")
 @XmlRootElement
 @NamedQueries({
-        @NamedQuery(name = WidgetCategory.GET_ALL, query = "select wc from WidgetCategory wc order by wc.text")
+        @NamedQuery(name = Category.GET_ALL, query = "select c from Category c order by c.text")
 })
-public class WidgetCategory implements BasicEntity, Serializable {
+public class Category implements BasicEntity, Serializable {
     // constants for JPA query names
-    public static final String GET_ALL = "WidgetCategory.getAll";
+    public static final String GET_ALL = "Category.getAll";
 
     @Id
     @Column(name = "entity_id")
-    @GeneratedValue(strategy = GenerationType.TABLE, generator = "widgetCategoryIdGenerator")
-    @TableGenerator(name = "widgetCategoryIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName = "SEQ_NAME",
-                    valueColumnName = "SEQ_COUNT", pkColumnValue = "widget_category",
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "categoryIdGenerator")
+    @TableGenerator(name = "categoryIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName = "SEQ_NAME",
+                    valueColumnName = "SEQ_COUNT", pkColumnValue = "category",
                     allocationSize = 1, initialValue = 1)
     private Long entityId;
 
@@ -66,11 +66,11 @@ public class WidgetCategory implements B
     @Temporal(javax.persistence.TemporalType.TIMESTAMP)
     private Date lastModifiedDate;
 
-    public WidgetCategory() {
+    public Category() {
 
     }
 
-    public WidgetCategory(Long entityId, String text, User createdUser, Date createdDate, User lastModifiedUser, Date lastModifiedDate) {
+    public Category(Long entityId, String text, User createdUser, Date createdDate, User lastModifiedUser, Date lastModifiedDate) {
         this.entityId = entityId;
         this.text = text;
         this.createdUser = createdUser;
@@ -137,7 +137,7 @@ public class WidgetCategory implements B
         if (getClass() != obj.getClass()) {
             return false;
         }
-        final WidgetCategory other = (WidgetCategory) obj;
+        final Category other = (Category) obj;
         if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId))) {
             return false;
         }
@@ -153,7 +153,7 @@ public class WidgetCategory implements B
 
     @Override
     public String toString() {
-        return "WidgetCategory{" +
+        return "Category{" +
                 "entityId=" + entityId +
                 ", text='" + text + '\'' +
                 '}';

Copied: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/CategoryRepository.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetCategoryRepository.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/CategoryRepository.java?p2=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/CategoryRepository.java&p1=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetCategoryRepository.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetCategoryRepository.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/CategoryRepository.java Tue Jan 24 17:32:46 2012
@@ -16,14 +16,14 @@
 package org.apache.rave.portal.repository;
 
 import org.apache.rave.persistence.Repository;
-import org.apache.rave.portal.model.WidgetCategory;
+import org.apache.rave.portal.model.Category;
 import java.util.List;
 
-public interface WidgetCategoryRepository extends Repository<WidgetCategory> {
+public interface CategoryRepository extends Repository<Category> {
     /**
-     * Gets a list of <strong>all</strong> WidgetCategory objects in the repository
+     * Gets a list of <strong>all</strong> Category objects in the repository
      *
      * @return a valid List
      */
-    List<WidgetCategory> getAll();
+    List<Category> getAll();
 }
\ No newline at end of file

Copied: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaCategoryRepository.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepository.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaCategoryRepository.java?p2=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaCategoryRepository.java&p1=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepository.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepository.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaCategoryRepository.java Tue Jan 24 17:32:46 2012
@@ -20,24 +20,24 @@
 package org.apache.rave.portal.repository.impl;
 
 import org.apache.rave.persistence.jpa.AbstractJpaRepository;
-import org.apache.rave.portal.model.WidgetCategory;
-import org.apache.rave.portal.repository.WidgetCategoryRepository;
+import org.apache.rave.portal.model.Category;
+import org.apache.rave.portal.repository.CategoryRepository;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
 /**
- * JPA implementation for {@link org.apache.rave.portal.repository.WidgetCategoryRepository}
+ * JPA implementation for {@link org.apache.rave.portal.repository.CategoryRepository}
  */
 @Repository
-public class JpaWidgetCategoryRepository extends AbstractJpaRepository<WidgetCategory> implements WidgetCategoryRepository {
+public class JpaCategoryRepository extends AbstractJpaRepository<Category> implements CategoryRepository {
 
-    public JpaWidgetCategoryRepository() {
-        super(WidgetCategory.class);
+    public JpaCategoryRepository() {
+        super(Category.class);
     }
 
     @Override
-    public List<WidgetCategory> getAll() {
-        return manager.createNamedQuery(WidgetCategory.GET_ALL, WidgetCategory.class).getResultList();
+    public List<Category> getAll() {
+        return manager.createNamedQuery(Category.GET_ALL, Category.class).getResultList();
     }
 }

Copied: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluator.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluator.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluator.java?p2=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluator.java&p1=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluator.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluator.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluator.java Tue Jan 24 17:32:46 2012
@@ -18,9 +18,9 @@
  */
 package org.apache.rave.portal.security.impl;
 
-import org.apache.rave.portal.model.WidgetCategory;
+import org.apache.rave.portal.model.Category;
 import org.apache.rave.portal.model.User;
-import org.apache.rave.portal.repository.WidgetCategoryRepository;
+import org.apache.rave.portal.repository.CategoryRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,38 +32,38 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * The default implementation of the ModelPermissionEvaluator for WidgetCategory objects
+ * The default implementation of the ModelPermissionEvaluator for Category objects
  */
 @Component
-public class DefaultWidgetCategoryPermissionEvaluator extends AbstractModelPermissionEvaluator<WidgetCategory> {
+public class DefaultCategoryPermissionEvaluator extends AbstractModelPermissionEvaluator<Category> {
     private Logger log = LoggerFactory.getLogger(getClass());
-    private WidgetCategoryRepository widgetCategoryRepository;
+    private CategoryRepository categoryRepository;
 
     @Autowired
-    public DefaultWidgetCategoryPermissionEvaluator(WidgetCategoryRepository widgetCategoryRepository) {
-        this.widgetCategoryRepository = widgetCategoryRepository;
+    public DefaultCategoryPermissionEvaluator(CategoryRepository categoryRepository) {
+        this.categoryRepository = categoryRepository;
     }
    
     @Override
-    public Class<WidgetCategory> getType() {
-        return WidgetCategory.class;
+    public Class<Category> getType() {
+        return Category.class;
     }
     
     /**
      * Checks to see if the Authentication object has the supplied Permission
-     * on the supplied WidgetCategory object.  This method invokes the private hasPermission
+     * on the supplied Category object.  This method invokes the private hasPermission
      * function with the trustedDomainObject parameter set to false since we don't
      * know if the model being passed in was modified in any way from the 
      * actual entity in the database.
      * 
      * @param authentication the current Authentication object
-     * @param widgetCategory the WidgetCategory model object
+     * @param category the Category model object
      * @param permission the Permission to check
      * @return true if the Authentication has the proper permission, false otherwise
      */
     @Override
-    public boolean hasPermission(Authentication authentication, WidgetCategory widgetCategory, Permission permission) {      
-        return hasPermission(authentication, widgetCategory, permission, false);
+    public boolean hasPermission(Authentication authentication, Category category, Permission permission) {
+        return hasPermission(authentication, category, permission, false);
     }    
 
     /**
@@ -86,20 +86,20 @@ public class DefaultWidgetCategoryPermis
         if (targetId instanceof RaveSecurityContext) {
             hasPermission = verifyRaveSecurityContext(authentication, (RaveSecurityContext)targetId);           
         } else {
-            hasPermission = hasPermission(authentication, widgetCategoryRepository.get((Long)targetId), permission, true);
+            hasPermission = hasPermission(authentication, categoryRepository.get((Long)targetId), permission, true);
         }
         return hasPermission;
     }  
         
-    private boolean hasPermission(Authentication authentication, WidgetCategory widgetCategory, Permission permission, boolean trustedDomainObject) {       
-        // this is our container of trusted widgetCategory objects that can be re-used 
-        // in this method so that the same trusted widgetCategory object doesn't have to
+    private boolean hasPermission(Authentication authentication, Category category, Permission permission, boolean trustedDomainObject) {
+        // this is our container of trusted category objects that can be re-used
+        // in this method so that the same trusted category object doesn't have to
         // be looked up in the repository multiple times
-        List<WidgetCategory> trustedWidgetCategoryContainer = new ArrayList<WidgetCategory>();                           
+        List<Category> trustedCategoryContainer = new ArrayList<Category>();
         
         // first execute the AbstractModelPermissionEvaluator's hasPermission function
         // to see if it allows permission via it's "higher authority" logic                
-        if (super.hasPermission(authentication, widgetCategory, permission)) {
+        if (super.hasPermission(authentication, category, permission)) {
             return true;
         }
         
@@ -107,11 +107,11 @@ public class DefaultWidgetCategoryPermis
         boolean hasPermission = false;                       
         switch (permission) {
             case READ:
-                // all users can read any WidgetCategory
+                // all users can read any Category
                 hasPermission = true;
                 break;
             // if you are here, you are not an administrator, and thus can't
-            // administer, create, update, or delete a WidgetCategory
+            // administer, create, update, or delete a Category
             case ADMINISTER:
             case CREATE:
             case DELETE:
@@ -125,38 +125,38 @@ public class DefaultWidgetCategoryPermis
         return hasPermission;
     }       
     
-    // returns a trusted WidgetCategory object, either from the WidgetCategoryRepository, or the
+    // returns a trusted Category object, either from the CategoryRepository, or the
     // cached container list
-    private WidgetCategory getTrustedWidgetCategory(long widgetCategoryId, List<WidgetCategory> trustedWidgetCategoryContainer) {
-        WidgetCategory p = null;
-        if (trustedWidgetCategoryContainer.isEmpty()) {
-            p = widgetCategoryRepository.get(widgetCategoryId);
-            trustedWidgetCategoryContainer.add(p);
+    private Category getTrustedCategory(long categoryId, List<Category> trustedCategoryContainer) {
+        Category p = null;
+        if (trustedCategoryContainer.isEmpty()) {
+            p = categoryRepository.get(categoryId);
+            trustedCategoryContainer.add(p);
         } else {
-            p = trustedWidgetCategoryContainer.get(0);
+            p = trustedCategoryContainer.get(0);
         }
         return p;
     }
    
-    // checks to see if the Authentication object principal is the owner of the supplied widgetCategory object
+    // checks to see if the Authentication object principal is the owner of the supplied category object
     // if trustedDomainObject is false, pull the entity from the database first to ensure
     // the model object is trusted and hasn't been modified
-    private boolean isWidgetCategoryCreatedUser(Authentication authentication, WidgetCategory widgetCategory, List<WidgetCategory> trustedWidgetCategoryContainer, boolean trustedDomainObject) {
-        WidgetCategory trustedWidgetCategory = null;
+    private boolean isCategoryCreatedUser(Authentication authentication, Category category, List<Category> trustedCategoryContainer, boolean trustedDomainObject) {
+        Category trustedCategory = null;
         if (trustedDomainObject) {
-            trustedWidgetCategory = widgetCategory;
+            trustedCategory = category;
         } else {
-            trustedWidgetCategory = getTrustedWidgetCategory(widgetCategory.getEntityId(), trustedWidgetCategoryContainer);
+            trustedCategory = getTrustedCategory(category.getEntityId(), trustedCategoryContainer);
         }
 
-        return isWidgetCategoryCreatedUserByUsername(authentication, trustedWidgetCategory.getCreatedUser().getUsername());
+        return isCategoryCreatedUserByUsername(authentication, trustedCategory.getCreatedUser().getUsername());
     }
 
-    private boolean isWidgetCategoryCreatedUserByUsername(Authentication authentication, String username) {
+    private boolean isCategoryCreatedUserByUsername(Authentication authentication, String username) {
         return ((User)authentication.getPrincipal()).getUsername().equals(username);
     }
 
-    private boolean isWidgetCategoryCreatedUserById(Authentication authentication, Long userId) {
+    private boolean isCategoryCreatedUserById(Authentication authentication, Long userId) {
         return ((User)authentication.getPrincipal()).getEntityId().equals(userId);
     }
 
@@ -170,7 +170,7 @@ public class DefaultWidgetCategoryPermis
 
         // perform the permissions check based on the class supplied to the RaveSecurityContext object
         if (User.class == clazz) {
-            return isWidgetCategoryCreatedUserById(authentication, (Long) raveSecurityContext.getId());
+            return isCategoryCreatedUserById(authentication, (Long) raveSecurityContext.getId());
         } else {
             throw new IllegalArgumentException("unknown RaveSecurityContext type: " + raveSecurityContext.getType());
         }

Copied: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/CategoryService.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetCategoryService.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/CategoryService.java?p2=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/CategoryService.java&p1=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetCategoryService.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetCategoryService.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/CategoryService.java Tue Jan 24 17:32:46 2012
@@ -19,55 +19,54 @@
 
 package org.apache.rave.portal.service;
 
-import org.apache.rave.portal.model.Tag;
+import org.apache.rave.portal.model.Category;
 import org.apache.rave.portal.model.User;
-import org.apache.rave.portal.model.WidgetCategory;
 import org.springframework.security.access.prepost.PostAuthorize;
 import org.springframework.security.access.prepost.PostFilter;
 import org.springframework.security.access.prepost.PreAuthorize;
 
 import java.util.List;
 
-public interface WidgetCategoryService {
+public interface CategoryService {
 
     /**
-     * @param entityId unique identifier of the {@link org.apache.rave.portal.model.WidgetCategory}
-     * @return WidgetCategory if it can be found, otherwise {@literal null}
+     * @param entityId unique identifier of the {@link org.apache.rave.portal.model.Category}
+     * @return Category if it can be found, otherwise {@literal null}
      */
     @PostAuthorize("returnObject == null or hasPermission(returnObject, 'read')")
-    WidgetCategory get(long entityId);
+    Category get(long entityId);
 
     /**
-     * @return a {@link java.util.List} with all {@link org.apache.rave.portal.model.WidgetCategory}'s
+     * @return a {@link java.util.List} with all {@link org.apache.rave.portal.model.Category}'s
      */
     @PostFilter("hasPermission(filterObject, 'read')")
-    List<WidgetCategory> getAll();
+    List<Category> getAll();
 
     /**
-     * Creates a new WidgetCategory object
+     * Creates a new Category object
      * @param text the category text value
      * @param createdUser the user creating this category
-     * @return a WidgetCategory object representing the new entity
+     * @return a Category object representing the new entity
      */
     @PostAuthorize("hasPermission(returnObject, 'create')")
-    WidgetCategory create(String text, User createdUser);
+    Category create(String text, User createdUser);
 
     /**
      * Updates a widget category
      *
-     * @param widgetCategoryId  the entityId of the WidgetCategory to update
+     * @param categoryId  the entityId of the Category to update
      * @param text the new text value
      * @param lastModifiedUser the user performing the update
-     * @return the updated WidgetCategory object
+     * @return the updated Category object
      */
-    @PreAuthorize("hasPermission(#widgetCategoryId, 'org.apache.rave.portal.model.WidgetCategory', 'update')")
-    WidgetCategory update(long widgetCategoryId, String text, User lastModifiedUser);
+    @PreAuthorize("hasPermission(#categoryId, 'org.apache.rave.portal.model.Category', 'update')")
+    Category update(long categoryId, String text, User lastModifiedUser);
 
     /**
-     * Deletes a WidgetCategory
+     * Deletes a Category
      *
-     * @param widgetCategory
+     * @param category
      */
-    @PreAuthorize("hasPermission(#widgetCategory.entityId, 'org.apache.rave.portal.model.WidgetCategory', 'delete')")
-    void delete(WidgetCategory widgetCategory);
+    @PreAuthorize("hasPermission(#category.entityId, 'org.apache.rave.portal.model.Category', 'delete')")
+    void delete(Category category);
 }

Copied: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultCategoryService.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryService.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultCategoryService.java?p2=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultCategoryService.java&p1=incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryService.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryService.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultCategoryService.java Tue Jan 24 17:32:46 2012
@@ -15,10 +15,10 @@
  */
 package org.apache.rave.portal.service.impl;
 
+import org.apache.rave.portal.model.Category;
 import org.apache.rave.portal.model.User;
-import org.apache.rave.portal.model.WidgetCategory;
-import org.apache.rave.portal.repository.WidgetCategoryRepository;
-import org.apache.rave.portal.service.WidgetCategoryService;
+import org.apache.rave.portal.repository.CategoryRepository;
+import org.apache.rave.portal.service.CategoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -28,53 +28,53 @@ import java.util.List;
 
 
 @Service
-public class DefaultWidgetCategoryService implements WidgetCategoryService {
+public class DefaultCategoryService implements CategoryService {
 
-    private final WidgetCategoryRepository widgetCategoryRepository;
+    private final CategoryRepository categoryRepository;
 
     @Autowired
-    public DefaultWidgetCategoryService(WidgetCategoryRepository widgetCategoryRepository) {
-        this.widgetCategoryRepository = widgetCategoryRepository;
+    public DefaultCategoryService(CategoryRepository categoryRepository) {
+        this.categoryRepository = categoryRepository;
     }
 
     @Override
-    public WidgetCategory get(long entityId) {
-        return widgetCategoryRepository.get(entityId);
+    public Category get(long entityId) {
+        return categoryRepository.get(entityId);
     }
 
     @Override
-    public List<WidgetCategory> getAll() {
-        return widgetCategoryRepository.getAll();
+    public List<Category> getAll() {
+        return categoryRepository.getAll();
     }
 
     @Override
     @Transactional
-    public WidgetCategory create(String text, User createdUser) {
-        WidgetCategory widgetCategory = new WidgetCategory();
+    public Category create(String text, User createdUser) {
+        Category category = new Category();
         Date now = new Date();
-        widgetCategory.setText(text);
-        widgetCategory.setCreatedDate(now);
-        widgetCategory.setCreatedUser(createdUser);
-        widgetCategory.setLastModifiedDate(now);
-        widgetCategory.setLastModifiedUser(createdUser);
-        widgetCategoryRepository.save(widgetCategory);
-        return widgetCategory;
+        category.setText(text);
+        category.setCreatedDate(now);
+        category.setCreatedUser(createdUser);
+        category.setLastModifiedDate(now);
+        category.setLastModifiedUser(createdUser);
+        categoryRepository.save(category);
+        return category;
     }
 
     @Override
     @Transactional
-    public WidgetCategory update(long widgetCategoryId, String text, User lastModifiedUser) {
-        WidgetCategory widgetCategory = widgetCategoryRepository.get(widgetCategoryId);
-        widgetCategory.setText(text);
-        widgetCategory.setLastModifiedDate(new Date());
-        widgetCategory.setLastModifiedUser(lastModifiedUser);
-        widgetCategoryRepository.save(widgetCategory);
-        return widgetCategory;
+    public Category update(long categoryId, String text, User lastModifiedUser) {
+        Category category = categoryRepository.get(categoryId);
+        category.setText(text);
+        category.setLastModifiedDate(new Date());
+        category.setLastModifiedUser(lastModifiedUser);
+        categoryRepository.save(category);
+        return category;
     }
 
     @Override
     @Transactional
-    public void delete(WidgetCategory widgetCategory) {
-        widgetCategoryRepository.delete(widgetCategory);
+    public void delete(Category category) {
+        categoryRepository.delete(category);
     }
 }

Copied: incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaCategoryRepositoryTest.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepositoryTest.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaCategoryRepositoryTest.java?p2=incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaCategoryRepositoryTest.java&p1=incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepositoryTest.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetCategoryRepositoryTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaCategoryRepositoryTest.java Tue Jan 24 17:32:46 2012
@@ -20,11 +20,9 @@
 package org.apache.rave.portal.repository.impl;
 
 import org.apache.openjpa.persistence.PersistenceException;
-import org.apache.rave.portal.model.Tag;
+import org.apache.rave.portal.model.Category;
 import org.apache.rave.portal.model.User;
-import org.apache.rave.portal.model.WidgetCategory;
-import org.apache.rave.portal.repository.TagRepository;
-import org.apache.rave.portal.repository.WidgetCategoryRepository;
+import org.apache.rave.portal.repository.CategoryRepository;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,23 +42,23 @@ import static org.hamcrest.CoreMatchers.
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations = {"classpath:test-dataContext.xml", "classpath:test-applicationContext.xml"})
 
-public class JpaWidgetCategoryRepositoryTest {
+public class JpaCategoryRepositoryTest {
 
     @PersistenceContext
     private EntityManager manager;
 
     @Autowired
-    private WidgetCategoryRepository repository;
+    private CategoryRepository repository;
 
     private static final String DUPLICATE_TEXT_VALUE = "Sample Category";
 
     @Test
     public void getAll() {
-        List<WidgetCategory> list = repository.getAll();
+        List<Category> list = repository.getAll();
         assertThat(list.size(), is(2));
         // verify proper sorting alphabetical by text attribute
         String lastText = "";
-        for (WidgetCategory wc : list) {
+        for (Category wc : list) {
             String currentText = wc.getText();
             assertThat(currentText.compareTo(lastText) > 0, is(true));
             lastText = currentText;
@@ -75,7 +73,7 @@ public class JpaWidgetCategoryRepository
         Date now = new Date();
         User user = new User(1L);
         
-        WidgetCategory wc = new WidgetCategory();
+        Category wc = new Category();
         wc.setText(DUPLICATE_TEXT_VALUE);
         wc.setCreatedDate(now);
         wc.setCreatedUser(user);

Copied: incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluatorTest.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluatorTest.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluatorTest.java?p2=incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluatorTest.java&p1=incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluatorTest.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultWidgetCategoryPermissionEvaluatorTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/security/impl/DefaultCategoryPermissionEvaluatorTest.java Tue Jan 24 17:32:46 2012
@@ -19,7 +19,7 @@
 package org.apache.rave.portal.security.impl;
 
 import org.apache.rave.portal.model.*;
-import org.apache.rave.portal.repository.WidgetCategoryRepository;
+import org.apache.rave.portal.repository.CategoryRepository;
 import org.apache.rave.portal.security.ModelPermissionEvaluator;
 import org.apache.rave.portal.security.util.AuthenticationUtils;
 import org.easymock.EasyMock;
@@ -37,24 +37,24 @@ import static org.easymock.EasyMock.*;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
-public class DefaultWidgetCategoryPermissionEvaluatorTest {
-    private DefaultWidgetCategoryPermissionEvaluator defaultWidgetCategoryPermissionEvaluator;
-    private WidgetCategoryRepository mockWidgetCategoryRepository;
+public class DefaultCategoryPermissionEvaluatorTest {
+    private DefaultCategoryPermissionEvaluator defaultCategoryPermissionEvaluator;
+    private CategoryRepository mockCategoryRepository;
 
-    private WidgetCategory widgetCategory;
+    private Category category;
     private User user, user2;
     private Authentication mockAuthentication;
     private List<GrantedAuthority> grantedAuthorities;
 
-    private final Long VALID_WIDGET_CATEGORY_ID = 22L;
+    private final Long VALID_CATEGORY_ID = 22L;
     private final Long VALID_USER_ID = 99L;
     private final String VALID_USERNAME = "john.doe";
     private final String VALID_USERNAME2 = "jane.doe";
     
     @Before
     public void setUp() {
-        mockWidgetCategoryRepository = createMock(WidgetCategoryRepository.class);
-        defaultWidgetCategoryPermissionEvaluator = new DefaultWidgetCategoryPermissionEvaluator(mockWidgetCategoryRepository);
+        mockCategoryRepository = createMock(CategoryRepository.class);
+        defaultCategoryPermissionEvaluator = new DefaultCategoryPermissionEvaluator(mockCategoryRepository);
         mockAuthentication = createMock(Authentication.class);
 
         user = new User();
@@ -63,9 +63,9 @@ public class DefaultWidgetCategoryPermis
         user2 = new User();
         user2.setUsername(VALID_USERNAME2);
         
-        widgetCategory = new WidgetCategory();
-        widgetCategory.setEntityId(VALID_WIDGET_CATEGORY_ID);
-        widgetCategory.setCreatedUser(user);
+        category = new Category();
+        category.setEntityId(VALID_CATEGORY_ID);
+        category.setCreatedUser(user);
 
         grantedAuthorities = new ArrayList<GrantedAuthority>();
         grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_USER"));
@@ -73,14 +73,14 @@ public class DefaultWidgetCategoryPermis
 
     @Test
     public void testGetType() throws ClassNotFoundException {
-        assertThat(defaultWidgetCategoryPermissionEvaluator.getType().getName(), is(WidgetCategory.class.getName()));
+        assertThat(defaultCategoryPermissionEvaluator.getType().getName(), is(Category.class.getName()));
     }
 
     @Test
     public void testHasPermission_3args_administer() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
         replay(mockAuthentication);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.ADMINISTER), is(false));
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.ADMINISTER), is(false));
         verify(mockAuthentication);
     }
 
@@ -89,120 +89,120 @@ public class DefaultWidgetCategoryPermis
         grantedAuthorities.add(new SimpleGrantedAuthority(AuthenticationUtils.ROLE_ADMIN));
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
         replay(mockAuthentication);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.ADMINISTER), is(true));
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.ADMINISTER), is(true));
         verify(mockAuthentication);
     }
 
     @Test
     public void testHasPermission_3args_create() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.CREATE), is(false));
-        verify(mockWidgetCategoryRepository);
+        replay(mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.CREATE), is(false));
+        verify(mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_3args_create_hasAdminRole() {
         grantedAuthorities.add(new SimpleGrantedAuthority(AuthenticationUtils.ROLE_ADMIN));
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.CREATE), is(true));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.CREATE), is(true));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_3args_delete() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.DELETE), is(false));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.DELETE), is(false));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_3args_delete_hasAdminRole() {
         grantedAuthorities.add(new SimpleGrantedAuthority(AuthenticationUtils.ROLE_ADMIN));
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.DELETE), is(true));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.DELETE), is(true));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_3args_update() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.UPDATE), is(false));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.UPDATE), is(false));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_3args_update_hasAdminRole() {
         grantedAuthorities.add(new SimpleGrantedAuthority(AuthenticationUtils.ROLE_ADMIN));
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.UPDATE), is(true));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.UPDATE), is(true));
+        verify(mockAuthentication, mockCategoryRepository);
     }     
 
     @Test
     public void testHasPermission_3args_read() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, widgetCategory, ModelPermissionEvaluator.Permission.READ), is(true));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, category, ModelPermissionEvaluator.Permission.READ), is(true));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_4args_administer() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
         replay(mockAuthentication);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_WIDGET_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.ADMINISTER), is(false));
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.ADMINISTER), is(false));
         verify(mockAuthentication);
     }
 
     @Test
     public void testHasPermission_4args_create() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        expect(mockWidgetCategoryRepository.get(VALID_WIDGET_CATEGORY_ID)).andReturn(widgetCategory);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_WIDGET_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.CREATE), is(false));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        expect(mockCategoryRepository.get(VALID_CATEGORY_ID)).andReturn(category);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.CREATE), is(false));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_4args_delete() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        expect(mockWidgetCategoryRepository.get(VALID_WIDGET_CATEGORY_ID)).andReturn(widgetCategory);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_WIDGET_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.DELETE), is(false));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        expect(mockCategoryRepository.get(VALID_CATEGORY_ID)).andReturn(category);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.DELETE), is(false));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_4args_read_isCreatedUser() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        expect(mockWidgetCategoryRepository.get(VALID_WIDGET_CATEGORY_ID)).andReturn(widgetCategory);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_WIDGET_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.READ), is(true));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        expect(mockCategoryRepository.get(VALID_CATEGORY_ID)).andReturn(category);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.READ), is(true));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_4args_read_isNotCreatedUser() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        expect(mockWidgetCategoryRepository.get(VALID_WIDGET_CATEGORY_ID)).andReturn(widgetCategory);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_WIDGET_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.READ), is(true));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        expect(mockCategoryRepository.get(VALID_CATEGORY_ID)).andReturn(category);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.READ), is(true));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
     public void testHasPermission_4args_update() {
         EasyMock.<Collection<? extends GrantedAuthority>>expect(mockAuthentication.getAuthorities()).andReturn(grantedAuthorities);
-        expect(mockWidgetCategoryRepository.get(VALID_WIDGET_CATEGORY_ID)).andReturn(widgetCategory);
-        replay(mockAuthentication, mockWidgetCategoryRepository);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_WIDGET_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.UPDATE), is(false));
-        verify(mockAuthentication, mockWidgetCategoryRepository);
+        expect(mockCategoryRepository.get(VALID_CATEGORY_ID)).andReturn(category);
+        replay(mockAuthentication, mockCategoryRepository);
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, VALID_CATEGORY_ID, Widget.class.getName(), ModelPermissionEvaluator.Permission.UPDATE), is(false));
+        verify(mockAuthentication, mockCategoryRepository);
     }
 
     @Test
@@ -211,7 +211,7 @@ public class DefaultWidgetCategoryPermis
 
         expect(mockAuthentication.getPrincipal()).andReturn(user);
         replay(mockAuthentication);
-        assertThat(defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, WidgetCategory.class.getName(), ModelPermissionEvaluator.Permission.UPDATE), is(true));
+        assertThat(defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, Category.class.getName(), ModelPermissionEvaluator.Permission.UPDATE), is(true));
         verify(mockAuthentication);
     }
 
@@ -221,7 +221,7 @@ public class DefaultWidgetCategoryPermis
 
         expect(mockAuthentication.getPrincipal()).andReturn(user);
         replay(mockAuthentication);
-        defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, WidgetCategory.class.getName(), ModelPermissionEvaluator.Permission.UPDATE);
+        defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, Category.class.getName(), ModelPermissionEvaluator.Permission.UPDATE);
         verify(mockAuthentication);
     }
 
@@ -231,7 +231,7 @@ public class DefaultWidgetCategoryPermis
 
         expect(mockAuthentication.getPrincipal()).andReturn(user);
         replay(mockAuthentication);
-        defaultWidgetCategoryPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, WidgetCategory.class.getName(), ModelPermissionEvaluator.Permission.UPDATE);
+        defaultCategoryPermissionEvaluator.hasPermission(mockAuthentication, raveSecurityContext, Category.class.getName(), ModelPermissionEvaluator.Permission.UPDATE);
         verify(mockAuthentication);
     }
 

Copied: incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultCategoryServiceTest.java (from r1235358, incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryServiceTest.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultCategoryServiceTest.java?p2=incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultCategoryServiceTest.java&p1=incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryServiceTest.java&r1=1235358&r2=1235367&rev=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetCategoryServiceTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultCategoryServiceTest.java Tue Jan 24 17:32:46 2012
@@ -19,11 +19,10 @@
 
 package org.apache.rave.portal.service.impl;
 
-import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultText;
+import org.apache.rave.portal.model.Category;
 import org.apache.rave.portal.model.User;
-import org.apache.rave.portal.model.WidgetCategory;
-import org.apache.rave.portal.repository.WidgetCategoryRepository;
-import org.apache.rave.portal.service.WidgetCategoryService;
+import org.apache.rave.portal.repository.CategoryRepository;
+import org.apache.rave.portal.service.CategoryService;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -36,12 +35,11 @@ import static org.junit.Assert.*;
 import static org.hamcrest.CoreMatchers.*;
 
 /**
- * Test for {@link org.apache.rave.portal.service.impl.DefaultWidgetCategoryService}
+ * Test for {@link org.apache.rave.portal.service.impl.DefaultCategoryService}
  */
-public class DefaultWidgetCategoryServiceTest {
-
-    private WidgetCategoryService service;
-    private WidgetCategoryRepository repository;
+public class DefaultCategoryServiceTest {
+    private CategoryService service;
+    private CategoryRepository repository;
     
     private final Long VALID_ID = 4L;
     private final String VALID_TEXT = "category1";
@@ -51,49 +49,49 @@ public class DefaultWidgetCategoryServic
     private final Long VALID_LAST_MODIFIED_USER_ID = 88L;
     private User validCreatedUser;
     private User validLastModifiedUser;    
-    private WidgetCategory validWidgetCategory;
+    private Category validCategory;
 
     private final Long INVALID_ID = -999L;
 
     @Before
     public void setup() {
-        repository = createMock(WidgetCategoryRepository.class);
-        service = new DefaultWidgetCategoryService(repository);
+        repository = createMock(CategoryRepository.class);
+        service = new DefaultCategoryService(repository);
 
         validCreatedUser = new User(VALID_CREATED_USER_ID);
         validLastModifiedUser = new User(VALID_LAST_MODIFIED_USER_ID);
         
-        validWidgetCategory = new WidgetCategory();
-        validWidgetCategory.setEntityId(VALID_ID);
-        validWidgetCategory.setText(VALID_TEXT);
-        validWidgetCategory.setCreatedUser(validCreatedUser);
-        validWidgetCategory.setCreatedDate(VALID_CREATED_DATE);
-        validWidgetCategory.setLastModifiedUser(validLastModifiedUser);
-        validWidgetCategory.setLastModifiedDate(VALID_LAST_MODIFIED_DATE);
+        validCategory = new Category();
+        validCategory.setEntityId(VALID_ID);
+        validCategory.setText(VALID_TEXT);
+        validCategory.setCreatedUser(validCreatedUser);
+        validCategory.setCreatedDate(VALID_CREATED_DATE);
+        validCategory.setLastModifiedUser(validLastModifiedUser);
+        validCategory.setLastModifiedDate(VALID_LAST_MODIFIED_DATE);
     }
 
     @Test
-    public void get_validWidgetCategoryId() {
-        expect(repository.get(VALID_ID)).andReturn(validWidgetCategory);
+    public void get_validCategoryId() {
+        expect(repository.get(VALID_ID)).andReturn(validCategory);
         replay(repository);
-        assertThat(service.get(VALID_ID), is(validWidgetCategory));
+        assertThat(service.get(VALID_ID), is(validCategory));
         verify(repository);
     }
 
     @Test
-    public void get_invalidWidgetCategoryId() {
+    public void get_invalidCategoryId() {
         expect(repository.get(INVALID_ID)).andReturn(null);
         replay(repository);
-        assertThat(service.get(INVALID_ID), is(nullValue(WidgetCategory.class)));
+        assertThat(service.get(INVALID_ID), is(nullValue(Category.class)));
         verify(repository);
     }
 
     @Test
     public void getAll() {
-        List<WidgetCategory> list = new ArrayList<WidgetCategory>();
-        list.add(validWidgetCategory);
-        list.add(new WidgetCategory());
-        list.add(new WidgetCategory());
+        List<Category> list = new ArrayList<Category>();
+        list.add(validCategory);
+        list.add(new Category());
+        list.add(new Category());
 
         expect(repository.getAll()).andReturn(list);
         replay(repository);
@@ -104,13 +102,13 @@ public class DefaultWidgetCategoryServic
     @Test
     public void create() {
         final String NEW_CATEGORY_TEXT = "new category";
-        WidgetCategory expectedWidgetCategory = new WidgetCategory();
-        expectedWidgetCategory.setText(NEW_CATEGORY_TEXT);
+        Category expectedCategory = new Category();
+        expectedCategory.setText(NEW_CATEGORY_TEXT);
 
-        expect(repository.save(expectedWidgetCategory)).andReturn(expectedWidgetCategory);
+        expect(repository.save(expectedCategory)).andReturn(expectedCategory);
         replay(repository);
 
-        WidgetCategory wc = service.create(NEW_CATEGORY_TEXT, validCreatedUser);
+        Category wc = service.create(NEW_CATEGORY_TEXT, validCreatedUser);
         assertThat(wc.getText(), is(NEW_CATEGORY_TEXT));
         assertThat(wc.getCreatedDate(), is(notNullValue(Date.class)));
         assertThat(wc.getCreatedDate(), is(wc.getLastModifiedDate()));
@@ -124,34 +122,34 @@ public class DefaultWidgetCategoryServic
     public void update() {
         final String UPDATED_TEXT = "modified category";
 
-        WidgetCategory expectedSaveWidgetCategory = new WidgetCategory();
-        expectedSaveWidgetCategory.setEntityId(VALID_ID);
-        expectedSaveWidgetCategory.setText(UPDATED_TEXT);
-        expectedSaveWidgetCategory.setCreatedUser(validCreatedUser);
-        expectedSaveWidgetCategory.setLastModifiedUser(validLastModifiedUser);
-        expectedSaveWidgetCategory.setCreatedDate(VALID_CREATED_DATE);
-        expectedSaveWidgetCategory.setLastModifiedDate(VALID_LAST_MODIFIED_DATE);
+        Category expectedSaveCategory = new Category();
+        expectedSaveCategory.setEntityId(VALID_ID);
+        expectedSaveCategory.setText(UPDATED_TEXT);
+        expectedSaveCategory.setCreatedUser(validCreatedUser);
+        expectedSaveCategory.setLastModifiedUser(validLastModifiedUser);
+        expectedSaveCategory.setCreatedDate(VALID_CREATED_DATE);
+        expectedSaveCategory.setLastModifiedDate(VALID_LAST_MODIFIED_DATE);
 
-        expect(repository.get(VALID_ID)).andReturn(validWidgetCategory);
-        expect(repository.save(expectedSaveWidgetCategory)).andReturn(expectedSaveWidgetCategory);
+        expect(repository.get(VALID_ID)).andReturn(validCategory);
+        expect(repository.save(expectedSaveCategory)).andReturn(expectedSaveCategory);
         replay(repository);
         
-        WidgetCategory updatedWidgetCategory = service.update(VALID_ID, UPDATED_TEXT, validLastModifiedUser);
-        assertThat(updatedWidgetCategory.getEntityId(), is(VALID_ID));
-        assertThat(updatedWidgetCategory.getText(), is(UPDATED_TEXT));
-        assertThat(updatedWidgetCategory.getCreatedUser(), is(validCreatedUser));
-        assertThat(updatedWidgetCategory.getLastModifiedUser(), is(validLastModifiedUser));
-        assertThat(updatedWidgetCategory.getLastModifiedDate().after(updatedWidgetCategory.getCreatedDate()), is(true));
+        Category updatedCategory = service.update(VALID_ID, UPDATED_TEXT, validLastModifiedUser);
+        assertThat(updatedCategory.getEntityId(), is(VALID_ID));
+        assertThat(updatedCategory.getText(), is(UPDATED_TEXT));
+        assertThat(updatedCategory.getCreatedUser(), is(validCreatedUser));
+        assertThat(updatedCategory.getLastModifiedUser(), is(validLastModifiedUser));
+        assertThat(updatedCategory.getLastModifiedDate().after(updatedCategory.getCreatedDate()), is(true));
 
         verify(repository);
     }
 
     @Test
     public void delete() {
-        repository.delete(validWidgetCategory);
+        repository.delete(validCategory);
         expectLastCall();
         replay(repository);
-        service.delete(validWidgetCategory);
+        service.delete(validCategory);
         verify(repository);
     }
 }

Modified: incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql?rev=1235367&r1=1235366&r2=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql Tue Jan 24 17:32:46 2012
@@ -36,7 +36,7 @@ set @widget_rating_seq = 'widget_rating'
 set @portal_preference_seq = 'portal_preference';
 set @tag_seq = 'tag';
 set @widget_tag_seq = 'widget_tag';
-set @widget_category_seq = 'widget_category';
+set @category_seq = 'category';
 
 CREATE TABLE IF NOT EXISTS RAVE_PORTAL_SEQUENCES (seq_name VARCHAR(255) PRIMARY KEY NOT NULL, seq_count BIGINT(19));
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@page_seq, 1);
@@ -52,7 +52,7 @@ INSERT INTO RAVE_PORTAL_SEQUENCES(seq_na
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@portal_preference_seq, 1);
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@tag_seq, 1);
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@widget_tag_seq, 1);
-INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@widget_category_seq, 1);
+INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@category_seq, 1);
 
 
   -- ***********************************************************************************
@@ -818,12 +818,12 @@ values (@next_widget_tag_id, 1,2);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_tag_seq;
 
 -- widget category
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'Sample Category', @user_id_1, '2012-01-19', @user_id_2, '2012-01-22');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
-
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'AAA Category', @user_id_1, '2012-01-19', @user_id_2, '2012-01-19');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'Sample Category', @user_id_1, '2012-01-19', @user_id_2, '2012-01-22');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;
+
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'AAA Category', @user_id_1, '2012-01-19', @user_id_2, '2012-01-19');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql?rev=1235367&r1=1235366&r2=1235367&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql Tue Jan 24 17:32:46 2012
@@ -39,7 +39,7 @@ set @widget_rating_seq = 'widget_rating'
 set @portal_preference_seq = 'portal_preference';
 set @tag_seq = 'tag';
 set @widget_tag_seq = 'widget_tag';
-set @widget_category_seq = 'widget_category';
+set @category_seq = 'category';
 
 CREATE TABLE IF NOT EXISTS RAVE_PORTAL_SEQUENCES (seq_name VARCHAR(255) PRIMARY KEY NOT NULL, seq_count BIGINT(19));
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@page_seq, 1);
@@ -58,7 +58,7 @@ INSERT INTO RAVE_PORTAL_SEQUENCES(seq_na
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@portal_preference_seq, 1);
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@tag_seq, 1);
 INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@widget_tag_seq, 1);
-INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@widget_category_seq, 1);
+INSERT INTO RAVE_PORTAL_SEQUENCES(seq_name, seq_count) values (@category_seq, 1);
 
   -- ***********************************************************************************
   -- start page layout data, required to make the portal work ---
@@ -863,27 +863,27 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 -- end portal preferences
 
 -- widget category
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'Technology', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
-
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'News', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
-
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'Travel', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
-
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'Projects', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
-
-set @next_widget_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_category_seq);
-insert into widget_category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
-values (@next_widget_category_id, 'Communications', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_category_seq;
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'Technology', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;
+
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'News', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;
+
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'Travel', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;
+
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'Projects', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;
+
+set @next_category_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @category_seq);
+insert into category (entity_id, text, created_user_id, created_date, last_modified_user_id, last_modified_date)
+values (@next_category_id, 'Communications', @user_id_1, '2012-01-19', @user_id_1, '2012-01-19');
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @category_seq;



Mime
View raw message