continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r767474 - in /continuum/branches/continuum-1.3.x: continuum-purge/src/main/java/org/apache/continuum/purge/ continuum-purge/src/main/java/org/apache/continuum/purge/executor/ continuum-webapp/src/main/java/org/apache/continuum/web/util/ con...
Date Wed, 22 Apr 2009 11:48:16 GMT
Author: jzurbano
Date: Wed Apr 22 11:48:15 2009
New Revision: 767474

URL: http://svn.apache.org/viewvc?rev=767474&view=rev
Log:
merge -r 766271:766272 from trunk

Added:
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLog.java   (with props)
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java   (with props)
Modified:
    continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java
    continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
    continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
    continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
    continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/log4j.xml

Modified: continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java Wed Apr 22 11:48:15 2009
@@ -31,4 +31,16 @@
     public static final String PURGE_DIRECTORY_RELEASES = "releases";
 
     public static final String PURGE_DIRECTORY_BUILDOUTPUT = "buildOutput";
+    
+    public static final String PURGE = "PURGE";
+    
+    public static final String PURGE_REPO_CONTENTS = "Purge All Repository Contents";
+    
+    public static final String PURGE_DIR_CONTENTS = "Purge All Directory Contents";
+   
+    public static final String PURGE_ARTIFACT = "Purge Artifact File";
+    
+    public static final String PURGE_FILE = "Purge Support File";
+    
+    public static final String PURGE_PROJECT = "Purge Project";
 }

Modified: continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java Wed Apr 22 11:48:15 2009
@@ -23,6 +23,7 @@
 import java.io.FilenameFilter;
 import java.util.Set;
 
+import org.apache.continuum.purge.ContinuumPurgeConstants;
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
 import org.apache.maven.archiva.model.ArtifactReference;
@@ -47,7 +48,7 @@
             {
                 File artifactFile = repository.toFile( reference );
                 artifactFile.delete();
-                log.info( "Purge artifact " + artifactFile.getName() );
+                log.info( ContinuumPurgeConstants.PURGE_ARTIFACT + " - " + artifactFile.getName() );
                 purgeSupportFiles( artifactFile, artifactFile.getName() );
                 // purge maven metadata
                 purgeSupportFiles( artifactFile.getParentFile(), "maven-metadata" );
@@ -83,8 +84,8 @@
             if ( file.exists() && file.isFile() )
             {
                 file.delete();
-                log.info( "Purge support file: " + file.getName() );
+                log.info( ContinuumPurgeConstants.PURGE_FILE + " - " + file.getName() );
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/CleanAllPurgeExecutor.java Wed Apr 22 11:48:15 2009
@@ -29,12 +29,17 @@
 import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
 import org.codehaus.plexus.util.FileUtils;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * @author Maria Catherine Tan
  */
 public class CleanAllPurgeExecutor
     extends AbstractContinuumPurgeExecutor
 {
+    private Logger log = LoggerFactory.getLogger( CleanAllPurgeExecutor.class );
+    
     private final String purgeType;
 
     public CleanAllPurgeExecutor( String purgeType )
@@ -71,6 +76,7 @@
             throw new ContinuumPurgeExecutorException( "Error while purging all artifacts or directories in " + path,
                                                        e );
         }
+        log.info( ContinuumPurgeConstants.PURGE_REPO_CONTENTS + " - " + path );
     }
 
     private void purgeReleases( String path )
@@ -87,6 +93,7 @@
             for ( File releaseDir : releasesDir )
             {
                 FileUtils.deleteDirectory( releaseDir );
+                log.info( ContinuumPurgeConstants.PURGE_DIR_CONTENTS + " - " + releaseDir.getName() );
             }
         }
         catch ( IOException e )
@@ -109,6 +116,7 @@
             for ( File projectDir : projectsDir )
             {
                 FileUtils.cleanDirectory( projectDir );
+                log.info( ContinuumPurgeConstants.PURGE_DIR_CONTENTS + " - " + projectDir.getName() );
             }
         }
         catch ( IOException e )

