Package org.infoglue.cms.entities.management

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


     
         QueryResults results = oql.execute(Database.READONLY);
          
    while (results.hasMore())
        {
      Language language = (Language)results.next();
        languageVOList.add(language.getValueObject());
        }
  
    results.close();
    oql.close();
View Full Code Here


      Collection repositoryLanguages = repository.getRepositoryLanguages();
      Iterator iterator = repositoryLanguages.iterator();
      while(iterator.hasNext())
      {
        RepositoryLanguage repositoryLanguage = (RepositoryLanguage)iterator.next();
        Language language = repositoryLanguage.getLanguage();
        language.getRepositoryLanguages().remove(repositoryLanguage);
       
        db.remove(repositoryLanguage);
        //deleteEntity(RepositoryLanguageImpl.class, repositoryLanguage.getRepositoryLanguageId(), db);
      }
    }
View Full Code Here

            List repositoryLanguageList = new ArrayList();
            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);
              }
      }
     
View Full Code Here

    {
      ContentVersion contentVersion = (ContentVersion)contentVersionsIterator.next();
     
      Integer languageId = contentVersion.getLanguageId();
      logger.info("languageId:" + languageId);
      Language language = null;
      if(languageIdMap.containsKey(languageId))
      {
        language = languageIdMap.get(languageId);
        logger.info("found match:" + language);
      }
      else
      {
        throw new SystemException("No matching language found in the target repository");
      }
           
      logger.info("Creating contentVersion for language:" + language.getLanguageCode() + " on content " + content.getName());
     
      contentVersion.setOwningContent((ContentImpl)content);
      contentVersion.setLanguage((LanguageImpl)language);
     
      Collection digitalAssets = contentVersion.getDigitalAssets();
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());
          language.getRepositoryLanguages().add(repositoryLanguage);
        }
      }
      db.commit();
    }
    catch (Exception e)
View Full Code Here

      Iterator contentVersionsIterator = contentVersions.iterator();
      while(contentVersionsIterator.hasNext())
      {
        ExportContentVersionImpl contentVersion = (ExportContentVersionImpl)contentVersionsIterator.next();
        Integer languageId = contentVersion.getLanguageId();
        Language oldLanguage = languages.get(languageId);
        if(oldLanguage == null)
        {
          logger.warn("A null language.... strange... setting master language");
          LanguageVO oldLanguageVO = LanguageController.getController().getMasterLanguage(content.getRepositoryId(), db);
          oldLanguage = LanguageController.getController().getLanguageWithId(oldLanguageVO.getId(), db);
        }
       
        Language language = LanguageController.getController().getLanguageWithCode(oldLanguage.getLanguageCode(), db);
        logger.info("Creating contentVersion for language:" + oldLanguage + " on content " + content.getName());
 
        ContentVersion cv = new ContentVersionImpl();
        cv.setValueObject(contentVersion.getValueObject());
       
View Full Code Here

    {
      logger.info("There was an cached languageVO:" + languageVO);
    }
    else
    {
      Language language = (Language)getObjectWithId(LanguageImpl.class, languageId, db);
       
      if(language != null)
        languageVO = language.getValueObject();
           
      CacheController.cacheObject("languageCache", key, languageVO);       
    }
       
    return languageVO;
View Full Code Here

      oql.bind(repositoryId);
     
        QueryResults results = oql.execute(Database.READONLY);
      while(results.hasMore())
          {
        Language language = (Language)results.next();
                list.add(language.getValueObject());
          }
           
      results.close();
      oql.close();
      /* */
 
View Full Code Here

   * todo - add attribute on repositoryLanguage to be able to sort them... and then fetch the first
   */
 
  public LanguageVO getMasterLanguage(Database db, String repositoryName) throws SystemException, Exception
  {
        Language language = null;

       OQLQuery oql = db.getOQLQuery( "SELECT l FROM org.infoglue.cms.entities.management.impl.simple.LanguageImpl l WHERE l.repositoryLanguages.repository.name = $1 ORDER BY l.repositoryLanguages.sortOrder, l.languageId");
    oql.bind(repositoryName);
   
      QueryResults results = oql.execute(Database.READONLY);
   
    if (results.hasMore())
        {
          language = (Language)results.next();
        }
         
    results.close();
    oql.close();

        return (language == null) ? null : language.getValueObject()
  }
View Full Code Here

     
      QueryResults results = oql.execute(Database.READONLY);
     
      if (results.hasMore())
      {
        Language language = (Language)results.next();
        languageVO = language.getValueObject();
      }
     
      results.close();
      oql.close();
View Full Code Here

TOP

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

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.