Examples of InputValidator


Examples of at.fhj.itm.beans.InputValidator

  }

  @Test
  public void testEmailValidator() {

    InputValidator iv = new InputValidator();
    assertTrue(iv.isEmailAddressValid("robert.alfort.itm08@fh-joanneum.at"));

  }
View Full Code Here

Examples of com.ecyrd.jspwiki.ui.InputValidator

    @SuppressWarnings("unchecked")
    public final void validateProfile( WikiContext context, UserProfile profile )
    {
        boolean isNew = profile.isNew();
        WikiSession session = context.getWikiSession();
        InputValidator validator = new InputValidator( SESSION_MESSAGES, context );
        ResourceBundle rb = context.getBundle( InternationalizationManager.CORE_BUNDLE );

        //
        //  Query the SpamFilter first
        //
       
        List<PageFilter> ls = m_engine.getFilterManager().getFilterList();
        for( PageFilter pf : ls )
        {
            if( pf instanceof SpamFilter )
            {
                if( ((SpamFilter)pf).isValidUserProfile( context, profile ) == false )
                {
                    session.addMessage( SESSION_MESSAGES, "Invalid userprofile" );
                    return;
                }
                break;
            }
        }
       
        // If container-managed auth and user not logged in, throw an error
        if ( m_engine.getAuthenticationManager().isContainerAuthenticated()
             && !context.getWikiSession().isAuthenticated() )
        {
            session.addMessage( SESSION_MESSAGES, rb.getString("security.error.createprofilebeforelogin") );
        }

        validator.validateNotNull( profile.getLoginName(), rb.getString("security.user.loginname") );
        validator.validateNotNull( profile.getFullname(), rb.getString("security.user.fullname") );
        validator.validate( profile.getEmail(), rb.getString("security.user.email"), InputValidator.EMAIL );

        // If new profile, passwords must match and can't be null
        if ( !m_engine.getAuthenticationManager().isContainerAuthenticated() )
        {
            String password = profile.getPassword();
View Full Code Here

Examples of com.ecyrd.jspwiki.ui.InputValidator

     * @param context the current wiki context
     * @param group the supplied Group
     */
    public final void validateGroup( WikiContext context, Group group )
    {
        InputValidator validator = new InputValidator( MESSAGES_KEY, context );

        // Name cannot be null or one of the restricted names
        try
        {
            checkGroupName( context, group.getName() );
        }
        catch( WikiSecurityException e )
        {

        }

        // Member names must be "safe" strings
        Principal[] members = group.members();
        for( int i = 0; i < members.length; i++ )
        {
            validator.validateNotNull( members[i].getName(), "Full name", InputValidator.ID );
        }
    }
View Full Code Here

Examples of com.ecyrd.jspwiki.ui.InputValidator

    protected final void checkGroupName( WikiContext context, String name ) throws WikiSecurityException
    {
        //TODO: groups cannot have the same name as a user

        // Name cannot be null
        InputValidator validator = new InputValidator( MESSAGES_KEY, context );
        validator.validateNotNull( name, "Group name" );

        // Name cannot be one of the restricted names either
        if( ArrayUtils.contains( Group.RESTRICTED_GROUPNAMES, name ) )
        {
            throw new WikiSecurityException( "The group name '" + name + "' is illegal. Choose another." );
View Full Code Here

Examples of com.intellij.openapi.ui.InputValidator

    }
  }

  @Nullable
  private static CreateStepDefinitionFileModel askUserForFilePath(@NotNull final GherkinStep step) {
    final InputValidator validator = new InputValidator() {
      public boolean checkInput(final String filePath) {
        return !StringUtil.isEmpty(filePath);
      }

      public boolean canClose(final String fileName) {
View Full Code Here

Examples of domain.logic.InputValidator

  }

  @Override
  protected void validatePage(Object command, Errors errors, int page) {
    FolderForm folderForm = (FolderForm) command;
    InputValidator inputValidator = (InputValidator) getValidator();

    switch (page) {
    case 1:
      errors.setNestedPath("folder.pi");
      inputValidator.validatePageOne(folderForm.getFolder().getPi(),
          errors);
      break;
    case 2:
      errors.setNestedPath("folder");
      inputValidator.validatePageTwo(folderForm.getFolder(), errors);
      break;
    default:
      break;
    }
    errors.setNestedPath("");
View Full Code Here

Examples of domain.logic.InputValidator

  }

  protected void validatePage(Object command, Errors errors, int page) {
    FolderForm folderForm = (FolderForm) command;
    InputValidator inputValidator = (InputValidator) getValidator();

    switch (page) {
    case 0:
      errors.setNestedPath("folder.pi");
      inputValidator.validatePageOne(folderForm.getFolder().getPi(),
          errors);
      logger.info("WizardCTRL - validatePageOne() was called");
      break;
    case 1:
      errors.setNestedPath("folder");
      inputValidator.validatePageTwo(folderForm.getFolder(), errors);

      logger.info("WizardCTRL - validatePageTwo() was called");
      break;
    case 2:
      errors.setNestedPath("folder.currentPromoDetail");
      inputValidator.validatePageThree(folderForm.getFolder()
          .getCurrentPromoDetail(), errors);
      logger.info("WizardCTRL - validatePageThree() was called");
      break;
    }
    errors.setNestedPath("");
View Full Code Here

Examples of logic.InputValidator

    private void onBtMask(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onBtMask
        System.out.println(cbMask.getSelectedIndex() + " -- " + cbMask.getSelectedItem());
    }//GEN-LAST:event_onBtMask

    private void onStartStop(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onStartStop
        final InputValidator validator = new InputValidator();

        if (engine.isRunning()) {
            engine.stop();
        } else {
            try {
                resultModel.clear();

                engine.setup(validator.prepareSearchMask(maskCbModel.getSelectedItem().toString()),
                        validator.prepareFileMask(fileCbModel.getSelectedItem().toString()),
                        validator.prepareDirectories(dirCbModel.getSelectedItem().toString()));
                engine.process();
                setStartStopButtonState(false);
                storeInput();
            } catch (Exception ex) {
                log(LogLevel.ERROR, ex);
View Full Code Here

Examples of org.apache.turbine.util.validation.InputValidator

    */
    public static InputValidator setInputValidator(String columnName,
                                                   String className)
        throws ClassNotFoundException
    {
        InputValidator validator = null;
        try
        {
           Class c   = Class.forName(className);
           validator = (InputValidator) c.newInstance();
           validators.put(columnName, validator);
View Full Code Here

Examples of org.apache.wiki.ui.InputValidator

    protected final void checkGroupName( WikiContext context, String name ) throws WikiSecurityException
    {
        //TODO: groups cannot have the same name as a user

        // Name cannot be null
        InputValidator validator = new InputValidator( MESSAGES_KEY, context );
        validator.validateNotNull( name, "Group name" );

        // Name cannot be one of the restricted names either
        if( ArrayUtils.contains( Group.RESTRICTED_GROUPNAMES, name ) )
        {
            throw new WikiSecurityException( "The group name '" + name + "' is illegal. Choose another." );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.