Package org.infoglue.cms.entities.content

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


             oql.bind(currentDate);

          QueryResults results = oql.execute(Database.READONLY);
        while(results.hasMore())
            {
          Content content = (ContentImpl)results.next();
          contentVOList.add(content.getValueObject());
            }

        results.close();
        oql.close();
         
View Full Code Here


             oql.bind(principal.getName());

          QueryResults results = oql.execute(Database.READONLY);
        while(results.hasMore())
            {
          Content content = (ContentImpl)results.next();
         
        boolean isValid = true;
        for(int i=0; i<excludedContentTypes.length; i++)
        {
          String contentTypeDefinitionNameToExclude = excludedContentTypes[i];
          ContentTypeDefinitionVO ctdVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName(contentTypeDefinitionNameToExclude, db);
          if(content.getContentTypeDefinitionId().equals(ctdVO.getId()))
          {
            isValid = false;
            break;
          }
        }
       
        if(isValid)
          contentVOList.add(content.getValueObject());
            }

        results.close();
        oql.close();
         
View Full Code Here

    }

    //ContentVersion newCV = null;
    List<ContentVersion> newContentVersions = new ArrayList<ContentVersion>();

    Content newMetaInfoContent = SiteNodeController.getController().createSiteNodeMetaInfoContent(db, newSiteNode, null, newParentSiteNode.getRepositoryId(), principal, null, newContentVersions, false, oldMetaInfoContentVO, newNameSuffix);
    RequestAnalyser.getRequestAnalyser().registerComponentStatistics("createSiteNodeMetaInfoContent", t.getElapsedTime());

        //ContentVersionVO newCV = ContentVersionController.getContentVersionController().getLatestActiveContentVersion(newMetaInfoContent.getId(), masterLanguage.getId(), db);
        //t.printElapsedTime("newCV:" + newCV);
       
