Package org.infoglue.cms.entities.management

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


     
    String value = "";
   
    try
    {
        LanguageVO languageVO = (LanguageVO)LanguageController.getController().getLanguageVOList().get(0);
        value = InfoGluePrincipalControllerProxy.getController().getPrincipalPropertyValue(infoGluePrincipal, propertyName, languageVO.getId(), null, false, escapeSpecialCharacters, findLargestValue);
    }
    catch(Exception e)
    {
        logger.warn("An error occurred trying to get property " + propertyName + " from infoGluePrincipal:" + e.getMessage(), e);
    }
View Full Code Here


    String value = "";
   
    try
    {
        InfoGluePrincipal infoGluePrincipal = this.getInfoGluePrincipal();
        LanguageVO languageVO = (LanguageVO)LanguageController.getController().getLanguageVOList().get(0);
        value = InfoGluePrincipalControllerProxy.getController().getPrincipalPropertyValue(infoGluePrincipal, propertyName, languageVO.getId(), null, false, escapeSpecialCharacters, findLargestValue, findPrioValue);
    }
    catch(Exception e)
    {
        logger.warn("An error occurred trying to get property " + propertyName + " from infoGluePrincipal:" + e.getMessage(), e);
    }
View Full Code Here

    Map value = new HashMap();
   
    try
    {
        InfoGluePrincipal infoGluePrincipal = this.getInfoGluePrincipal();
        LanguageVO languageVO = (LanguageVO)LanguageController.getController().getLanguageVOList().get(0);
      value = InfoGluePrincipalControllerProxy.getController().getPrincipalPropertyHashValues(infoGluePrincipal, propertyName, languageVO.getId(), null, false, escapeSpecialCharacters);
    }
    catch(Exception e)
    {
        logger.warn("An error occurred trying to get property " + propertyName + " from infoGluePrincipal:" + e.getMessage(), e);
    }
View Full Code Here

    return DigitalAssetController.getController().getContentId(digitalAssetId);
  }

  public LanguageVO getLanguageVO(Integer languageId) throws Exception
  {
    LanguageVO languageVO = LanguageController.getController().getLanguageVOWithId(languageId);

    return languageVO;
  }
