continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1097686 - in /continuum/trunk/continuum-webapp/src: main/java/org/apache/continuum/web/action/admin/ main/java/org/apache/continuum/web/util/ main/java/org/apache/maven/continuum/web/action/ main/java/org/apache/maven/continuum/web/action/...
Date Fri, 29 Apr 2011 05:32:50 GMT
Author: ctan
Date: Fri Apr 29 05:32:48 2011
New Revision: 1097686

URL: http://svn.apache.org/viewvc?rev=1097686&view=rev
Log:
[CONTINUUM-2620] 
- move validation to xml files
- remove regex validation in description and just escape xml to prevent xss attacks

Added:
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction-addProjectGroup-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction.properties   (with props)
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_de.properties   (with props)
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_en.properties   (with props)
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_fr.properties   (with props)
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_pt_BR.properties   (with props)
Removed:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/util/RegexPatternConstants.java
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveGroupBuildDefinition-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveProjectBuildDefinition-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction-ircNotifierSave-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_de.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_en.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/IrcNotifierEditAction_pt_BR.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction-jabberNotifierSave-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_de.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_en.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/JabberNotifierEditAction_pt_BR.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction-mailNotifierSave-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_de.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_en.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MailNotifierEditAction_pt_BR.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction-msnNotifierSave-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_de.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_en.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/MsnNotifierEditAction_pt_BR.properties
Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction-savePurgeConfig-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction-addProject-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction-saveProjectGroup-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction-saveSchedule-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_de.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_pt_BR.properties
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml
    continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupAdd.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupEdit.jsp
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java Fri Apr 29 05:32:48 2011
@@ -165,6 +165,9 @@ public class BuildAgentAction
 
         ConfigurationService configuration = getContinuum().getConfiguration();
 
+        // escape xml to prevent xss attacks
+        buildAgent.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( buildAgent.getDescription() ) ) );
+
         if ( configuration.getBuildAgents() != null )
         {
             for ( BuildAgentConfiguration agent : configuration.getBuildAgents() )

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeConfigurationAction.java Fri Apr 29 05:32:48 2011
@@ -27,6 +27,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.model.repository.AbstractPurgeConfiguration;
 import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
 import org.apache.continuum.model.repository.LocalRepository;
@@ -35,12 +36,10 @@ import org.apache.continuum.purge.Contin
 import org.apache.continuum.purge.PurgeConfigurationService;
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
-import org.apache.maven.continuum.build.settings.SchedulesActivationException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
-import org.apache.maven.continuum.web.action.ScheduleAction;
 import org.apache.struts2.ServletActionContext;
 import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.redback.integration.interceptor.SecureAction;
@@ -547,7 +546,8 @@ public class PurgeConfigurationAction
         repoPurge.setRetentionCount( this.retentionCount );
         repoPurge.setEnabled( this.enabled );
         repoPurge.setDefaultPurge( this.defaultPurgeConfiguration );
-        repoPurge.setDescription( this.description );
+        // escape xml to prevent xss attacks
+        repoPurge.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( this.description ) ) );
         repoPurge.setDefaultPurge( this.defaultPurgeConfiguration );
 
         if ( repositoryId != 0 )
@@ -573,7 +573,8 @@ public class PurgeConfigurationAction
         dirPurge.setEnabled( this.enabled );
         dirPurge.setDaysOlder( this.daysOlder );
         dirPurge.setRetentionCount( this.retentionCount );
-        dirPurge.setDescription( this.description );
+        // escape xml to prevent xss attacks
+        dirPurge.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( this.description ) ) );
         dirPurge.setDirectoryType( this.directoryType );
         dirPurge.setDefaultPurge( this.defaultPurgeConfiguration );
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java Fri Apr 29 05:32:48 2011
@@ -23,9 +23,9 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
-import org.apache.continuum.web.util.RegexPatternConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
@@ -97,66 +97,8 @@ public class AddProjectAction
 
     private boolean emptyProjectGroups;
 
