Package org.infoglue.cms.entities.management

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


    List localCategoryKeys = getDefinedCategoryKeys(localSchemaValue);

    Iterator categoriesIterator = remoteCategoryKeys.iterator();
    while(categoriesIterator.hasNext())
    {
      CategoryAttribute categoryAttribute = (CategoryAttribute)categoriesIterator.next();
      //logger.info("categoryAttribute:" + categoryAttribute.getCategoryName());
     
      Iterator localCategoriesIterator = localCategoryKeys.iterator();
      boolean categoryExisted = false;
      while(localCategoriesIterator.hasNext())
      {
        CategoryAttribute localCategoryAttribute = (CategoryAttribute)localCategoriesIterator.next();
        if(localCategoryAttribute.getCategoryName().equals(categoryAttribute.getCategoryName()))
          categoryExisted = true;
      }
      //logger.info("categoryExisted:" + categoryExisted);
     
      if(!categoryExisted)
View Full Code Here


  public List getDefinedCategoryKeys(String schemaValue) throws Exception
  {
    List categoryKeys = ContentTypeDefinitionController.getController().getDefinedCategoryKeys(schemaValue);
    for (Iterator iter = categoryKeys.iterator(); iter.hasNext();)
    {
      CategoryAttribute info = (CategoryAttribute) iter.next();
      if(info.getCategoryId() != null)
        info.setCategoryName(getCategoryName(info.getCategoryId()));
      else
        info.setCategoryName("Undefined");
    }
   
    return categoryKeys;
  }
View Full Code Here

    {
      Node enumeration = nodes.item(i);
      String value = enumeration.getAttributes().getNamedItem("value").getNodeValue();
      try
      {
        CategoryAttribute category = new CategoryAttribute(value);
        keys.add(category);

        Element params = (Element)XPathAPI.selectSingleNode(enumeration, attributesXPath);
        if(params != null)
        {
          category.setTitle(getElementValue(params, "title"));
          category.setDescription(getElementValue(params, "description"));
          category.setCategoryId(getElementValue(params, "categoryId"));
        }
      }
      catch (TransformerException e)
      {
        keys.add(new CategoryAttribute(value));
      }
    }
    return keys;
  }
View Full Code Here

  public List getDefinedCategoryKeys() throws Exception
  {
    List categoryKeys = ContentTypeDefinitionController.getController().getDefinedCategoryKeys(contentTypeDefinitionVO, true);
    for (Iterator iter = categoryKeys.iterator(); iter.hasNext();)
    {
      CategoryAttribute info = (CategoryAttribute) iter.next();
      if(info.getCategoryId() != null)
        info.setCategoryName(getCategoryName(info.getCategoryId()));
      else
        info.setCategoryName("Undefined");
    }
    return categoryKeys;
  }
View Full Code Here

    assertResult(ViewContentTypeDefinitionAction.USE_EDITOR, testAction.doUpdateCategoryKey());
    refreshTestDefinition();

    List keys = testController.getDefinedCategoryKeys(testDefinition, true);
    assertEquals("Wrong number of keys found", 3, keys.size());
    assertTrue("updated key not found", keys.contains(new CategoryAttribute(getName(), "999", "New Title", "New Description")));
    assertFalse("old key found", keys.contains(new CategoryAttribute("third", "300", "Third Title", "Third Description")));
  }
View Full Code Here

    assertResult(ViewContentTypeDefinitionAction.USE_EDITOR, testAction.doDeleteCategoryKey());
    refreshTestDefinition();

    List keys = testController.getDefinedCategoryKeys(testDefinition, true);
    assertEquals("Wrong number of keys found", 2, keys.size());
    assertFalse("old key found", keys.contains(new CategoryAttribute("third", "300")));
  }
View Full Code Here

  public void testGetDefinedCategoryKeys() throws Exception
  {
    List keys = testController.getDefinedCategoryKeys(testDefinition, true);
    assertEquals("Wrong number of keys were found", 3, keys.size());
    assertTrue("first key not found", keys.contains(new CategoryAttribute("first", "100", "First Title", "First Description")));
    assertTrue("second key not found", keys.contains(new CategoryAttribute("second", "200", "Second Title", "Second Description")));
    assertTrue("third key not found", keys.contains(new CategoryAttribute("third", "300", "Third Title", "Third Description")));
    assertFalse("xxxxxx key found", keys.contains(new CategoryAttribute("xxxxx", "0")));
  }
View Full Code Here

TOP

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

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.