continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1162043 [2/2] - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/continuum/purge/ continuum-api/src/main/java/org/apache/continuum/purge/controller/ continuum-api/src/main/ja...
Date Fri, 26 Aug 2011 09:34:44 GMT
Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?rev=1162043&r1=1162042&r2=1162043&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java (original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java Fri Aug 26 09:34:42 2011
@@ -32,6 +32,7 @@ import org.apache.commons.lang.BooleanUt
 import org.apache.continuum.model.release.ReleaseListenerSummary;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
+import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
@@ -48,9 +49,16 @@ import org.apache.maven.shared.release.c
 import org.apache.maven.shared.release.config.ReleaseDescriptorStoreException;
 import org.apache.maven.shared.release.versions.DefaultVersionInfo;
 import org.apache.maven.shared.release.versions.VersionInfo;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
@@ -62,8 +70,13 @@ import org.codehaus.plexus.util.xml.pull
  * @version $Id$
  */
 public class DefaultContinuumReleaseManager
-    implements ContinuumReleaseManager
+    implements ContinuumReleaseManager, Contextualizable
 {
+    
+    private static final String PLEXUS_KEY_PERFORM_RELEASE_TASKQUEUE_EXECUTOR = "perform-release";
+    private static final String PLEXUS_KEY_PREPARE_RELEASE_TASKQUEUE_EXECUTOR = "prepare-release";
+    private static final String PLEXUS_KEY_ROLLBACK_RELEASE_TASKQUEUE_EXECUTOR = "rollback-release";
+    
     /**
      * @plexus.requirement
      */
@@ -89,6 +102,8 @@ public class DefaultContinuumReleaseMana
      */
     private ScmManager scmManager;
 
+    private PlexusContainer container;
+
     private Map<String, ContinuumReleaseManagerListener> listeners;
 
     /**
@@ -389,4 +404,57 @@ public class DefaultContinuumReleaseMana
 
         return null;
     }
+    
+    public boolean isExecutingRelease() throws Exception
+    {
+        return prepareReleaseQueue.getQueueSnapshot().size() > 0 || 
+            performReleaseQueue.getQueueSnapshot().size() > 0 || 
+            rollbackReleaseQueue.getQueueSnapshot().size() > 0 ||
+            getPerformReleaseTaskQueueExecutor().getCurrentTask() != null || 
+            getPrepareReleaseTaskQueueExecutor().getCurrentTask() != null ||
+            getRollbackReleaseTaskQueueExecutor().getCurrentTask() != null;
+    }
+    
+
+    public TaskQueueExecutor getPerformReleaseTaskQueueExecutor() throws TaskQueueManagerException
+    {
+        try
+        {
+            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, PLEXUS_KEY_PERFORM_RELEASE_TASKQUEUE_EXECUTOR );
+        }
+        catch ( ComponentLookupException e )
+        {
+            throw new TaskQueueManagerException( e.getMessage(), e );
+        }
+    }
+    
+    public TaskQueueExecutor getPrepareReleaseTaskQueueExecutor() throws TaskQueueManagerException
+    {
+        try
+        {
+            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, PLEXUS_KEY_PREPARE_RELEASE_TASKQUEUE_EXECUTOR );
+        }
+        catch ( ComponentLookupException e )
+        {
+            throw new TaskQueueManagerException( e.getMessage(), e );
+        }
+    }
+    
+    public TaskQueueExecutor getRollbackReleaseTaskQueueExecutor() throws TaskQueueManagerException
+    {
+        try
+        {
+            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, PLEXUS_KEY_ROLLBACK_RELEASE_TASKQUEUE_EXECUTOR );
+        }
+        catch ( ComponentLookupException e )
+        {
+            throw new TaskQueueManagerException( e.getMessage(), e );
+        }
+    }
+
+    public void contextualize( Context context )
+        throws ContextException
+    {
+        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+    }
 }

Added: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDaoImpl.java?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDaoImpl.java (added)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDaoImpl.java Fri Aug 26 09:34:42 2011
@@ -0,0 +1,164 @@
+package org.apache.continuum.dao;
+
+/*
+ * 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 java.util.Collections;
+import java.util.List;
+
+import javax.jdo.Extent;
+import javax.jdo.PersistenceManager;
+import javax.jdo.Query;
+import javax.jdo.Transaction;
+
+import org.apache.continuum.model.repository.DistributedDirectoryPurgeConfiguration;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @author
+ * @version $Id$
+ * @plexus.component role="org.apache.continuum.dao.DistributedDirectoryPurgeConfigurationDao"
+ */
+@Repository("distributedDirectoryPurgeConfigurationDao")
+public class DistributedDirectoryPurgeConfigurationDaoImpl
+    extends AbstractDao
+    implements DistributedDirectoryPurgeConfigurationDao
+{
+    public List<DistributedDirectoryPurgeConfiguration> getAllDistributedDirectoryPurgeConfigurations()
+    {
+        return getAllObjectsDetached( DistributedDirectoryPurgeConfiguration.class );
+    }
+
+    public List<DistributedDirectoryPurgeConfiguration> getDistributedDirectoryPurgeConfigurationsBySchedule( int scheduleId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( DistributedDirectoryPurgeConfiguration.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int scheduleId" );
+
+            query.setFilter( "this.schedule.id == scheduleId" );
+
+            List result = (List) query.execute( scheduleId );
+
+            return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
+        }
+        finally
+        {
+            tx.commit();
+
+            rollback( tx );
+        }
+    }
+    
+    public List<DistributedDirectoryPurgeConfiguration> getEnableDistributedDirectoryPurgeConfigurationsBySchedule( int scheduleId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( DistributedDirectoryPurgeConfiguration.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int scheduleId" );
+
+            query.setFilter( "this.schedule.id == scheduleId && this.enabled == true" );
+
+            List result = (List) query.execute( scheduleId );
+
+            return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
+        }
+        finally
+        {
+            tx.commit();
+
+            rollback( tx );
+        }
+    }
+
+    public List<DistributedDirectoryPurgeConfiguration> getDistributedDirectoryPurgeConfigurationsByType( String type )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( DistributedDirectoryPurgeConfiguration.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareImports( "import java.lang.String" );
+
+            query.declareParameters( "String type" );
+
+            query.setFilter( "this.directoryType == type" );
+
+            List result = (List) query.execute( type );
+
+            return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result );
+        }
+        finally
+        {
+            tx.commit();
+
+            rollback( tx );
+        }
+    }
+
+    public DistributedDirectoryPurgeConfiguration getDistributedDirectoryPurgeConfiguration( int configurationId )
+        throws ContinuumStoreException
+    {
+        return (DistributedDirectoryPurgeConfiguration) getObjectById( DistributedDirectoryPurgeConfiguration.class, configurationId );
+    }
+
+    public DistributedDirectoryPurgeConfiguration addDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration purgeConfiguration )
+        throws ContinuumStoreException
+    {
+        return (DistributedDirectoryPurgeConfiguration) addObject( purgeConfiguration );
+    }
+
+    public void updateDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration purgeConfiguration )
+        throws ContinuumStoreException
+    {
+        updateObject( purgeConfiguration );
+    }
+
+    public void removeDistributedDirectoryPurgeConfiguration( DistributedDirectoryPurgeConfiguration purgeConfiguration )
+        throws ContinuumStoreException
+    {
+        removeObject( purgeConfiguration );
+    }
+}