-    public void validate()
-    {
-        clearErrorsAndMessages();
-        initializeActionContext();
-        
-        try
-        {
-            if ( ( projectName != null ) && !( projectName.trim().length() > 0 ) )
-            {
-                addActionError( getText( "addProject.name.required" ) );
-            }
-            else if ( ( projectName != null ) && !( projectName.trim().matches( RegexPatternConstants.NAME_REGEX ) ) )
-            {
-                addActionError( getText( "addProject.name.invalid" ) );
-            }
-            if (( projectDescription != null ) && !( projectDescription.trim().matches( RegexPatternConstants.DESCRIPTION_REGEX ) ) )
-            {
-                addActionError( getText( "addProject.description.invalid" ) );
-            }
-            if ( ( projectVersion != null ) && !( projectVersion.trim().length() > 0 ) )
-            {
-                addActionError( getText( "addProject.version.required" ) );
-            }
-            else if ( ( projectVersion != null ) && !(projectVersion.trim().matches( RegexPatternConstants.VERSION_REGEX ) ) )
-            {
-                addActionError( getText( "addProject.version.invalid" ) );
-            }
-            if ( ( projectScmUrl != null ) && !( projectScmUrl.trim().length() > 0 ) )
-            {
-                addActionError( getText( "addProject.scmUrl.required" ) );
-            }
-            else if ( ( projectScmUrl != null ) && !( projectScmUrl.trim().matches( RegexPatternConstants.SCM_URL_REGEX ) ) )
-            {
-                addActionError( getText( "addProject.scmUrl.invalid" ) );
-            }
-            if ( ( projectScmTag != null ) && !( projectScmTag.trim().matches( RegexPatternConstants.SCM_URL_REGEX ) ) )
-            {
-                addActionError( getText( "addProject.scmTag.invalid" ) );
-            }
-            if ( isEmptyProjectGroups() )
-            {
-                addActionError( getText( "addProject.projectGroup.required" ) );
-            }
-            if ( hasActionErrors() )
-            {
-                input();
-            }
-        }
-        catch ( ContinuumException e )
-        {
-            logger.error( e.getMessage(), e );
-        }
-        catch ( BuildDefinitionServiceException e )
-        {
-            logger.error( e.getMessage(), e );
-        }
-    }
-
     public String add()
-        throws ContinuumException
+        throws ContinuumException, ProfileException, BuildDefinitionServiceException
     {
         initializeProjectGroupName();
         initializeActionContext();
@@ -178,6 +120,11 @@ public class AddProjectAction
             return REQUIRES_AUTHORIZATION;
         }
 
+        if ( isEmptyProjectGroups() )
+        {
+            addActionError( getText( "addProject.projectGroup.required" ) );
+        }
+
         String projectNameTrim = projectName.trim();
         String versionTrim = projectVersion.trim();
         String scmTrim = projectScmUrl.trim();
@@ -190,17 +137,22 @@ public class AddProjectAction
                 StringUtils.equalsIgnoreCase( project.getScmUrl(), scmTrim ) )
             {
                 addActionError( getText( "projectName.already.exist.error" ) );
-                return INPUT;
+                break;
             }
         }
 
+        if ( hasActionErrors() )
+        {
+            return INPUT;
+        }
+
         Project project = new Project();
 
         project.setName( projectNameTrim );
 
         if ( projectDescription != null )
         {
-            project.setDescription( projectDescription.trim() );
+            project.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( projectDescription.trim() ) ) );
         }
 
         project.setVersion( versionTrim );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java Fri Apr 29 05:32:48 2011
@@ -19,15 +19,13 @@ package org.apache.maven.continuum.web.a
  * under the License.
  */
 
-import com.opensymphony.xwork2.Validateable;
-
 import java.util.List;
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.repository.RepositoryServiceException;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
-import org.apache.continuum.web.util.RegexPatternConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -40,7 +38,6 @@ import org.slf4j.LoggerFactory;
  */
 public class AddProjectGroupAction
     extends ContinuumActionSupport
-    implements Validateable
 {
     private static final Logger logger = LoggerFactory.getLogger( AddProjectGroupAction.class );
 
@@ -62,75 +59,43 @@ public class AddProjectGroupAction
         repositories = getContinuum().getRepositoryService().getAllLocalRepositories();
     }
 
