Package org.infoglue.cms.entities.content

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


        if(logger.isInfoEnabled())
          t.printElapsedTime("AAAAAAAAAAAAAAAAAAAAAA search returning :" + set.size() + ":" + Thread.currentThread().getId());
        final List result = new ArrayList();
        for(Iterator i = set.iterator(); i.hasNext(); )
        {
          final Content content = (Content) i.next();
          /*
          String contentKey = "" + content.getValueObject().getId();
          CacheController.cacheObjectInAdvancedCache("contentCache", contentKey, content.getValueObject(), new String[]{CacheController.getPooledString(1, content.getValueObject().getId())}, true);
          */
          //if(ContentDeliveryController.getContentDeliveryController().isValidContent(this.getDatabase(), content.getId(), localLanguageId, USE_LANGUAGE_FALLBACK, true, getPrincipal(), this.deliveryContext))
          InfoGluePrincipal principal = UserControllerProxy.getController(getDatabase()).getUser(userName);
          if(ContentDeliveryController.getContentDeliveryController().isValidContent(this.getDatabase(), content.getValueObject(), localLanguageId, USE_LANGUAGE_FALLBACK, true, principal, this.deliveryContext, false, false))
          {
            if(startNodeId != null)
            {
              if(hasNodeIdAsParent(content.getContentId(), startNodeId))
              {
                result.add(content.getValueObject());
              }
            }
            else
            {
              result.add(content.getValueObject());
            }
          }
        }

        RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getMatchingContents against db", t.getElapsedTime());
View Full Code Here


    List sortedContents   = sortContents(db, unsortedChildren, languageId, siteNodeId, sortAttribute, sortOrder, useLanguageFallback, includeFolders, deliveryContext, infoGluePrincipal);
   
    Iterator boundContentsIterator = sortedContents.iterator();
    while(boundContentsIterator.hasNext())
    {
      Content content = (Content)boundContentsIterator.next();
      sortedContentVOList.add(content.getValueObject());
    }
   
    CacheController.cacheObject(cacheName, sortedChildContentsKey, sortedContentVOList);
     
    return sortedContentVOList;
View Full Code Here

     
      QueryResults results = oql.execute(Database.READONLY);
   
    while (results.hasMore())
        {
          Content content = (Content)results.next();
         
          if(searchRecursive && currentLevel < maximumNumberOfLevels)
            getChildContents(infoGluePrincipal, contents, content.getContentId(), languageId, useLanguageFallback, currentLevel + 1, searchRecursive, maximumNumberOfLevels, db, includeFolders, deliveryContext);

        if(isValidContent(infoGluePrincipal, content.getValueObject(), languageId, useLanguageFallback, includeFolders, db, deliveryContext))
        {
           contents.add(content);
        }
        }
   
View Full Code Here

     
    QueryResults results = oql.execute(Database.READONLY);
   
    while (results.hasMore())
    {
      Content content = (Content)results.next();
   
      if(searchRecursive && currentLevel < maximumNumberOfLevels)
        getChildContents(infoGluePrincipal, contents, content.getContentId(), languageId, useLanguageFallback, currentLevel + 1, searchRecursive, includeFolders, maximumNumberOfLevels, db, deliveryContext);

        if(content.getIsBranch().booleanValue() && includeFolders && isValidContent(infoGluePrincipal, content.getValueObject(), languageId, useLanguageFallback, includeFolders, db, deliveryContext))
        {
        contents.add(content);
        }
      else if(isValidContent(infoGluePrincipal, content.getValueObject(), languageId, useLanguageFallback, includeFolders, db, deliveryContext))
      {
        contents.add(content);
      }
    }
   