Propchange: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDaoImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DistributedDirectoryPurgeConfigurationDaoImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.java?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.java (added)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.java Fri Aug 26 09:34:42 2011
@@ -0,0 +1,482 @@
+package org.apache.continuum.web.action.admin;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.model.repository.AbstractPurgeConfiguration;
+import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
+import org.apache.continuum.model.repository.DistributedDirectoryPurgeConfiguration;
+import org.apache.continuum.purge.ContinuumPurgeManager;
+import org.apache.continuum.purge.PurgeConfigurationService;
+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.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.redback.integration.interceptor.SecureAction;
+import org.codehaus.redback.integration.interceptor.SecureActionBundle;
+import org.codehaus.redback.integration.interceptor.SecureActionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.opensymphony.xwork2.Preparable;
+
+/**
+ * @author
+ * @version $Id$
+ * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="distributedPurgeConfiguration"
+ * @since
+ */
+public class DistributedPurgeConfigurationAction
+    extends ContinuumConfirmAction
+    implements Preparable, SecureAction
+{
+    private static final Logger logger = LoggerFactory.getLogger( DistributedPurgeConfigurationAction.class );
+
+    private static final String PURGE_TYPE_DIRECTORY = "directory";
+
+    private static final String PURGE_DIRECTORY_RELEASES = "releases";
+    
+    private static final String PURGE_DIRECTORY_WORKING = "working";
+
+    private static final int DEFAULT_RETENTION_COUNT = 2;
+
+    private static final int DEFAULT_DAYS_OLDER = 100;
+
+    private String purgeType;
+
+    private String directoryType;
+
+    private String description;
+
+    private String message;
+
+    private boolean deleteAll;
+
+    private boolean deleteReleasedSnapshots;
+
+    private boolean enabled;
+
+    private boolean confirmed;
+
+    private boolean defaultPurgeConfiguration;
+
+    private int retentionCount;
+
+    private int daysOlder;
+
+    private int scheduleId;
+
+    private int purgeConfigId;
+    
+    private String buildAgentUrl;
+
+    private AbstractPurgeConfiguration purgeConfig;
+
+    private Map<Integer, String> schedules;
+
+    private List<String> directoryTypes;
+    
+    private List<String> buildAgentUrls;
+
+    /**
+     * @plexus.requirement
+     */
+    private PurgeConfigurationService purgeConfigService;
+    
+    @Override
+    public void prepare()
+        throws Exception
+    {
+        super.prepare();
+        
+        // build schedules
+        if ( schedules == null )
+        {
+            schedules = new HashMap<Integer, String>();
+
+            Collection<Schedule> allSchedules = getContinuum().getSchedules();
+
+            for ( Schedule schedule : allSchedules )
+            {
+                schedules.put( schedule.getId(), schedule.getName() );
+            }
+        }
+
+        // build repositories
+        if ( buildAgentUrls == null )
+        {
+            List<BuildAgentConfiguration> buildAgents = getContinuum().getConfiguration().getBuildAgents();
+            buildAgentUrls = new ArrayList<String>( buildAgents.size() );
+            for ( BuildAgentConfiguration buildAgent : buildAgents )
+            {
+                buildAgentUrls.add( buildAgent.getUrl() );
+            }
+            Collections.sort( buildAgentUrls );
+        }
+
+        directoryTypes = new ArrayList<String>();
+        directoryTypes.add( PURGE_DIRECTORY_RELEASES );
+        directoryTypes.add( PURGE_DIRECTORY_WORKING );
+    }
+
+    @Override
+    public String input()
+        throws Exception
+    {
+        if ( purgeConfigId != 0 )
+        {
+            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
+
+            if ( purgeConfig instanceof DistributedDirectoryPurgeConfiguration )
+            {
+                DistributedDirectoryPurgeConfiguration dirPurge = (DistributedDirectoryPurgeConfiguration) purgeConfig;
+
+                this.purgeType = PURGE_TYPE_DIRECTORY;
+                this.daysOlder = dirPurge.getDaysOlder();
+                this.retentionCount = dirPurge.getRetentionCount();
+                this.directoryType = dirPurge.getDirectoryType();
+                this.deleteAll = dirPurge.isDeleteAll();
+                this.enabled = dirPurge.isEnabled();
+                this.defaultPurgeConfiguration = dirPurge.isDefaultPurge();
+                this.description = dirPurge.getDescription();
+                this.buildAgentUrl = dirPurge.getBuildAgentUrl();
+                if ( dirPurge.getSchedule() != null )
+                {
+                    this.scheduleId = dirPurge.getSchedule().getId();
+                }
+            }
+        }
+        else
+        {
+            this.retentionCount = DEFAULT_RETENTION_COUNT;
+            this.daysOlder = DEFAULT_DAYS_OLDER;
+        }
+
+        return INPUT;
+    }
+
+    public String save()
+        throws Exception
+    {
+        if ( purgeConfigId == 0 )
+        {   
+            purgeConfig = new DistributedDirectoryPurgeConfiguration();
+
+            purgeConfig = setupPurgeConfiguration( purgeConfig );
+
+            purgeConfig = purgeConfigService.addPurgeConfiguration( purgeConfig );
+        }
+        else
+        {
+            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
+            purgeConfig = setupPurgeConfiguration( purgeConfig );
+
+            purgeConfigService.updatePurgeConfiguration( purgeConfig );
+        }
+        
+        /*if ( purgeConfig.isDefaultPurge() )
+        {
+            updateDefaultPurgeConfiguration();
+        }*/
+
+        if ( purgeConfig.isEnabled() && purgeConfig.getSchedule() != null )
+        {
+            getContinuum().activePurgeSchedule( purgeConfig.getSchedule() );
+        }
+
+        return SUCCESS;
+    }
+
+    public String remove()
+        throws Exception
+    {
+        
+        if ( confirmed )
+        {
+            purgeConfigService.removePurgeConfiguration( purgeConfigId );
+        }
+        else
+        {
+            return CONFIRM;
+        }
+
+        return SUCCESS;
+    }
+
+    public String purge()
+        throws Exception
+    {
+        
+        ContinuumPurgeManager purgeManager = getContinuum().getPurgeManager();
+
+        if ( purgeConfigId > 0 )
+        {
+            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );
+
+            DistributedDirectoryPurgeConfiguration dirPurge = ( DistributedDirectoryPurgeConfiguration ) purgeConfig;
+            purgeManager.purgeDistributedDirectory( dirPurge );
+        }
+
+        return SUCCESS;
+    }
+
+    public String getPurgeType()
+    {
+        return this.purgeType;
+    }
+
+    public void setPurgeType( String purgeType )
+    {
+        this.purgeType = purgeType;
+    }
+
+    public String getDirectoryType()
+    {
+        return this.directoryType;
+    }
+
+    public void setDirectoryType( String directoryType )
+    {
+        this.directoryType = directoryType;
+    }
+
+    public String getDescription()
+    {
+        return this.description;
+    }
+
+    public void setDescription( String description )
+    {
+        this.description = description;
+    }
+
+    public String getMessage()
+    {
+        return this.message;
+    }
+
+    public void setMessage( String message )
+    {
+        this.message = message;
+    }
+
+    public boolean isDeleteAll()
+    {
+        return this.deleteAll;
+    }
+
+    public void setDeleteAll( boolean deleteAll )
+    {
+        this.deleteAll = deleteAll;
+    }
+
+    public boolean isDeleteReleasedSnapshots()
+    {
+        return this.deleteReleasedSnapshots;
+    }
+
+    public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
+    {
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+    }
+
+    public boolean isEnabled()
+    {
+        return this.enabled;
+    }
+
+    public void setEnabled( boolean enabled )
+    {
+        this.enabled = enabled;
+    }
+
+    @Override
+    public boolean isConfirmed()
+    {
+        return this.confirmed;
+    }
+
+    @Override
+    public void setConfirmed( boolean confirmed )
+    {
+        this.confirmed = confirmed;
+    }
+
+    public boolean isDefaultPurgeConfiguration()
+    {
+        return this.defaultPurgeConfiguration;
+    }
+
+    public void setDefaultPurgeConfiguration( boolean defaultPurgeConfiguration )
+    {
+        this.defaultPurgeConfiguration = defaultPurgeConfiguration;
+    }
+
+    public int getRetentionCount()
+    {
+        return this.retentionCount;
+    }
+
+    public void setRetentionCount( int retentionCount )
+    {
+        this.retentionCount = retentionCount;
+    }
+
+    public int getDaysOlder()
+    {
+        return this.daysOlder;
+    }
+
+    public void setDaysOlder( int daysOlder )
+    {
+        this.daysOlder = daysOlder;
+    }
+
+    public int getScheduleId()
+    {
+        return this.scheduleId;
+    }
+
+    public void setScheduleId( int scheduleId )
+    {
+        this.scheduleId = scheduleId;
+    }
+
+    public int getPurgeConfigId()
+    {
+        return purgeConfigId;
+    }
+
+    public void setPurgeConfigId( int purgeConfigId )
+    {
+        this.purgeConfigId = purgeConfigId;
+    }
+
+    public AbstractPurgeConfiguration getPurgeConfig()
+    {
+        return this.purgeConfig;
+    }
+
+    public void setPurgeConfig( AbstractPurgeConfiguration purgeConfig )
+    {
+        this.purgeConfig = purgeConfig;
+    }
+
+    public Map<Integer, String> getSchedules()
+    {
+        return this.schedules;
+    }
+
+    public void setSchedules( Map<Integer, String> schedules )
+    {
+        this.schedules = schedules;
+    }
+
+    public List<String> getDirectoryTypes()
+    {
+        return this.directoryTypes;
+    }
+
+    public void setDirectoryTypes( List<String> directoryTypes )
+    {
+        this.directoryTypes = directoryTypes;
+    }
+
+    private AbstractPurgeConfiguration setupPurgeConfiguration( AbstractPurgeConfiguration purgeConfiguration )
+        throws Exception
+    {
+        return buildDirPurgeConfiguration();
+    }
+
+    public String getBuildAgentUrl()
+    {
+        return buildAgentUrl;
+    }
+
+    public void setBuildAgentUrl( String buildAgentUrl )
+    {
+        this.buildAgentUrl = buildAgentUrl;
+    }
+
+    public List<String> getBuildAgentUrls()
+    {
+        return buildAgentUrls;
+    }
+
+    public void setBuildAgentUrls( List<String> buildAgentUrls )
+    {
+        this.buildAgentUrls = buildAgentUrls;
+    }
+
+    private DistributedDirectoryPurgeConfiguration buildDirPurgeConfiguration()
+        throws Exception
+    {
+        DistributedDirectoryPurgeConfiguration dirPurge = (DistributedDirectoryPurgeConfiguration) purgeConfig;
+        dirPurge.setDeleteAll( this.deleteAll );
+        dirPurge.setEnabled( this.enabled );
+        dirPurge.setDaysOlder( this.daysOlder );
+        dirPurge.setRetentionCount( this.retentionCount );
+        dirPurge.setDirectoryType( this.directoryType );
+        dirPurge.setDefaultPurge( this.defaultPurgeConfiguration );
+        dirPurge.setBuildAgentUrl( buildAgentUrl );
+        
+        // escape xml to prevent xss attacks
+        dirPurge.setDescription( StringEscapeUtils.escapeXml( StringEscapeUtils.unescapeXml( this.description ) ) );
+
+        if ( scheduleId > 0 )
+        {
+            Schedule schedule = getContinuum().getSchedule( scheduleId );
+            dirPurge.setSchedule( schedule );
+        }
+        
+        return dirPurge;
+    }
+
+    private void updateDefaultPurgeConfiguration()
+        throws Exception
+    {
+        DirectoryPurgeConfiguration dirPurge =
+            purgeConfigService.getDefaultPurgeConfigurationForDirectoryType( directoryType );
+
+        if ( dirPurge != null && dirPurge.getId() != purgeConfig.getId() )
+        {
+            dirPurge.setDefaultPurge( false );
+            purgeConfigService.updateDirectoryPurgeConfiguration( dirPurge );
+        }
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_PURGING, Resource.GLOBAL );
+
+        return bundle;
+    }
+}

