Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.ConstraintExceptionBuffer


    }
    else
    {
      */
        Database db = CastorDatabaseService.getDatabase();
          ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
     
        beginTransaction(db);
       
          try
          {
            languageVOList = getLanguageVOListForRepositoryId(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


      logger.info("There was an cached list:" + repositoryLanguageVOList);
    }
    else
    {
        Database db = CastorDatabaseService.getDatabase();
          ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
     
        beginTransaction(db);
       
          try
          {
          List availableRepositoryLanguageList = RepositoryLanguageController.getController().getRepositoryLanguageListWithRepositoryId(repositoryId, db);
       
          repositoryLanguageVOList = new ArrayList();
          Iterator i = availableRepositoryLanguageList.iterator();
        while(i.hasNext())
        {
          RepositoryLanguage repositoryLanguage = (RepositoryLanguage)i.next();
          repositoryLanguageVOList.add(repositoryLanguage.getLanguage().getValueObject());
        }
     
                CacheController.cacheObject("repositoryLanguageListCache", repositoryLanguageListKey, repositoryLanguageVOList);
       
        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

  }

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

     RepositoryLanguage repositoryLanguage = null;

     beginTransaction(db);
View Full Code Here

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

     RepositoryLanguage repositoryLanguage = null;

     beginTransaction(db);
View Full Code Here

  }
 
  public CreateInterceptorAction(InterceptorVO interceptorVO)
  {
    this.interceptorVO = interceptorVO;
    this.ceb = new ConstraintExceptionBuffer();
     
 
View Full Code Here

   */
 
  public ContentVO create(CreateContentWizardInfoBean createContentWizardInfoBean) throws ConstraintException, SystemException
  {
    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    Content content = null;

    beginTransaction(db);

    try
    {
      content = create(db, createContentWizardInfoBean.getParentContentId(), createContentWizardInfoBean.getContentTypeDefinitionId(), createContentWizardInfoBean.getRepositoryId(), createContentWizardInfoBean.getContent().getValueObject());
     
      Iterator it = createContentWizardInfoBean.getContentVersions().keySet().iterator();
      while (it.hasNext())
      {
        Integer languageId = (Integer)it.next();
        logger.info("languageId:" + languageId);
        ContentVersionVO contentVersionVO = (ContentVersionVO)createContentWizardInfoBean.getContentVersions().get(languageId);
        contentVersionVO = ContentVersionController.getContentVersionController().createMedium(content.getContentId(), languageId, contentVersionVO, db).getValueObject();
      }
     
      //Bind if needed?
     
      ceb.throwIfNotEmpty();
           
      commitTransaction(db)
    }
    catch(ConstraintException ce)
    {
View Full Code Here

   */
 
    public ContentVO create(Integer parentContentId, Integer contentTypeDefinitionId, Integer repositoryId, ContentVO contentVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        Content content = null;

        beginTransaction(db);

        try
        {
            content = create(db, parentContentId, contentTypeDefinitionId, repositoryId, contentVO);
            ceb.throwIfNotEmpty();
           
            commitTransaction(db)
        }
        catch(ConstraintException ce)
        {
View Full Code Here

  public static void addChildContent(ContentVO parentVO, ContentVO childVO)
    throws ConstraintException, SystemException
  {

        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {
      Content parent = (Content) getObjectWithId(ContentImpl.class, parentVO.getContentId(), db);
      Content child = (Content) getObjectWithId(ContentImpl.class, childVO.getContentId(), db);
      parent.getChildren().add(child);

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

  public static void removeChildContent(ContentVO parentVO, ContentVO childVO)
    throws ConstraintException, SystemException
  {

        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {
      Content parent = (Content) getObjectWithId(ContentImpl.class, parentVO.getContentId(), db);
      Content child = (Content) getObjectWithId(ContentImpl.class, childVO.getContentId(), db);
      parent.getChildren().remove(child);

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

   * Such actions would result in model-errors.
   */
   
  public void moveContent(ContentVO contentVO, Integer newParentContentId, Database db) throws ConstraintException, SystemException
    {
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        //Content content = null;
    //Content newParentContent = null;
    //Content oldParentContent = null;

        //Validation that checks the entire object
        contentVO.validate();
   
    if(newParentContentId == null)
        {
          logger.warn("You must specify the new parent-content......");
          throw new ConstraintException("Content.parentContentId", "3303");
        }

        if(contentVO.getId().intValue() == newParentContentId.intValue())
        {
          logger.warn("You cannot have the content as it's own parent......");
          throw new ConstraintException("Content.parentContentId", "3301");
        }
   
    Content content          = getMediumContentWithId(contentVO.getContentId(), db);
        //oldParentContent = content.getParentContent();
        //newParentContent = getContentWithId(newParentContentId, db);
                   
        if(content.getValueObject().getParentContentId() == null || content.getValueObject().getParentContentId().intValue() == newParentContentId.intValue())
        {
          logger.warn("You cannot specify the same folder as it originally was located in......");
          throw new ConstraintException("Content.parentContentId", "3304");
        }

    //ContentVO tempContent = newParentContent.getParentContent();
    ContentVO newParentContentVO = getContentVOWithId(newParentContentId, db);
   
    Integer parentContentId = newParentContentVO.getParentContentId();
    while(parentContentId != null)
    {
      ContentVO tempContent = getContentVOWithId(parentContentId, db);
      if(tempContent.getId().intValue() == content.getId().intValue())
      {
        logger.warn("You cannot move the content to a child under it......");
            throw new ConstraintException("Content.parentContentId", "3302");
      }
      parentContentId = tempContent.getParentContentId();
    }                   
       
        //oldParentContent.getChildren().remove(content);
        //content.setParentContent((ContentImpl)newParentContent);
        content.getValueObject().setParentContentId(newParentContentId);
        changeRepositoryRecursive(content, newParentContentVO.getRepositoryId());
        //content.setRepository(newParentContent.getRepository());
        //newParentContent.getChildren().add(content);
       
        //If any of the validations or setMethods reported an error, we throw them up now before create.
        ceb.throwIfNotEmpty();
   
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.