Package org.exoplatform.webui.exception

Examples of org.exoplatform.webui.exception.MessageException


      return createMessageException(value, uiInput, getMessageLocalizationKey());
   }
  
   protected MessageException createMessageException(String value, UIFormInput uiInput, String localizationKey) throws Exception
   {
      return new MessageException(new ApplicationMessage(localizationKey, getMessageArgs(value, uiInput), ApplicationMessage.WARNING));
   }
View Full Code Here


      validate(value, label, messages, uiInput);

      if (!messages.isEmpty())
      {
         throw new MessageException(messages);
      }
   }
View Full Code Here

         String lastValue = pref.getValue(TOTAL_COLUMNS, "" + DEFAULT_COLUMNS);

         if (uiInput.getValue() == null || uiInput.getValue().length() == 0)
         {
            uiInput.setValue(lastValue);
            throw new MessageException(new ApplicationMessage("EmptyFieldValidator.msg.empty-input", args));
         }

         int totalCols = 0;
         try
         {
            totalCols = Integer.parseInt(uiInput.getValue());
            if (totalCols < 1 || totalCols > MAX_COLUMNS)
               throw new Exception();
         }
         catch (Exception e)
         {
            uiInput.setValue(lastValue);
            throw new MessageException(new ApplicationMessage("NumberFormatValidator.msg.Invalid-number", args));
         }

         uiInput = uiForm.getUIStringInput(DashboardParent.ISPRIVATE);
         pref.setValue(DashboardParent.ISPRIVATE, uiInput.getValue());
View Full Code Here

            CompoundApplicationMessage messages = new CompoundApplicationMessage();

            validate((String) uiInput.getValue(), label, messages, uiInput);

            if (!messages.isEmpty()) {
                throw new MessageException(messages);
            }

        }
    }
View Full Code Here

      {
         label = uiInput.getName();
      }
      label = label.trim();
      Object[] args = {label};
      throw new MessageException(new ApplicationMessage("EmptyFieldValidator.msg.empty-input", args,
         ApplicationMessage.WARNING));
   }
View Full Code Here

      Object[] args = {label};
     
      String s = (String)uiInput.getValue();
      if(s.charAt(0) == '0' && s.length() > 1)
      {
         throw new MessageException(new ApplicationMessage("NumberFormatValidator.msg.Invalid-number", args));
      }
      else if(s.charAt(0) == '-' && s.length() > 1 && s.charAt(1) == '0')
      {
         throw new MessageException(new ApplicationMessage("NumberFormatValidator.msg.Invalid-number", args));
      }
      try
      {
         Integer.parseInt(s);
      }
      catch(NumberFormatException e)
      {
         throw new MessageException(new ApplicationMessage("NumberFormatValidator.msg.Invalid-number", args));
      }
   }
View Full Code Here

      }
      String s = (String)uiInput.getValue();
      if (Character.isDigit(s.charAt(0)) || s.charAt(0) == '-' || s.charAt(0) == '.' || s.charAt(0) == '_')
      {
         Object[] args = {label, uiInput.getBindingField()};
         throw new MessageException(new ApplicationMessage("FirstCharacterNameValidator.msg", args,
            ApplicationMessage.WARNING));
      }
      for (int i = 0; i < s.length(); i++)
      {
         char c = s.charAt(i);
         if (Character.isLetter(c) || Character.isDigit(c) || c == '_' || c == '-' || c == '.')
         {
            continue;
         }
         Object[] args = {label};
         throw new MessageException(new ApplicationMessage("ResourceValidator.msg.Invalid-char", args,
            ApplicationMessage.WARNING));
      }
   }
View Full Code Here

      catch (Exception e)
      {
         label = uiInput.getName();
      }
      Object[] args = {label};
      throw new MessageException(new ApplicationMessage(key_, args, ApplicationMessage.WARNING));
   }
View Full Code Here

      catch (Exception e)
      {
         label = uiInput.getName();
      }
      Object[] args = {label, min_.toString(), max_.toString()};
      throw new MessageException(new ApplicationMessage("StringLengthValidator.msg.length-invalid", args,
         ApplicationMessage.WARNING));
   }
View Full Code Here

      catch (Exception e)
      {
         label = uiInput.getName();
      }
      Object[] args = {label, min_.toString(), max_.toString()};
      throw new MessageException(new ApplicationMessage("StringLengthValidator.msg.length-invalid", args,
         ApplicationMessage.WARNING));
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.exception.MessageException

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.