View Full Code Here

        logger.info("contentVO:" + contentVO);
        logger.info("contentVersionVO:" + contentVersionVO);
        logger.info("categories:" + categories);
        }
       
      final Content content = ContentControllerProxy.getContentController().create(db, parentContent.getId(), contentTypeDefinitionVO.getId(), parentContent.getRepositoryId(), contentVO);
      final ContentVersion newContentVersion = ContentVersionController.getContentVersionController().create(content.getId(), language.getId(), contentVersionVO, null, db);
      createCategories(newContentVersion, categories);
     
      if(logger.isDebugEnabled())
        logger.info("Returning:" + content + ":" + content.getValueObject());
     
      return content.getValueObject();
      }
      catch(Exception e)
      {
      //logger.error(e);
        throw e;
View Full Code Here

   */
  private ContentVO updateContent(final ContentVO contentVO, final ContentVersionVO contentVersionVO, final Map categories)
  {
    try
    {
      final Content content = ContentControllerProxy.getContentController().getContentWithId(contentVO.getId(), db);
      content.setValueObject(contentVO);
      final ContentVersion contentVersion = ContentVersionController.getContentVersionController().getLatestActiveContentVersion(content.getId(), language.getId(), db);
      if(contentVersion != null)
      {
        contentVersion.getValueObject().setVersionValue(contentVersionVO.getVersionValue());
        deleteCategories(contentVersion);
        createCategories(contentVersion, categories);
      }
      else
      {
        final ContentVersion newContentVersion = ContentVersionController.getContentVersionController().create(content.getId(), language.getId(), contentVersionVO, null, db);
        createCategories(newContentVersion, categories);
      }
     
      return content.getValueObject();
      }
    catch(Exception e)
    {
      e.printStackTrace();
      logger.warn(e);
View Full Code Here

        Iterator allContentIdsIterator = allContentIds.iterator();
        while(allContentIdsIterator.hasNext())
        {
          Integer contentId = (Integer)allContentIdsIterator.next();
       
          Content content = ContentController.getContentController().getContentWithId(contentId, db);
          updateContentVersions(content, contentIdMap, siteNodeIdMap, onlyLatestVersions, replaceMap);
        }
        db.commit();
      }
      catch(Exception e)
View Full Code Here

   
    //List allContentIds = new ArrayList();
    Iterator allContentsIterator = allContents.iterator();
    while(allContentsIterator.hasNext())
    {
      Content content = (Content)allContentsIterator.next();
      allContentIds.add(content.getContentId());
    }

    //TEST
    Map args = new HashMap();
      args.put("globalKey", "infoglue");
View Full Code Here

      logger.info("contents:" + contents);
 
      Iterator<Content> contentsIterator = contents.getContents().iterator();
      while(contentsIterator.hasNext())
      {
        Content content = contentsIterator.next();
        logger.info("content:" + content + ":" + content.getValueObject().getId() + ":" + content.getValueObject().getRepositoryId() + ":" + content.getRepositoryId());
        contentMap.put(content.getContentId(), content);
        if(content.getValueObject().getParentContentId() == null)
        {
          logger.info("content was root:" + content + ":" + content.getValueObject().getId() + ":" + content.getValueObject().getRepositoryId() + ":" + content.getRepositoryId());
          if(!repositoryContentMap.containsKey("" + content.getRepositoryId()))
            repositoryContentMap.put("" + content.getRepositoryId(), content);
          else
            logger.info("content was root but skipping as registration allready there:" + content + ":" + content.getValueObject().getId() + ":" + content.getValueObject().getRepositoryId() + ":" + content.getRepositoryId());
               
        }
        //logger.info("readContentCandidate debug...:" + readContentCandidate.getName() + ":" + readContentCandidate.getId() + ":" + readContentCandidate.getRepositoryId());
      }
     
      contentsIterator = contents.getContents().iterator();
      while(contentsIterator.hasNext())
      {
        Content content = contentsIterator.next();
        logger.info("content:" + content.getName() + ":" + content.getValueObject().getParentContentId());
       
        if(content.getValueObject().getParentContentId() != null)
        {
          Content parentContent = contentMap.get(content.getValueObject().getParentContentId());
          if(parentContent != null)
          {
            logger.info("parentContent:" + parentContent.getName() + ":" + parentContent);
            parentContent.getChildren().add(content);
            content.setParentContent((ContentImpl)parentContent);
           
            logger.info("Children after: " + parentContent.getChildren());
          }
          else
          {
            logger.error("Something is strange with parent content id:"+content.getValueObject().getParentContentId() +" it doesn't have a parent content id:"+content.getContentId());
          }
        }
       
        logger.info("repositoryIdMap:" + repositoryIdMap);
        //logger.info("Looking for repo:" + content.getRepositoryId());
        Repository newRepository = (Repository)repositoryIdMap.get("" + content.getRepositoryId() + "_repository");
        //logger.info("newRepository:" + newRepository);
        content.setRepository((RepositoryImpl)newRepository);
        //logger.info("readContentCandidate debug...:" + readContentCandidate.getName() + ":" + readContentCandidate.getId() + ":" + readContentCandidate.getRepositoryId());
      }
     
      InfoGlueExportImpl contentVersions = getInfoGlueExportImpl(contentVersionsFile, encoding);
      logger.info("contentVersions:" + contentVersions);
      float memoryLeft = ((float)Runtime.getRuntime().maxMemory() - (float)Runtime.getRuntime().totalMemory()) / 1024f / 1024f;
      logger.info("Memory after contentVersions-file:" + memoryLeft);
     
      for(ExportContentVersionImpl contentVersion : contentVersions.getContentVersions())
      {
        List<ExportContentVersionImpl> versions = allContentVersionMap.get(contentVersion.getValueObject().getContentId());
        if(versions == null)
        {
          versions = new ArrayList<ExportContentVersionImpl>();
          logger.info("Creating versions for " + contentVersion.getValueObject().getContentId());
          allContentVersionMap.put(contentVersion.getValueObject().getContentId(), versions);
        }
        //logger.info("Adding version:" + contentVersion.getValueObject().getContentVersionId() + ":" + contentVersion.getValueObject().getContentId());
        versions.add(contentVersion);
        //logger.info("readContentCandidate debug...:" + readContentCandidate.getName() + ":" + readContentCandidate.getId() + ":" + readContentCandidate.getRepositoryId());
      }
    }
   
    for(Repository repositoryRead : repositories)
    {
      logger.info("Getting root content for: " + repositoryRead.getId());
      Content rootContent = (Content)repositoryContentMap.get("" + repositoryRead.getId());
      logger.info("rootContent: " + rootContent);
      if(rootContent == null)
      {
        Integer oldRepoId = (Integer)repositoryIdMap.get("" + repositoryRead.getId() + "_old");
        logger.info("Getting root content for: " + oldRepoId);
View Full Code Here

    if(childContents != null)
    {
      Iterator childContentsIterator = childContents.iterator();
      while(childContentsIterator.hasNext())
      {
        Content childContent = (Content)childContentsIterator.next();
        //childContent.setRepository(content.getRepository());
        logger.info("Setting parentContent on child: " + childContent.getName() + " to:" + content.getId());
        childContent.setParentContent((ContentImpl)content);
        childContent.getValueObject().setParentContentId(content.getValueObject().getContentId());
        createContents(childContent, allContentVersionMap, idMap, contentTypeDefinitionIdMap, allContents, languages, contentTypeDefinitions, categoryIdMap, allSmallAssets, assetVersionsMap, db, onlyLatestVersions, isCopyAction, replaceMap);
      }
    }
   
   
View Full Code Here

      }
     
      final List result = new ArrayList();
      for(Iterator i = set.iterator(); i.hasNext(); )
      {
        final Content content = (Content) i.next();
        //if(ContentDeliveryController.getContentDeliveryController().isValidContent(this.getDatabase(), content.getId(), localLanguageId, USE_LANGUAGE_FALLBACK, true, getPrincipal(), this.deliveryContext))
        if(ContentDeliveryController.getContentDeliveryController().isValidContent(this.getDatabase(), content, localLanguageId, USE_LANGUAGE_FALLBACK, true, getPrincipal(), this.deliveryContext, false, false))
        {
          if(startNodeId != null)
          {
            if(hasNodeIdAsParent(content.getContentId(), startNodeId))
            {
              result.add(content.getValueObject());
            }
          }
          else
          {
            result.add(content.getValueObject());
          }
        }
      }

      if(cacheResult)
View Full Code Here

TOP

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

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.