Package org.infoglue.cms.entities.management

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


        List params = new ArrayList();
        params.add(Boolean.TRUE);
        roots = executeQueryReadOnly(findActiveRootCategories, params, db);
        for (Iterator iter = roots.iterator(); iter.hasNext();)
        {
          CategoryVO root = (CategoryVO) iter.next();
          if(includePaths)
          {
            String categoryPath = this.getCategoryPath(root.getCategoryId(), db);
            root.setCategoryPath(categoryPath);
          }
          root.setChildren(getAllActiveChildren(root.getId(), includePaths, db));
        }

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


  public List getAuthorizedActiveChildren(Integer parentId, InfoGluePrincipal infogluePrincipal) throws SystemException
  {
    List children = findActiveByParent(parentId);
    for (Iterator iter = children.iterator(); iter.hasNext();)
    {
      CategoryVO child = (CategoryVO) iter.next();
      if(!getIsAccessApproved(child.getCategoryId(), infogluePrincipal))
      {
          iter.remove();
      }
     
      List subChildren = findAllActiveChildren(child.getId());
      Iterator subChildrenIterator = subChildren.iterator();
      while(subChildrenIterator.hasNext())
      {
          CategoryVO subChild = (CategoryVO) subChildrenIterator.next();
          if(getIsAccessApproved(subChild.getCategoryId(), infogluePrincipal))
        {
            child.getChildren().add(subChild);
        }
      }
    }
View Full Code Here

    Timer t = new Timer();

    List<CategoryVO> children = getActiveCategoryVOListByParent(parentId, db);
    for (Iterator iter = children.iterator(); iter.hasNext();)
    {
      CategoryVO child = (CategoryVO) iter.next();
      child.setChildren(getActiveChildrenCategoryVOList(child.getId(), db));
    }
    /*
    List children = findActiveByParent(parentId);
    for (Iterator iter = children.iterator(); iter.hasNext();)
    {
View Full Code Here

  {
    Timer t = new Timer();
    List<CategoryVO> children = getActiveCategoryVOListByParent(parentId, db);
    for (Iterator iter = children.iterator(); iter.hasNext();)
    {
      CategoryVO child = (CategoryVO) iter.next();
      child.setChildren(getAllActiveChildren(child.getId(), db));
    }
    return children;
  }
View Full Code Here

  public List findAllActiveChildren(Integer parentId, boolean includePaths) throws SystemException
  {
    List children = findActiveByParent(parentId);
    for (Iterator iter = children.iterator(); iter.hasNext();)
    {
      CategoryVO child = (CategoryVO) iter.next();
      if(includePaths)
      {
        String categoryPath = CategoryController.getController().getCategoryPath(child.getCategoryId());
        child.setCategoryPath(categoryPath);
      }
      child.setChildren(findAllActiveChildren(child.getId()));
    }
    return children;
  }
View Full Code Here

  public List<CategoryVO> getAllActiveChildren(Integer parentId, boolean includePaths, Database db) throws SystemException
  {
    List children = getActiveByParent(parentId, db);
    for (Iterator iter = children.iterator(); iter.hasNext();)
    {
      CategoryVO child = (CategoryVO) iter.next();
      if(includePaths)
      {
        String categoryPath = CategoryController.getController().getCategoryPath(child.getCategoryId(), db);
        child.setCategoryPath(categoryPath);
      }
      child.setChildren(getAllActiveChildren(child.getId(), db));
    }
    return children;
  }
View Full Code Here

   * @return  The saved CategoryVO
   * @throws  SystemException If an error happens
   */
  public CategoryVO moveCategory(Integer categoryId, Integer newParentId) throws SystemException
  {
    CategoryVO category = findById(categoryId);
    category.setParentId(newParentId);
    return save(category);
  }
View Full Code Here

  /**
   * Implemented for BaseController
   */
  public BaseEntityVO getNewVO()
  {
    return new CategoryVO();
  }
View Full Code Here

    public void compareAndCompleteCategoryLists(List remoteCategoryVOList, List<CategoryVO> allLocalCategories, CategoryVO localParentCategory, Map handledRemoteCategoryPaths, Map request) throws SystemException
  {
      Iterator remoteCategoryVOListIterator = remoteCategoryVOList.iterator();
      while(remoteCategoryVOListIterator.hasNext())
      {
        CategoryVO remoteCategoryVO = (CategoryVO)remoteCategoryVOListIterator.next();
       
        boolean categoryExists = false;
        CategoryVO localCategoryVO = null;
        Iterator allLocalCategoriesIterator = allLocalCategories.iterator();
        while(allLocalCategoriesIterator.hasNext())
          {
            localCategoryVO = (CategoryVO)allLocalCategoriesIterator.next();
            if(localCategoryVO.getName().equals(remoteCategoryVO.getName()))
            {
              categoryExists = true;
              break;
            }
          }
         
        boolean skipLocalCategory = false;
          if(!categoryExists)
          {
            Database db = CastorDatabaseService.getDatabase();
           
            try
            {
              beginTransaction(db);
             
              String remoteParentPath = remoteCategoryVO.getCategoryPath();
              String isCategorySelected = (String)request.get(remoteParentPath + "_transfer");
                if(isCategorySelected != null && isCategorySelected.equals("true"))
                {
                  skipLocalCategory = true;
                  handleSubCategories(localParentCategory, remoteCategoryVO, handledRemoteCategoryPaths, request, db);
                }
               
              commitTransaction(db);
            }
            catch (Exception e)
            {
              e.printStackTrace();
              rollbackTransaction(db);
            }
          }
         
          if(remoteCategoryVO.getChildren() != null && remoteCategoryVO.getChildren().size() > 0)
          {
            if(localCategoryVO != null && !skipLocalCategory)
            {
              compareAndCompleteCategoryLists(remoteCategoryVO.getChildren(), localCategoryVO.getChildren(), localCategoryVO, handledRemoteCategoryPaths, request);
            }
            else
            {
              compareAndCompleteCategoryLists(remoteCategoryVO.getChildren(), new ArrayList(), null, handledRemoteCategoryPaths, request);
            }
View Full Code Here

          List subCategories = remoteCategoryVO.getChildren();
          Iterator subCategoriesIterator = subCategories.iterator();
          while(subCategoriesIterator.hasNext())
          {
            CategoryVO subCategory = (CategoryVO)subCategoriesIterator.next();
            logger.info("subCategory:[" + subCategory + "]");
            handleSubCategories(newLocalCategory.getValueObject(), subCategory, handledRemoteCategoryPaths, request, db);
          }
      }
    }
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.