Propchange: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeAction.java?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeAction.java (added)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeAction.java Fri Aug 26 09:34:42 2011
@@ -0,0 +1,212 @@
+package org.apache.continuum.web.action.admin;
+
+/*
+ * 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.Preparable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+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.DistributedDirectoryPurgeConfiguration;
+import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
+import org.apache.continuum.purge.ContinuumPurgeManager;
+import org.apache.continuum.purge.PurgeConfigurationService;
+import org.apache.continuum.repository.RepositoryService;
+import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+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.struts2.ServletActionContext;
+import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.redback.integration.interceptor.SecureAction;
+import org.codehaus.redback.integration.interceptor.SecureActionBundle;
+import org.codehaus.redback.integration.interceptor.SecureActionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author
+ * @version $Id$
+ * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="purge"
+ * @since
+ */
+public class PurgeAction
+    extends ContinuumConfirmAction
+    implements Preparable, SecureAction
+{
+    private static final Logger logger = LoggerFactory.getLogger( PurgeConfigurationAction.class );
+
+    private static final String DISTRIBUTED_BUILD_SUCCESS = "distributed-build-success";
+
+    private static final String PURGE_TYPE_REPOSITORY = "repository";
+
+    private static final String PURGE_TYPE_DIRECTORY = "directory";
+
+    private static final String PURGE_DIRECTORY_RELEASES = "releases";
+
+    private static final String PURGE_DIRECTORY_BUILDOUTPUT = "buildOutput";
+    
+    private static final String PURGE_DIRECTORY_WORKING = "working";
+
+    private Map<Integer, String> repositories;
+
+    private Map<Integer, String> schedules;
+
+    private List<RepositoryPurgeConfiguration> repoPurgeConfigs;
+
+    private List<DirectoryPurgeConfiguration> dirPurgeConfigs;
+    
+    private List<DistributedDirectoryPurgeConfiguration> distributedDirPurgeConfigs;
+
+    private List<String> directoryTypes;
+
+    /**
+     * @plexus.requirement
+     */
+    private PurgeConfigurationService purgeConfigService;
+
+    /**
+     * @plexus.requirement
+     */
+    private RepositoryService repositoryService;
+    
+    private Schedule sched = null;
+
+    public String display()
+        throws Exception
+    {
+        if ( schedules == null )
+        {
+            schedules = new HashMap<Integer, String>();
+
+            Collection<Schedule> allSchedules = getContinuum().getSchedules();
+
+            for ( Schedule schedule : allSchedules )
+            {
+                schedules.put( schedule.getId(), schedule.getName() );
+            }
+        }
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            String errorMessage = ServletActionContext.getRequest().getParameter( "errorMessage" );
+
+            if ( errorMessage != null )
+            {
+                addActionError( getText( errorMessage ) );
+            }
+            distributedDirPurgeConfigs = purgeConfigService.getAllDistributedDirectoryPurgeConfigurations();
+            
+            return DISTRIBUTED_BUILD_SUCCESS;
+        }
+        else
+        {
+
+            String errorMessage = ServletActionContext.getRequest().getParameter( "errorMessage" );
+
+            if ( errorMessage != null )
+            {
+                addActionError( getText( errorMessage ) );
+            }
+
+            repoPurgeConfigs = purgeConfigService.getAllRepositoryPurgeConfigurations();
+            dirPurgeConfigs = purgeConfigService.getAllDirectoryPurgeConfigurations();
+
+            return SUCCESS;
+        }
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_PURGING, Resource.GLOBAL );
+
+        return bundle;
+    }
+
+    public Map<Integer, String> getRepositories()
+    {
+        return repositories;
+    }
+
+    public void setRepositories( Map<Integer, String> repositories )
+    {
+        this.repositories = repositories;
+    }
+
+    public List<RepositoryPurgeConfiguration> getRepoPurgeConfigs()
+    {
+        return repoPurgeConfigs;
+    }
+
+    public void setRepoPurgeConfigs( List<RepositoryPurgeConfiguration> repoPurgeConfigs )
+    {
+        this.repoPurgeConfigs = repoPurgeConfigs;
+    }
+
+    public List<DirectoryPurgeConfiguration> getDirPurgeConfigs()
+    {
+        return dirPurgeConfigs;
+    }
+
+    public void setDirPurgeConfigs( List<DirectoryPurgeConfiguration> dirPurgeConfigs )
+    {
+        this.dirPurgeConfigs = dirPurgeConfigs;
+    }
+
+    public List<DistributedDirectoryPurgeConfiguration> getDistributedDirPurgeConfigs()
+    {
+        return distributedDirPurgeConfigs;
+    }
+
+    public void setDistributedDirPurgeConfigs( List<DistributedDirectoryPurgeConfiguration> distributedDirPurgeConfigs )
+    {
+        this.distributedDirPurgeConfigs = distributedDirPurgeConfigs;
+    }
+
+    public List<String> getDirectoryTypes()
+    {
+        return directoryTypes;
+    }
+
+    public void setDirectoryTypes( List<String> directoryTypes )
+    {
+        this.directoryTypes = directoryTypes;
+    }
+
+    public PurgeConfigurationService getPurgeConfigService()
+    {
+        return purgeConfigService;
+    }
+
+    public void setPurgeConfigService( PurgeConfigurationService purgeConfigService )
+    {
+        this.purgeConfigService = purgeConfigService;
+    }
+}

