diff options
author | Brett Porter <brett@apache.org> | 2014-02-22 11:45:03 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2014-02-22 11:45:03 +0000 |
commit | 32278f16b183995b71cb01ed79106ba28023e996 (patch) | |
tree | e031eba4d0d5e0ae94c54485d176de226b8d3c74 | |
parent | 6afe043d2fdbdf532b7b307e67e177afb57686f5 (diff) | |
download | archiva-32278f16b183995b71cb01ed79106ba28023e996.tar.gz archiva-32278f16b183995b71cb01ed79106ba28023e996.zip |
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
4 files changed, 0 insertions, 207 deletions
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 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ 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. - --> - -<!DOCTYPE validators PUBLIC - "-//Apache Struts//XWork Validator 1.0.2//EN" - "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> - -<validators> - <field name="id"> - <field-validator type="requiredstring"> - <message>You must enter the repository identifier.</message> - </field-validator> - </field> - <field name="name"> - <field-validator type="requiredstring"> - <message>You must enter the repository name.</message> - </field-validator> - </field> - <field name="layout"> - <field-validator type="requiredstring"> - <message>Select repository type.</message> - </field-validator> - <field-validator type="fieldexpression"> - <param name="expression">layout in {"legacy", "default"}</param> - <message>Invalid repository type.</message> - </field-validator> - </field> - <field name="managedRepository"> - <field-validator type="requiredstring"> - <message>A managed repository must be selected.</message> - </field-validator> - </field> - - <validator type="syncedrepo"> - <message/> - </validator> - -</validators>
\ 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 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ 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. - --> - -<!DOCTYPE validators PUBLIC - "-//Apache Struts//XWork Validator 1.0.2//EN" - "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> - -<validators> - <field name="connector.sourceRepoId"> - <field-validator type="requiredstring"> - <param name="trim">true</param> - <message>You must select a source repository Id.</message> - </field-validator> - </field> - <field name="connector.targetRepoId"> - <field-validator type="requiredstring"> - <param name="trim">true</param> - <message>You must select a target repository Id.</message> - </field-validator> - </field> -</validators>
\ 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 @@ <validator name="stringlength" class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/> <validator name="regex" class="com.opensymphony.xwork2.validator.validators.RegexFieldValidator"/> <validator name="interval" class="org.apache.maven.archiva.web.validator.IntervalValidator"/> - <validator name="syncedrepo" class="org.apache.maven.archiva.web.validator.SyncedRepositoryValidator"/> <validator name="crontab" class="org.apache.maven.archiva.web.validator.CronExpressionValidator"/> </validators> |