Modified: continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/DaysOldDirectoryPurgeExecutor.java Wed Apr 22 11:48:15 2009
@@ -33,6 +33,9 @@
 import org.apache.continuum.purge.ContinuumPurgeConstants;
 import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * @author Maria Catherine Tan
  */
@@ -40,6 +43,8 @@
     extends AbstractContinuumPurgeExecutor
     implements ContinuumPurgeExecutor
 {
+    private Logger log = LoggerFactory.getLogger( DaysOldDirectoryPurgeExecutor.class );
+    
     private final int daysOlder;
 
     private final int retentionCount;
@@ -99,6 +104,7 @@
             {
                 try
                 {
+                    log.info( ContinuumPurgeConstants.PURGE_DIR_CONTENTS + " - " + dir.getName() );
                     FileUtils.deleteDirectory( dir );
                     countToPurge--;
                 }
@@ -145,11 +151,13 @@
                 {
                     try
                     {
+                        log.info( ContinuumPurgeConstants.PURGE_DIR_CONTENTS + " - " + buildDir.getName() );
                         FileUtils.deleteDirectory( buildDir );
                         File logFile = new File( buildDir.getAbsoluteFile() + ".log.txt" );
 
                         if ( logFile.exists() )
                         {
+                            log.info( ContinuumPurgeConstants.PURGE_FILE + " - " + logFile.getName() );
                             logFile.delete();
                         }
 

Modified: continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/executor/ReleasedSnapshotsRepositoryPurgeExecutor.java Wed Apr 22 11:48:15 2009
@@ -25,6 +25,7 @@
 import java.util.List;
 
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
+import org.apache.continuum.purge.ContinuumPurgeConstants;
 import org.apache.maven.archiva.common.utils.VersionComparator;
 import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.model.ArtifactReference;
@@ -33,6 +34,9 @@
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Codes were taken from Archiva's CleanupReleasedSnapshotsRepositoryPurge and just made some few changes
  *
@@ -42,6 +46,8 @@
     extends AbstractContinuumPurgeExecutor
 {
     private final RepositoryManagedContent repository;
+    
+    private Logger log = LoggerFactory.getLogger( ReleasedSnapshotsRepositoryPurgeExecutor.class );
 
     public ReleasedSnapshotsRepositoryPurgeExecutor( RepositoryManagedContent repository )
     {
@@ -106,6 +112,8 @@
                 {
                     versionRef.setVersion( version );
                     repository.deleteVersion( versionRef );
+                    
+                    log.info( ContinuumPurgeConstants.PURGE_PROJECT + " - " + VersionedReference.toKey( versionRef ) );
 
                     removeMetadata( versionRef );
                 }
@@ -131,4 +139,4 @@
 
         purgeSupportFiles( projectDir, "maven-metadata" );
     }
-}
\ No newline at end of file
+}

Added: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLog.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLog.java?rev=767474&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLog.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLog.java Wed Apr 22 11:48:15 2009
@@ -0,0 +1,114 @@
+package org.apache.continuum.web.util;
+
+/*
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+
+/**
+ * @author Jevica Arianne B. Zurbano
+ * @version $Id: AuditLog.java
+ * @since 17 apr 09
+ */
+public class AuditLog
+{
+    private Logger logger = LoggerFactory.getLogger( AuditLog.class.getName() );
+
+    private String action;
+
+    private String category;
+    
+    private String resource;
+
+    private String currentUser;
+
+    public AuditLog( String action )
+    {
+        this.action = action;
+    }
+
+    public AuditLog( String resource, String action )
+    {
+        this.action = action;
+        this.resource = resource;
+    }
+
+    public void setCurrentUser( String currentUser )
+    {
+        this.currentUser = currentUser;
+    }
+
+    public String getCurrentUser()
+    {
+        return currentUser;
+    }
+
+    public void setResource( String resource )
+    {
+        this.resource = resource;
+    }
+
+    public String getResource()
+    {
+        return resource;
+    }
+
+    public void setCategory( String category )
+    {
+        this.category = category;
+    }
+
+    public String getCategory()
+    {
+        return category;
+    }
+
+    public void setAction( String action )
+    {
+        this.action = action;
+    }
+
+    public String getAction()
+    {
+        return action;
+    }
+
+    public void log()
+    {
+        if ( currentUser != null )
+        {
+            MDC.put( "security.currentUser", currentUser );
+        }
+        
+        if ( resource != null )
+        {
+            if ( category != null )
+            {
+                logger.info( category + " " + resource + " - " + action );
+            }
+            else
+            {
+                logger.info( resource + " - " + action );
+            }
+        }
+    }
+}
+

Propchange: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java?rev=767474&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java Wed Apr 22 11:48:15 2009
@@ -0,0 +1,84 @@
+package org.apache.continuum.web.util;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author Jevica Arianne B. Zurbano
+ * @version $Id: AuditLogConstants.java
+ * @since 09 apr 09
+ */
+public class AuditLogConstants
+{
+    public static final String PROJECT = "PROJECT";
+
+    public static final String SCHEDULE = "BUILD_SCHEDULE";
+
+    public static final String TEMPLATE = "BUILD_TEMPLATE";
+
+    public static final String BUILD_DEFINITION = "BUILD_DEFINITION";
+
+    public static final String PROJECT_GROUP = "PROJECT_GROUP";
+
+    // events
+    public static final String FORCE_BUILD = "Forced Project Build";
+
+    public static final String CANCEL_BUILD = "Cancelled Project Build";
+
+    public static final String CI_BUILD = "Scheduled Project Build";
+
+    public static final String PREPARE_RELEASE = "Prepare Project Release";
+
+    public static final String PERFORM_RELEASE = "Perform Project Release";
+
+    public static final String ROLLBACK_RELEASE = "Rollback Project Release";
+
+    public static final String ADD_M2_PROJECT = "Added M2 Project";
+
+    public static final String ADD_PROJECT = "Added Project";
+
+    public static final String MODIFY_PROJECT = "Modified Project";
+
+    public static final String REMOVE_PROJECT = "Removed Project";
+
+    public static final String ADD_PROJECT_GROUP = "Added Project Group";
+
+    public static final String MODIFY_PROJECT_GROUP = "Modified Project Group";
+
+    public static final String REMOVE_PROJECT_GROUP = "Removed Project Group";
+
+    public static final String MODIFY_SCHEDULE = "Modified Build Schedule";
+
+    public static final String ADD_SCHEDULE = "Added Build Schedule";
+
+    public static final String REMOVE_SCHEDULE = "Removed Build Schedule";
+
+    public static final String ADD_GOAL = "Added Build Definition";
+
+    public static final String MODIFY_GOAL = "Modified Build Definition";
+
+    public static final String REMOVE_GOAL = "Removed Build Definition";
+
+    public static final String ADD_TEMPLATE = "Added Build Definition Template";
+
+    public static final String MODIFY_TEMPLATE = "Modified Build Definition Template";
+
+    public static final String REMOVE_TEMPLATE = "Removed Build Definition Template";
+}
+

Propchange: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/continuum/web/util/AuditLogConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java Wed Apr 22 11:48:15 2009
@@ -25,6 +25,8 @@
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -109,6 +111,11 @@
                                                         !this.isNonRecursiveProject(),
                                                         this.getBuildDefinitionTemplateId() );
         }
+        
+        AuditLog event = new AuditLog( pomUrl, AuditLogConstants.ADD_M2_PROJECT );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return result;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java Wed Apr 22 11:48:15 2009
@@ -32,6 +32,8 @@
 import org.apache.maven.continuum.profile.ProfileException;
 import org.apache.maven.continuum.profile.ProfileService;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -188,6 +190,11 @@
             this.setProjectGroupId( this.getSelectedProjectGroup() );
             return "projectGroupSummary";
         }