Propchange: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/PurgeAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=1162043&r1=1162042&r2=1162043&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties Fri Aug 26 09:34:42 2011
@@ -1017,6 +1017,7 @@ purgeConfigs.table.deleteAll = Delete Al
 purgeConfigs.table.directoryType = Directory Type
 purgeConfigs.table.default = Default
 purgeConfigs.table.enabled = Enabled
+purgeConfigs.table.buildAgent = Build Agent
 purgeConfigs.table.deleteReleasedSnapshots = Delete Released Snapshots
 
 #-----------------------------------------------------------------------
@@ -1035,6 +1036,7 @@ purgeConfig.schedule.label = Schedule
 purgeConfig.description.label = Description
 purgeConfig.enabled.label = Enabled Purge Configuration
 purgeConfig.no.repositories = No repositories to purge
+purgeConfig.buildAgent.label = Build Agent
 
 #-----------------------------------------------------------------------
 # Page: Delete Purge Configuration

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_de.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_de.properties?rev=1162043&r1=1162042&r2=1162043&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_de.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_de.properties Fri Aug 26 09:34:42 2011
@@ -898,6 +898,7 @@ purgeConfigs.table.deleteAll = Alle l\u0
 purgeConfigs.table.directoryType = Verzeichnistyp
 purgeConfigs.table.default = Standard
 purgeConfigs.table.enabled = Aktiviert
