Package org.infoglue.cms.entities.management

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


  {
    logger.info("We want to create a list of categories if not existing under the parent category " + parentCategory);
    Iterator categoryIterator = categories.iterator();
    while(categoryIterator.hasNext())
    {
      CategoryVO categoryVO = (CategoryVO)categoryIterator.next();
      Category newParentCategory = null;
     
      List existingCategories = null;
      if(parentCategory != null)
        existingCategories = CategoryController.getController().findByParent(parentCategory.getCategoryId(), db);
      else
        existingCategories = CategoryController.getController().findRootCategories(db);
       
      Iterator existingCategoriesIterator = existingCategories.iterator();
      while(existingCategoriesIterator.hasNext())
      {
        Category existingCategory = (Category)existingCategoriesIterator.next();
        logger.info("existingCategory:" + existingCategory.getName());
        if(existingCategory.getName().equals(categoryVO.getName()))
        {
          logger.info("Existed... setting " + existingCategory.getName() + " to new parent category.");
          newParentCategory = existingCategory;
          break;
        }
      }

      if(newParentCategory == null)
      {
        logger.info("No existing category - we create it.");
        Integer oldId = categoryVO.getId();
        categoryVO.setCategoryId(null);
        if(parentCategory != null
          categoryVO.setParentId(parentCategory.getCategoryId());
        else
          categoryVO.setParentId(null);
         
        Category newCategory = CategoryController.getController().save(categoryVO, db);
        categoryIdMap.put(oldId, newCategory.getCategoryId());
        newParentCategory = newCategory;
      }
      else
      {
        categoryIdMap.put(categoryVO.getId(), newParentCategory.getCategoryId());
      }
       
      importCategories(categoryVO.getChildren(), newParentCategory, categoryIdMap, db);
    }
  }
View Full Code Here


    */
      final String protectCategories = CmsPropertyHandler.getProtectCategories();
      if(protectCategories != null && protectCategories.equalsIgnoreCase("true") && request.getParameter("categoryId") != null && !request.getParameter("categoryId").equals(""))
      {
      Integer categoryId = new Integer(request.getParameter("categoryId"));
      CategoryVO categoryVO = CategoryController.getController().findById(categoryId);

      buttons.add(new ToolbarButton("",
            getLocalizedString(locale, "tool.common.accessRights.accessRightsButtonLabel"),
            getLocalizedString(locale, "tool.common.accessRights.accessRightsButtonTitle"),
            "ViewAccessRights!V3.action?interceptionPointCategory=Category&extraParameters=" + categoryVO.getName() + "&returnAddress=ViewInlineOperationMessages.action&originalAddress=refreshParent",
            "css/images/v3/accessRightIcon.gif",
            "accessRights",
            "inlineDiv"));
      }

View Full Code Here

        ContentVO contentVO = ContentController.getContentController().getContentVOWithId(entityId);
        path = contentVO.getName();
      }
      else if(entity.equalsIgnoreCase("Category"))
      {
        CategoryVO categoryVO = CategoryController.getController().findById(entityId);
        path = categoryVO.getDisplayName();
      }

      component.setAttribute("path", path);
      NamedNodeMap attributes = component.getAttributes();
      logger.debug("NumberOfAttributes:" + attributes.getLength() + ":" + attributes);
View Full Code Here

   */
  public String getWhereClause() {
    final StringBuffer categoryClauses = new StringBuffer();
    for(int i=0; i<names.size(); ++i) {
      final String attributeName  = (String) names.get(i);
      final CategoryVO categoryVO = (CategoryVO) categories.get(i);
     
      if(i > 0)
        categoryClauses.append(SPACE + OR + SPACE);
      categoryClauses.append(getOneCategoryClause(attributeName, categoryVO));
    }
View Full Code Here

    final Boolean isNotSetArgument   = (path.equalsIgnoreCase("UNDEFINED") ? true : false);
    final Boolean isSetArgument   = (path.equalsIgnoreCase("*") ? true : false);
   
    try
    {
      CategoryVO categoryVO = null;
      if(!isNotSetArgument && !isSetArgument)
      {
        categoryVO = CategoryController.getController().findByPath(path);
        if(categoryVO == null)
          throw new IllegalArgumentException("ConditionsParser.parseCategory() - no such category [" + path + "].");
View Full Code Here

  private void populate() throws WorkflowException
  {
    List result = new ArrayList();
    for(Iterator i = rootCategory.getChildren().iterator(); i.hasNext();)
    {
      final CategoryVO categoryVO = (CategoryVO) i.next();
      final String key = getCategoryKey(categoryVO);
      final String value = getRequestParameter(key);
      if(parameterExists(key) && value != null && value.equals("1"))
      {
        setPropertySetDataString(getCategoryKey(categoryVO), "1");
View Full Code Here

   */
  private CategoryVO getRootCategory(final String path) throws WorkflowException
  {
    try
    {
      final CategoryVO categoryVO = CategoryController.getController().findByPath(path, getDatabase());
      return CategoryController.getController().findWithChildren(categoryVO.getId(), getDatabase());
    }
    catch(Exception e)
    {
      e.printStackTrace();
      throw new WorkflowException("SimpleCategoryProvider.getRootCategory() : " + e);
View Full Code Here

   */
  private void createOptions()
  {
    for(final Iterator i = rootCategoryVO.getChildren().iterator(); i.hasNext();)
    {
      final CategoryVO categoryVO = (CategoryVO) i.next();
      final String name           = categoryVO.getName();
      final String value          = categoryVO.getId().toString();
     
      getElement().addChild("option")
        .addText(name)
        .addAttribute("value", value)
        .addAttribute("selected", "selected", value != null && selected != null && value.equals(selected));
View Full Code Here

   */
  private CategoryVO getRootCategory(final String path) throws JspException
  {
    try
    {
      final CategoryVO categoryVO = CategoryController.getController().findByPath(path);
      if(categoryVO != null)
        return CategoryController.getController().findWithChildren(categoryVO.getId());
      else
        throw new Exception("No category with path " + path + " was found.");
    }
    catch(Exception e)
    {
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

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.