+        
+        AuditLog event = new AuditLog( projectNameTrim, AuditLogConstants.ADD_PROJECT );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java Wed Apr 22 11:48:15 2009
@@ -23,6 +23,8 @@
 
 import java.util.List;
 
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.repository.RepositoryServiceException;
 import org.apache.maven.continuum.ContinuumException;
@@ -151,6 +153,11 @@
 
             return ERROR;
         }
+        
+        AuditLog event = new AuditLog( name, AuditLogConstants.ADD_PROJECT_GROUP );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java Wed Apr 22 11:48:15 2009
@@ -37,6 +37,8 @@
 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.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -312,6 +314,12 @@
             addActionError( authzE.getMessage() );
             return REQUIRES_AUTHORIZATION;
         }
+        
+        String resource = getProjectGroupName() + ":" +  goals + " " + arguments;
+        AuditLog event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
+        event.setCategory( AuditLogConstants.BUILD_DEFINITION );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         if ( groupBuildView )
         {
@@ -359,6 +367,12 @@
 
         if ( projectId != 0 )
         {
+            String resource = getProjectGroupName() + ":" +  goals + " " + arguments;
+            AuditLog event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
+            event.setCategory( AuditLogConstants.BUILD_DEFINITION );
+            event.setCurrentUser( getPrincipal() );
+            event.log();
+            
             return SUCCESS;
         }
         else
@@ -377,6 +391,12 @@
             if ( confirmed )
             {
                 getContinuum().removeBuildDefinitionFromProject( projectId, buildDefinitionId );
+                
+                String resource = getProjectGroupName() + ":" +  goals + " " + arguments;
+                AuditLog event = new AuditLog( resource, AuditLogConstants.REMOVE_GOAL );
+                event.setCategory( AuditLogConstants.BUILD_DEFINITION );
+                event.setCurrentUser( getPrincipal() );
+                event.log();
 
                 return SUCCESS;
             }
@@ -405,6 +425,12 @@
             if ( confirmed )
             {
                 getContinuum().removeBuildDefinitionFromProjectGroup( projectGroupId, buildDefinitionId );
+                
+                String resource = getProjectGroupName() + ":" +  goals + " " + arguments;
+                AuditLog event = new AuditLog( resource, AuditLogConstants.REMOVE_GOAL );
+                event.setCategory( AuditLogConstants.BUILD_DEFINITION );
+                event.setCurrentUser( getPrincipal() );
+                event.log();
 
                 return SUCCESS;
             }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java Wed Apr 22 11:48:15 2009
@@ -21,6 +21,8 @@
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -77,9 +79,16 @@
                 getContinuum().buildProjects();
             }
         }
