From 32278f16b183995b71cb01ed79106ba28023e996 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Sat, 22 Feb 2014 11:45:03 +0000 Subject: remove old validation code git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@1570822 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/validator/SyncedRepositoryValidator.java | 113 --------------------- ...tion-addSelectedSyncedRepository-validation.xml | 55 ---------- ...roxyConnector-saveProxyConnector-validation.xml | 38 ------- .../src/main/resources/validators.xml | 1 - 4 files changed, 207 deletions(-) delete mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java delete mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml delete mode 100644 archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java deleted file mode 100644 index 36e463f6a..000000000 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.apache.maven.archiva.web.validator; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import com.opensymphony.xwork2.validator.ValidationException; -import com.opensymphony.xwork2.validator.ValidatorContext; -import com.opensymphony.xwork2.validator.validators.ValidatorSupport; - -/** - * Validator for synced repository form. The values to be validated depends on the - * selected sync method to be used. - * - */ -public class SyncedRepositoryValidator - extends ValidatorSupport -{ - - public void validate( Object obj ) - throws ValidationException - { - - String method = (String) getFieldValue( "method", obj ); - ValidatorContext ctxt = getValidatorContext(); - - if ( method.equals( "rsync" ) ) - { - String rsyncHost = (String) getFieldValue( "rsyncHost", obj ); - if ( rsyncHost == null || rsyncHost.equals( "" ) ) - { - ctxt.addActionError( "Rsync host is required." ); - } - - String rsyncDirectory = (String) getFieldValue( "rsyncDirectory", obj ); - if ( rsyncDirectory == null || rsyncDirectory.equals( "" ) ) - { - ctxt.addActionError( "Rsync directory is required." ); - } - - String rsyncMethod = (String) getFieldValue( "rsyncMethod", obj ); - if ( rsyncMethod == null || rsyncMethod.equals( "" ) ) - { - ctxt.addActionError( "Rsync method is required." ); - } - else - { - if ( !rsyncMethod.equals( "anonymous" ) && !rsyncMethod.equals( "ssh" ) ) - { - ctxt.addActionError( "Invalid rsync method" ); - } - } - - String username = (String) getFieldValue( "username", obj ); - if ( username == null || username.equals( "" ) ) - { - ctxt.addActionError( "Username is required." ); - } - - } - else if ( method.equals( "svn" ) ) - { - String svnUrl = (String) getFieldValue( "svnUrl", obj ); - if ( svnUrl == null || svnUrl.equals( "" ) ) - { - ctxt.addActionError( "SVN url is required." ); - } - - String username = (String) getFieldValue( "username", obj ); - if ( username == null || username.equals( "" ) ) - { - ctxt.addActionError( "Username is required." ); - } - } - else if ( method.equals( "cvs" ) ) - { - String cvsRoot = (String) getFieldValue( "cvsRoot", obj ); - if ( cvsRoot == null || cvsRoot.equals( "" ) ) - { - ctxt.addActionError( "CVS root is required." ); - } - } - else if ( method.equals( "file" ) ) - { - String directory = (String) getFieldValue( "directory", obj ); - if ( directory == null || directory.equals( "" ) ) - { - ctxt.addActionError( "Directory is required." ); - } - } - - if ( ctxt.hasActionErrors() ) - { - return; - } - } - -} diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml deleted file mode 100644 index febeb060f..000000000 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - You must enter the repository identifier. - - - - - You must enter the repository name. - - - - - Select repository type. - - - layout in {"legacy", "default"} - Invalid repository type. - - - - - A managed repository must be selected. - - - - - - - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml deleted file mode 100644 index 595ca7808..000000000 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - true - You must select a source repository Id. - - - - - true - You must select a target repository Id. - - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml index 3394a42fa..231bb7bc8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml @@ -38,7 +38,6 @@ - -- cgit v1.2.3