Package org.infoglue.cms.exception

Examples of org.infoglue.cms.exception.ConstraintException


        try
        {
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(this.contentVO.getContentId());
          if(ContentController.getContentController().hasPublishedVersion(this.contentVO.getContentId()))
          {
            throw new ConstraintException("ContentVersion.stateId", "3300", contentVO.getName());
          }
         
          String contentName = contentVO.getName();
          parentContentId = new Integer(contentVO.getId());
         
View Full Code Here


    {
      logger.error("Error getting references:" + e.getMessage());
    }
   
    if(references.size() > 0 && !forceDelete)
      throw new ConstraintException("Category.name", "3608");
   
    // So we have the parent and know which page to go to
    setModel(controller.findById(getCategoryId()));
    controller.delete(getCategoryId());
View Full Code Here

    }   
   
    public void updatePassword(String userName, String oldPassword, String newPassword, Database db) throws ConstraintException, SystemException, Exception
    {
        if(newPassword == null)
            throw new ConstraintException("SystemUser.newPassword", "301");

    if(CmsPropertyHandler.getUsePasswordEncryption())
    {
      try
      {
        byte[] encryptedPassRaw = DigestUtils.sha(newPassword);
        String encryptedPass = new String(Base64.encodeBase64(encryptedPassRaw), "ASCII");
        newPassword = encryptedPass;

        byte[] encryptedOldPasswordRaw = DigestUtils.sha(oldPassword);
        String encryptedOldPass = new String(Base64.encodeBase64(encryptedOldPasswordRaw), "ASCII");
        oldPassword = encryptedOldPass;
      }
      catch (Exception e)
      {
        logger.error("Error generating password:" + e.getMessage());
      }
    }

        SystemUser systemUser = getSystemUser(db, userName, oldPassword);
        if(systemUser == null)
            throw new ConstraintException("SystemUser.oldPassword", "310");
           
        systemUser.setPassword(newPassword);   
    }
View Full Code Here

    if(exception != null) {
      // set chained to null but don't mess with the parameter.
      final String fieldName = exception.getFieldName();
      final String errorCode = exception.getErrorCode();
      final String extraInformation = exception.getExtraInformation();
      ConstraintException ce = null;
      if(extraInformation != null && !extraInformation.equals(""))
      ce = new ConstraintException(fieldName, errorCode, extraInformation);
    else
      ce = new ConstraintException(fieldName, errorCode);
   
      if(exception.getLinkBeans() != null && exception.getLinkBeans().size() > 0)
        ce.getLinkBeans().addAll(exception.getLinkBeans());
     
      this.exceptions.add(ce);
      add(exception.getChainedException());
    }
  }
View Full Code Here

   *
   * @return the root exception of the chain.
   */
  public ConstraintException toConstraintException()
  {
    ConstraintException rootException = null;
    for(Iterator iterator = this.exceptions.iterator(); iterator.hasNext(); )
    {
      ConstraintException ce = (ConstraintException) iterator.next();
      ce.setChainedException(rootException);
      rootException = ce;
    }
    return rootException;
  }
View Full Code Here

        VCConnector connector = new NetBeansConnector(cvsRoot, localPath, password);
        availableTags.addAll(connector.getTags(serverBean.getModuleName()));
    }
    catch (Exception e)
    {
      throw new ConstraintException("vcCommunication", "311", "" + e.getMessage() + "<br/>CVSRoot: " + serverBean.getCVSROOT());
    }   
   
    return availableTags;
  }
View Full Code Here

        Collection siteNodeTypeDefinitionList = availableServiceBinding.getSiteNodeTypeDefinitions();
           
        //if(availableServiceBinding.getServiceBindings() != null && availableServiceBinding.getServiceBindings().size() > 0)
        if((serviceBindingList != null && serviceBindingList.size() > 0) || (siteNodeTypeDefinitionList != null && siteNodeTypeDefinitionList.size() > 0))
        {
          throw new ConstraintException("AvailableServiceBinding.deleteAction", "3100");
       
       
          deleteEntity(AvailableServiceBindingImpl.class, availableServiceBindingVO.getAvailableServiceBindingId(), db);

          commitTransaction(db);
View Full Code Here

  {
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
     ValidatorFactory.createStringValidator("Content.name", true, 2, 100).validate(name, ceb);
    
    if(this.publishDateTime == null)
      ceb.add(new ConstraintException("Content.publishDateTime", "300"));
    if(this.expireDateTime == null)
      ceb.add(new ConstraintException("Content.expireDateTime", "300"));
    if(this.publishDateTime != null && this.expireDateTime != null)
      if(this.publishDateTime.after(this.expireDateTime))
        ceb.add(new ConstraintException("Content.publishDateTime", "308"));
   
    return ceb;
 
View Full Code Here

  {
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
     ValidatorFactory.createStringValidator("SiteNode.name", true, 2, 100).validate(name, ceb);
    
     if(this.publishDateTime.after(this.expireDateTime))
      ceb.add(new ConstraintException("SiteNode.publishDateTime", "308"));
   
    return ceb;
 
View Full Code Here

        {
            publishDate = toDate(dateString, "yyyy-MM-dd");
        }
        catch(Exception e)
        {
            throw new ConstraintException(fieldName, "305");
        }   
        return publishDate;
     }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.exception.ConstraintException

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.