+        
+        AuditLog event = new AuditLog( AuditLogConstants.FORCE_BUILD );
+        event.setCurrentUser( getPrincipal() );
 
         if ( projectId > 0 )
         {
+            event.setResource( "Project id=" + projectId );
+            event.setCategory( AuditLogConstants.PROJECT );
+            event.log();
+
             if ( fromGroupPage )
             {
                 return "to_group_page";
@@ -89,6 +98,12 @@
                 return "to_project_page";
             }
         }
+        else
+        {
+            event.setResource( "Project Group id=" + projectGroupId );
+            event.setCategory( AuditLogConstants.PROJECT_GROUP );
+            event.log();
+        }
 
         return SUCCESS;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java Wed Apr 22 11:48:15 2009
@@ -30,6 +30,8 @@
 import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.taskqueue.BuildProjectTask;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -65,6 +67,11 @@
             BuildsManager buildsManager = getContinuum().getBuildsManager();
 
             buildsManager.cancelBuild( projectId );
+            
+            AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.CANCEL_BUILD );
+            event.setCategory( AuditLogConstants.PROJECT );
+            event.setCurrentUser( getPrincipal() );
+            event.log();
         }
         catch ( AuthorizationRequiredException e )
         {
@@ -101,7 +108,14 @@
             int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
             if ( index > 0 )
             {
-                getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
+                int projId = projectsId[index];
+                
+                getContinuum().getBuildsManager().cancelBuild( projId );
+	            
+  	            AuditLog event = new AuditLog( "Project id=" + projId, AuditLogConstants.CANCEL_BUILD );
+                event.setCategory( AuditLogConstants.PROJECT );
+                event.setCurrentUser( getPrincipal() );
+                event.log();
             }
 
         }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ContinuumActionSupport.java Wed Apr 22 11:48:15 2009
@@ -544,4 +544,22 @@
     {
         return getTexts( "localization/Continuum" );
     }
