Package org.infoglue.cms.entities.content

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


          logger.info("templateLanguageCode:" + templateLanguageCode);
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithName(repositoryName);
        LanguageVO masterLanguageVO = LanguageController.getController().getLanguageVOWithCode(templateLanguageCode);
       
       
        ContentVO localParentContentVO = null;
        if(repositoryVO == null)
        {
          RepositoryVO newRepositoryVO = new RepositoryVO();
          newRepositoryVO.setName(repositoryName);
          newRepositoryVO.setDnsName("undefined");
          newRepositoryVO.setDescription("Autogenerated during cvs sync");

          repositoryVO = RepositoryController.getController().create(newRepositoryVO);
          if(masterLanguageVO == null)
            masterLanguageVO = (LanguageVO)LanguageController.getController().getLanguageVOList().get(0);
         
          RepositoryLanguageController.getController().createRepositoryLanguage(repositoryVO.getId(), masterLanguageVO.getId(), 0);
          localParentContentVO = ContentController.getContentController().getRootContentVO(repositoryVO.getId(), getInfoGluePrincipal().getName(), true);
          this.repositoryCreated = true;
        }
        else
        {
          logger.info("Found repository:" + repositoryVO.getName());
          localParentContentVO = ContentController.getContentController().getRootContentVO(repositoryVO.getId(), getInfoGluePrincipal().getName(), true);
          masterLanguageVO = LanguageController.getController().getMasterLanguage(repositoryVO.getId());
        }
       
        String contentPath = getContentPathAsListFromCheckoutFile(missingRemoteContentFile);
        logger.info("contentPath:" + contentPath);
       
        ContentVO contentVO = ContentController.getContentController().getContentVOWithPath(repositoryVO.getId(), contentPath, true, getInfoGluePrincipal());
          if(contentVO != null)
          {
            if(missingRemoteContentFile.isFile())
            {
              ContentVO newContentVO = new ContentVO();
              newContentVO.setCreatorName(getInfoGluePrincipal().getName());
              newContentVO.setIsBranch(false);
              newContentVO.setName(plainName);
              ContentVO newlyCreatedContentVO = ContentController.getContentController().create(contentVO.getId(), ctd.getContentTypeDefinitionId(), contentVO.getRepositoryId(), newContentVO);
             
              logger.info("Created content:" + newlyCreatedContentVO.getName());
 
              String fileContent = "";
              if(missingRemoteContentFile.exists())
                fileContent = FileHelper.getFileAsString(missingRemoteContentFile, "iso-8859-1");
           
              ContentVersionVO newContentVersionVO = new ContentVersionVO();
              newContentVersionVO.setVersionComment("Checked out from version control system (tag: " + tagName + ")");
              newContentVersionVO.setVersionModifier(getInfoGluePrincipal().getName());
              newContentVersionVO.setVersionValue(fileContent);
              ContentVersionController.getContentVersionController().create(newlyCreatedContentVO.getId(), masterLanguageVO.getId(), newContentVersionVO, null);
            }
            else
            {
              ContentVO newContentVO = new ContentVO();
              newContentVO.setCreatorName(getInfoGluePrincipal().getName());
              newContentVO.setIsBranch(true);
              newContentVO.setName(plainName);
              ContentVO newlyCreatedContentVO = ContentController.getContentController().create(contentVO.getId(), ctdFolder.getContentTypeDefinitionId(), contentVO.getRepositoryId(), newContentVO);
             
              logger.info("Created content:" + newlyCreatedContentVO.getName());
            }
        }
        }
      }
     
      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 deviatingFilePath = this.getRequest().getParameter("deviatingRemoteVersionId_" + deviatingLocalContentId);
            logger.info("deviatingFilePath:" + deviatingFilePath);
           
            ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(deviatingLocalContentId).intValue());
          if(contentVO != null)
          {
          LanguageVO languageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId());
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageVO.getId());
          String fileContent = FileHelper.getFileAsString(new File(deviatingFilePath), "iso-8859-1");
         
          contentVersionVO.setVersionValue(fileContent);
          contentVersionVO.setVersionComment("Checked out from version control system (tag: " + tagName + ")");
         
          logger.info("We are going to replace local content: " + contentVO.getName() + " with contents in " + deviatingFilePath);
          ContentVersionController.getContentVersionController().update(contentVersionVO.getContentId(), contentVersionVO.getLanguageId(), contentVersionVO, getInfoGluePrincipal());
        }
        }
      }
     
View Full Code Here


    return languageVO;
  }

  public ContentVO getContentVO(Integer contentId) throws Exception
  {
    ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);

    return contentVO;
  }
View Full Code Here

  public String getContentPath(Integer contentId) throws Exception
  {
    StringBuffer sb = new StringBuffer();
   
    ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId);
    sb.insert(0, contentVO.getName());
    while(contentVO.getParentContentId() != null)
    {
      contentVO = ContentController.getContentController().getContentVOWithId(contentVO.getParentContentId());
      sb.insert(0, contentVO.getName() + "/");
    }
    sb.insert(0, "/");
   
    return sb.toString();
  }
View Full Code Here

  public String getContentPath(Integer contentId, Database db) throws Exception
  {
    StringBuffer sb = new StringBuffer();
   
    ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentId, db);
    sb.insert(0, contentVO.getName());
    while(contentVO.getParentContentId() != null)
    {
      contentVO = ContentController.getContentController().getContentVOWithId(contentVO.getParentContentId(), db);
      sb.insert(0, contentVO.getName() + "/");
    }
    sb.insert(0, "/");
   
    return sb.toString();
  }
