Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.CategoryVO


  private List<Category> categoryVOListToCategoryList(final List<CategoryVO> categoryVOList, Database db) throws Exception
  {
    final List<Category> result = new ArrayList<Category>();
    for (Iterator<CategoryVO> i = categoryVOList.iterator(); i.hasNext(); )
    {
      CategoryVO categoryVO = i.next();
      result.add(CategoryController.getController().findById(categoryVO.getCategoryId(), db));
    }
    return result;
  }
View Full Code Here


                String categoryKey = split[0];
                String fullCategoryName = split[1];
                logger.info("categoryKey:" + categoryKey);
                logger.info("fullCategoryName:" + fullCategoryName);
               
                CategoryVO categoryVO = CategoryController.getController().findByPath(fullCategoryName);
                logger.info("categoryVO:" + categoryVO);

          List<CategoryVO> categoryVOList = new ArrayList<CategoryVO>();
                categoryVOList.add(categoryVO);
               
View Full Code Here

  private List categoryVOListToCategoryList(final List categoryVOList, Database db) throws Exception
  {
    final List result = new ArrayList();
    for(Iterator i=categoryVOList.iterator(); i.hasNext(); )
    {
      CategoryVO categoryVO = (CategoryVO) i.next();
      result.add(CategoryController.getController().findById(categoryVO.getCategoryId(), db));
    }
    return result;
  }
View Full Code Here

    return category;
  }

  public void setCategory(CategoryVO c)
  {
    category = (c != null) ? c : new CategoryVO();
  }
View Full Code Here

   * @return  The CategoryVO identified by the provided path
   * @throws  SystemException If an error happens
   */
  public CategoryVO findByPath(String path) throws SystemException
  {
      CategoryVO categoryVO = null;
     
      String[] nodes = path.substring(1).split("/");
       
      if(nodes.length > 0)
      {
          List rootCategories = findRootCategories();
          String name = nodes[0];
          categoryVO = getCategoryVOWithNameInList(rootCategories, name);
         
          for(int i = 1; i < nodes.length; i++)
          {
              categoryVO = getCategoryVOWithNameInList(findByParent(categoryVO.getId()), nodes[i]);
        }
      }
     
      return categoryVO;
  }
View Full Code Here

   */
  public CategoryVO findByPath(String path, Database db) throws SystemException
  {
    String key = "" + path;
   
    CategoryVO categoryVO = (CategoryVO)CacheController.getCachedObjectFromAdvancedCache("categoryCache", key);
    if(categoryVO != null)
    {
      logger.info("There was an cached categoryVO:" + categoryVO);
    }
    else
    {
        String[] nodes = path.substring(1).split("/");
         
        if(nodes.length > 0)
        {
            List rootCategories = findRootCategoryVOList(db);
            String name = nodes[0];
            categoryVO = getCategoryVOWithNameInList(rootCategories, name);
           
            for(int i = 1; i < nodes.length; i++)
            {
                categoryVO = getCategoryVOWithNameInList(findByParent(categoryVO.getId(), db), nodes[i]);
          }
        }
       
        if(categoryVO != null)
          CacheController.cacheObjectInAdvancedCache("categoryCache", key, categoryVO);
View Full Code Here

   * @return
   */

  private CategoryVO getCategoryVOWithNameInList(List categoryVOList, String name)
  {
      CategoryVO categoryVO = null;
     
        Iterator categoryVOListIterator = categoryVOList.iterator();
        while(categoryVOListIterator.hasNext())
        {
            CategoryVO currentCategoryVO = (CategoryVO)categoryVOListIterator.next();
          logger.info("currentCategoryVO:" + currentCategoryVO.getName() + "=" + name);
            if(currentCategoryVO.getName().equalsIgnoreCase(name))
            {
                categoryVO = currentCategoryVO;
              break;
            }
        }
View Full Code Here

   * @return  A list of CategoryVOs that are at the root of the category tree
   * @throws  SystemException If an error happens
   */
  public CategoryVO findWithChildren(Integer id) throws SystemException
  {
    CategoryVO c = findById(id);
    c.setChildren(findByParent(c.getId()));
    return c;
  }
View Full Code Here

        List params = new ArrayList();
        params.add(Boolean.TRUE);
        roots = toVOList(executeQueryReadOnly(findActiveRootCategories, params, db));
        for (Iterator iter = roots.iterator(); iter.hasNext();)
        {
          CategoryVO root = (CategoryVO) iter.next();
          root.setChildren(getAllActiveChildren(root.getId(), db));
        }

            rollbackTransaction(db);
        }
        catch(Exception e)
View Full Code Here

    List params = new ArrayList();
    params.add(Boolean.TRUE);
    List roots = executeQuery(findActiveRootCategories, params);
    for (Iterator iter = roots.iterator(); iter.hasNext();)
    {
      CategoryVO root = (CategoryVO) iter.next();
      if(includePaths)
      {
        String categoryPath = this.getCategoryPath(root.getCategoryId());
        root.setCategoryPath(categoryPath);
      }
     
      root.setChildren(findAllActiveChildren(root.getId(), includePaths));
    }
    return roots;
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.CategoryVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.