-    public void validate()
-    {   
-        clearErrorsAndMessages();       
-        if ( name != null && name.equals( "" ) )
-        {
-            addActionError( getText( "projectGroup.error.name.required" ) );
-        }
-        else if ( name != null && name.trim().equals( "" ) )
+    public String execute()
+    {
+        try
         {
-            addActionError( getText( "projectGroup.error.name.cannot.be.spaces" ) );
+            checkAddProjectGroupAuthorization();
         }
-        else if ( name != null && !name.trim().matches( RegexPatternConstants.NAME_REGEX ) )
+        catch ( AuthorizationRequiredException authzE )
         {
-            addActionError( getText( "projectGroup.error.name.invalid" ) );
+            addActionError( authzE.getMessage() );
+            return REQUIRES_AUTHORIZATION;
         }
-        else if ( name != null && !name.equals( "" ) )
+
+        for ( ProjectGroup projectGroup : getContinuum().getAllProjectGroups() )
         {
-            for ( ProjectGroup projectGroup : getContinuum().getAllProjectGroups() )
+            if ( name.equals( projectGroup.getName() ) )
             {
-                if ( name.equals( projectGroup.getName() ) )
-                {
-                    addActionError( getText( "projectGroup.error.name.already.exists" ) );
-                    break;
-                }
+                addActionError( getText( "projectGroup.error.name.already.exists" ) );
+                break;
             }
         }
-        if ( groupId != null && groupId.equals( "" ) )
-        {
-            addActionError( getText( "projectGroup.error.groupId.required" ) );
-        }
-        else if ( groupId != null && groupId.trim().equals( "" ) )
-        {
-            addActionError( getText( "projectGroup.error.groupId.cannot.be.spaces" ) );
-        }
-        else if ( groupId != null && !groupId.trim().matches( RegexPatternConstants.GROUP_ID_REGEX ))
-        {
-            addActionError( getText( "projectGroup.error.groupId.invalid" ) );
-        }
-        else
+
+        try
         {
-            try
-            {
-                if ( getContinuum().getProjectGroupByGroupId( groupId ) != null )
-                {
-                    addActionError( getText( "projectGroup.error.groupId.already.exists" ) );
-                }
-            }
-            catch ( ContinuumException e )
+            if ( getContinuum().getProjectGroupByGroupId( groupId ) != null )
             {
-                //since we want to add a new project group, we should be getting
-                //this exception
+                addActionError( getText( "projectGroup.error.groupId.already.exists" ) );
             }
         }
-        if( description != null && !description.trim().matches( RegexPatternConstants.DESCRIPTION_REGEX ))
+        catch ( ContinuumException e )
         {
-            addActionError( getText( "projectGroup.error.description.invalid" ) );
+            //since we want to add a new project group, we should be getting
+            //this exception
         }
-    }
 
-    public String execute()
-    {
-        try
-        {
-            checkAddProjectGroupAuthorization();
-        }
-        catch ( AuthorizationRequiredException authzE )
+        if ( hasActionErrors() )
         {
-            addActionError( authzE.getMessage() );
-            return REQUIRES_AUTHORIZATION;
+            return INPUT;
         }
 
         ProjectGroup projectGroup = new ProjectGroup();
@@ -139,7 +104,7 @@ public class AddProjectGroupAction
 
         projectGroup.setGroupId( groupId.trim() );
 
-        projectGroup.setDescription( description );
+        projectGroup.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( description ) ) );
 
         try
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java Fri Apr 29 05:32:48 2011
@@ -38,6 +38,7 @@ import org.apache.maven.continuum.profil
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.continuum.web.exception.ContinuumActionException;
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.codehaus.plexus.util.StringUtils;
@@ -504,7 +505,7 @@ public class BuildDefinitionAction
                 buildDefinition.setProfile( profile );
             }
         }
-        buildDefinition.setDescription( description );
+        buildDefinition.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( description ) ) );
         buildDefinition.setType( buildDefinitionType );
         buildDefinition.setAlwaysBuild( alwaysBuild );
         buildDefinition.setUpdatePolicy( updatePolicy );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Fri Apr 29 05:32:48 2011
@@ -35,6 +35,7 @@ import java.util.regex.Pattern;
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.collections.ComparatorUtils;
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.continuum.buildagent.NoBuildAgentException;
 import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