+purgeConfigs.table.buildAgent = Vorgangsagent
 purgeConfigs.table.deleteReleasedSnapshots = Ver\u00F6ffentlichte Snapshots l\u00F6schen
 
 #-----------------------------------------------------------------------
@@ -916,6 +917,7 @@ purgeConfig.schedule.label = Zeitplan
 purgeConfig.description.label = Beschreibung
 purgeConfig.enabled.label = Aktiviert
 purgeConfig.no.repositories = Keine zu bereinigende Repositories.
+purgeConfig.buildAgent.label = Vorgangsagent
 
 # ----------------------------------------------------------------------
 # Page: Release Results

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties?rev=1162043&r1=1162042&r2=1162043&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties Fri Aug 26 09:34:42 2011
@@ -982,6 +982,7 @@ purgeConfigs.table.deleteAll = Supprimer
 purgeConfigs.table.directoryType = Type de r\u00e9pertoire
 purgeConfigs.table.default = Defaut
 purgeConfigs.table.enabled = Activ\u00e9
+purgeConfigs.table.buildAgent = Agent de construction
 purgeConfigs.table.deleteReleasedSnapshots = Suppression des snapshots "releas\u00e9"
 
 #-----------------------------------------------------------------------
@@ -1000,6 +1001,8 @@ purgeConfig.schedule.label = Planificati
 purgeConfig.description.label = Description
 purgeConfig.enabled.label = Activ\u00e9
 purgeConfig.no.repositories = Pas de repositories \u00e0 purger
