Package org.infoglue.cms.entities.content

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


      List<LanguageVO> languageVOList = RepositoryLanguageController.getController().getAvailableLanguageVOListForRepositoryId(this.content.getRepositoryId());
      if(logger.isInfoEnabled())
        logger.info("languageVOList:" + languageVOList.size());
      for(LanguageVO languageVO : languageVOList)
      {
        ContentVersionVO cv = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(this.content.getId(), languageVO.getId());
        if(logger.isInfoEnabled())
          logger.info("cv:" + cv);
       
        if(cv != null)
        {
          cv.setLanguageName(languageVO.getName());
          contentChildren.add( new ContentVersionResource(cv) );         
        }
      }

      List<ContentVO> children = ContentController.getContentController().getContentChildrenVOList(content.getId(), null, false);
View Full Code Here


              bean.setRemoteVersion(remoteContentVO);
              if(localContentVO != null)
              {
                  bean.setLocalVersion(localContentVO);
              LanguageVO languageVO = LanguageController.getController().getMasterLanguage(localContentVO.getRepositoryId());
              ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(localContentVO.getId(), languageVO.getId());
              if(contentVersionVO != null)
              {
                localContentVO.setVersions(new String[]{contentVersionVO.getVersionValue()});
                localContentVO.setVersionComments(new String[]{contentVersionVO.getVersionComment()});
                localContentVO.setContentVersion(contentVersionVO);
              }
              }
   
              deviatingContents.add(bean);
            }
          }
          else
          {
            Iterator componentsIterator = components.iterator();
            while(componentsIterator.hasNext())
            {
              ContentVO localContentVO = (ContentVO)componentsIterator.next();
            String fullPath = ContentController.getContentController().getContentPath(localContentVO.getId(), true, true);
            localContentVO.setFullPath(fullPath);
 
            Iterator remoteContentVOListIterator = remoteContentVOList.iterator();
              ContentVO remoteContentVO = null;
              while(remoteContentVOListIterator.hasNext())
              {
                ContentVO remoteContentVOCandidate = (ContentVO)remoteContentVOListIterator.next();
                if(localContentVO.getName().equals(remoteContentVOCandidate.getName()))
                  remoteContentVO = remoteContentVOCandidate;
              }
             
              DeploymentCompareBean bean = new DeploymentCompareBean();
            LanguageVO languageVO = LanguageController.getController().getMasterLanguage(localContentVO.getRepositoryId());
            ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(localContentVO.getId(), languageVO.getId());
            if(contentVersionVO != null)
            {
              localContentVO.setVersions(new String[]{contentVersionVO.getVersionValue()});
              localContentVO.setVersionComments(new String[]{contentVersionVO.getVersionComment()});
              localContentVO.setContentVersion(contentVersionVO);
            }
              bean.setLocalVersion(localContentVO);
 
              if(remoteContentVO != null)
View Full Code Here

 
                    ContentVO parentContent = ContentController.getContentController().getContentVOWithPath(repositoryVO.getId(), restString, true, this.getInfoGluePrincipal());
                    logger.info("parentContent:" + parentContent);
                    ContentVO newContentVO = ContentController.getContentController().create(parentContent.getId(), contentTypeDefinitionVO.getContentTypeDefinitionId(), parentContent.getRepositoryId(), remoteContentVO);
                    logger.info("Now we want to create the version also on:" + newContentVO.getName());
                    ContentVersionVO contentVersionVO = new ContentVersionVO();
                    contentVersionVO.setVersionComment("deployment");
                    contentVersionVO.setVersionModifier(this.getInfoGluePrincipal().getName());
                    if(remoteContentVO.getVersions() != null && remoteContentVO.getVersions().length > 0)
                    {
                      contentVersionVO.setVersionValue(remoteContentVO.getVersions()[0]);
                      ContentVersionController.getContentVersionController().create(newContentVO.getId(), languageVO.getId(), contentVersionVO, null);
                    }
                  }
                }
                catch (Exception e)
                {
                  e.printStackTrace();
                }

                break;
              }
            }
            /*
            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.setFullPath(fullPath);

            missingComponents.add(contentVO);
            }
            */
          }
        }

       
        String[] deviatingRemoteContentIdArray = this.getRequest().getParameterValues("deviatingContentId");
        //logger.info("deviatingRemoteContentIdArray:" + deviatingRemoteContentIdArray);
       
        List components = ContentController.getContentController().getContentVOWithContentTypeDefinition("HTMLTemplate");
       
        if(deviatingRemoteContentIdArray != null)
        {
          for(int i=0; i<deviatingRemoteContentIdArray.length; i++)
          {
            String deviatingRemoteContentId = deviatingRemoteContentIdArray[i];
           
            //String deviatingContentName = deviatingRemoteContentIdArray[i];
            //logger.info("Updating deviatingContentName:" + deviatingContentName);
   
              Iterator remoteContentVOListIterator = remoteContentVOList.iterator();
              while(remoteContentVOListIterator.hasNext())
              {
                ContentVO remoteContentVO = (ContentVO)remoteContentVOListIterator.next();
                //logger.info("remoteContentVO:" + remoteContentVO.getName());
                if(remoteContentVO.getId().toString().equals(deviatingRemoteContentId))
                {
                  String[] versionValues = remoteContentVO.getVersions();
                  if(versionValues != null && versionValues.length > 0)
                  {
                    String remoteVersionValue = versionValues[0];
 
                    Iterator componentsIterator = components.iterator();
                      ContentVO localContentVO = null;
                      while(componentsIterator.hasNext())
                      {
                        ContentVO candidate = (ContentVO)componentsIterator.next();
                        if(candidate.getName().equals(remoteContentVO.getName()))
                        {
                          localContentVO = candidate;
                        }
                      }
                     
                  LanguageVO languageVO = LanguageController.getController().getMasterLanguage(localContentVO.getRepositoryId());
                  ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(localContentVO.getId(), languageVO.getId());
                  if(contentVersionVO != null)
                  {
                    contentVersionVO.setVersionValue(remoteVersionValue);
                    //logger.info("Updating :" + localContentVO.getName() + " with new latest versionValue");
                    ContentVersionController.getContentVersionController().update(contentVersionVO.getId(), contentVersionVO);
                  }
                  }
                }
              }
          }
        }
      }
      else
      {
        logger.info("Updating components with push....");

        Map input = new HashMap();

        String[] missingLocalContentIdArray = this.getRequest().getParameterValues("missingContentId");
        logger.info("missingLocalContentIdArray:" + missingLocalContentIdArray);
       
        List missingComponents = new ArrayList();
        if(missingLocalContentIdArray != null)
        {
          for(int i=0; i<missingLocalContentIdArray.length; i++)
          {
            String missingLocalContentId = missingLocalContentIdArray[i];
            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[]{"BBBBBB:" + 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];
            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[]{"AAAAAAA:" + contentVersionVO.getVersionComment()});
            }
            contentVO.setFullPath(fullPath);

            deviatingComponents.add(contentVO);
            }
