Package org.infoglue.cms.entities.content

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


      return Action.INPUT + "InlineAssetV3";
  }

  public ContentVO getContentVO(Integer contentId)
  {
    ContentVO contentVO = null;
   
    try
    {
      if(contentId != null)
      {
View Full Code Here


    }

    Iterator<ContentVO> contentsMarkedForDeletionIterator = contentsMarkedForDeletion.iterator();
    while(contentsMarkedForDeletionIterator.hasNext())
    {
      ContentVO contentVO = contentsMarkedForDeletionIterator.next();
      try
      {
        ContentControllerProxy.getController().acDelete(getInfoGluePrincipal(), contentVO, true);
      }
      catch (Exception e)
      {
        logger.error("Could not delete content[" + contentVO.getName() + "]:" + e.getMessage());
        logger.warn("Could not delete content[" + contentVO.getName() + "]:" + e.getMessage(), e);
      }
    }

    Iterator<RepositoryVO> repositoriesMarkedForDeletionIterator = repositoriesMarkedForDeletion.iterator();
    while(repositoriesMarkedForDeletionIterator.hasNext())
View Full Code Here

    try
       
      List arguments = (List)envelope.getNodes();
          Integer contentId = ((Node)arguments.get(0)).getId();
      logger.info("contentId:" + contentId);
            ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
            logger.info("contentVO:" + contentVO.getContentId() + " " + contentVO.getName());
            Node node = new Node();
            node.setId(contentVO.getContentId());
            node.setName(contentVO.getName());
            node.setIsBranch(contentVO.getIsBranch());
           
            List nodes = new ArrayList();
            nodes.add(node);
            responseEnvelope.setNodes(nodes);
        }
View Full Code Here

    return super.doEndTag();
  }

  private ContentVO getContent() throws JspTagException
  {
    ContentVO content;
    try
    {
      content = ContentController.getContentController().getContentVOWithId(contentId);
    }
    catch(Exception e)
View Full Code Here

              AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
             
              if(interceptionPointCategory.equalsIgnoreCase("Content"))
              { 
                Integer contentId = new Integer(parameters);
                ContentVO contentVO = ContentControllerProxy.getController().getContentVOWithId(contentId);
                if(!contentVO.getCreatorName().equalsIgnoreCase(principal.getName()))
                {
                  Integer protectedContentId = ContentControllerProxy.getController().getProtectedContentId(contentId);
                  if(ContentControllerProxy.getController().getIsContentProtected(contentId) && !AccessRightController.getController().getIsPrincipalAuthorized(principal, "Content.ChangeAccessRights", protectedContentId.toString()))
                    ceb.add(new AccessConstraintException("Content.contentId", "1006"));
                }
View Full Code Here

      }
    }
   
    if(contentId != null && contentId > -1)
    {
      ContentVO contentVO = ContentControllerProxy.getController().getACContentVOWithId(getInfoGluePrincipal(), contentId);
      List languageVOList = LanguageController.getController().getLanguageVOList(contentVO.getRepositoryId());
      Iterator languageVOListIterator = languageVOList.iterator();
      while(languageVOListIterator.hasNext())
      {
        LanguageVO language = (LanguageVO)languageVOListIterator.next();
        ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentId, language.getId());
View Full Code Here

        for(int i=0; i<missingLocalContentIdArray.length; i++)
        {
          String missingLocalContentId = missingLocalContentIdArray[i];
            logger.info("missingLocalContentId:" + missingLocalContentId);
                 
            ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(missingLocalContentId).intValue());
          if(contentVO != null)
          {
          LanguageVO languageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());
         
          String fullPath = ContentController.getContentController().getContentPath(contentVO.getId(), true, true);
         
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageVO.getId());
          if(contentVersionVO != null)
          {
            contentVO.setVersions(new String[]{contentVersionVO.getVersionValue()});
            contentVO.setVersionComments(new String[]{contentVersionVO.getVersionComment()});
          }
         
          contentVO.setFullPath(fullPath);

          missingComponents.add(contentVO);
          }
        }
      }

      String[] deviatingLocalContentIdArray = this.getRequest().getParameterValues("deviatingContentId");
      logger.info("deviatingLocalContentIdArray:" + deviatingLocalContentIdArray);
     
      List deviatingComponents = new ArrayList();
      if(deviatingLocalContentIdArray != null)
      {
        for(int i=0; i<deviatingLocalContentIdArray.length; i++)
        {
          String deviatingLocalContentId = deviatingLocalContentIdArray[i];
            logger.info("deviatingLocalContentId:" + deviatingLocalContentId);
       
            String deviatingRemoteVersionId = this.getRequest().getParameter("deviatingRemoteVersionId_" + deviatingLocalContentId);
            logger.info("deviatingRemoteVersionId:" + deviatingRemoteVersionId);

          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(deviatingLocalContentId).intValue());
          if(contentVO != null)
          {
          LanguageVO languageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());
         
          //String fullPath = ContentController.getContentController().getContentPath(contentVO.getId(), true, true);
         
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageVO.getId());
          if(contentVersionVO != null)
          {
            contentVO.setVersions(new String[]{contentVersionVO.getVersionValue()});
            contentVO.setVersionComments(new String[]{contentVersionVO.getVersionComment()});
          }
         
          //contentVO.setFullPath(fullPath);
          contentVO.setFullPath("deviatingRemoteVersionId=" + deviatingRemoteVersionId);
         
          deviatingComponents.add(contentVO);
          }
        }
      }