+    
+    protected String getPrincipal()
+    {
+        String principal = "guest";
+        
+        if ( getSecuritySession() != null )
+        {
+            if ( getSecuritySession().getUser() != null )
+            {
+                principal = (String) getSecuritySession().getUser().getPrincipal();
+            }
+        }
+        else
+        {
+            principal = "unknown-user";
+        }
+        return principal;
+     }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java Wed Apr 22 11:48:15 2009
@@ -22,6 +22,8 @@
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -50,6 +52,11 @@
         {
             return REQUIRES_AUTHORIZATION;
         }
+        
+        AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.REMOVE_PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.log();
 
         getContinuum().removeProject( projectId );
 

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java Wed Apr 22 11:48:15 2009
@@ -22,6 +22,8 @@
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -78,6 +80,12 @@
         project.setScmTag( scmTag );
 
         getContinuum().updateProject( project );
+        
+        String resource = project.getGroupId() + ":" + project.getArtifactId();
+        AuditLog event = new AuditLog( resource, AuditLogConstants.MODIFY_PROJECT );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Wed Apr 22 11:48:15 2009
@@ -34,6 +34,8 @@
 import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -301,6 +303,11 @@
             name = getProjectGroupName();
             return CONFIRM;
         }
+        
+        AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.REMOVE_PROJECT_GROUP );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }
@@ -519,6 +526,11 @@
                 getContinuum().updateProject( project );
             }
         }
+        
+        AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.MODIFY_PROJECT_GROUP );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }
@@ -544,6 +556,11 @@
         {
             getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId );
         }
+        
+        AuditLog event = new AuditLog( getProjectGroupName(), AuditLogConstants.FORCE_BUILD );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         if ( this.isFromSummaryPage() )
         {

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectsListAction.java Wed Apr 22 11:48:15 2009
@@ -22,6 +22,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
@@ -97,7 +99,10 @@
 
                 try
                 {
-                    logger.info( "Removing Project with id=" + projectId );
+                    AuditLog event = new AuditLog( "Project id=" + selectedProject, AuditLogConstants.REMOVE_PROJECT );
+                    event.setCategory( AuditLogConstants.PROJECT );
+                    event.setCurrentUser( getPrincipal() );
+                    event.log();
 
                     getContinuum().removeProject( projectId );
                 }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java Wed Apr 22 11:48:15 2009
@@ -25,6 +25,8 @@
 import org.apache.continuum.release.distributed.DistributedReleaseUtil;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.continuum.web.action.AbstractReleaseAction;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.system.Profile;
@@ -260,6 +262,12 @@
             releaseManager.perform( releaseId, performDirectory, goals, arguments, useReleaseProfile, listener,
                                     repository );
         }
+        
+        String resource = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
+        AuditLog event = new AuditLog( resource, AuditLogConstants.PERFORM_RELEASE );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java Wed Apr 22 11:48:15 2009
@@ -23,6 +23,8 @@
 import org.apache.continuum.release.distributed.DistributedReleaseUtil;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.continuum.web.action.AbstractReleaseAction;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.Project;
@@ -354,6 +356,12 @@
                                         workingDirectory, environments, executable );
         }
 
+        String resource = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
+        AuditLog event = new AuditLog( resource, AuditLogConstants.PREPARE_RELEASE );
+        event.setCategory( AuditLogConstants.PROJECT );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
+
         return SUCCESS;
     }
 

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java Wed Apr 22 11:48:15 2009
@@ -24,6 +24,8 @@
 
 import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.continuum.model.project.Project;
@@ -105,6 +107,11 @@
                     //do nothing
                 }
             }
+            String resource = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
+            AuditLog event = new AuditLog( resource, AuditLogConstants.ROLLBACK_RELEASE );
+            event.setCategory( AuditLogConstants.PROJECT );
+            event.setCurrentUser( getPrincipal() );
+            event.log();
     
             releaseManager.getPreparedReleases().remove( releaseId );
         }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java Wed Apr 22 11:48:15 2009
@@ -31,6 +31,8 @@
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.web.exception.AuthenticationRequiredException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -238,11 +240,17 @@
                 logger.debug( "Unexpected error getting schedule" );
             }
         }
