Package org.infoglue.cms.entities.content

Examples of org.infoglue.cms.entities.content.ContentCategory


  {
    Database db = beginTransaction();

    try
    {
      ContentCategory contentCategory = (ContentCategory)getObjectWithId(MediumContentCategoryImpl.class, id, db);
        MediumContentVersionImpl contentVersion = ContentVersionController.getContentVersionController().checkStateAndChangeIfNeeded(contentCategory.getContentVersionId(), principal, db);
           
        //ContentCategory contentCategory = (ContentCategory)getObjectWithId(ContentCategoryImpl.class, id, db);
        //ContentVersion contentVersion = (ContentVersion)getObjectWithId(ContentVersionImpl.class, contentCategory.getContentVersionId(), db);
        Iterator contentCategoriesIterator = contentVersion.getContentCategories().iterator();
        while(contentCategoriesIterator.hasNext())
        {
          MediumContentCategoryImpl currentContentCategory = (MediumContentCategoryImpl)contentCategoriesIterator.next();
          ContentCategoryVO currentContentCategoryVO = currentContentCategory.getValueObject();
          if(currentContentCategoryVO.getAttributeName().equals(contentCategory.getAttributeName()) && currentContentCategory.getCategory().getId().equals(contentCategory.getCategory().getId()))
          {
            contentCategoriesIterator.remove();
            db.remove(currentContentCategory);
            break;
          }
View Full Code Here


  public void deleteByContentVersion(ContentVersion contentVersion, Database db) throws SystemException, Exception
  {
      Iterator contentVersionIterator = contentVersion.getContentCategories().iterator();
      while(contentVersionIterator.hasNext())
      {
          ContentCategory contentCategory = (ContentCategory)contentVersionIterator.next();
          contentVersionIterator.remove();
          db.remove(contentCategory);
      }
  }
View Full Code Here

          List initialContentCategories = new ArrayList();
           
          Iterator contentCategoriesIterator = contentCategories.iterator();
          while(contentCategoriesIterator.hasNext())
          {
            ContentCategory contentCategory = (ContentCategory)contentCategoriesIterator.next();
            logger.info("contentCategory:" + contentCategory);
            contentCategory.setContentVersion((ContentVersionImpl)cv);
           
            Integer oldCategoryId = contentCategory.getCategoryId();
            logger.info("oldCategoryId:" + oldCategoryId);
            if(!isCopyAction)
            {
              Integer newCategoryId = (Integer)categoryIdMap.get(oldCategoryId);
              logger.info("newCategoryId:" + newCategoryId);
              if(newCategoryId == null)
                newCategoryId = oldCategoryId;
             
              if(newCategoryId != null)
              {
                Category category = CategoryController.getController().findById(newCategoryId, db);
                logger.info("Got category:" + category);
                if(category != null)
                {
                  contentCategory.setCategory((CategoryImpl)category);
                  logger.info("Creating content category:" + contentCategory);
                 
                  db.create(contentCategory);
               
                  initialContentCategories.add(contentCategory);
                }
              }
            }
            else
            {
              Category category = CategoryController.getController().findById(oldCategoryId, db);
              logger.info("Got category:" + category);
              if(category != null)
              {
                contentCategory.setCategory((CategoryImpl)category);
                logger.info("Creating content category:" + contentCategory);
               
                db.create(contentCategory);
             
                initialContentCategories.add(contentCategory);
View Full Code Here

    }
   
    Iterator assignedContentCategoriesIterator = assignedContentCategories.iterator();
    while(assignedContentCategoriesIterator.hasNext())
    {
      ContentCategory contentCategory = (ContentCategory)assignedContentCategoriesIterator.next();
      assignedCategoryVOList.add(contentCategory.getCategory().getValueObject());
    }
   
    return assignedCategoryVOList;
  }
View Full Code Here

    //{
      List orignals = contentCategoryController.findByContentVersion(originalContentVersion, db);
      logger.info("orignals:" + orignals.size() + " on " + originalContentVersion);
      for (Iterator iter = orignals.iterator(); iter.hasNext();)
      {
        ContentCategory contentCategory = (ContentCategory)iter.next();
        ContentCategoryVO vo = new ContentCategoryVO();
        vo.setAttributeName(contentCategory.getAttributeName());
        vo.setCategory(contentCategory.getCategory().getValueObject());
        vo.setContentVersionId(newContentVersionId);
        ContentCategory newContentCategory = contentCategoryController.createWithDatabase(vo, db);
        //newContentCategory
      }
    //}
  }
View Full Code Here

        List initialContentCategories = new ArrayList();
         
        Iterator contentCategoriesIterator = contentCategories.iterator();
        while(contentCategoriesIterator.hasNext())
        {
          ContentCategory contentCategory = (ContentCategory)contentCategoriesIterator.next();
          logger.info("contentCategory:" + contentCategory);
          contentCategory.setContentVersion((ContentVersionImpl)contentVersion);
         
          Integer oldCategoryId = contentCategory.getCategoryId();
          logger.info("oldCategoryId:" + oldCategoryId);
          Integer newCategoryId = (Integer)categoryIdMap.get(oldCategoryId);
          logger.info("newCategoryId:" + newCategoryId);
          if(newCategoryId == null)
            newCategoryId = oldCategoryId;
         
          if(newCategoryId != null)
          {
            Category category = CategoryController.getController().findById(newCategoryId, db);
            logger.info("Got category:" + category);
            if(category != null)
            {
              contentCategory.setCategory((CategoryImpl)category);
              logger.info("Creating content category:" + contentCategory);
             
              db.create(contentCategory);
           
              initialContentCategories.add(contentCategory);
View Full Code Here

        List initialContentCategories = new ArrayList();
         
        Iterator contentCategoriesIterator = contentCategories.iterator();
        while(contentCategoriesIterator.hasNext())
        {
          ContentCategory contentCategory = (ContentCategory)contentCategoriesIterator.next();
          logger.info("contentCategory:" + contentCategory);
          contentCategory.setContentVersion((ContentVersionImpl)contentVersion);
         
          Integer oldCategoryId = contentCategory.getCategoryId();
          logger.info("oldCategoryId:" + oldCategoryId);
          if(!isCopyAction)
          {
            Integer newCategoryId = (Integer)categoryIdMap.get(oldCategoryId);
            logger.info("newCategoryId:" + newCategoryId);
            if(newCategoryId == null)
              newCategoryId = oldCategoryId;
           
            if(newCategoryId != null)
            {
              Category category = CategoryController.getController().findById(newCategoryId, db);
              logger.info("Got category:" + category);
              if(category != null)
              {
                contentCategory.setCategory((CategoryImpl)category);
                logger.info("Creating content category:" + contentCategory);
               
                db.create(contentCategory);
             
                initialContentCategories.add(contentCategory);
              }
            }
          }
          else
          {
            Category category = CategoryController.getController().findById(oldCategoryId, db);
            logger.info("Got category:" + category);
            if(category != null)
            {
              contentCategory.setCategory((CategoryImpl)category);
              logger.info("Creating content category:" + contentCategory);
             
              db.create(contentCategory);
           
              initialContentCategories.add(contentCategory);
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.content.ContentCategory

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.