]> source.dussan.org Git - archiva.git/commitdiff
remove old validation code
authorBrett Porter <brett@apache.org>
Sat, 22 Feb 2014 11:45:03 +0000 (11:45 +0000)
committerBrett Porter <brett@apache.org>
Sat, 22 Feb 2014 11:45:03 +0000 (11:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@1570822 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.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 (file)
index 36e463f..0000000
+++ /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 (file)
index febeb06..0000000
+++ /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 (file)
index 595ca78..0000000
+++ /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
index 3394a42fa61cd1a24d26b2963c3ea8b9e5296c54..231bb7bc890300e0bed9e50ddf548c95399524fe 100644 (file)
@@ -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>