Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.LanguageVO


              DeploymentCompareBean bean = new DeploymentCompareBean();
              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);
View Full Code Here


                    }
                  }
                 
                  if(repositoryVO != null)
                  {
                    LanguageVO languageVO = LanguageController.getController().getMasterLanguage(repositoryVO.getRepositoryId());
 
                    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()});
            }
View Full Code Here

    return contentVO;
  }

  public LanguageVO getLanguageVO(Integer languageId)
  {
    LanguageVO languageVO = null;
   
    try
    {
      if(languageId != null)
      {
View Full Code Here

  private String languageCode;
  private ConstraintExceptionBuffer ceb;
 
  public UpdateLanguageAction()
  {
    this(new LanguageVO());
  }
View Full Code Here

    try
    {
        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);
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

        }
       
        boolean isPartOfAllowedComponentGroupNames = false;
        if(allowedComponentGroups != null && allowedComponentGroups.length > 0 && contentVO.getRepositoryId() != null)
        {
          LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(contentVO.getRepositoryId(), db);
          if(masterLanguageVO != null)
          {
            //logger.info("masterLanguageVO for " + contentVO.getRepositoryId() + " is " + masterLanguageVO);
                ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestContentVersionVO(contentVO.getContentId(), masterLanguageVO.getId(), db);
                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

       
        autoContentVO = ContentController.getContentController().create(db, parentContentVO.getId(), createContentTypeDefinitionVO.getId(), siteNodeVO.getRepositoryId(), autoContentVO).getValueObject();
        ContentVersionController.getContentVersionController().create(autoContentVO.getId(), languageId, autoContentVersionVO, null, db);
       
        Locale locale = LanguageController.getController().getLocaleWithId(languageId, db);
        LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(siteNodeVO.getRepositoryId(), db);   

        String entity = "Content";
        Integer entityId  = new Integer(autoContentVO.getId());
        String propertyName = "" + componentPropertyDefinition.getName();
       
        ComponentController.getController().addComponentPropertyBinding(document, locale, siteNodeId, languageId, masterLanguageVO.getId(), entity, entityId, propertyName, newComponentId, path, assetKey, principal);
      }
    }
  }
View Full Code Here

     
      ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), languageId);
      if(contentVersionVO == null)
      {
        SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId);
        LanguageVO masterLanguage = LanguageController.getController().getMasterLanguage(siteNodeVO.getRepositoryId());
        contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getId(), masterLanguage.getLanguageId());
      }
     
      template = ContentVersionController.getContentVersionController().getAttributeValue(contentVersionVO.getId(), "ComponentStructure", false);
     
      if(template == null)
View Full Code Here

   
      //this.contentVersionVO = ContentVersionControllerProxy.getController().getACLatestActiveContentVersionVO(this.getInfoGluePrincipal(), contentId, languageId);
      //this.contentVersionVO = ContentVersionController.getLatestActiveContentVersionVO(contentId, languageId);
          if(languageId == null)
          {
            LanguageVO languageVO = LanguageController.getController().getMasterLanguage(this.contentVO.getRepositoryId());
            if(languageVO != null)
            {
              languageId = languageVO.getId();
              this.languageId = languageId;
            }
          }

          this.contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentId, languageId);
             if(this.contentVersionVO == null && fallBackToMasterLanguage)
      {
          //logger.info("repositoryId:" + repositoryId);
          Integer usedRepositoryId = this.repositoryId;
          if(this.repositoryId == null && this.contentVO != null)
              usedRepositoryId = this.contentVO.getRepositoryId();
         
          LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(usedRepositoryId);
          //logger.info("MasterLanguage: " + masterLanguageVO);
          this.contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentId, masterLanguageVO.getId());
      }
     
      if(this.contentVersionVO != null)
        contentVersionId = contentVersionVO.getContentVersionId();
    }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.LanguageVO

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.