+purgeConfig.buildAgent.label = Agent de construction
+
 
 #-----------------------------------------------------------------------
 # Page: Delete Purge Configuration

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction-saveDistributedPurgeConfig-validation.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction-saveDistributedPurgeConfig-validation.xml?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction-saveDistributedPurgeConfig-validation.xml (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction-saveDistributedPurgeConfig-validation.xml Fri Aug 26 09:34:42 2011
@@ -0,0 +1,42 @@
+<!--
+  ~ 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="daysOlder">
+    <field-validator type="int">
+      <param name="min">0</param>
+      <message key="purgeConfig.daysOlder.min"/>
+    </field-validator>
+  </field>
+  <field name="retentionCount">
+    <field-validator type="int">
+      <param name="min">0</param>
+      <message key="purgeConfig.retentionCount.min"/>
+    </field-validator>
+  </field>
+  <field name="buildAgentUrl">
+    <field-validator type="requiredstring">
+      <message key="purgeConfig.buildagent.required"/>
+    </field-validator>
+  </field>
+</validators>

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction-saveDistributedPurgeConfig-validation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction-saveDistributedPurgeConfig-validation.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.properties?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.properties Fri Aug 26 09:34:42 2011
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+purgeConfig.daysOlder.min = Days Older must be a positive number.
+purgeConfig.retentionCount.min = Retention Count must be a positive number.
+purgeConfig.description.invalid = Description contains invalid characters.
+purgeConfig.buildagent.required = Build Agent is required.
\ No newline at end of file

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction_en.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction_en.properties?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction_en.properties (added)
+++ continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction_en.properties Fri Aug 26 09:34:42 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/continuum/web/action/admin/DistributedPurgeConfigurationAction_en.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/resources/org/apache/continuum/web/action/admin/DistributedPurgeConfigurationAction_en.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/struts.xml?rev=1162043&r1=1162042&r2=1162043&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/struts.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/struts.xml Fri Aug 26 09:34:42 2011
@@ -912,7 +912,7 @@
     </action>    
 
     <action name="removePrepareBuildEntry" class="queues" method="removePrepareBuildEntry">
-	  <result name="success" type="redirectAction">
+      <result name="success" type="redirectAction">
         <param name="actionName">displayQueues</param>
       </result>
     </action>
@@ -936,9 +936,9 @@
     </action>
 
     <action name="removeDistributedPrepareBuildEntries" class="queues" method="removeDistributedPrepareBuildEntries">
-	  <result name="success" type="redirectAction">
-	    <param name="actionName">displayQueues</param>
-	  </result>
+      <result name="success" type="redirectAction">
+        <param name="actionName">displayQueues</param>
+      </result>
     </action>
 
     <action name="removeDistributedBuildEntries" class="queues" method="removeDistributedBuildEntries">
@@ -1023,7 +1023,14 @@
     <!--
     * Purge actions
     -->
+    <action name="displayPurge" class="purge" method="display">
+        <result name="success">/WEB-INF/jsp/admin/purgeConfigurationsList.jsp</result>
+        <result name="distributed-build-success">/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp</result>
+    </action>
     
+    <!--
+    * Parallel Purge Actions
+    -->
     <action name="purgeConfigList" class="purgeConfiguration" method="list">
       <result name="success">/WEB-INF/jsp/admin/purgeConfigurationsList.jsp</result>
     </action>
@@ -1036,7 +1043,7 @@
     <action name="savePurgeConfig" class="purgeConfiguration" method="save">
       <result name="input">/WEB-INF/jsp/admin/editPurgeConfiguration.jsp</result>
       <result name="success" type="redirectAction">
-        <param name="actionName">purgeConfigList</param>
+        <param name="actionName">displayPurge</param>
       </result>
     </action>
     
@@ -1047,7 +1054,7 @@
       </result>
       <result name="confirm">/WEB-INF/jsp/admin/confirmDeletePurgeConfiguration.jsp</result>
       <result name="success" type="redirectAction">
-        <param name="actionName">purgeConfigList</param>
+        <param name="actionName">displayPurge</param>
       </result>
       <interceptor-ref name="configuredContinuumStack">
         <param name="tokenSession.includeMethods">remove</param>
@@ -1056,14 +1063,57 @@
     
     <action name="doPurge" class="purgeConfiguration" method="purge">
       <result name="success" type="redirectAction">
-        <param name="actionName">purgeConfigList</param>
+        <param name="actionName">displayPurge</param>
+      </result>
+      <result name="error" type="redirectAction">
+        <param name="actionName">displayPurge</param>
+        <param name="errorMessage">${message}</param>
+      </result>
+    </action>
+
+    <!--
+    * Distributed Purge actions
+    -->
+    <action name="editDistributedPurgeConfig" class="distributedPurgeConfiguration" method="input">
+      <result name="error">/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp</result>
+      <result name="input">/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp</result>
+    </action>
+    
+    <action name="saveDistributedPurgeConfig" class="distributedPurgeConfiguration" method="save">
+      <result name="input">/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp</result>
+      <result name="success" type="redirectAction">
+        <param name="actionName">displayPurge</param>
       </result>
+    </action>
+    
+    <action name="removeDistributedPurgeConfig" class="distributedPurgeConfiguration" method="remove">
       <result name="error" type="redirectAction">
         <param name="actionName">purgeConfigList</param>
         <param name="errorMessage">${message}</param>
       </result>
+      <result name="confirm">/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp</result>
+      <result name="success" type="redirectAction">
+        <param name="actionName">displayPurge</param>
+      </result>
+      <interceptor-ref name="configuredContinuumStack">
+        <param name="tokenSession.includeMethods">remove</param>
+      </interceptor-ref>
     </action>
     
+    <action name="doDistributedPurge" class="distributedPurgeConfiguration" method="purge">
+      <result name="success" type="redirectAction">
+        <param name="actionName">displayPurge</param>
+      </result>
+      <result name="error" type="redirectAction">
+        <param name="actionName">displayPurge</param>
+        <param name="errorMessage">${message}</param>
+      </result>
+    </action>
+
+    <!--
+    * Build Agent actions
+    -->
+    
     <action name="buildAgentList" class="buildAgent" method="list">
       <result name="success">/WEB-INF/jsp/admin/buildAgentsList.jsp</result>
     </action>

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp Fri Aug 26 09:34:42 2011
@@ -0,0 +1,56 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ taglib uri="/struts-tags" prefix="s" %>
+<%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<html>
+  <s:i18n name="localization.Continuum">
+    <head>
+        <title><s:text name="deletePurgeConfiguration.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><s:text name="deletePurgeConfiguration.section.title"/></h3>
+        <div class="axial">
+        <s:form action="removeDistributedPurgeConfig" method="post">
+          <s:token/>
+          <s:hidden name="purgeConfigId"/>
+          <s:hidden name="confirmed" value="true"/>
+          <s:actionerror/>
+
+          <div class="warningmessage">
+            <p>
+              <strong>
+                <s:text name="deletePurgeConfiguration.confirmation.message">
+                  <s:param><s:property value="%{description}"/></s:param>
+                </s:text>
+              </strong>
+            </p>
+          </div>
+
+          <div class="functnbar3">
+            <c1:submitcancel value="%{getText('delete')}" cancel="%{getText('cancel')}"/>
+          </div>
+        </s:form>
+        </div>
+      </div>
+    </body>
+  </s:i18n>
+</html>
\ No newline at end of file

Propchange: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteDistributedPurgeConfiguration.jsp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp Fri Aug 26 09:34:42 2011
@@ -0,0 +1,85 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ taglib uri="/struts-tags" prefix="s" %>
+<%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="continuum" prefix="c1" %>
+<%@ taglib uri="http://plexus.codehaus.org/redback/taglib-1.0" prefix="redback" %>
+
+<html>
+  <s:i18n name="localization.Continuum">
+    <head>
+      <title><s:text name="purgeConfigs.page.title"/></title>
+    </head>
+    <body>
+      <div id="h3">
+        <h3><s:text name="purgeConfigs.dir.section.title"/></h3>
+        <s:set name="distributedDirPurgeConfigs" value="distributedDirPurgeConfigs" scope="request"/>
+        <ec:table items="distributedDirPurgeConfigs"
+                  var="dirPurge"
+                  autoIncludeParameters="false"
+                  showExports="false"
+                  showPagination="false"
+                  showStatusBar="false"
+                  sortable="false"
+                  filterable="false">
+         <ec:row>
+            <ec:column property="directoryType" title="purgeConfigs.table.directoryType"/>
+            <ec:column property="daysOlder" title="purgeConfigs.table.daysOlder"/>
+            <ec:column property="retentionCount" title="purgeConfigs.table.retentionCount"/>
+            <ec:column property="deleteAll" title="purgeConfigs.table.deleteAll"/>
+            <ec:column property="schedule.name" title="purgeConfigs.table.schedule"/>
+            <ec:column property="enabled" title="purgeConfigs.table.enabled"/>
+            <ec:column property="description" title="purgeConfigs.table.description"/>
+            <ec:column property="buildAgentUrl" title="purgeConfigs.table.buildAgent"/>
+            <ec:column property="editActions" title="&nbsp;" width="1%">
+                <s:url id="editPurgeConfigUrl" action="editDistributedPurgeConfig">
+                  <s:param name="purgeConfigId"><c:out value="${pageScope.dirPurge.id}"/></s:param>
+                </s:url>
+                <s:a href="%{editPurgeConfigUrl}"><img src="<s:url value='/images/edit.gif' includeParams="none"/>" alt="<s:text name='edit'/>" title="<s:text name='edit'/>" border="0" /></s:a>
+            </ec:column>
+            <ec:column property="purgeActions" title="&nbsp;" width="1%">
+                <s:url id="purgeUrl" action="doDistributedPurge">
+                  <s:param name="purgeConfigId"><c:out value="${pageScope.dirPurge.id}"/></s:param>
+                </s:url>
+                <s:a href="%{purgeUrl}"><img src="<s:url value='/images/purgenow.gif' includeParams="none"/>" alt="<s:text name='purge'/>" title="<s:text name='purge'/>" border="0" /></s:a>
+            </ec:column>
+            <ec:column property="deleteActions" title="&nbsp;" width="1%">
+                <s:token/>
+                <s:url id="removePurgeConfigUrl" action="removeDistributedPurgeConfig">
+                  <s:param name="purgeConfigId"><c:out value="${pageScope.dirPurge.id}"/></s:param>
+                  <s:param name="description"><c:out value="${pageScope.dirPurge.description}"/></s:param>
+                  <s:param name="struts.token.name">struts.token</s:param>
+                  <s:param name="struts.token"><s:property value="struts.token"/></s:param>
+                </s:url>
+                <s:a href="%{removePurgeConfigUrl}"><img src="<s:url value='/images/delete.gif' includeParams="none"/>" alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0"></s:a>
+            </ec:column>
+          </ec:row>
+        </ec:table>
+      </div>
+      <div class="functnbar3">
+        <s:form name="addDirPurgeConfig" action="editDistributedPurgeConfig" method="post">
+          <s:hidden name="purgeType" value="directory"/>
+          <s:submit value="%{getText('add')}" theme="simple"/>
+        </s:form>
+      </div>
+    </body>
+  </s:i18n>
+</html>
\ No newline at end of file

Propchange: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/distributedPurgeConfigurationsList.jsp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp?rev=1162043&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp Fri Aug 26 09:34:42 2011
@@ -0,0 +1,68 @@
+<%--
+  ~ 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.
+  --%>
+
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="/struts-tags" prefix="s" %>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <s:i18n name="localization.Continuum">
+  <head>
+    <title><s:text name="purgeConfig.page.title"/></title>
+  </head>
+  <body>
+  <div class="app">
+    <div id="axial" class="h3">
+      <h3><s:text name="purgeConfig.section.title"/></h3>
+
+    <div class="axial">
+      <s:form action="saveDistributedPurgeConfig" method="post" validate="true">
+        <c:if test="${!empty actionErrors}">
+          <div class="errormessage">
+            <s:iterator value="actionErrors">
+              <p><s:property/></p>
+            </s:iterator>
+          </div>
+        </c:if>
+          <table>
+            <s:select label="%{getText('purgeConfig.directoryType.label')}" name="directoryType" list="directoryTypes"/>
+            <s:textfield label="%{getText('purgeConfig.daysOlder.label')}" name="daysOlder"/>
+            <s:textfield label="%{getText('purgeConfig.retentionCount.label')}" name="retentionCount"/>
+            <s:checkbox label="%{getText('purgeConfig.deleteAll.label')}" name="deleteAll"/>
+            <s:if test="purgeType == 'repository'">
+              <s:checkbox label="%{getText('purgeConfig.deleteReleasedSnapshots.label')}" name="deleteReleasedSnapshots"/>
+            </s:if>
+            <s:select label="%{getText('purgeConfig.buildAgent.label')}" name="buildAgentUrl" list="buildAgentUrls"/>
+            <s:select label="%{getText('purgeConfig.schedule.label')}" name="scheduleId" list="schedules"
+                       headerKey="-1" headerValue=""/>
+            <s:textfield label="%{getText('purgeConfig.description.label')}" name="description"/>
+            <s:checkbox label="%{getText('purgeConfig.enabled.label')}" name="enabled"/>
+          </table>
+          <s:hidden name="purgeConfigId"/>
+          <s:hidden name="purgeType"/>
+          <div class="functnbar3">
+            <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
+          </div>
+      </s:form>
+    </div>
+  </div>
+</div>
+
+</body>
+</s:i18n>
+</html>
\ No newline at end of file

Propchange: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editDistributedPurgeConfiguration.jsp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp?rev=1162043&r1=1162042&r2=1162043&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp Fri Aug 26 09:34:42 2011
@@ -98,7 +98,7 @@
           </div>
         </redback:ifAuthorized>
         <redback:ifAuthorized permission="continuum-manage-purging">
-          <s:url id="purgeConfigListUrl" action="purgeConfigList" namespace="/admin" includeParams="none"/>
+          <s:url id="purgeConfigListUrl" action="displayPurge" namespace="/admin" includeParams="none"/>
           <div class="body">
             <s:a href="%{purgeConfigListUrl}">
               <s:text name="menu.administration.purge"/>
@@ -258,4 +258,4 @@
     </div>
   </div>
 </div>
-</s:i18n>
+</s:i18n>
\ No newline at end of file



Mime
View raw message