@@ -45,7 +46,6 @@ import org.apache.continuum.model.reposi
 import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
-import org.apache.continuum.web.util.RegexPatternConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -169,6 +169,14 @@ public class ProjectGroupAction
         randomizer = new SecureRandom();
     }
 
+    public void prepare()
+        throws Exception
+    {
+        super.prepare();
+    
+        repositories = getContinuum().getRepositoryService().getAllLocalRepositories();
+    }
+    
     public String summary()
         throws ContinuumException
     {
@@ -484,37 +492,15 @@ public class ProjectGroupAction
             addActionError( authzE.getMessage() );
             return REQUIRES_AUTHORIZATION;
         }
-        
-        if ( name != null )
+
+        for ( ProjectGroup projectGroup : getContinuum().getAllProjectGroups() )
         {
-            if ( name.equals( "" ) )
-            {
-                addActionError( getText( "projectGroup.error.name.required" ) );
-            }
-            else if ( name.trim().equals( "" ) )
-            {
-                addActionError( getText( "projectGroup.error.name.cannot.be.spaces" ) );
-            }
-            else if ( !name.trim().matches( RegexPatternConstants.NAME_REGEX ) )
+            if ( name.equals( projectGroup.getName() ) && projectGroup.getId() != projectGroupId )
             {
-                addActionError( getText( "projectGroup.error.name.invalid" ) );
-            }
-            else
-            {
-                name = name.trim();
-                for ( ProjectGroup projectGroup : getContinuum().getAllProjectGroups() )
-                {
-                    if ( name.equals( projectGroup.getName() ) && projectGroup.getId() != projectGroupId )
-                    {
-                        addActionError( getText( "projectGroup.error.name.already.exists" ) );
-                    }
-                }
+                addActionError( getText( "projectGroup.error.name.already.exists" ) );
             }
         }
-        if ( description != null && !description.trim().matches( RegexPatternConstants.DESCRIPTION_REGEX ) )
-        {
-            addActionError( getText( "projectGroup.error.description.invalid" ) );
-        }
+
         if ( hasActionErrors() )
         {
             initialize();
@@ -544,7 +530,7 @@ public class ProjectGroupAction
 
         }
 
-        projectGroup.setDescription( description );
+        projectGroup.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( description ) ) );
 
         // [CONTINUUM-2228]. In select field can't select empty values.
         if ( repositoryId > 0 )

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java Fri Apr 29 05:32:48 2011
@@ -26,6 +26,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
@@ -283,7 +284,7 @@ public class ScheduleAction
         schedule.setActive( active );
         schedule.setCronExpression( getCronExpression() );
         schedule.setDelay( delay );