View Full Code Here

  public Integer getProtectedContentId(Database db, Integer contentId) throws SystemException, Exception
  {
    Integer protectedContentId = null;
   
    //org.infoglue.deliver.util.Timer t = new org.infoglue.deliver.util.Timer();
      Content content = (Content)getObjectWithId(SmallContentImpl.class, contentId, db);
      //Content content = (Content)getObjectWithId(ContentImpl.class, contentId, db);
           
      protectedContentId = getProtectedContentId(db, content);

      //totalLoadTime = totalLoadTime + t.getElapsedTimeNanos();
View Full Code Here

          protectedContentId = null;
        else if(content.getIsProtected().intValue() == ContentVO.YES.intValue())
          protectedContentId = content.getId();
        else if(content.getIsProtected().intValue() == ContentVO.INHERITED.intValue())
        {
          Content parentContent = null; //= content.getParentContent();
          if(content instanceof MediumContentImpl)
          {
            Integer parentContentId = ((MediumContentImpl)content).getParentContentId();
            if(parentContentId != null)
              parentContent = (MediumContentImpl)getObjectWithId(MediumContentImpl.class, parentContentId, db);
View Full Code Here

    try
    {   
      Iterator iterator = contents.iterator();
      while(iterator.hasNext())
      {
        Content content = (Content)iterator.next();
        if(includeFolders || content.getIsBranch().booleanValue() == false)
        {
          int index = 0;
          Iterator sortedListIterator = sortedContents.iterator();
          while(sortedListIterator.hasNext())
          {
            Content sortedContent = (Content)sortedListIterator.next();
           
            //Here we sort on name if the name on a container is wanted
            if(sortAttributeName.equalsIgnoreCase("contentId"))
            {
              Integer id       = content.getContentId();
              Integer sortedId = sortedContent.getContentId();
              if(id != null && sortedId != null && sortOrder.equalsIgnoreCase("asc") && id.compareTo(sortedId) < 0)
                {
                  break;
                }
                else if(id != null && sortedId != null && sortOrder.equalsIgnoreCase("desc") && id.compareTo(sortedId) > 0)
                {
                  break;
                }
            }
            else if(sortAttributeName.equalsIgnoreCase("name"))
            {
              String name       = content.getName();
              String sortedName = sortedContent.getName();
              if(name != null && sortedName != null && sortOrder.equalsIgnoreCase("asc") && name.compareTo(sortedName) < 0)
                {
                  break;
                }
                else if(name != null && sortedName != null && sortOrder.equalsIgnoreCase("desc") && name.compareTo(sortedName) > 0)
                {
                  break;
                }
            }
            //Here we sort on date if the dates on a container is wanted
            else if(sortAttributeName.equalsIgnoreCase("publishDateTime"))
            {
              Date date       = content.getPublishDateTime();
              Date sortedDate = sortedContent.getPublishDateTime();
              if(date != null && sortedDate != null && sortOrder.equalsIgnoreCase("asc") && date.before(sortedDate))
                {
                  break;
                }
                else if(date != null && sortedDate != null && sortOrder.equalsIgnoreCase("desc") && date.after(sortedDate))
                {
                  break;
                }
            }
            else if(sortAttributeName.equalsIgnoreCase("expireDateTime"))
            {
              Date date       = content.getExpireDateTime();
              Date sortedDate = sortedContent.getExpireDateTime();
              if(date != null && sortedDate != null && sortOrder.equalsIgnoreCase("asc") && date.before(sortedDate))
                {
                  break;
                }
                else if(date != null && sortedDate != null && sortOrder.equalsIgnoreCase("desc") && date.after(sortedDate))
                {
                  break;
                }
            }
            else
            {
              long current = System.currentTimeMillis();
              String contentAttribute       = this.getContentAttribute(db, content.getId(), languageId, sortAttributeName, siteNodeId, useLanguageFallback, deliveryContext, infoGluePrincipal, false);
              String sortedContentAttribute = this.getContentAttribute(db, sortedContent.getId(), languageId, sortAttributeName, siteNodeId, useLanguageFallback, deliveryContext, infoGluePrincipal, false);
              attributesTimes = attributesTimes + (System.currentTimeMillis() - current);
              if(contentAttribute != null && sortedContentAttribute != null && sortOrder.equalsIgnoreCase("asc") && contentAttribute.compareTo(sortedContentAttribute) < 0)
                {
                  break;
                }
View Full Code Here

  }
 
 
  private void recurseContentTree(Integer contentId, Integer languageId, TemplateController templateController) throws Exception
  {
      Content content = ContentController.getContentController().getReadOnlyContentWithId(contentId, templateController.getDatabase());
      ContentVO contentVO = templateController.getContent(contentId);
     
      Collection childContents = content.getChildren();
   
      Iterator childContentsIterator = childContents.iterator();
      while(childContentsIterator.hasNext())
        {
          Content childContent = (Content)childContentsIterator.next();
          recurseContentTree(childContent.getId(), languageId, templateController);
         
          logger.info("Before read title of content...");
          templateController.getContentAttribute(childContent.getId(), languageId, "Title", true);
          templateController.getContentAttribute(childContent.getId(), languageId, "NavigationTitle", true);
          //templateController.getContentAttribute(childContent.getId(), languageId, "LeadIn", true);
          //templateController.getContentAttribute(childContent.getId(), languageId, "FullText", true);
          logger.info("Read title of content...");
        }
      //Thread.sleep(100);
View Full Code Here

     
      Iterator i = contentIdList.iterator();
      while(i.hasNext())
      {
        Integer contentId = (Integer)i.next();
        Content content   = ContentController.getContentController().getContentWithId(contentId, db);
        contents.add(content);
      }
     
      List contentTypeDefinitions = new ArrayList();
      if(includeContentTypes)
View Full Code Here

     
      String[] contentIds = new String[]{"" + contentId};
      for(int i=0; i<contentIds.length; i++)
      {
        Integer currentContentId = new Integer(contentIds[i]);
        Content content     = ContentController.getContentController().getContentWithId(currentContentId, db);
        contents.add(content);
      }
     
      List<ContentTypeDefinition> contentTypeDefinitions = ContentTypeDefinitionController.getController().getContentTypeDefinitionList(db);
      List<CategoryVO> categories = CategoryController.getController().getAllActiveCategories();
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.