Package org.infoglue.cms.entities.management

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


   public void unpublishRepositoryLanguage(RepositoryLanguageVO repositoryLanguageVO) throws ConstraintException, SystemException
   {
     Database db = CastorDatabaseService.getDatabase();
     ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

     RepositoryLanguage repositoryLanguage = null;

     beginTransaction(db);

     try
     {
       //Here we should do some serious cleanup.... take away all content-attributes that has this language for example?
       repositoryLanguage = getRepositoryLanguageWithId(repositoryLanguageVO.getRepositoryLanguageId(), db);
       repositoryLanguage.setIsPublished(new Boolean(false));
       commitTransaction(db);
     }
     catch(Exception e)
     {
       logger.error("An error occurred so we should not complete the transaction:" + e, e);
View Full Code Here


     beginTransaction(db);

     try
     {
         RepositoryLanguage originalRepositoryLanguage = this.getRepositoryLanguageWithId(repositoryLanguageVO.getRepositoryLanguageId(), db);
         List repositoryLanguages = this.getRepositoryLanguageListWithRepositoryId(originalRepositoryLanguage.getRepository().getId(), db);
      
       for(int i=0; i<repositoryLanguages.size(); i++)
       {
           RepositoryLanguage repositoryLanguage = (RepositoryLanguage)repositoryLanguages.get(i);
           if(repositoryLanguage.getRepositoryLanguageId().intValue() == repositoryLanguageVO.getRepositoryLanguageId().intValue())
           {
               if(down && i != repositoryLanguages.size() - 1)
               {
                   RepositoryLanguage nextRepositoryLanguage = (RepositoryLanguage)repositoryLanguages.get(i+1);
                   Integer currentSortOrder = repositoryLanguage.getSortOrder();
                   repositoryLanguage.setSortOrder(nextRepositoryLanguage.getSortOrder());
                   nextRepositoryLanguage.setSortOrder(currentSortOrder);
               }
               else if(!down && i != 0)
               {
                   RepositoryLanguage previousRepositoryLanguage = (RepositoryLanguage)repositoryLanguages.get(i-1);
                   Integer currentSortOrder = repositoryLanguage.getSortOrder();
                   repositoryLanguage.setSortOrder(previousRepositoryLanguage.getSortOrder());
                   previousRepositoryLanguage.setSortOrder(currentSortOrder);            
               }
           }
       }
      
       commitTransaction(db);
View Full Code Here

   public void createRepositoryLanguage(Integer repositoryId, Integer languageId, Integer sortOrder) throws ConstraintException, SystemException
   {
     Database db = CastorDatabaseService.getDatabase();
     ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

     RepositoryLanguage repositoryLanguage = null;

     beginTransaction(db);

     try
     {
View Full Code Here

            if(languageValues != null)
      {
        for (int i=0; i < languageValues.length; i++)
              {
                Language language = LanguageController.getController().getLanguageWithId(new Integer(languageValues[i]), db);
                RepositoryLanguage repositoryLanguage = create(repository.getId(), new Integer(languageValues[i]), new Integer(i), db);
                repositoryLanguageList.add(repositoryLanguage);
              }
      }
     
      //repository = RepositoryController.getController().getRepositoryWithId(repositoryVO.getRepositoryId(), db);
View Full Code Here

        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

   
        Collection repositoryLanguages = repositoryRead.getRepositoryLanguages();
        Iterator repositoryLanguagesIterator = repositoryLanguages.iterator();
        while(repositoryLanguagesIterator.hasNext())
        {
          RepositoryLanguage repositoryLanguage = (RepositoryLanguage)repositoryLanguagesIterator.next();
          Language originalLanguage = repositoryLanguage.getLanguage();
         
          Language language = LanguageController.getController().getLanguageWithCode(originalLanguage.getLanguageCode(), db);
          if(language == null)
          {
              db.create(originalLanguage);
              language = originalLanguage;
          }
         
          repositoryLanguage.setLanguage(language);
          repositoryLanguage.setRepository(repositoryRead);
   
          db.create(repositoryLanguage);
         
          logger.info("language:" + language);
          logger.info("language.getRepositoryLanguages():" + language.getRepositoryLanguages());
View Full Code Here

    Repository repository = RepositoryController.getController().getRepositoryWithId(siteNodeVO.getRepositoryId(), templateController.getDatabase());
    Collection languages = repository.getRepositoryLanguages();
    Iterator languagesIterator = languages.iterator();
    while(languagesIterator.hasNext())
    {
        RepositoryLanguage repositoryLanguage = (RepositoryLanguage)languagesIterator.next();
        LanguageDeliveryController.getLanguageDeliveryController().getLanguageIfSiteNodeSupportsIt(templateController.getDatabase(), repositoryLanguage.getLanguage().getId(), siteNodeId);
    }
  
     
      Integer contentId = new Integer(-1);
     
View Full Code Here

    {
      Collection languages = repository.getRepositoryLanguages();
      Iterator languageIterator = languages.iterator();
      while(languageIterator.hasNext())
      {
        RepositoryLanguage repositoryLanguage = (RepositoryLanguage)languageIterator.next();
        Language currentLanguage = repositoryLanguage.getLanguage();
        logger.info("CurrentLanguageCode:" + currentLanguage.getLanguageCode());
        currentIndex = languageCodes.toLowerCase().indexOf(currentLanguage.getLanguageCode().toLowerCase());
        if( currentIndex > -1 && currentIndex < index)
        {
          index = currentIndex;
View Full Code Here

            if(languageValues != null)
      {
        for (int i=0; i < languageValues.length; i++)
              {
                Language language = LanguageController.getController().getLanguageWithId(new Integer(languageValues[i]), db);
                RepositoryLanguage repositoryLanguage = RepositoryLanguageController.getController().create(repositoryVO.getRepositoryId(), new Integer(languageValues[i]), new Integer(i), db);
                repositoryLanguageList.add(repositoryLanguage);
          language.getRepositoryLanguages().add(repositoryLanguage);
              }
      }
     
View Full Code Here

    return languageVO;
  }

    public Language getLanguageWithRepositoryLanguageId(Integer repositoryLanguageId, Database db) throws ConstraintException, SystemException, Bug
    {
    RepositoryLanguage repositoryLanguage = (RepositoryLanguage) getObjectWithId(RepositoryLanguageImpl.class, repositoryLanguageId, db);
    Language language = repositoryLanguage.getLanguage();
       
    return language;
    }
View Full Code Here

TOP

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

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.