View Full Code Here

  {
    boolean hasVersion = false;
   
    try
    {
      ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(this.contentId, this.languageId);
      if(contentVersionVO != null)
      {
        hasVersion = true;
      }
    }
View Full Code Here

  {
    boolean isReadOnly = false;
   
    try
    {
      ContentVersionVO contentVersion = ContentVersionController.getContentVersionController().getContentVersionVOWithId(this.contentVersionId);
      if(contentVersion != null && (contentVersion.getStateId().intValue() == 1 || contentVersion.getStateId().intValue() == 2 || contentVersion.getStateId().intValue() == 3))
      {
        isReadOnly = true
      }
    }
    catch(Exception e){}
View Full Code Here

    try
    {
        boolean latest = true;
        if(this.contentVersionId != null)
        {
            ContentVersionVO currentContentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId(this.contentVersionId);
            ContentVersionVO latestContentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(currentContentVersionVO.getContentId(), currentContentVersionVO.getLanguageId());
            if(currentContentVersionVO != null && latestContentVersionVO != null && currentContentVersionVO.getId().intValue() != latestContentVersionVO.getId().intValue())
                latest = false;
           
            extraInformation = "" + getStateDescription(currentContentVersionVO);
        }
       
View Full Code Here

    }
   
    Iterator i = l.iterator();
    while(i.hasNext())
    {
      ContentVersionVO vo = (ContentVersionVO) i.next();
      ContentNodeImpl node =  new ContentNodeImpl();
      node.setId(vo.getId());
      node.setState(vo.getStateId());
      node.setContainer(false);
      node.setTitle(vo.getVersionComment() + " (" + vo.getModifiedDateTime() + ")");
      node.getParameters().put("languageId", vo.getLanguageId());
      node.getParameters().put("languageName", vo.getLanguageName());

      ret.add(node);
     
    }
   
View Full Code Here

              {
                ContentVO contentVO = ContentController.getContentController().getSmallContentVOWithId(incompleteContentVersionVO.getContentId(), db, null);
               
                String groupNameDefault = "Unknown";
            String descriptionDefault = "Unknown";
            ContentVersionVO fullContentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId(incompleteContentVersionVO.getId(), db);
            String groupNameAttribute = ContentVersionController.getContentVersionController().getAttributeValue(fullContentVersionVO, "GroupName", false);
                String descriptionAttribute = ContentVersionController.getContentVersionController().getAttributeValue(fullContentVersionVO, "Description", false);
                logger.info("GroupInfo ContentVersionId:" + incompleteContentVersionVO.getId() + " - " + groupNameAttribute);
            contentVO.getExtraProperties().put("GroupName", (groupNameAttribute == null ? groupNameDefault : groupNameAttribute));
            contentVO.getExtraProperties().put("Description", (descriptionAttribute == null ? descriptionDefault : descriptionAttribute));
View Full Code Here

    {
        ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
        if(contentVO != null)
        {
          LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentId, masterLanguageVO.getId());
   
          String groupNameDefault = "Unknown";
        String descriptionDefault = "Unknown";
          String groupNameAttribute = ContentVersionController.getContentVersionController().getAttributeValue(contentVersionVO, "GroupName", false);
          String descriptionAttribute = ContentVersionController.getContentVersionController().getAttributeValue(contentVersionVO, "Description", false);
            logger.info("GroupInfo ContentVersionId:" + contentVersionVO.getId() + " - " + groupNameAttribute);
        contentVO.getExtraProperties().put("GroupName", (groupNameAttribute == null ? groupNameDefault : groupNameAttribute));
        contentVO.getExtraProperties().put("Description", (descriptionAttribute == null ? descriptionDefault : descriptionAttribute));
     
          List<ContentVO> allComponents = templatesAndPagePartMap.get("all");
          if(allComponents == null)
View Full Code Here

      boolean isPartOfAllowedComponentGroupNames = false;
      if(allowedComponentGroups != null && allowedComponentGroups.length > 0)
      {
        LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());   

            ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestContentVersionVO(contentVO.getContentId(), masterLanguageVO.getId());
            String groupName = null;
            if(contentVersionVO != null)
              groupName = ContentVersionController.getContentVersionController().getAttributeValue(contentVersionVO, "GroupName", false);

            for(int i=0; i<allowedComponentGroups.length; i++)
View Full Code Here

TOP

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

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.