-        schedule.setDescription( description );
+        schedule.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( description ) ) );
         schedule.setName( name );
         schedule.setMaxJobExecutionTime(maxJobExecutionTime);
         if (!getContinuum().getConfiguration().isDistributedBuildEnabled()) {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java Fri Apr 29 05:32:48 2011
@@ -29,6 +29,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.web.util.AuditLog;
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
@@ -243,6 +244,10 @@ public class BuildDefinitionTemplateActi
         throws Exception
     {
         Schedule schedule = null;
+
+        // need to escape xml to prevent xss attacks
+        buildDefinition.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( buildDefinition.getDescription() ) ) );
+
         if ( buildDefinition.getProfile() != null )
         {
             Profile profile = getContinuum().getProfileService().getProfile( buildDefinition.getProfile().getId() );

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/BuildAgentAction.properties Fri Apr 29 05:32:48 2011
@@ -19,7 +19,6 @@
 
 buildAgent.url.required = Build agent url is required.
 buildAgent.url.invalid = Build agent url is invalid.
-buildAgent.description.invalid = Build agent description contains invalid characters.
 buildAgent.error.exist = Build agent already exists.
 buildAgent.error.delete.busy = Cannot delete build agent because it's busy at the moment
 buildAgent.error.notfound = Build agent does not exist.

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction-savePurgeConfig-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction-savePurgeConfig-validation.xml?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction-savePurgeConfig-validation.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/PurgeConfigurationAction-savePurgeConfig-validation.xml Fri Apr 29 05:32:48 2011
@@ -34,10 +34,4 @@
       <message key="purgeConfig.retentionCount.min"/>
     </field-validator>
   </field>
-  <field name="description">
-    <field-validator type="regex">
-      <param name="expression"><![CDATA[[A-Za-z0-9_.\s\-]*]]></param>
-      <message key="purgeConfig.description.invalid"/>
-    </field-validator>
-  </field>
 </validators>

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction-addProject-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction-addProject-validation.xml?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction-addProject-validation.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction-addProject-validation.xml Fri Apr 29 05:32:48 2011
@@ -32,13 +32,6 @@
       <message key="addProject.name.invalid"/>
     </field-validator>
   </field>
-  <field name="projectDescription">
-    <field-validator type="regex">
-      <param name="trim">true</param>
-      <param name="expression"><![CDATA[[a-zA-Z0-9_.\s-]*]]></param>
-      <message key="addProject.scmTag.invalid"/>
-    </field-validator>
-  </field>
   <field name="projectVersion">
     <field-validator type="requiredstring">
       <message key="addProject.version.required"/>
@@ -54,8 +47,7 @@
       <message key="addProject.scmUrl.required"/>
     </field-validator>
     <field-validator type="regex">
-      <param name="trim">true</param>
-      <param name="expression"><![CDATA[[a-zA-Z0-9_.:@${}\\/|#~=\[\]-]*]]></param>
+      <param name="expression"><![CDATA[[a-zA-Z0-9_.:${}#~=@\\/|\[\]-]*]]></param>
       <message key="addProject.scmUrl.invalid"/>
     </field-validator>
   </field>

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectAction.properties Fri Apr 29 05:32:48 2011
@@ -19,7 +19,6 @@
 
 addProject.name.required = Name is required and cannot contain null or spaces only
 addProject.name.invalid = Name contains invalid characters.
-addProject.description.invalid = Description contains invalid characters.
 addProject.version.required = Version is required and cannot contain null or spaces only.
 addProject.version.invalid = Version contains invalid characters.
 addProject.scmUrl.required = SCM Url is required and cannot contain null or spaces only.

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction-addProjectGroup-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction-addProjectGroup-validation.xml?rev=1097686&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction-addProjectGroup-validation.xml (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction-addProjectGroup-validation.xml Fri Apr 29 05:32:48 2011
@@ -0,0 +1,43 @@
+<!--
+  ~ 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
+    "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+    "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+  <field name="name">
+    <field-validator type="requiredstring">
+      <message key="addProjectGroup.name.required"/>
+    </field-validator>
+    <field-validator type="regex">
+      <param name="expression"><![CDATA[[A-Za-z0-9_.\s\-]*]]></param>
+      <message key="addProjectGroup.name.invalid"/>
+    </field-validator>
+  </field>
+  <field name="groupId">
+    <field-validator type="requiredstring">
+      <message key="addProjectGroup.groupId.required"/>
+    </field-validator>
+    <field-validator type="regex">
+      <param name="expression"><![CDATA[[a-zA-Z0-9.\\s]*]]></param>
+      <message key="addProjectGroup.groupId.invalid"/>
+    </field-validator>
+  </field>
+</validators>
\ No newline at end of file

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction.properties?rev=1097686&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction.properties Fri Apr 29 05:32:48 2011
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+addProjectGroup.name.required = Project Group Name is required
+addProjectGroup.name.invalid = Name contains invalid characters.
+addProjectGroup.groupId.required = Project Group ID is required
+addProjectGroup.groupId.invalid = Id contains invalid characters.
+

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction.properties
------------------------------------------------------------------------------
    svn:executable = *

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_de.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_de.properties?rev=1097686&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_de.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_de.properties Fri Apr 29 05:32:48 2011
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+addProjectGroup.name.required = Es mu\u00DF ein Projektgruppen-Name angegeben werden.

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_de.properties
------------------------------------------------------------------------------
    svn:executable = *

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_en.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_en.properties?rev=1097686&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_en.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_en.properties Fri Apr 29 05:32:48 2011
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_en.properties
------------------------------------------------------------------------------
    svn:executable = *

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_fr.properties?rev=1097686&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_fr.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_fr.properties Fri Apr 29 05:32:48 2011
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+addProjectGroup.name.required = le nom du groupe de projets est obligatoire

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_fr.properties
------------------------------------------------------------------------------
    svn:executable = *

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_pt_BR.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_pt_BR.properties?rev=1097686&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_pt_BR.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_pt_BR.properties Fri Apr 29 05:32:48 2011
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+addProjectGroup.name.required=Nome de Grupo do Projeto \u00E9 obrigat\u00F3rio

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/AddProjectGroupAction_pt_BR.properties
------------------------------------------------------------------------------
    svn:executable = *

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveBuildDefinition-validation.xml Fri Apr 29 05:32:48 2011
@@ -46,11 +46,4 @@
       <message key="buildDefinition.arguments.invalid"/>
     </field-validator>
   </field>
-  <field name="description">
-    <field-validator type="regex">
-      <param name="trim">true</param>
-      <param name="expression"><![CDATA[[a-zA-Z0-9_.\s-]*]]></param>
-      <message key="buildDefinition.description.invalid"/>
-    </field-validator>
-  </field>
 </validators>

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties Fri Apr 29 05:32:48 2011
@@ -20,5 +20,4 @@
 buildDefinition.buildFile.required = Build file is required and cannot contain spaces only.
 buildDefinition.buildFile.invalid = Build file contains invalid characters.
 buildDefinition.goals.invalid = Goals contains invalid characters.
-buildDefinition.arguments.invalid = Arguments contains invalid characters.
-buildDefinition.description.invalid = Description contains invalid characters. 
+buildDefinition.arguments.invalid = Arguments contains invalid characters. 

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction-saveProjectGroup-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction-saveProjectGroup-validation.xml?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction-saveProjectGroup-validation.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction-saveProjectGroup-validation.xml Fri Apr 29 05:32:48 2011
@@ -23,8 +23,12 @@
 
 <validators>
   <field name="name">
-    <field-validator type="required">
+    <field-validator type="requiredstring">
       <message key="projectGroup.name.required"/>
     </field-validator>
+    <field-validator type="regex">
+      <param name="expression"><![CDATA[[A-Za-z0-9_.\s\-]*]]></param>
+      <message key="projectGroup.name.invalid"/>
+    </field-validator>
   </field>
 </validators>
\ No newline at end of file

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ProjectGroupAction.properties Fri Apr 29 05:32:48 2011
@@ -19,6 +19,4 @@
 
 projectGroup.name.required = Project Group Name is required
 projectGroup.name.invalid = Name contains invalid characters.
-projectGroup.id.invalid = Id contains invalid characters.
-projectGroup.description.invalid = Description contains invalid characters.
 

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction-saveSchedule-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction-saveSchedule-validation.xml?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction-saveSchedule-validation.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction-saveSchedule-validation.xml Fri Apr 29 05:32:48 2011
@@ -34,12 +34,7 @@
   </field>
   <field name="description">
     <field-validator type="requiredstring">
-      <message key="schedule.version.required"/>
-    </field-validator>
-    <field-validator type="regex">
-      <param name="trim">true</param>
-      <param name="expression"><![CDATA[[a-zA-Z0-9_.\s-]*]]></param>
-      <message key="schedule.version.invalid"/>
+      <message key="schedule.description.required"/>
     </field-validator>
   </field>
   <field name="maxJobExecutionTime">

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction.properties Fri Apr 29 05:32:48 2011
@@ -19,8 +19,7 @@
 
 schedule.name.required = Name is required and cannot contain spaces only.
 schedule.name.invalid = Name contains invalid characters.
-schedule.version.required = Description is required and cannot contain spaces only.
-schedule.version.invalid = Description contains invalid characters.
+schedule.description.required = Description is required and cannot contain spaces only.
 schedule.maxJobExecutionTime.required = Maximum job execution time is required.
 schedule.maxJobExecutionTime.invalid = Maximum job execution time must be an integer.
 schedule.delay.invalid = Quiet period must be an integer.

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_de.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_de.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_de.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_de.properties Fri Apr 29 05:32:48 2011
@@ -18,7 +18,7 @@
 #
 
 schedule.name.required = Es mu\u00DF ein Name angegeben werden.
-schedule.version.required = Es mu\u00DF eine Beschreibung angegeben werden.
+schedule.description.required = Es mu\u00DF eine Beschreibung angegeben werden.
 schedule.maxJobExecutionTime.required = Es mu\u00DF eine maximale Ausf\u00FChrungszeit angegeben werden.
 schedule.maxJobExecutionTime.invalid = Es mu\u00DF eine Zahl f\u00FCr die maximale Ausf\u00FChrungszeit angegeben werden.
 schedule.delay.invalid = Es mu\u00DF eine Zahl f\u00FCr die Ruhezeit angegeben werden.

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_fr.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_fr.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_fr.properties Fri Apr 29 05:32:48 2011
@@ -18,7 +18,7 @@
 #
 
 schedule.name.required = le nom est obligatoire et ne peut pas contenir uniquement des espaces
-schedule.version.required = la description est obligatoire et ne peut pas contenir uniquement des espaces
+schedule.description.required = la description est obligatoire et ne peut pas contenir uniquement des espaces
 schedule.maxJobExecutionTime.required = le temp d''ex\u00e9cution du travail maximum est obligatoire
 schedule.maxJobExecutionTime.invalid = le temp d''ex\u00e9cution du travail maximum doit \u00eatre un entier
 schedule.delay.invalid = la p\u00e9riode d''attente doit \u00eatre un entier 

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_pt_BR.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_pt_BR.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_pt_BR.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/ScheduleAction_pt_BR.properties Fri Apr 29 05:32:48 2011
@@ -20,4 +20,4 @@ schedule.delay.invalid=Per\u00EDodo de e
 schedule.maxJobExecutionTime.invalid=Tempo de execu\u00E7\u00E3o m\u00E1xima de um job deve ser um inteiro
 schedule.maxJobExecutionTime.required=Tempo de execu\u00E7\u00E3o m\u00E1xima de um job \u00E9 obrigat\u00F3rio
 schedule.name.required=Nome \u00E9 obrigat\u00F3rio e n\u00E3o pode conter somente espa\u00E7os
-schedule.version.required=Descri\u00E7\u00E3o \u00E9 obrigat\u00F3ria e n\u00E3o pode conter somente espa\u00E7os
+schedule.description.required=Descri\u00E7\u00E3o \u00E9 obrigat\u00F3ria e n\u00E3o pode conter somente espa\u00E7os

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction-saveBuildDefinitionAsTemplate-validation.xml Fri Apr 29 05:32:48 2011
@@ -35,10 +35,6 @@
     <field-validator type="requiredstring">
       <message key="buildDefinition.description.required"/>
     </field-validator>
-    <field-validator type="regex">
-      <param name="expression"><![CDATA[[A-Za-z0-9_.\s\-]*]]></param>
-      <message key="buildDefinition.description.invalid"/>
-    </field-validator>
   </field>
   <field name="buildDefinition.goals">
     <field-validator type="regex">

Modified: continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.properties Fri Apr 29 05:32:48 2011
@@ -23,6 +23,5 @@ buildDefinitionTemplate.name.invalid = N
 buildDefinition.buildFile.required = BuildFile is required
 buildDefinition.buildFile.invalid = BuildFile contains invalid characters
 buildDefinition.description.required = Description is required
-buildDefinition.description.invalid = Description contains invalid characters
 buildDefinition.goals.invalid = Goals contain invalid characters
 buildDefinition.arguments.invalid = Arguments contain invalid characters

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupAdd.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupAdd.jsp?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupAdd.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupAdd.jsp Fri Apr 29 05:32:48 2011
@@ -30,8 +30,7 @@
         <h3><s:text name="projectGroup.add.section.title"/></h3>
 
         <div class="axial">
-          <s:url id="actionUrl" action="addProjectGroup" includeContext="false" />
-          <s:form action="%{actionUrl}" method="post" >
+          <s:form action="addProjectGroup" method="post" validate="true">
             <c:if test="${!empty actionErrors}">
               <div class="errormessage">
                 <s:iterator value="actionErrors">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupEdit.jsp?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupEdit.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupEdit.jsp Fri Apr 29 05:32:48 2011
@@ -32,18 +32,18 @@
 
         <div class="axial">
           <s:form action="saveProjectGroup" method="post" validate="true">
-              <s:if test="projectInCOQueue">
-                <div class="label">
-                    <p><s:text name="%{getText('project.in.checkout.queue.error')}"/></p>
-                            </div >
-              </s:if>
-              <c:if test="${!empty actionErrors}">
+            <s:if test="projectInCOQueue">
+              <div class="label">
+                <p><s:text name="%{getText('project.in.checkout.queue.error')}"/></p>
+              </div >
+            </s:if>
+            <c:if test="${!empty actionErrors}">
               <div class="errormessage">
                 <s:iterator value="actionErrors">
                   <p><s:property/></p>
                 </s:iterator>
               </div>
-              </c:if>
+            </c:if>
             <table>
               <tbody>
                 <s:hidden name="projectGroupId"/>

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java?rev=1097686&r1=1097685&r2=1097686&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java (original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/AddProjectActionTest.java Fri Apr 29 05:32:48 2011
@@ -44,24 +44,14 @@ public class AddProjectActionTest
 
     private static final String VALID_NAME_CHARACTER = "abcABC123whitespaces_.:-";
     
-    private static final String INVALID_NAME_CHARACTER = "!@#$<>?etc";
-    
     private static final String VALID_VERSION_CHARACTER = "abcABC123.-";
-    
-    private static final String INVALID_VERSION_CHARACTER = "<>whitespaces!#etc";
-    
+
     private static final String VALID_SCM_URL_CHARACTER = "abcABC123_.:-#~=@\\/|[]";
     
-    private static final String INVALID_SCM_URL_CHARACTER = "!<>*%etc";
-    
     private static final String VALID_SCM_TAG_CHARACTER = "abcABC123_.:-#~=@\\/|[]";
-    
-    private static final String INVALID_SCM_TAG_CHARACTER = "!<>*%etc";
 
     private static final String VALID_DESCRIPTION_CHARACTER = "abcABC123whitespaces_.-";
-    
-    private static final String INVALID_DESCRIPTION_CHARACTER = "![]<>'^&etc";
-    
+
     protected void setUp()
         throws Exception
     {
@@ -144,25 +134,6 @@ public class AddProjectActionTest
         continuumMock.verify();
     }
 
-    public void testAddAntProjectWithInvalidValues()
-    {
-        action.setProjectName( INVALID_NAME_CHARACTER );
-        action.setProjectDescription( INVALID_DESCRIPTION_CHARACTER );
-        action.setProjectVersion( INVALID_VERSION_CHARACTER );
-        action.setProjectScmUrl( INVALID_SCM_URL_CHARACTER );
-        action.setProjectScmTag( INVALID_SCM_TAG_CHARACTER );
-        action.setProjectType( "ant" );
-        action.setSelectedProjectGroup( 1 );
-        action.setBuildDefintionTemplateId( 1 );
-
-        // validate
-        action.validate();
-
-        // verify
-        assertTrue( action.hasActionErrors() );
-        assertEquals( 5, action.getActionErrors().size() );
-    }
-
     /**
      * Test add of Shell project
      *
@@ -218,25 +189,6 @@ public class AddProjectActionTest
         continuumMock.verify();
     }
 
-    public void testAddShellProjectWithInvalidValues()
-    {
-        action.setProjectName( INVALID_NAME_CHARACTER );
-        action.setProjectDescription( INVALID_DESCRIPTION_CHARACTER );
-        action.setProjectVersion( INVALID_VERSION_CHARACTER );
-        action.setProjectScmUrl( INVALID_SCM_URL_CHARACTER );
-        action.setProjectScmTag( INVALID_SCM_TAG_CHARACTER );
-        action.setProjectType( "shell" );
-        action.setSelectedProjectGroup( 1 );
-        action.setBuildDefintionTemplateId( 1 );
-
-        // validate
-        action.validate();
-
-        // verify
-        assertTrue( action.hasActionErrors() );
-        assertEquals( 5, action.getActionErrors().size() );
-    }
-
     private List<Project> createProjectList()
     {
         List<Project> projects = new ArrayList<Project>();



Mime
View raw message