View Full Code Here

        List<LanguageVO> languages = LanguageController.getController().getAvailableLanguageVOListForRepository(snVO.getRepositoryId(), db);
    RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getAvailableLanguageVOListForRepository..", t.getElapsedTime());
        LanguageVO masterLanguage = LanguageController.getController().getMasterLanguage(snVO.getRepositoryId(), db);
    RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getMasterLanguage..", t.getElapsedTime());

      ContentVO contentVO = null;
      if(snVO.getMetaInfoContentId() != null)
      {
        try
        {
          contentVO = ContentController.getContentController().getSmallContentVOWithId(snVO.getMetaInfoContentId(), db, null);
        }
        catch (Exception e)
        {
          if(e.getCause().getClass().getName().equals(ObjectNotFoundException.class.getName()))
          {
            logger.error("No meta info found on " + snVO.getId() + ". Returning as if ok.");
            return;
          }
      }
      }
      else
      {
          logger.warn("There was no metaInfoContentId on the siteNode... run validation to improve performance..");

          Integer metaInfoAvailableServiceBindingId = null;
        Integer serviceBindingId = null;
        AvailableServiceBindingVO availableServiceBindingVO = AvailableServiceBindingController.getController().getAvailableServiceBindingVOWithName("Meta information", db);
        if(availableServiceBindingVO != null)
          metaInfoAvailableServiceBindingId = availableServiceBindingVO.getAvailableServiceBindingId();

          logger.info("after loading service binding for meta info");

        List<SmallServiceBindingImpl> serviceBindings = ServiceBindingController.getController().getSmallServiceBindingsListForSiteNodeVersion(siteNodeVersionVO.getSiteNodeVersionId(), db);
        Iterator<SmallServiceBindingImpl> serviceBindingIterator = serviceBindings.iterator();
        while(serviceBindingIterator.hasNext())
        {
          SmallServiceBindingImpl serviceBinding = serviceBindingIterator.next();
          if(serviceBinding.getAvailableServiceBinding().getId().intValue() == metaInfoAvailableServiceBindingId.intValue())
          {
            serviceBindingId = serviceBinding.getId();
            break;
          }
        }

        if(serviceBindingId != null)
        {
          List boundContents = ContentController.getBoundContents(db, serviceBindingId);
          logger.info("boundContents:" + boundContents.size());
          if(boundContents.size() > 0)
          {
            contentVO = (ContentVO)boundContents.get(0);
            logger.info("contentVO:" + contentVO.getId());
          }
        }
      }
    RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getSmallContentVOWithId..", t.getElapsedTime());

      if(contentVO != null)
      {       
      Iterator<LanguageVO> languageIterator = languages.iterator();
      while(languageIterator.hasNext())
      {
        LanguageVO language = languageIterator.next();
        ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), language.getId(), db);

        //if(contentVersion != null && contentVersion.getStateId().intValue() == siteNodeVersion.getStateId().intValue())
        if(contentVersionVO != null && contentVersionVO.getStateId().intValue() != stateId.intValue())
        {
          logger.info("State on current:" + contentVersionVO.getStateId());
            logger.info("changing state on contentVersion:" + contentVersionVO.getId());
            ContentVersion contentVersion = ContentStateController.changeState(contentVersionVO.getId(), contentVO, stateId, versionComment, overrideVersionModifyer, null, infoGluePrincipal, contentVO.getId(), db, events);
            contentVersionVO = contentVersion.getValueObject();
        }

        if(language.getId().equals(masterLanguage.getId()) && contentVersionVO != null)
        {
View Full Code Here

    return topRepositoryId;
  }
 
  public CreateContentWizardAction()
  {
    this(new ContentVO());
  }
View Full Code Here

  private String[] allowedContentTypeIds   = null;


  public CreateContentWizardInputContentAction()
  {
    this(new ContentVO());
  }
View Full Code Here

        initialContentVersionVO.setVersionModifier(this.getInfoGluePrincipal().getName());
        initialContentVersionVO.setVersionValue(versionValue);
       
        createContentWizardInfoBean.getContentVersions().put(languageId, initialContentVersionVO);
 
          ContentVO contentVO = ContentControllerProxy.getController().acCreate(this.getInfoGluePrincipal(), createContentWizardInfoBean);
        this.contentId = contentVO.getContentId();
        createContentWizardInfoBean.setContentVO(contentVO);
     
        ContentVersionVO newContentVersion = (ContentVersionVO)createContentWizardInfoBean.getContentVersions().get(languageId);
        this.contentVersionId = newContentVersion.getId();
      }
View Full Code Here

        initialContentVersionVO.setVersionModifier(this.getInfoGluePrincipal().getName());
        initialContentVersionVO.setVersionValue(versionValue);
       
        createContentWizardInfoBean.getContentVersions().put(languageId, initialContentVersionVO);
 
          ContentVO contentVO = ContentControllerProxy.getController().acCreate(this.getInfoGluePrincipal(), createContentWizardInfoBean);
        this.contentId = contentVO.getContentId();
        createContentWizardInfoBean.setContentVO(contentVO);
     
        ContentVersionVO newContentVersion = (ContentVersionVO)createContentWizardInfoBean.getContentVersions().get(languageId);
        this.contentVersionId = newContentVersion.getId();
      }
View Full Code Here

      return Action.INPUT + "InlineAssetV3";
  }

  public ContentVO getContentVO(Integer contentId)
  {
    ContentVO contentVO = null;
   
    try
    {
      if(contentId != null)
      {
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.