View Full Code Here

      if(snVO == null)
        return;
     
        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)
        {
            //TODO - lets keep the ref to meta info alive...
            //RegistryController.getController().updateSiteNodeVersion(siteNodeVersion, db);
            //RegistryController.getController().updateContentVersion(contentVersionVO, siteNodeVersionVO, db);
          RegistryController.getController().updateContentVersionThreaded(contentVersionVO, siteNodeVersionVO);
View Full Code Here

          logger.info("Using prio value");
      }
     
      if(value.equals("") && useLanguageFallback)
      {
        LanguageVO masterLanguageVO = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId);
        if(!masterLanguageVO.getLanguageId().equals(languageId))
          value = getPrincipalPropertyValue(infoGluePrincipal, propertyName, masterLanguageVO.getLanguageId(), siteNodeId, useLanguageFallback, escapeSpecialCharacters, findLargestValue);
      }
    }
   
    if(value.equals(""))
    { 
      List groups = infoGluePrincipal.getGroups();
      String largestValue = "-1";
      String prioValue = null;
      int latestPriority = 0;
      Iterator groupsIterator = groups.iterator();
      while(groupsIterator.hasNext())
      {
        InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
       
        Collection groupPropertiesList = GroupPropertiesController.getController().getGroupPropertiesList(group.getName(), languageId, db, true);

        Iterator groupPropertiesListIterator = groupPropertiesList.iterator();
        while(groupPropertiesListIterator.hasNext())
        {
          GroupProperties groupProperties = (GroupProperties)groupPropertiesListIterator.next();
         
          if(groupProperties != null && groupProperties.getLanguage().getLanguageId().equals(languageId) && groupProperties.getValue() != null && propertyName != null)
          {
            String propertyXML = groupProperties.getValue();
            DOMBuilder domBuilder = new DOMBuilder();
            Document document = domBuilder.getDocument(propertyXML);
           
            Node propertyPriorityNode = document.getRootElement().selectSingleNode("attributes/PropertyPriority");
            int currentPriority = 0;
            if(propertyPriorityNode != null)
            {
              try
              {
                String propertyPriorityValue = propertyPriorityNode.getStringValue();
                logger.info("propertyPriorityValue:" + propertyPriorityValue);

                if(propertyPriorityValue != null && !propertyPriorityValue.equals(""))
                  currentPriority = new Integer(propertyPriorityValue);
              }
              catch (Exception e)
              {
                e.printStackTrace();
              }
            }

            Node node = document.getRootElement().selectSingleNode("attributes/" + propertyName);
            if(node != null)
            {
              value = node.getStringValue();
              logger.info("Getting value: " + value);
              if(value != null && escapeSpecialCharacters)
                value = new VisualFormatter().escapeHTML(value);
             
              if(value != null && !value.equals("") && findLargestValue && new Integer(largestValue).intValue() < new Integer(value).intValue())
                  largestValue = value;
             
              logger.info("" + findLargestValue + ":" + findPrioValue + ":" + currentPriority + "=" + latestPriority);
              if(value != null && !value.equals("") && !findLargestValue && findPrioValue && currentPriority > latestPriority)
              {
                logger.info("Using other value..");
                prioValue = value;
                latestPriority = currentPriority;
              }
             
              break;
            }
          }
        }
      }
     
      if(findLargestValue)
          value = largestValue;
     
      if(findPrioValue && prioValue != null)
      {
          value = prioValue;
          logger.info("Using prio value");
      }

      if(value.equals("") && useLanguageFallback)
      {
        LanguageVO masterLanguageVO = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId);
        if(!masterLanguageVO.getLanguageId().equals(languageId))
          value = getPrincipalPropertyValue(infoGluePrincipal, propertyName, masterLanguageVO.getLanguageId(), siteNodeId, useLanguageFallback, escapeSpecialCharacters, findLargestValue);
      }
    }
     
    if(value != null)
        CacheController.getCachedObject("principalPropertyValueCache", key);
View Full Code Here

    if(this.languageId == null)
    {
      this.languageId = createContentWizardInfoBean.getLanguageId();
      if(this.languageId == null)
      {     
        LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(createContentWizardInfoBean.getRepositoryId());
        this.languageId = masterLanguageVO.getLanguageId();
      }
    }
   
    if(this.contentVersionVO != null && this.contentVersionVO.getContentVersionId() != null)
           digitalAssets = DigitalAssetController.getDigitalAssetVOList(this.contentVersionVO.getId());
View Full Code Here

    if(this.languageId == null)
    {
      this.languageId = createContentWizardInfoBean.getLanguageId();
      if(this.languageId == null)
      {
        LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(createContentWizardInfoBean.getRepositoryId());
        this.languageId = masterLanguageVO.getLanguageId();
      }
    }

    if(this.contentVersionId == null)
    {
View Full Code Here

      remainingLanguages.addAll(languageList);
         
      Iterator languageIterator = languageList.iterator();
      while(languageIterator.hasNext())
      {
        LanguageVO languageVO = (LanguageVO)languageIterator.next();
        logger.info("Language:" + languageVO.getName());   
        Iterator repositoryLanguageIterator = repositoryLanguageList.iterator();
        while(repositoryLanguageIterator.hasNext())
        {
          RepositoryLanguage repositoryLanguage = (RepositoryLanguage)repositoryLanguageIterator.next();
          logger.info("Comparing" + languageVO.getLanguageId().intValue() + " and " + repositoryLanguage.getLanguage().getLanguageId().intValue());
          if(languageVO.getLanguageId().intValue() == repositoryLanguage.getLanguage().getLanguageId().intValue())
          {
            remainingLanguages.remove(languageVO);
          }
        }
      }
View Full Code Here

    return contentVO;
  }

  public LanguageVO getLanguageVO(Integer languageId)
  {
    LanguageVO languageVO = null;
   
    try
    {
      if(languageId != null)
      {
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.