+        
+        AuditLog event = new AuditLog( getName(), AuditLogConstants.ADD_SCHEDULE );
+        event.setCategory( AuditLogConstants.SCHEDULE );
+        event.setCurrentUser( getPrincipal() );
+
         if ( id == 0 )
         {
             try
             {
                 getContinuum().addSchedule( setFields( new Schedule() ) );
+                event.log();
             }
             catch ( ContinuumException e )
             {
@@ -256,6 +264,8 @@
             try
             {
                 getContinuum().updateSchedule( setFields( getContinuum().getSchedule( id ) ) );
+                event.setAction( AuditLogConstants.MODIFY_SCHEDULE );
+                event.log();
             }
             catch ( ContinuumException e )
             {
@@ -349,6 +359,11 @@
 
             return CONFIRM;
         }
+        
+        AuditLog event = new AuditLog( name, AuditLogConstants.REMOVE_SCHEDULE );
+        event.setCategory( AuditLogConstants.SCHEDULE );
+        event.setCurrentUser( getPrincipal() );
+        event.log();
 
         return SUCCESS;
     }

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildDefinitionTemplateAction.java Wed Apr 22 11:48:15 2009
@@ -27,6 +27,8 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.continuum.web.util.AuditLog;
+import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionServiceException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -133,16 +135,24 @@
         throws Exception
     {
         List<BuildDefinition> selectedBuildDefinitions = getBuildDefinitionsFromSelectedBuildDefinitions();
+        
+        AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.ADD_TEMPLATE );
+        event.setCategory( AuditLogConstants.TEMPLATE );
+        event.setCurrentUser( getPrincipal() );
+
         if ( this.buildDefinitionTemplate.getId() > 0 )
         {
             buildDefinitionTemplate.setBuildDefinitions( selectedBuildDefinitions );
             this.getContinuum().getBuildDefinitionService().updateBuildDefinitionTemplate( buildDefinitionTemplate );
+            event.setAction( AuditLogConstants.MODIFY_TEMPLATE );
+            event.log();
         }
         else
         {
             buildDefinitionTemplate.setBuildDefinitions( selectedBuildDefinitions );
             this.buildDefinitionTemplate =
                 this.getContinuum().getBuildDefinitionService().addBuildDefinitionTemplate( buildDefinitionTemplate );
+            event.log();
         }
 
         return SUCCESS;
@@ -155,6 +165,12 @@
         {
             buildDefinitionTemplate = getContinuum().getBuildDefinitionService().getBuildDefinitionTemplate(
                 this.buildDefinitionTemplate.getId() );
+
+            AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.REMOVE_TEMPLATE );
+            event.setCategory( AuditLogConstants.TEMPLATE );
+            event.setCurrentUser( getPrincipal() );
+            event.log();
+
             this.getContinuum().getBuildDefinitionService().removeBuildDefinitionTemplate( buildDefinitionTemplate );
         }
         else

Modified: continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/log4j.xml?rev=767474&r1=767473&r2=767474&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/log4j.xml (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/log4j.xml Wed Apr 22 11:48:15 2009
@@ -29,6 +29,15 @@
       <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
     </layout>
   </appender>
+  
+  <appender name="continuumAuditlog" class="org.apache.log4j.DailyRollingFileAppender">
+    <param name="file" value="${appserver.base}/logs/continuum-audit.log" />
+    <param name="append" value="true" />
+    <param name="datePattern" value="'.'yyyy-MM-dd" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} - %X{security.currentUser} - %m%n"/>
+    </layout>
+  </appender>
 
   <appender name="redbackAuditLog" class="org.apache.log4j.DailyRollingFileAppender">
     <param name="file" value="${appserver.base}/logs/continuum-security-audit.log" />
@@ -43,6 +52,11 @@
     <level value="info" />
     <appender-ref ref="redbackAuditLog" />
   </logger>
+  
+  <logger name="org.apache.continuum.web.util.AuditLog" additivity="false">
+    <level value="info" />
+    <appender-ref ref="continuumAuditlog" />
+  </logger>
 
   <!-- Help identify bugs during testing -->
   <logger name="org.apache.maven">



Mime
View raw message