Package org.infoglue.cms.entities.content

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


          logger.warn("You cannot specify the same folder as it originally was located in......");
          throw new ConstraintException("Content.parentContentId", "3304");
        }

    //ContentVO tempContent = newParentContent.getParentContent();
    ContentVO newParentContentVO = getContentVOWithId(newParentContentId, db);
   
    Integer parentContentId = newParentContentVO.getParentContentId();
    while(parentContentId != null)
    {
      ContentVO tempContent = getContentVOWithId(parentContentId, db);
      if(tempContent.getId().intValue() == content.getId().intValue())
      {
        logger.warn("You cannot move the content to a child under it......");
            throw new ConstraintException("Content.parentContentId", "3302");
      }
      parentContentId = tempContent.getParentContentId();
    }                   
       
        //oldParentContent.getChildren().remove(content);
        //content.setParentContent((ContentImpl)newParentContent);
        content.getValueObject().setParentContentId(newParentContentId);
View Full Code Here


     {
       if(repositoryId == null || repositoryId.intValue() < 1)
         return null;
      
    String key = "root_" + repositoryId;
    ContentVO contentVO = (ContentVO)CacheController.getCachedObjectFromAdvancedCache("rootContentCache", key);
    if(contentVO != null)
    {
      return contentVO;
    }

        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {
            logger.info("Fetching the root content for the repository " + repositoryId);
      //OQLQuery oql = db.getOQLQuery( "SELECT c FROM org.infoglue.cms.entities.content.impl.simple.ContentImpl c WHERE is_undefined(c.parentContent) AND c.repository.repositoryId = $1");
      OQLQuery oql = db.getOQLQuery( "SELECT c FROM org.infoglue.cms.entities.content.impl.simple.SmallContentImpl c WHERE is_undefined(c.parentContentId) AND c.repositoryId = $1");
      oql.bind(repositoryId);
     
          QueryResults results = oql.execute(Database.READONLY);     
      if (results.hasMore())
            {
        Content content = (Content)results.next();
        contentVO = content.getValueObject();
          }
            else
            {
        //None found - we create it and give it the name of the repository.
        logger.info("Found no rootContent so we create a new....");
        ContentVO rootContentVO = new ContentVO();
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(repositoryId);
        rootContentVO.setCreatorName(userName);
        rootContentVO.setName(repositoryVO.getName());
        rootContentVO.setIsBranch(new Boolean(true));
              Content content = create(db, null, null, repositoryId, rootContentVO);
              contentVO = content.getValueObject();
            }
           
      results.close();
View Full Code Here

   */
         
  public ContentVO getRootContentVO(Integer repositoryId, String userName, boolean createIfNonExisting) throws ConstraintException, SystemException
  {
    String key = "root_" + repositoryId;
    ContentVO contentVO = (ContentVO)CacheController.getCachedObjectFromAdvancedCache("rootContentCache", key);
    if(contentVO != null)
    {
      return contentVO;
    }

View Full Code Here

        try
        {
          ContentTypeDefinitionVO htmlTemplateMetaInfoCTDVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName("HTMLTemplate");
          ContentTypeDefinitionVO pagePartTemplateMetaInfoCTDVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName("PagePartTemplate");
          MediumContentVersionImpl contentVersion = (MediumContentVersionImpl)object;
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentVersion.getContentId(), true);
          if(contentVO.getContentTypeDefinitionId() == null || (
             contentVO.getContentTypeDefinitionId().equals(htmlTemplateMetaInfoCTDVO.getId()) ||
             contentVO.getContentTypeDefinitionId().equals(pagePartTemplateMetaInfoCTDVO.getId())))
          {
            ComponentController.getController().reIndexComponentContentsDelayed(contentVersion.getContentId());
          }

          CacheController.clearCacheForGroup("registryCache", "" + ("org.infoglue.cms.entities.content.ContentVersion_" + getObjectIdentity(object)).hashCode());

          CacheController.clearCacheForGroup("childContentCache", "content_" + contentVO.getId());
          if(contentVO.getParentContentId() != null)
            CacheController.clearCacheForGroup("childContentCache", "content_" + contentVO.getParentContentId());

          CacheController.clearCacheForGroup("contentVersionCache", "content_" + contentVersion.getContentId());
          CacheController.clearCacheForGroup("contentVersionCache", "contentVersion_" + contentVersion.getId());

          CacheController.clearCacheForGroup("contentAttributeCache", "content_" + contentVersion.getContentId());
View Full Code Here

          if(content.getValueObject().getParentContentId() != null)
          {
            CacheController.clearCacheForGroup("childContentCache", "content_" + content.getValueObject().getParentContentId());
            if(ContentController.getContentController().getDoesContentExist(content.getId()))
            {
              ContentVO parentContentVO = ContentController.getContentController().getContentVOWithId(content.getValueObject().getParentContentId(), false);
              if(parentContentVO.getParentContentId() != null)
              {
                CacheController.clearCacheForGroup("childContentCache", "content_" + parentContentVO.getParentContentId());
              }
            }
          }
        }
        catch (Exception e)
        {
          logger.warn("Error in JDOCallback:" + e.getMessage(), e);
        }
       
        clearCache(SmallContentImpl.class);
        clearCache(SmallishContentImpl.class);
        clearCache(MediumContentImpl.class);
      }
      else if(object.getClass().getName().equals(MediumContentImpl.class.getName()))
      {
        try
        {
          MediumContentImpl content = (MediumContentImpl)object;
          CacheController.clearCacheForGroup("childContentCache", "content_" + content.getId());
          if(content.getValueObject().getParentContentId() != null)
          {
            CacheController.clearCacheForGroup("childContentCache", "content_" + content.getValueObject().getParentContentId());
            ContentVO parentContentVO = ContentController.getContentController().getContentVOWithId(content.getValueObject().getParentContentId(), false);
            if(parentContentVO.getParentContentId() != null)
            {
              CacheController.clearCacheForGroup("childContentCache", "content_" + parentContentVO.getParentContentId());
            }
          }
        }
        catch (Exception e)
        {
View Full Code Here

        MediumContentVersionImpl contentVersion = (MediumContentVersionImpl)object;
        try
        {
          ContentTypeDefinitionVO htmlTemplateMetaInfoCTDVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName("HTMLTemplate");
          ContentTypeDefinitionVO pagePartTemplateMetaInfoCTDVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName("PagePartTemplate");
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentVersion.getContentId(), true);
          if(contentVO.getContentTypeDefinitionId() == null || (
             contentVO.getContentTypeDefinitionId().equals(htmlTemplateMetaInfoCTDVO.getId()) ||
             contentVO.getContentTypeDefinitionId().equals(pagePartTemplateMetaInfoCTDVO.getId())))
          {
            ComponentController.getController().reIndexComponentContentsDelayed(contentVersion.getContentId());
          }
          CacheController.clearCacheForGroup("contentVersionCache", "content_" + contentVersion.getContentId());
        }
View Full Code Here

      logger.info("Arguments:" + arguments.size());
      contents = getContentVOListByContentTypeNames(arguments, db);
      Iterator contentIterator = contents.iterator();
      while(contentIterator.hasNext())
      {
          ContentVO candidateContentVO = (ContentVO)contentIterator.next();
         
          Map hashMap = new HashMap();
          hashMap.put("contentId", candidateContentVO.getContentId());
         
          try
          {
            if(interceptionPointName.equals("Component.Select"))
            {
View Full Code Here

      logger.info("Arguments for 'selectListOnContentTypeName': " + arguments.size());
      contents = getContentVOListByContentTypeNames(arguments);
      Iterator<ContentVO> contentIterator = contents.iterator();
      while(contentIterator.hasNext())
      {
        ContentVO candidateContentVO = (ContentVO)contentIterator.next();
        Map<String, Integer> hashMap = new HashMap<String, Integer>();
        hashMap.put("contentId", candidateContentVO.getContentId());
        try
        {
          intercept(hashMap, "Content.Read", infoGluePrincipal, false);
        }
        catch(Exception e)
        {
          logger.debug("User <" + infoGluePrincipal.getName() + "> was not authorized to look at task with Content-id: " + candidateContentVO.getContentId());
          contentIterator.remove();
        }
      }
    }
    return contents;
View Full Code Here

  {
    Integer protectedContentId = null;
 
    try
    {
      ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
      if(contentVO != null && contentVO.getIsProtected() != null)
      { 
        if(contentVO.getIsProtected().intValue() == NO.intValue())
          protectedContentId = null;
        else if(contentVO.getIsProtected().intValue() == YES.intValue())
          protectedContentId = contentVO.getId();
        else if(contentVO.getIsProtected().intValue() == INHERITED.intValue())
        {
          //ContentVO parentContentVO = ContentController.getParentContent(contentId);
          ContentVO parentContentVO = ContentController.getParentContent(contentVO);
          if(parentContentVO != null)
            protectedContentId = getProtectedContentId(parentContentVO.getId());
        }
      }
    }
    catch(Exception e)
    {
View Full Code Here

  {
    Integer protectedContentId = null;
 
    try
    {
      ContentVO contentVO = ContentController.getContentController().getSmallContentVOWithId(contentId, db, null);
      if(contentVO != null && contentVO.getIsProtected() != null)
      { 
        if(contentVO.getIsProtected().intValue() == NO.intValue())
          protectedContentId = null;
        else if(contentVO.getIsProtected().intValue() == YES.intValue())
          protectedContentId = contentVO.getId();
        else if(contentVO.getIsProtected().intValue() == INHERITED.intValue())
        {
          ContentVO parentContentVO = ContentController.getContentController().getSmallParentContent(contentVO, db);
          if(parentContentVO != null)
            protectedContentId = getProtectedContentId(parentContentVO.getId(), db);
        }
      }
    }
    catch(Exception e)
    {
View Full Code Here

TOP

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

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.