Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.ConstraintExceptionBuffer


  }
 
  public CreateContentWizardAction(ContentVO contentVO)
  {
    this.contentVO = contentVO;
    this.ceb = new ConstraintExceptionBuffer();     
 
View Full Code Here


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

     beginTransaction(db);

     try
     {
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);
View Full Code Here

 
 
   public void updateRepositoryLanguages(Integer repositoryId, String[] languageValues) throws ConstraintException, SystemException
   {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {     
        Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
        deleteRepositoryLanguages(repository, db);

          //add validation here if needed        
            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);
              }
      }
     
      //repository = RepositoryController.getController().getRepositoryWithId(repositoryVO.getRepositoryId(), db);
            //repository.setValueObject(repositoryVO);
            repository.setRepositoryLanguages(repositoryLanguageList);
     
            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
View Full Code Here

    }
   
  public List getRemainingLanguages(Integer repositoryId) throws ConstraintException, SystemException
  {
    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    List remainingLanguages = new ArrayList();

    beginTransaction(db);

    try
    {
      Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
      Collection repositoryLanguageList = repository.getRepositoryLanguages();
      List languageList = LanguageController.getController().getLanguageVOList();
      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);
          }
        }
      }
         
      //If any of the validations or setMethods reported an error, we throw them up now before create.
      ceb.throwIfNotEmpty();
           
      commitTransaction(db);
    }
    catch(ConstraintException ce)
    {
View Full Code Here

  }
 
  public CreateContentWizardInputContentAction(ContentVO contentVO)
  {
    this.contentVO = contentVO;
    this.ceb = new ConstraintExceptionBuffer();     
 
View Full Code Here

  private String mandatoryAssetMaximumSize  = null;
  private String inputMoreAssets         = null;
 
  public CreateContentWizardFinishAction()
  {
    this.ceb = new ConstraintExceptionBuffer();     
  }
View Full Code Here


    public RepositoryLanguage getRepositoryLanguageWithId(Integer repositoryLanguageId) throws ConstraintException, SystemException, Bug
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        RepositoryLanguage repositoryLanguage = null;

        try
        {
          beginTransaction(db);

        repositoryLanguage = getRepositoryLanguageWithId(repositoryLanguageId, db);
       
            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
View Full Code Here


    public List getRepositoryLanguageVOListWithLanguageId(Integer languageId) throws SystemException, Bug
    {
      Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    ArrayList repositoryLanguageList = new ArrayList();
       
      beginTransaction(db);
     
        try
        {
           OQLQuery oql = db.getOQLQuery("SELECT rl FROM org.infoglue.cms.entities.management.impl.simple.RepositoryLanguageImpl rl WHERE rl.language = $1 order by rl.sortOrder, rl.language.languageId");
      oql.bind(languageId);
     
          QueryResults results = oql.execute(Database.READONLY);
     
      while (results.hasMore())
            {
                RepositoryLanguage repositoryLanguage = (RepositoryLanguage)results.next();
                repositoryLanguageList.add(repositoryLanguage.getValueObject());
            }

      results.close();
      oql.close();

            ceb.throwIfNotEmpty();
            commitTransaction(db);
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not completes the transaction:" + e, e);
View Full Code Here

    }
    else
    {
      */
        Database db = CastorDatabaseService.getDatabase();
          ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
     
        beginTransaction(db);
       
          try
          {
              repositoryLanguageList = getRepositoryLanguageVOListWithRepositoryId(repositoryId, db);
             
              //if(repositoryLanguageList != null)
              //{
              //    CacheController.cacheObject("repositoryLanguageListCache", repositoryLanguageListKey, repositoryLanguageList);
              //}
             
              ceb.throwIfNotEmpty();
              commitTransaction(db);
          }
          catch(Exception e)
          {
              logger.error("An error occurred so we should not completes the transaction:" + e, e);
View Full Code Here

TOP

Related Classes of org.infoglue.cms.util.ConstraintExceptionBuffer

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.