View Full Code Here

      rootNode.setContainer(rs.getBoolean("isBranch"))
      setRootNode(rootNode);
    }
    else
    {
      ContentVO vo =null;
      try
      {
        vo = ContentControllerProxy.getController().getRootContentVO(repositoryId, userName);
        rootNode.setChildren(true);
        rootNode.setId(vo.getId());
        rootNode.setTitle(vo.getName());
        rootNode.setContainer(vo.getIsBranch().booleanValue())
        setRootNode(rootNode);
      }
      catch (ConstraintException e)
      {
      }
View Full Code Here

  private InfoGluePrincipal infogluePrincipal = null;
  private List languageVOList = null;
 
  public ContentNodeSupplier(Integer repositoryId, InfoGluePrincipal infogluePrincipal) throws SystemException
  {
    ContentVO vo =null;
    try
    {
        this.infogluePrincipal = infogluePrincipal;
        this.languageVOList = LanguageController.getController().getLanguageVOList(repositoryId);

      Timer t = new Timer();
      if(repositoryId != null && repositoryId.intValue() > 0)
      {
        try
        {
          vo = ContentControllerProxy.getController().getRootContentVO(repositoryId, infogluePrincipal.getName());
        }
        catch (Exception e)
        {
          logger.warn("Not a valid repository");
        }
        BaseNode rootNode =  new ContentNodeImpl();
        rootNode.setChildren(true);
        rootNode.setId(vo.getId());
        rootNode.setTitle(vo.getName());
        rootNode.setContainer(vo.getIsBranch().booleanValue())
       
        setRootNode(rootNode);
      }
     
      if(logger.isDebugEnabled())
View Full Code Here

      {
            List filteredList = new ArrayList();
            Iterator iterator = children.iterator();
        while(iterator.hasNext())
        {
          ContentVO contentVO = (ContentVO) iterator.next();
          if(contentVO.getContentTypeDefinitionId() != null && !contentVO.getIsBranch().booleanValue())
          {
            try
            {
              ContentTypeDefinitionVO contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId());
              boolean exists = false;
              for(int i=0; i<allowedContentTypeIds.length; i++)
              {
                  String allowedId = allowedContentTypeIds[i];
                 
                  if(allowedId.equalsIgnoreCase(contentTypeDefinitionVO.getId().toString()))
                {
                      exists = true;
                      break;
                }
              }
 
              if(exists)
              {
                  filteredList.add(contentVO);
              }
            }
            catch (Exception e)
            {
              logger.warn("The content " + contentVO.getName() + " (" + contentVO.getId() + " ) points to a removed content type perhaps: " + e.getMessage());
            }
          }
          else
          {
              filteredList.add(contentVO);
          }
        }
       
        children = filteredList;
      }
    }
    catch(Exception e)
    {
        logger.warn("Error filtering Content Children", e);
    }
   
    if(logger.isDebugEnabled())
      t.printElapsedTime("Done filtering children");
       
    //Sort the tree nodes if setup to do so
    String sortProperty = CmsPropertyHandler.getContentTreeSort();
    if(sortProperty != null)
      Collections.sort(children, new ReflectionComparator(sortProperty));
    t.printElapsedTime("sorting children took");
   
    Iterator i = children.iterator();
    while(i.hasNext())
    {
      ContentVO vo = (ContentVO) i.next();
     
      boolean hasUserContentAccess = true;
      String useAccessRightsOnContentTreeString = CmsPropertyHandler.getUseAccessRightsOnContentTree();
      if(useAccessRightsOnContentTreeString != null && useAccessRightsOnContentTreeString.equalsIgnoreCase("true"))
        hasUserContentAccess = getHasUserContentAccess(this.infogluePrincipal, vo.getId());

      if(vo.getName().equals("Meta info folder"))
      {
        try
        {
          hasUserContentAccess = AccessRightController.getController().getIsPrincipalAuthorized(this.infogluePrincipal, "ContentTool.ShowMetaInfoFolders", false, true);
        }
        catch (Exception e)
        {
          logger.warn("Problem getting access to meta info:" + e.getMessage(), e);
        }
      }
      t.printElapsedTime("Access right took");
     
      if(hasUserContentAccess)
      {
        BaseNode node =  new ContentNodeImpl();
        node.setId(vo.getId());
        node.setTitle(vo.getName());
       
        //String disableCustomIcons = CmsPropertyHandler.getDisableCustomIcons();
        //if(disableCustomIcons == null || !disableCustomIcons.equals("true"))
          node.getParameters().put("contentTypeDefinitionId", vo.getContentTypeDefinitionId());
       
        if(vo.getIsProtected().intValue() == ContentVO.YES.intValue())
          node.getParameters().put("isProtected", "true");
       
        if(vo.getStateId() != null && vo.getStateId() < ContentVersionVO.PUBLISHED_STATE)
          node.getParameters().put("stateId", "" + vo.getStateId());
        t.printElapsedTime("Getting state took");
       
       
        /*
        try
        {
          Iterator languageVOListIterator = languageVOList.iterator();
          while(languageVOListIterator.hasNext())
          {
            LanguageVO languageVO = (LanguageVO)languageVOListIterator.next();
            ContentVersionVO latestContentVersion = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(vo.getId(), languageVO.getId());
            if(latestContentVersion != null && !latestContentVersion.getStateId().equals(ContentVersionVO.PUBLISHED_STATE))
            {
              node.getParameters().put("stateId", "" + latestContentVersion.getStateId());             
              break;
            }
          }
        }
        catch (Exception e)
        {
          logger.warn("A problem when fecthing latest master content version: " + e.getMessage(), e);
        }
        */
       
        if (vo.getIsBranch().booleanValue())
        {
          node.setContainer(true);
          node.setChildren((vo.getChildCount().intValue() > 0));
         
          ret.add(node);
        }
        else if(showLeafs)
        {
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.