Index: src/share/org/apache/slide/common/Domain.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
retrieving revision 1.42
diff -w -u -w -r1.42 Domain.java
--- src/share/org/apache/slide/common/Domain.java	12 Dec 2003 02:48:30 -0000	1.42
+++ src/share/org/apache/slide/common/Domain.java	5 Feb 2004 15:14:17 -0000
@@ -79,6 +79,7 @@
 import org.apache.slide.util.conf.ConfigurationException;
 import org.apache.slide.util.conf.Populate;
 import org.apache.slide.util.logger.Logger;
+import org.apache.slide.event.EventDispatcher;
 import org.xml.sax.InputSource;
 
 /**
@@ -479,6 +480,12 @@
         }
         
         namespacesInitialized = true;
+        
+        Enumeration eventConfigurations = configuration.getConfigurations("events");
+        if ( eventConfigurations.hasMoreElements() ) {
+            Configuration eventConfiguration = (Configuration)eventConfigurations.nextElement();
+            EventDispatcher.getInstance().configure(eventConfiguration);
+        }
     }
     
     
Index: src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java,v
retrieving revision 1.23
diff -w -u -w -r1.23 NamespaceAccessTokenImpl.java
--- src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java	5 Nov 2003 14:24:36 -0000	1.23
+++ src/share/org/apache/slide/common/NamespaceAccessTokenImpl.java	5 Feb 2004 15:14:17 -0000
@@ -92,6 +92,9 @@
 import org.apache.slide.util.conf.ConfigurationException;
 import org.apache.slide.util.conf.Populate;
 import org.apache.slide.util.logger.Logger;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.TransactionEvent;
+import org.apache.slide.event.VetoException;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
@@ -422,6 +425,7 @@
      */
     public void begin()
         throws NotSupportedException, SystemException {
+        if ( TransactionEvent.BEGIN.isEnabled() ) EventDispatcher.getInstance().fireEvent(TransactionEvent.BEGIN, new TransactionEvent(this));
         namespace.getTransactionManager().begin();
     }
     
@@ -449,7 +453,13 @@
         throws RollbackException, HeuristicMixedException,
         HeuristicRollbackException, SecurityException, IllegalStateException,
         SystemException {
+        try {
+            if ( TransactionEvent.COMMIT.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(TransactionEvent.COMMIT, new TransactionEvent(this));
+        } catch ( VetoException e ) {
+            throw new SystemException(e.getMessage());
+        }
         namespace.getTransactionManager().commit();
+        if ( TransactionEvent.COMMITED.isEnabled() ) EventDispatcher.getInstance().fireEvent(TransactionEvent.COMMITED, new TransactionEvent(this));
     }
     
     
@@ -467,6 +477,7 @@
      */
     public void rollback()
         throws SecurityException, IllegalStateException, SystemException {
+        if ( TransactionEvent.ROLLBACK.isEnabled() ) EventDispatcher.getInstance().fireEvent(TransactionEvent.ROLLBACK, new TransactionEvent(this));
         namespace.getTransactionManager().rollback();
     }
     
Index: src/share/org/apache/slide/common/XMLUnmarshaller.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v
retrieving revision 1.27
diff -w -u -w -r1.27 XMLUnmarshaller.java
--- src/share/org/apache/slide/common/XMLUnmarshaller.java	22 Jan 2004 12:49:16 -0000	1.27
+++ src/share/org/apache/slide/common/XMLUnmarshaller.java	5 Feb 2004 15:14:18 -0000
@@ -94,6 +94,7 @@
 import org.apache.slide.util.conf.ConfigurationException;
 import org.apache.slide.util.conf.Populate;
 import org.apache.slide.util.logger.Logger;
+import org.apache.slide.event.VetoException;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
@@ -313,6 +314,9 @@
             accessToken.getLogger().log(e,LOG_CHANNEL,Logger.WARNING);
             accessToken.getLogger().log
                 (e.toString(),LOG_CHANNEL,Logger.WARNING);
+        } catch (VetoException e) {
+            accessToken.getLogger().log(e,LOG_CHANNEL,Logger.WARNING);
+            accessToken.getLogger().log(e.toString(),LOG_CHANNEL,Logger.WARNING);
         } catch (LinkedObjectNotFoundException e) {
             // Icorrect link
             accessToken.getLogger().log(e,LOG_CHANNEL,Logger.WARNING);
@@ -357,7 +361,7 @@
                                                   SlideToken token, String uri)
         throws ServiceAccessException, ConfigurationException,
         AccessDeniedException, ObjectNotFoundException,
-        LinkedObjectNotFoundException {
+        LinkedObjectNotFoundException, VetoException {
         
         
         try {
@@ -393,7 +397,7 @@
                                            Configuration revisionDefinition)
         throws ServiceAccessException, ConfigurationException,
         AccessDeniedException, ObjectNotFoundException,
-        LinkedObjectNotFoundException {
+        LinkedObjectNotFoundException, VetoException {
         
         // Retrieving the list of properties
         Enumeration propertyDefinitions =
Index: src/share/org/apache/slide/content/Content.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/content/Content.java,v
retrieving revision 1.12
diff -w -u -w -r1.12 Content.java
--- src/share/org/apache/slide/content/Content.java	12 Dec 2003 02:48:29 -0000	1.12
+++ src/share/org/apache/slide/content/Content.java	5 Feb 2004 15:14:18 -0000
@@ -69,6 +69,7 @@
 import org.apache.slide.security.AccessDeniedException;
 import org.apache.slide.structure.LinkedObjectNotFoundException;
 import org.apache.slide.structure.ObjectNotFoundException;
+import org.apache.slide.event.VetoException;
 
 /**
  * Content.
@@ -91,7 +92,7 @@
     NodeRevisionDescriptors retrieve(SlideToken token, String strUri)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        ObjectLockedException;
+        ObjectLockedException, VetoException;
     
     
     /**
@@ -105,7 +106,7 @@
          NodeRevisionNumber revisionNumber)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        RevisionDescriptorNotFoundException, ObjectLockedException;
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException;
     
     
     /**
@@ -118,7 +119,7 @@
         (SlideToken token, NodeRevisionDescriptors revisionDescriptors)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        RevisionDescriptorNotFoundException, ObjectLockedException;
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException;
     
     
     /**
@@ -133,7 +134,7 @@
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        BranchNotFoundException, NodeNotVersionedException;
+        BranchNotFoundException, NodeNotVersionedException, VetoException;
     
     
     /**
@@ -148,7 +149,7 @@
         throws ObjectNotFoundException, AccessDeniedException, 
         RevisionNotFoundException, LinkedObjectNotFoundException, 
         ServiceAccessException, RevisionContentNotFoundException, 
-        ObjectLockedException;
+        ObjectLockedException, VetoException;
     
     
     /**
@@ -162,7 +163,7 @@
         throws ObjectNotFoundException, AccessDeniedException, 
         RevisionNotFoundException, LinkedObjectNotFoundException, 
         ServiceAccessException, RevisionContentNotFoundException, 
-        ObjectLockedException;
+        ObjectLockedException, VetoException;
     
     
     /**
@@ -175,7 +176,7 @@
                        boolean isVersioned)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        ObjectLockedException;
+        ObjectLockedException, VetoException;
     
     
     /**
@@ -190,7 +191,7 @@
                 NodeRevisionContent revisionContent)
         throws ObjectNotFoundException, AccessDeniedException, 
         RevisionAlreadyExistException, LinkedObjectNotFoundException, 
-        ServiceAccessException, ObjectLockedException;
+        ServiceAccessException, ObjectLockedException, VetoException;
     
     
     /**
@@ -208,7 +209,7 @@
         RevisionAlreadyExistException, LinkedObjectNotFoundException, 
         ServiceAccessException, RevisionDescriptorNotFoundException, 
         ObjectLockedException, NodeNotVersionedException, 
-        BranchNotFoundException;
+        BranchNotFoundException, VetoException;
     
     
     /**
@@ -227,7 +228,7 @@
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        NodeNotVersionedException, RevisionAlreadyExistException;
+        NodeNotVersionedException, RevisionAlreadyExistException, VetoException;
     
     
     /**
@@ -246,7 +247,7 @@
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        NodeNotVersionedException, RevisionAlreadyExistException;
+        NodeNotVersionedException, RevisionAlreadyExistException, VetoException;
     
     
     /**
@@ -267,7 +268,7 @@
         LinkedObjectNotFoundException, ServiceAccessException, 
         RevisionDescriptorNotFoundException, ObjectLockedException,
         NodeNotVersionedException, BranchNotFoundException,
-        RevisionAlreadyExistException;
+        RevisionAlreadyExistException, VetoException;
     
     
     /**
@@ -287,7 +288,7 @@
         LinkedObjectNotFoundException, ServiceAccessException, 
         RevisionDescriptorNotFoundException, ObjectLockedException,
         NodeNotVersionedException, BranchNotFoundException,
-        RevisionAlreadyExistException;
+        RevisionAlreadyExistException, VetoException;
     
     
     /**
@@ -303,7 +304,7 @@
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
         RevisionDescriptorNotFoundException, ObjectLockedException, 
-        RevisionNotFoundException;
+        RevisionNotFoundException, VetoException;
     
     
     /**
@@ -315,7 +316,7 @@
                 NodeRevisionDescriptors revisionDescriptors)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        RevisionDescriptorNotFoundException, ObjectLockedException;
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException;
     
     
     /**
@@ -328,7 +329,7 @@
                 NodeRevisionDescriptor revisionDescriptor)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        RevisionDescriptorNotFoundException, ObjectLockedException;
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException;
     
     
     /**
@@ -341,6 +342,6 @@
                 NodeRevisionNumber revisionNumber)
         throws ObjectNotFoundException, AccessDeniedException, 
         LinkedObjectNotFoundException, ServiceAccessException, 
-        RevisionDescriptorNotFoundException, ObjectLockedException;
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException;
     
 }
Index: src/share/org/apache/slide/content/ContentImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v
retrieving revision 1.51
diff -w -u -w -r1.51 ContentImpl.java
--- src/share/org/apache/slide/content/ContentImpl.java	22 Jan 2004 12:49:16 -0000	1.51
+++ src/share/org/apache/slide/content/ContentImpl.java	5 Feb 2004 15:14:19 -0000
@@ -86,6 +86,10 @@
 import org.apache.slide.structure.Structure;
 import org.apache.slide.structure.SubjectNode;
 import org.apache.slide.util.Configuration;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.ContentEvent;
+import org.apache.slide.event.VetoException;
+import org.apache.slide.event.TransactionEvent;
 
 /**
  * Implementation of the content interface.
@@ -187,7 +191,7 @@
      */
     public NodeRevisionDescriptors retrieve(SlideToken token, String strUri)
         throws ObjectNotFoundException, AccessDeniedException,
-        LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException {
+        LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, VetoException {
         
         String originalUri = strUri;
         strUri = redirectUri( originalUri ); // security token null - is ignored anyway
@@ -217,6 +221,7 @@
         }
         
         revisionDescriptors.setOriginalUri( originalUri );
+
         return revisionDescriptors;
     }
     
@@ -233,7 +238,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        BranchNotFoundException, NodeNotVersionedException {
+        BranchNotFoundException, NodeNotVersionedException, VetoException {
         
         NodeRevisionDescriptor result;
         Uri objectUri = namespace.getUri(token, revisionDescriptors.getUri());
@@ -268,7 +273,6 @@
         }
         
         return result;
-        
     }
     
     
@@ -283,7 +287,7 @@
          NodeRevisionNumber revisionNumber)
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
-        RevisionDescriptorNotFoundException, ObjectLockedException {
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException {
         
         ObjectNode associatedObject = structureHelper.retrieve
             (token, revisionDescriptors.getUri(), false);
@@ -305,8 +309,10 @@
         invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                            null, POST_RETRIEVE);
         
-        return revisionDescriptor;
+        // Fire event
+        if ( ContentEvent.RETRIEVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.RETRIEVE, new ContentEvent(this, token, revisionDescriptors, revisionDescriptor));
         
+        return revisionDescriptor;
     }
     
     
@@ -320,7 +326,7 @@
         (SlideToken token, NodeRevisionDescriptors revisionDescriptors)
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
-        RevisionDescriptorNotFoundException, ObjectLockedException {
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException {
         
         NodeRevisionDescriptor result;
         Uri objectUri = namespace.getUri(token, revisionDescriptors.getUri());
@@ -340,7 +346,6 @@
         }
         
         return result;
-        
     }
     
     
@@ -356,7 +361,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionNotFoundException, RevisionContentNotFoundException,
-        ObjectLockedException {
+        ObjectLockedException, VetoException {
         return retrieve(token, revisionDescriptors.getUri(),
                         revisionDescriptor);
     }
@@ -374,7 +379,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionNotFoundException, RevisionContentNotFoundException,
-        ObjectLockedException {
+        ObjectLockedException, VetoException {
         
         ObjectNode associatedObject =
             structureHelper.retrieve(token, strUri, false);
@@ -395,6 +400,9 @@
         invokeInterceptors(token, null, revisionDescriptor,
                            revisionContent, POST_RETRIEVE);
         
+        // Fire event
+        if ( ContentEvent.RETRIEVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.RETRIEVE, new ContentEvent(this, token, revisionDescriptor, revisionContent));
+
         return revisionContent;
     }
     
@@ -409,7 +417,7 @@
                        boolean isVersioned)
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
-        ObjectLockedException {
+        ObjectLockedException, VetoException {
         
         // Check parent exists and is not lock-null
         checkParentExists(strUri, token);
@@ -440,9 +448,12 @@
         NodeRevisionDescriptors revisionDescriptors =
             new NodeRevisionDescriptors(isVersioned);
         revisionDescriptors.setUri(strUri);
+
+        // Fire event
+        if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, revisionDescriptors));
+
         objectUri.getStore()
             .createRevisionDescriptors(objectUri, revisionDescriptors);
-        
     }
     
     
@@ -458,7 +469,7 @@
                        NodeRevisionContent revisionContent)
         throws ObjectNotFoundException, AccessDeniedException,
         RevisionAlreadyExistException, LinkedObjectNotFoundException,
-        ServiceAccessException, ObjectLockedException {
+        ServiceAccessException, ObjectLockedException, VetoException {
         
         // Check parent exists and is not lock-null
         checkParentExists(strUri, token);
@@ -536,6 +547,9 @@
             // We update the descriptor
             revisionDescriptor.setRevisionNumber(newRevisionNumber);
             
+            // Fire event
+            if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, revisionDescriptors, revisionDescriptor, revisionContent));
+
             // Invoke interceptors
             invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                                revisionContent, PRE_STORE);
@@ -606,6 +620,9 @@
                         revisionDescriptor = oldRevisionDescriptor;
                     } // end of merge
                     
+                    // Fire event
+                    if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, revisionDescriptors, revisionDescriptor, revisionContent));
+
                     // Invoke interceptors
                     invokeInterceptors(token, revisionDescriptors,
                                        revisionDescriptor,
@@ -639,6 +656,9 @@
                     // revision, which is incorrect since the object
                     // HAS revisions.
                     
+                    // Fire event
+                    if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, revisionDescriptors, revisionDescriptor, revisionContent));
+
                     // Invoke interceptors
                     invokeInterceptors(token, revisionDescriptors,
                                        revisionDescriptor,
@@ -670,7 +690,6 @@
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                            revisionContent, POST_STORE);
-        
     }
     
     
@@ -689,7 +708,7 @@
         RevisionAlreadyExistException, LinkedObjectNotFoundException,
         ServiceAccessException, RevisionDescriptorNotFoundException,
         ObjectLockedException, NodeNotVersionedException,
-        BranchNotFoundException {
+        BranchNotFoundException, VetoException {
         
         // Check parent exists and is not lock-null
         checkParentExists(strUri, token);
@@ -737,7 +756,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        NodeNotVersionedException, RevisionAlreadyExistException {
+        NodeNotVersionedException, RevisionAlreadyExistException, VetoException {
         
         return fork(token, strUri, branchName,
                     basedOnRevisionDescriptor.getRevisionNumber());
@@ -761,7 +780,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        NodeNotVersionedException, RevisionAlreadyExistException {
+        NodeNotVersionedException, RevisionAlreadyExistException, VetoException {
         
         if (branchName.equals(NodeRevisionDescriptors.MAIN_BRANCH))
             return null;
@@ -822,6 +841,9 @@
         revisionDescriptors.addSuccessor
             (basedOnRevisionNumber, branchedRevisionNumber);
         
+        // Fire event
+        if ( ContentEvent.FORK.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.FORK, new ContentEvent(this, token, revisionDescriptors));
+
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors,
                            basedOnRevisionDescriptor,
@@ -866,7 +888,7 @@
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionDescriptorNotFoundException, ObjectLockedException,
         NodeNotVersionedException, BranchNotFoundException,
-        RevisionAlreadyExistException {
+        RevisionAlreadyExistException, VetoException {
         
         merge(token, strUri, mainBranch.getBranchName(),
               branch.getBranchName(), newRevisionDescriptor, revisionContent);
@@ -891,7 +913,7 @@
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionDescriptorNotFoundException, ObjectLockedException,
         NodeNotVersionedException, BranchNotFoundException,
-        RevisionAlreadyExistException {
+        RevisionAlreadyExistException, VetoException {
         
         // Retrieve the associated object
         ObjectNode associatedObject =
@@ -949,6 +971,9 @@
             (branchLatestRevisionNumber, newRevisionNumber);
         revisionDescriptors.setLatestRevision(mainBranch, newRevisionNumber);
         
+        // Fire event
+        if ( ContentEvent.MERGE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.MERGE, new ContentEvent(this, token, revisionDescriptors, newRevisionDescriptor, revisionContent));
+
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, newRevisionDescriptor,
                            revisionContent, PRE_STORE);
@@ -969,7 +994,6 @@
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, newRevisionDescriptor,
                            revisionContent, POST_STORE);
-        
     }
     
     
@@ -986,7 +1010,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
         RevisionDescriptorNotFoundException, ObjectLockedException,
-        RevisionNotFoundException {
+        RevisionNotFoundException, VetoException {
         
         // Retrieve the associated object
         ObjectNode associatedObject =
@@ -1016,6 +1040,9 @@
             objectUri.getStore().retrieveRevisionDescriptor
             (objectUri, revisionDescriptor.getRevisionNumber());
         
+        // Fire event
+        if ( ContentEvent.STORE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.STORE, new ContentEvent(this, token, revisionDescriptors, revisionDescriptor, revisionContent));
+
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                            revisionContent, PRE_STORE);
@@ -1053,7 +1080,6 @@
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                            revisionContent, POST_STORE);
-        
     }
     
     
@@ -1066,11 +1092,14 @@
                        NodeRevisionDescriptors revisionDescriptors)
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
-        RevisionDescriptorNotFoundException, ObjectLockedException {
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException {
         
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, null, null, PRE_REMOVE);
         
+        // Fire event
+        if ( ContentEvent.REMOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.REMOVE, new ContentEvent(this, token, revisionDescriptors));
+
         // Retrieve the associated object
         ObjectNode associatedObject = structureHelper.retrieve
             (token, revisionDescriptors.getUri(), false);
@@ -1107,7 +1136,7 @@
                        NodeRevisionDescriptor revisionDescriptor)
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
-        RevisionDescriptorNotFoundException, ObjectLockedException {
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException {
         
         remove(token, strUri, revisionDescriptor.getRevisionNumber());
         
@@ -1124,7 +1153,7 @@
                        NodeRevisionNumber revisionNumber)
         throws ObjectNotFoundException, AccessDeniedException,
         LinkedObjectNotFoundException, ServiceAccessException,
-        RevisionDescriptorNotFoundException, ObjectLockedException {
+        RevisionDescriptorNotFoundException, ObjectLockedException, VetoException {
         
         // Retrieve the associated object
         ObjectNode associatedObject =
@@ -1149,6 +1178,9 @@
             objectUri.getStore().retrieveRevisionDescriptor
             (objectUri, revisionNumber);
         
+        // Fire event
+        if ( ContentEvent.REMOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.REMOVE, new ContentEvent(this, token, revisionDescriptor));
+
         // Invoke interceptors
         invokeInterceptors(token, null, revisionDescriptor, null, PRE_REMOVE);
         
@@ -1181,7 +1213,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         RevisionAlreadyExistException, LinkedObjectNotFoundException,
         ServiceAccessException, RevisionDescriptorNotFoundException,
-        ObjectLockedException, NodeNotVersionedException {
+        ObjectLockedException, NodeNotVersionedException, VetoException {
         
         // Retrieve the associated object
         ObjectNode associatedObject =
@@ -1247,6 +1279,9 @@
         newRevisionDescriptor.setBranchName
             (realOldRevisionDescriptor.getBranchName());
         
+        // Fire event
+        if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, revisionDescriptors, newRevisionDescriptor, revisionContent));
+
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, newRevisionDescriptor,
                            revisionContent, PRE_STORE);
@@ -1285,7 +1320,6 @@
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, newRevisionDescriptor,
                            revisionContent, POST_STORE);
-        
     }
     
     
@@ -1300,7 +1334,7 @@
         throws ObjectNotFoundException, AccessDeniedException,
         RevisionAlreadyExistException, LinkedObjectNotFoundException,
         ServiceAccessException, RevisionDescriptorNotFoundException,
-        ObjectLockedException, NodeNotVersionedException {
+        ObjectLockedException, NodeNotVersionedException, VetoException {
         
         // Retrieve the associated object
         ObjectNode associatedObject =
@@ -1342,6 +1376,9 @@
         }
         revisionDescriptor.setBranchName(branchName);
         
+        // Fire event
+        if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, revisionDescriptors, revisionDescriptor));
+        
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                            null, PRE_STORE);
@@ -1365,7 +1402,6 @@
         // Invoke interceptors
         invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                            null, POST_STORE);
-        
     }
     
     private void setCreationUser(SlideToken token, NodeRevisionDescriptor revisionDescriptor) throws ServiceAccessException, ObjectNotFoundException {
@@ -1491,7 +1527,7 @@
     
     private void checkParentExists(String strUri, SlideToken token)
         throws ServiceAccessException, ObjectLockedException, AccessDeniedException,
-        LinkedObjectNotFoundException, ObjectNotFoundException {
+        LinkedObjectNotFoundException, ObjectNotFoundException, VetoException {
         
         if (namespaceConfig.getCreateObjectAction() == ActionNode.DEFAULT) {
             // do not check during start-up
Index: src/share/org/apache/slide/lock/Lock.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/lock/Lock.java,v
retrieving revision 1.16
diff -w -u -w -r1.16 Lock.java
--- src/share/org/apache/slide/lock/Lock.java	12 Dec 2003 02:48:31 -0000	1.16
+++ src/share/org/apache/slide/lock/Lock.java	5 Feb 2004 15:14:19 -0000
@@ -74,6 +74,7 @@
 import org.apache.slide.structure.ObjectNode;
 import org.apache.slide.structure.ObjectNotFoundException;
 import org.apache.slide.structure.SubjectNode;
+import org.apache.slide.event.VetoException;
 
 /**
  * Lock helper class.
@@ -102,7 +103,7 @@
      */
     void lock(SlideToken slideToken, NodeLock token)
         throws ServiceAccessException, ObjectIsAlreadyLockedException, 
-        AccessDeniedException, ObjectNotFoundException;
+        AccessDeniedException, ObjectNotFoundException, VetoException;
     
     
     /**
@@ -118,7 +119,7 @@
      * Lock Store service
      */
     boolean unlock(SlideToken slideToken, NodeLock token)
-        throws ServiceAccessException, LockTokenNotFoundException;
+        throws ServiceAccessException, LockTokenNotFoundException, VetoException;
     
     
     /**
@@ -135,7 +136,7 @@
     void unlock(SlideToken slideToken, String objectUri, 
                 String lockId)
         throws ServiceAccessException, LockTokenNotFoundException, 
-        ObjectNotFoundException;
+        ObjectNotFoundException, VetoException;
     
     
     /**
@@ -150,7 +151,7 @@
      */
     void renew(SlideToken slideToken, NodeLock token, 
                Date newExpirationDate)
-        throws ServiceAccessException, LockTokenNotFoundException;
+        throws ServiceAccessException, LockTokenNotFoundException, VetoException;
     
     
     /**
@@ -168,7 +169,7 @@
     void renew(SlideToken slideToken, String objectUri, 
                String lockId, Date newExpirationDate)
         throws ServiceAccessException, LockTokenNotFoundException, 
-        ObjectNotFoundException;
+        ObjectNotFoundException, VetoException;
     
     
     /**
@@ -186,7 +187,7 @@
      */
     void kill(SlideToken slideToken, SubjectNode subject)
         throws ServiceAccessException, AccessDeniedException, 
-        LockTokenNotFoundException, ObjectNotFoundException;
+        LockTokenNotFoundException, ObjectNotFoundException, VetoException;
     
     
     /**
Index: src/share/org/apache/slide/lock/LockImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v
retrieving revision 1.39
diff -w -u -w -r1.39 LockImpl.java
--- src/share/org/apache/slide/lock/LockImpl.java	12 Dec 2003 02:48:31 -0000	1.39
+++ src/share/org/apache/slide/lock/LockImpl.java	5 Feb 2004 15:14:21 -0000
@@ -82,6 +82,10 @@
 import org.apache.slide.structure.ObjectNotFoundException;
 import org.apache.slide.structure.SubjectNode;
 import org.apache.slide.util.Configuration;
+import org.apache.slide.event.VetoException;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.ContentEvent;
+import org.apache.slide.event.LockEvent;
 
 /**
  * Lock helper class.
@@ -148,7 +152,7 @@
      */
     public void lock(SlideToken slideToken, NodeLock token)
         throws ServiceAccessException, ObjectIsAlreadyLockedException,
-        AccessDeniedException, ObjectNotFoundException {
+        AccessDeniedException, ObjectNotFoundException, VetoException {
         
         ObjectIsAlreadyLockedException nestedException =
             new ObjectIsAlreadyLockedException(token.getObjectUri());
@@ -171,6 +175,8 @@
             throw nestedException;
         }
         
+        // Fire event
+        if ( LockEvent.LOCK.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(LockEvent.LOCK, new LockEvent(this, slideToken, objectUri));
     }
     
     
@@ -187,7 +193,7 @@
      * Lock Store service
      */
     public boolean unlock(SlideToken slideToken, NodeLock token)
-        throws ServiceAccessException, LockTokenNotFoundException {
+        throws ServiceAccessException, LockTokenNotFoundException, VetoException {
         
         try {
             if (!checkLockOwner(slideToken, token)) {
@@ -206,6 +212,10 @@
         Uri lockedUri = namespace.getUri(slideToken, token.getObjectUri(),
                                          true);
         lockedUri.getStore().removeLock(lockedUri, token);
+
+        // Fire event
+        if ( LockEvent.UNLOCK.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(LockEvent.UNLOCK, new LockEvent(this, slideToken, lockedUri));
+
         return true;
     }
     
@@ -223,7 +233,7 @@
     public void unlock(SlideToken slideToken, String objectUri,
                        String lockId)
         throws ServiceAccessException, LockTokenNotFoundException,
-        ObjectNotFoundException {
+        ObjectNotFoundException, VetoException {
         
         Enumeration locksList = enumerateLocks(slideToken, objectUri, false);
         while (locksList.hasMoreElements()) {
@@ -250,10 +260,13 @@
      */
     public void renew(SlideToken slideToken, NodeLock token,
                       Date newExpirationDate)
-        throws ServiceAccessException, LockTokenNotFoundException {
+        throws ServiceAccessException, LockTokenNotFoundException, VetoException {
         token.setExpirationDate(newExpirationDate);
         Uri lockedUri = namespace.getUri(slideToken, token.getObjectUri());
         lockedUri.getStore().renewLock(lockedUri, token);
+
+        // Fire event
+        if ( LockEvent.RENEW.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(LockEvent.RENEW, new LockEvent(this, slideToken, lockedUri));
     }
     
     
@@ -270,7 +283,7 @@
     public void renew(SlideToken slideToken, String objectUri,
                       String lockId, Date newExpirationDate)
         throws ServiceAccessException, LockTokenNotFoundException,
-        ObjectNotFoundException {
+        ObjectNotFoundException, VetoException {
         
         Enumeration locksList = enumerateLocks(slideToken, objectUri, false);
         while (locksList.hasMoreElements()) {
@@ -298,7 +311,7 @@
      */
     public void kill(SlideToken slideToken, SubjectNode subject)
         throws ServiceAccessException, AccessDeniedException,
-        LockTokenNotFoundException, ObjectNotFoundException {
+        LockTokenNotFoundException, ObjectNotFoundException, VetoException {
         
         // We retrieve the enumeration of locks which have been put on the
         // subject.
@@ -314,6 +327,8 @@
                 .killLock(subjectUri, (NodeLock) locks.nextElement());
         }
         
+        // Fire event
+        if ( LockEvent.KILL.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(LockEvent.KILL, new LockEvent(this, slideToken, subjectUri));
     }
     
     public Enumeration enumerateLocks(SlideToken slideToken, String objectUri)
Index: src/share/org/apache/slide/macro/Macro.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/macro/Macro.java,v
retrieving revision 1.14
diff -w -u -w -r1.14 Macro.java
--- src/share/org/apache/slide/macro/Macro.java	25 Aug 2003 15:51:08 -0000	1.14
+++ src/share/org/apache/slide/macro/Macro.java	5 Feb 2004 15:14:22 -0000
@@ -64,6 +64,7 @@
 package org.apache.slide.macro;
 
 import org.apache.slide.common.SlideToken;
+import org.apache.slide.event.VetoException;
 
 /**
  * Macro helper class.
Index: src/share/org/apache/slide/macro/MacroImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
retrieving revision 1.36
diff -w -u -w -r1.36 MacroImpl.java
--- src/share/org/apache/slide/macro/MacroImpl.java	18 Dec 2003 15:55:03 -0000	1.36
+++ src/share/org/apache/slide/macro/MacroImpl.java	5 Feb 2004 15:14:23 -0000
@@ -97,6 +97,9 @@
 import org.apache.slide.structure.ObjectNotFoundException;
 import org.apache.slide.structure.Structure;
 import org.apache.slide.util.Configuration;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.MacroEvent;
+import org.apache.slide.event.VetoException;
 
 /**
  * Macro helper class.
@@ -259,6 +262,11 @@
             throw e;
         }
         
+        try {
+            if ( MacroEvent.COPY.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(MacroEvent.COPY, new MacroEvent(this, sourceUri, destinationUri));
+        } catch ( VetoException ve ) {
+            throw new CopyMacroException(ve.getMessage());
+        }
     }
     
     /**
@@ -474,6 +482,12 @@
                  copyRedirector, copyListener, deleteRedirector, deleteListener);
             delete(token, sourceUri, parameters, deleteRedirector, deleteListener);
         }
+
+        try {
+            if ( MacroEvent.MOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(MacroEvent.MOVE, new MacroEvent(this, sourceUri, destinationUri));
+        } catch ( VetoException ve ) {
+            throw new CopyMacroException(ve.getMessage()); // FIXME: Where is the MoveMacroException?    
+        }
     }
     
     /**
@@ -553,6 +567,11 @@
             throw e;
         }
         
+        try {
+            if ( MacroEvent.DELETE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(MacroEvent.DELETE, new MacroEvent(this, targetUri));
+        } catch ( VetoException ve ) {
+            throw new DeleteMacroException(ve.getMessage());
+        }
     }
     
     
@@ -747,7 +766,7 @@
         
     }
     
-    private boolean destinationExists(SlideToken token, String destinationUri) throws ServiceAccessException, LinkedObjectNotFoundException, RevisionDescriptorNotFoundException, ObjectLockedException, AccessDeniedException {
+    private boolean destinationExists(SlideToken token, String destinationUri) throws ServiceAccessException, LinkedObjectNotFoundException, RevisionDescriptorNotFoundException, ObjectLockedException, AccessDeniedException, VetoException {
         boolean destinationExists = true;
         NodeRevisionDescriptor destinationNrd = null;
         try {
@@ -876,7 +895,7 @@
      * Removes all <i>hidden</i> revisions for the specified URI. Currently there are hidden
      * revisions only at 0.0.
      */
-    private void removeHiddenRevisions( SlideToken token, String targetUri ) throws ServiceAccessException, ObjectNotFoundException, LinkedObjectNotFoundException, AccessDeniedException, ObjectLockedException {
+    private void removeHiddenRevisions( SlideToken token, String targetUri ) throws ServiceAccessException, ObjectNotFoundException, LinkedObjectNotFoundException, AccessDeniedException, ObjectLockedException, VetoException {
         
         // Can this piece of code be moved to MoveMethod.afterDelete() and DeleteMethod.afterDelete?
         // It would look more consistent (the copying of hidden revisions is there!!)
Index: src/share/org/apache/slide/search/Search.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/search/Search.java,v
retrieving revision 1.13
diff -w -u -w -r1.13 Search.java
--- src/share/org/apache/slide/search/Search.java	12 Dec 2003 02:48:30 -0000	1.13
+++ src/share/org/apache/slide/search/Search.java	5 Feb 2004 15:14:24 -0000
@@ -65,6 +65,7 @@
 
 import org.apache.slide.common.ServiceAccessException;
 import org.apache.slide.common.SlideToken;
+import org.apache.slide.event.VetoException;
 import org.jdom.Element;
 
 /**
@@ -91,7 +92,7 @@
      * @throws   ServiceAccessException DataSource access error
      */
     SearchQueryResult search(SlideToken token, SearchQuery query)
-        throws ServiceAccessException;
+        throws ServiceAccessException, VetoException;
     
     
     /**
Index: src/share/org/apache/slide/search/SearchImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/search/SearchImpl.java,v
retrieving revision 1.14
diff -w -u -w -r1.14 SearchImpl.java
--- src/share/org/apache/slide/search/SearchImpl.java	12 Dec 2003 02:48:30 -0000	1.14
+++ src/share/org/apache/slide/search/SearchImpl.java	5 Feb 2004 15:14:24 -0000
@@ -73,6 +73,10 @@
 import org.apache.slide.content.Content;
 import org.apache.slide.search.basic.BasicSearchLanguage;
 import org.apache.slide.structure.Structure;
+import org.apache.slide.event.VetoException;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.StructureEvent;
+import org.apache.slide.event.SearchEvent;
 import org.jdom.Element;
 
 /**
@@ -157,7 +161,11 @@
      * @exception ServiceAccessException DataSource access error
      */
     public SearchQueryResult search (SlideToken token, SearchQuery query)
-        throws ServiceAccessException {
+        throws ServiceAccessException, VetoException {
+
+        // Fire event
+        if ( SearchEvent.SEARCH.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SearchEvent.SEARCH, new SearchEvent(this, token, query));
+
         return query.execute ();
     }
     
Index: src/share/org/apache/slide/security/Security.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/security/Security.java,v
retrieving revision 1.24
diff -w -u -w -r1.24 Security.java
--- src/share/org/apache/slide/security/Security.java	17 Jan 2004 21:48:00 -0000	1.24
+++ src/share/org/apache/slide/security/Security.java	5 Feb 2004 15:14:25 -0000
@@ -73,6 +73,7 @@
 import org.apache.slide.structure.ObjectNode;
 import org.apache.slide.structure.ObjectNotFoundException;
 import org.apache.slide.structure.SubjectNode;
+import org.apache.slide.event.VetoException;
 
 /**
  * Security helper.
@@ -184,7 +185,7 @@
     void grantPermission(SlideToken token, ObjectNode object,
                          SubjectNode subject, ActionNode action)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -199,7 +200,7 @@
      */
     void grantPermission(SlideToken token, NodePermission permission)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -219,7 +220,7 @@
                          SubjectNode subject, ActionNode action,
                          boolean inheritable)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -238,7 +239,7 @@
     void denyPermission(SlideToken token, ObjectNode object,
                         SubjectNode subject, ActionNode action)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -253,7 +254,7 @@
      */
     void denyPermission(SlideToken token, NodePermission permission)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -273,7 +274,7 @@
                         SubjectNode subject, ActionNode action,
                         boolean inheritable)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -291,7 +292,7 @@
     void revokePermission(SlideToken token, ObjectNode object,
                           SubjectNode subject, ActionNode action)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
     
     
     /**
@@ -306,7 +307,7 @@
      */
     public void revokePermission(SlideToken token, NodePermission permission)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException;
+        AccessDeniedException, VetoException;
             
     
      
Index: src/share/org/apache/slide/security/SecurityImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/security/SecurityImpl.java,v
retrieving revision 1.44
diff -w -u -w -r1.44 SecurityImpl.java
--- src/share/org/apache/slide/security/SecurityImpl.java	17 Jan 2004 21:48:00 -0000	1.44
+++ src/share/org/apache/slide/security/SecurityImpl.java	5 Feb 2004 15:14:27 -0000
@@ -97,6 +97,10 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.util.XMLValue;
 import org.apache.slide.util.logger.Logger;
+import org.apache.slide.event.VetoException;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.ContentEvent;
+import org.apache.slide.event.SecurityEvent;
 import org.jdom.JDOMException;
 
 /**
@@ -221,7 +225,7 @@
     public void grantPermission(SlideToken token, ObjectNode object,
                                 SubjectNode subject, ActionNode action)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         grantPermission(token, object, subject, action, true);
     }
     
@@ -243,7 +247,7 @@
                                 SubjectNode subject, ActionNode action,
                                 boolean inheritable)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         NodePermission permission = new NodePermission(object, subject, action,
                                                        inheritable);
         grantPermission(token, permission);
@@ -263,7 +267,7 @@
     public void grantPermission(SlideToken token,
                                 NodePermission permission)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         Uri objectUri = namespace.getUri(token, permission.getObjectUri());
         ObjectNode object = objectUri.getStore()
             .retrieveObject(objectUri);
@@ -282,6 +286,13 @@
                              namespaceConfig.getGrantPermissionAction());
             objectUri.getStore().grantPermission(objectUri, permission);
         }
+
+        // Fire event
+        if ( permission.isNegative() ) {
+            if ( SecurityEvent.DENY_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.DENY_PERMISSION, new SecurityEvent(this, token, objectUri, permission));
+        } else {
+            if ( SecurityEvent.GRANT_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.GRANT_PERMISSION, new SecurityEvent(this, token, objectUri, permission));
+        }
     }
     
     
@@ -301,7 +312,7 @@
     public void denyPermission(SlideToken token, ObjectNode object,
                                SubjectNode subject, ActionNode action)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         denyPermission(token, object, subject, action, true);
     }
     
@@ -323,7 +334,7 @@
                                SubjectNode subject, ActionNode action,
                                boolean inheritable)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         NodePermission permission = new NodePermission(object, subject, action,
                                                        inheritable, true);
         denyPermission(token, permission);
@@ -343,7 +354,7 @@
     public void denyPermission(SlideToken token,
                                NodePermission permission)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         // Make sure the permission we're about to set is indeed a negative
         // permission
         if (!permission.isNegative())
@@ -367,7 +378,7 @@
     public void revokePermission(SlideToken token, ObjectNode object,
                                  SubjectNode subject, ActionNode action)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         //Domain.info("Revoke permission on " + object.getUri());
         checkCredentials(token, object, namespaceConfig
                              .getRevokePermissionAction());
@@ -376,6 +387,9 @@
         Uri objectUri = namespace.getUri(token, object.getUri());
         objectUri.getStore()
             .revokePermission(objectUri, permission);
+
+        // Fire event
+        if ( SecurityEvent.REVOKE_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.REVOKE_PERMISSION, new SecurityEvent(this, token, objectUri, permission));
     }
     
     
@@ -392,7 +406,7 @@
      */
     public void revokePermission(SlideToken token, NodePermission permission)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException {
+        AccessDeniedException, VetoException {
         
         Uri objectUri = namespace.getUri(token, permission.getObjectUri());
         ObjectNode object = objectUri.getStore().retrieveObject(objectUri);
@@ -400,6 +414,9 @@
         checkCredentials(token, object,
                          namespaceConfig.getRevokePermissionAction());
         objectUri.getStore().revokePermission(objectUri, permission);
+
+        // Fire event
+        if ( SecurityEvent.REVOKE_PERMISSION.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(SecurityEvent.REVOKE_PERMISSION, new SecurityEvent(this, token, objectUri, permission));
     }
     
     
@@ -1107,8 +1124,8 @@
                 actionAggregationClosure.put(aNode, buildClosure(aClosure));
             }
             // log success
-            if (logger.isEnabled(LOG_CHANNEL, Logger.INFO)) {
-                logger.log("Action aggregations loaded successfully", LOG_CHANNEL, Logger.INFO);
+            if (logger.isEnabled(LOG_CHANNEL, Logger.DEBUG)) {
+                logger.log("Action aggregations loaded successfully", LOG_CHANNEL, Logger.DEBUG);
             }
             if (logger.isEnabled(LOG_CHANNEL, Logger.DEBUG)) {
                 logger.log("\n@@@ Actions aggregations", LOG_CHANNEL, Logger.DEBUG);
Index: src/share/org/apache/slide/structure/Structure.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/structure/Structure.java,v
retrieving revision 1.13
diff -w -u -w -r1.13 Structure.java
--- src/share/org/apache/slide/structure/Structure.java	10 Oct 2003 11:31:09 -0000	1.13
+++ src/share/org/apache/slide/structure/Structure.java	5 Feb 2004 15:14:29 -0000
@@ -69,6 +69,7 @@
 import org.apache.slide.common.SlideToken;
 import org.apache.slide.lock.ObjectLockedException;
 import org.apache.slide.security.AccessDeniedException;
+import org.apache.slide.event.VetoException;
 
 /**
  * Structure helper.
@@ -101,7 +102,7 @@
      */
     Enumeration getChildren(SlideToken token, ObjectNode object) 
         throws ServiceAccessException, ObjectNotFoundException, 
-        LinkedObjectNotFoundException;
+        LinkedObjectNotFoundException, VetoException;
     
     
     /**
@@ -125,7 +126,7 @@
      */
     ObjectNode getParent(SlideToken token, ObjectNode object) 
         throws ServiceAccessException, ObjectNotFoundException, 
-        LinkedObjectNotFoundException, AccessDeniedException;
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException;
     
     /**
      * Return all parents of this object node. If pathOnly=true, only parents
@@ -155,7 +156,7 @@
      */
     List getParents(SlideToken token, ObjectNode object, boolean pathOnly, boolean storeOnly, boolean includeSelf)
         throws ServiceAccessException, ObjectNotFoundException,
-        LinkedObjectNotFoundException, AccessDeniedException;
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException;
     
     /**
      * Retrieves a node by URI, following any links.
@@ -175,7 +176,7 @@
      */
     ObjectNode retrieve(SlideToken token, String strUri) 
         throws ServiceAccessException, ObjectNotFoundException, 
-        LinkedObjectNotFoundException, AccessDeniedException;
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException;
     
     
     /**
@@ -200,7 +201,7 @@
     ObjectNode retrieve(SlideToken token, String strUri, 
                         boolean translateLastUriElement) 
         throws ServiceAccessException, ObjectNotFoundException, 
-        LinkedObjectNotFoundException, AccessDeniedException;
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException;
     
     
     /**
@@ -225,7 +226,7 @@
     void create(SlideToken token, ObjectNode object, String strUri)
         throws ServiceAccessException, ObjectAlreadyExistsException, 
         ObjectNotFoundException, LinkedObjectNotFoundException, 
-        AccessDeniedException, ObjectLockedException;
+        AccessDeniedException, ObjectLockedException, VetoException;
     
     
     /**
@@ -252,7 +253,7 @@
                     ObjectNode linkedObject)
         throws ServiceAccessException, ObjectAlreadyExistsException, 
         ObjectNotFoundException, LinkedObjectNotFoundException, 
-        AccessDeniedException, ObjectLockedException;
+        AccessDeniedException, ObjectLockedException, VetoException;
     
     
     /**
@@ -271,7 +272,7 @@
      */
     void store(SlideToken token, ObjectNode object)
         throws ServiceAccessException, ObjectNotFoundException, 
-        AccessDeniedException, LinkedObjectNotFoundException;
+        AccessDeniedException, LinkedObjectNotFoundException, VetoException;
     
     
     /**
@@ -293,7 +294,7 @@
     void remove(SlideToken token, ObjectNode object)
         throws ServiceAccessException, ObjectNotFoundException, 
         ObjectHasChildrenException, AccessDeniedException, 
-        LinkedObjectNotFoundException, ObjectLockedException;
+        LinkedObjectNotFoundException, ObjectLockedException, VetoException;
     
     
     /**
@@ -313,7 +314,7 @@
      */
     void addBinding( SlideToken token, ObjectNode collectionNode, String segment, ObjectNode sourceNode )
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException, CrossServerBindingException;
+        AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException, CrossServerBindingException, VetoException;
 
     /**
      * Modifies the collection identified by <b>collectionNode</b>, by removing the binding
@@ -332,6 +333,6 @@
      */
     void removeBinding( SlideToken token, ObjectNode collectionNode, String segment )
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException;
+        AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException, VetoException;
 }
 
Index: src/share/org/apache/slide/structure/StructureImpl.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
retrieving revision 1.39
diff -w -u -w -r1.39 StructureImpl.java
--- src/share/org/apache/slide/structure/StructureImpl.java	9 Jan 2004 18:43:14 -0000	1.39
+++ src/share/org/apache/slide/structure/StructureImpl.java	5 Feb 2004 15:14:29 -0000
@@ -86,6 +86,10 @@
 import org.apache.slide.security.Security;
 import org.apache.slide.store.Store;
 import org.apache.slide.util.Configuration;
+import org.apache.slide.event.EventDispatcher;
+import org.apache.slide.event.ContentEvent;
+import org.apache.slide.event.StructureEvent;
+import org.apache.slide.event.VetoException;
 
 /**
  * Default implementation of the Structure interface.
@@ -148,7 +152,7 @@
     
     public Enumeration getChildren(SlideToken token, ObjectNode object)
         throws ServiceAccessException, ObjectNotFoundException,
-        LinkedObjectNotFoundException {
+        LinkedObjectNotFoundException, VetoException {
         Enumeration childrenUri = object.enumerateChildren();
         Vector result = new Vector();
         while (childrenUri.hasMoreElements()) {
@@ -165,7 +169,7 @@
     
     public ObjectNode getParent(SlideToken token, ObjectNode object)
         throws ServiceAccessException, ObjectNotFoundException,
-        LinkedObjectNotFoundException, AccessDeniedException {
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException {
         String objectUriStr = object.getUri();
         Uri parentUri = namespace.getUri(token, objectUriStr).getParentUri();
         if (parentUri == null) {
@@ -179,7 +183,7 @@
     
     public ObjectNode retrieve(SlideToken token, String strUri)
         throws ServiceAccessException, ObjectNotFoundException,
-        LinkedObjectNotFoundException, AccessDeniedException {
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException {
         return retrieve(token, strUri, true);
     }
     
@@ -187,12 +191,15 @@
     public ObjectNode retrieve(SlideToken token, String strUri,
                                boolean translateLastUriElement)
         throws ServiceAccessException, ObjectNotFoundException,
-        LinkedObjectNotFoundException, AccessDeniedException {
+        LinkedObjectNotFoundException, AccessDeniedException, VetoException {
         
         Uri uri = namespace.getUri(token, strUri);
         
         ObjectNode result = null;
         
+        // Fire event
+        if ( StructureEvent.RETRIEVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.RETRIEVE, new StructureEvent(this, token, strUri));
+
         // First of all, we try to load the object directly from the given Uri.
         try {
             result = uri.getStore().retrieveObject(uri);
@@ -293,7 +300,10 @@
                        String strUri)
         throws ServiceAccessException, ObjectAlreadyExistsException,
         ObjectNotFoundException, LinkedObjectNotFoundException,
-        AccessDeniedException, ObjectLockedException {
+        AccessDeniedException, ObjectLockedException, VetoException {
+
+        // Fire event
+        if ( StructureEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.CREATE, new StructureEvent(this, token, strUri));
         
         // Checking roles
         Enumeration roles = securityHelper.getRoles(object);
@@ -449,15 +459,19 @@
                            String linkUri, ObjectNode linkedObject)
         throws ServiceAccessException, ObjectAlreadyExistsException,
         ObjectNotFoundException, LinkedObjectNotFoundException,
-        AccessDeniedException, ObjectLockedException {
+        AccessDeniedException, ObjectLockedException, VetoException {
         link.setLinkedUri(linkedObject.getUri());
+
+        // Fire event
+        if ( StructureEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.CREATE_LINK, new StructureEvent(this, token, link, linkUri));
+
         create(token, link, linkUri);
     }
     
     
     public void store(SlideToken token, ObjectNode object)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException, LinkedObjectNotFoundException {
+        AccessDeniedException, LinkedObjectNotFoundException, VetoException {
         
         store(token, object, false);
     }
@@ -465,7 +479,10 @@
     
     public void store(SlideToken token, ObjectNode object, boolean setModificationDate)
         throws ServiceAccessException, ObjectNotFoundException,
-        AccessDeniedException, LinkedObjectNotFoundException {
+        AccessDeniedException, LinkedObjectNotFoundException, VetoException {
+
+        // Fire event
+        if ( StructureEvent.STORE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.STORE, new StructureEvent(this, token, object));
         
         // Checking roles
         Enumeration roles = securityHelper.getRoles(object);
@@ -523,11 +540,14 @@
     public void remove(SlideToken token, ObjectNode object)
         throws ServiceAccessException, ObjectNotFoundException,
         ObjectHasChildrenException, AccessDeniedException,
-        LinkedObjectNotFoundException, ObjectLockedException {
+        LinkedObjectNotFoundException, ObjectLockedException, VetoException {
         
         ObjectNode nodeToDelete = retrieve(token, object.getUri(), false);
         Uri uri = namespace.getUri(token, nodeToDelete.getUri());
         
+        // Fire event
+        if ( StructureEvent.REMOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.REMOVE, new StructureEvent(this, token, object, uri.toString()));
+
         if (!object.getUri().equals("/")) {
             Uri curUri = namespace.getUri(token, nodeToDelete.getUri());
             Uri parentUri = curUri.getParentUri();
@@ -575,13 +595,16 @@
      * @throws   ObjectLockedException
      *
      */
-    public void addBinding(SlideToken token, ObjectNode collectionNode, String segment, ObjectNode sourceNode) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException, CrossServerBindingException {
+    public void addBinding(SlideToken token, ObjectNode collectionNode, String segment, ObjectNode sourceNode) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException, CrossServerBindingException, VetoException {
         if (Configuration.useBinding(namespace.getUri(token, collectionNode.getUri()).getStore())) {
             collectionNode = retrieve(token, collectionNode.getUri(), false);
             sourceNode = retrieve(token, sourceNode.getUri(), false);
             Uri collectionUri = namespace.getUri(token, collectionNode.getUri());
             Uri sourceUri = namespace.getUri(token, sourceNode.getUri());
             
+            // Fire event
+            if ( StructureEvent.ADD_BINDING.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.ADD_BINDING, new StructureEvent(this, token, sourceNode, collectionUri.toString()));
+
 //            if (collectionUri.getStore() != sourceUri.getStore()) {
 //                throw new CrossServerBindingException(collectionNode.getUri(), sourceNode.getUri());
 //            }
@@ -620,11 +643,14 @@
      * @throws   ObjectLockedException
      *
      */
-    public void removeBinding(SlideToken token, ObjectNode collectionNode, String segment) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException {
+    public void removeBinding(SlideToken token, ObjectNode collectionNode, String segment) throws ServiceAccessException, ObjectNotFoundException, AccessDeniedException, LinkedObjectNotFoundException, ObjectLockedException, VetoException {
         if (Configuration.useBinding(namespace.getUri(token, collectionNode.getUri()).getStore())) {
             collectionNode = retrieve(token, collectionNode.getUri(), false);
             ObjectNode childNode = retrieve(token, collectionNode.getUri()+"/"+segment, false);
             
+            // Fire event
+            if ( StructureEvent.REMOVE_BINDING.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(StructureEvent.REMOVE_BINDING, new StructureEvent(this, token, childNode, collectionNode.getUri()));
+
             lockHelper.checkLock
                 (token, collectionNode, namespaceConfig.getCreateObjectAction());
             lockHelper.checkLock
@@ -664,7 +690,7 @@
      * @throws   AccessDeniedException
      *
      */
-    public List getParents(SlideToken token, ObjectNode object, boolean pathOnly, boolean storeOnly, boolean includeSelf) throws ServiceAccessException, ObjectNotFoundException, LinkedObjectNotFoundException, AccessDeniedException {
+    public List getParents(SlideToken token, ObjectNode object, boolean pathOnly, boolean storeOnly, boolean includeSelf) throws ServiceAccessException, ObjectNotFoundException, LinkedObjectNotFoundException, AccessDeniedException, VetoException {
         List result = new ArrayList();
         if (token.isForceStoreEnlistment()) {
             // get read-only token
Index: src/share/org/apache/slide/util/Configuration.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/share/org/apache/slide/util/Configuration.java,v
retrieving revision 1.15
diff -w -u -w -r1.15 Configuration.java
--- src/share/org/apache/slide/util/Configuration.java	12 Dec 2003 02:48:31 -0000	1.15
+++ src/share/org/apache/slide/util/Configuration.java	5 Feb 2004 15:14:31 -0000
@@ -164,6 +164,14 @@
 
 
         /**
+         * Property specifying if events are enabled.
+         * <pre>
+         * org.apache.slide.events
+         * </pre>
+         */
+        public static final String Events = "org.apache.slide.events";
+
+        /**
          * Property specifying the encoding for URLs.
          * <pre>
          * org.apache.slide.urlEncoding
@@ -249,6 +257,10 @@
      */
     private static boolean _binding;
 
+    /**
+     * True if events should be fired
+     */
+    private static boolean _events;
 
     /**
      * URL encoding.
@@ -317,6 +329,13 @@
         return _binding;
     }
 
+    /**
+     * Returns true if events are enabled by default
+     */
+    public static boolean fireEvents() {
+        return _events;
+    }
+
     
     /**
      * Returns the used URL encoding.
@@ -454,6 +473,13 @@
             _binding = true;
         } else {
             _binding = false;
+        }
+
+        prop = _default.getProperty(Property.Events, "false");
+        if (prop.equalsIgnoreCase("true") || prop.equalsIgnoreCase("on")) {
+            _events = true;
+        } else {
+            _events = false;
         }
 
         prop = _default.getProperty(Property.PrincipalIdentifiedLocks, "false");
Index: src/util/org/apache/util/WebdavStatus.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/util/org/apache/util/WebdavStatus.java,v
retrieving revision 1.3
diff -w -u -w -r1.3 WebdavStatus.java
--- src/util/org/apache/util/WebdavStatus.java	25 Apr 2002 21:15:16 -0000	1.3
+++ src/util/org/apache/util/WebdavStatus.java	5 Feb 2004 15:14:48 -0000
@@ -184,6 +184,7 @@
         // HTTP 1.1 Server status codes -- see RFC 2048
         addStatusCodeMap(SC_CONTINUE, "Continue");
         addStatusCodeMap(SC_METHOD_NOT_ALLOWED, "Method Not Allowed");
+        addStatusCodeMap(SC_NOT_ACCEPTABLE, "Not Acceptable");
         addStatusCodeMap(SC_CONFLICT, "Conflict");
         addStatusCodeMap(SC_PRECONDITION_FAILED, "Precondition Failed");
         addStatusCodeMap(SC_REQUEST_TOO_LONG, "Request Too Long");
Index: src/webdav/server/org/apache/slide/webdav/method/AclMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java,v
retrieving revision 1.36
diff -w -u -w -r1.36 AclMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/AclMethod.java	5 Nov 2003 14:24:34 -0000	1.36
+++ src/webdav/server/org/apache/slide/webdav/method/AclMethod.java	5 Feb 2004 15:15:06 -0000
@@ -76,9 +76,11 @@
 import org.apache.slide.structure.SubjectNode;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.AclConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.ViolatedPrecondition;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -293,6 +295,8 @@
         }
         
         try {
+            if ( WebdavEvent.ACL.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.ACL, new WebdavEvent(this));
+
             checkPreconditions();
             security.setPermissions(slideToken, resourcePath, permissions.elements());
         }
Index: src/webdav/server/org/apache/slide/webdav/method/BindMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/BindMethod.java,v
retrieving revision 1.11
diff -w -u -w -r1.11 BindMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/BindMethod.java	12 Dec 2003 02:59:22 -0000	1.11
+++ src/webdav/server/org/apache/slide/webdav/method/BindMethod.java	5 Feb 2004 15:15:06 -0000
@@ -75,9 +75,11 @@
 import org.apache.slide.structure.ObjectNode;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.BindConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.ViolatedPrecondition;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.JDOMException;
 
@@ -223,6 +225,9 @@
 
         try {
             checkPreconditions();
+
+            if ( WebdavEvent.BIND.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.BIND, new WebdavEvent(this));
+
             structure.addBinding( slideToken, collectionNode, segment, sourceNode );
         }
         catch (ObjectLockedException e) {
Index: src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java,v
retrieving revision 1.22
diff -w -u -w -r1.22 CheckinMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java	7 Sep 2003 15:53:15 -0000	1.22
+++ src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java	5 Feb 2004 15:15:06 -0000
@@ -68,10 +68,12 @@
 import org.apache.slide.common.ServiceAccessException;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.VersioningHelper;
 import org.apache.slide.webdav.util.WebdavUtils;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -173,6 +175,9 @@
         try {
             VersioningHelper vh = VersioningHelper.getVersioningHelper(
                 slideToken, token, req, resp, getConfig() );
+
+            if ( WebdavEvent.CHECKIN.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.CHECKIN, new WebdavEvent(this));
+
             locationValue = vh.checkin( resourcePath , forkOk, keepCheckedOut, false);
         }
         catch (PreconditionViolationException e) {
Index: src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java,v
retrieving revision 1.26
diff -w -u -w -r1.26 CheckoutMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java	18 Sep 2003 11:01:07 -0000	1.26
+++ src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java	5 Feb 2004 15:15:06 -0000
@@ -70,12 +70,14 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.LabeledRevisionNotFoundException;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.VersioningHelper;
 import org.apache.slide.webdav.util.ViolatedPrecondition;
 import org.apache.slide.webdav.util.WebdavUtils;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -223,6 +225,8 @@
         }
 
         try {
+            if ( WebdavEvent.CHECKOUT.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.CHECKOUT, new WebdavEvent(this));
+
             locationValue = versioningHelper.checkout( resourcePath, forkOk, applyToVersion );
         }
         catch (PreconditionViolationException e) {
Index: src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java,v
retrieving revision 1.58
diff -w -u -w -r1.58 CopyMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java	5 Nov 2003 14:24:34 -0000	1.58
+++ src/webdav/server/org/apache/slide/webdav/method/CopyMethod.java	5 Feb 2004 15:15:09 -0000
@@ -97,6 +97,7 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.AclConstants;
 import org.apache.slide.webdav.util.BindConstants;
 import org.apache.slide.webdav.util.DeltavConstants;
@@ -112,6 +113,8 @@
 import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
 import org.apache.slide.webdav.util.resourcekind.VersionableImpl;
+import org.apache.slide.event.VetoException;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -224,15 +227,16 @@
               ) {
                 // COPY on existing WSs or WRs is *not* restricted !!!
                 try {
+                    if ( WebdavEvent.COPY.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.COPY, new WebdavEvent(this));
+
                     content.retrieve(slideToken, destinationUri);
                     sendError = false;
                 }
-                catch( ServiceAccessException x ) {
+                catch( SlideException x ) {
                     int statusCode = getErrorCode((SlideException)x);
                     sendError( statusCode, x );
                     throw new WebdavException( statusCode );
                 }
-                catch( SlideException x ) {};
             }
             if( sendError ) {
                 int statusCode = WebdavStatus.SC_FORBIDDEN;
@@ -459,7 +463,7 @@
      * @param      destinationRevisionDescriptors  the NodeRevisionDescriptors of
      *                                             the resource.
      */
-    private void restoreBackupRevisionDescriptor(String destinationUri, NodeRevisionDescriptors destinationNrds) throws RevisionNotFoundException, ServiceAccessException, RevisionAlreadyExistException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, AccessDeniedException, RevisionDescriptorNotFoundException, BranchNotFoundException, NodeNotVersionedException {
+    private void restoreBackupRevisionDescriptor(String destinationUri, NodeRevisionDescriptors destinationNrds) throws RevisionNotFoundException, ServiceAccessException, RevisionAlreadyExistException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, AccessDeniedException, RevisionDescriptorNotFoundException, BranchNotFoundException, NodeNotVersionedException, VetoException {
         
         NodeRevisionDescriptor backupNrd =
             (NodeRevisionDescriptor)destinationBackupDescriptorMap.get(destinationUri);
Index: src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
retrieving revision 1.30
diff -w -u -w -r1.30 DeleteMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java	7 Sep 2003 15:53:08 -0000	1.30
+++ src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java	5 Feb 2004 15:15:09 -0000
@@ -76,6 +76,7 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.PropertyHelper;
@@ -86,6 +87,7 @@
 import org.apache.slide.webdav.util.resourcekind.CheckedOutVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
 import org.apache.slide.webdav.util.resourcekind.Working;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.JDOMException;
 
@@ -189,6 +191,8 @@
         
         isCollection = isCollection(toDelete);
         try {
+            if ( WebdavEvent.DELETE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.DELETE, new WebdavEvent(this));
+
             macro.delete(slideToken, toDelete, null, this);
             resp.setStatus(WebdavStatus.SC_NO_CONTENT);
         } catch (DeleteMacroException dme) {
@@ -234,8 +238,11 @@
             // throw any WebDAV exception to indicate the transaction wants to be aborted
             //
             throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
+        } catch( SlideException x ) {
+            int statusCode = getErrorCode((SlideException)x);
+            sendError( statusCode, x );
+            throw new WebdavException( statusCode );
         }
-        
     }
     
     // ------------------------------------------------------ Interface DeleteListener
Index: src/webdav/server/org/apache/slide/webdav/method/GetMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java,v
retrieving revision 1.40
diff -w -u -w -r1.40 GetMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/GetMethod.java	18 Sep 2003 11:01:07 -0000	1.40
+++ src/webdav/server/org/apache/slide/webdav/method/GetMethod.java	5 Feb 2004 15:15:10 -0000
@@ -89,12 +89,14 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.LabeledRevisionNotFoundException;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.VersioningHelper;
 import org.apache.slide.webdav.util.ViolatedPrecondition;
 import org.apache.slide.webdav.util.WebdavUtils;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 
 /**
@@ -238,6 +240,8 @@
         }
 
         try {
+            // fire put event
+            if ( WebdavEvent.GET.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.GET, new WebdavEvent(this));
 
             // Then we must get object contents ...
 
Index: src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java,v
retrieving revision 1.21
diff -w -u -w -r1.21 LabelMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java	12 Dec 2003 02:59:22 -0000	1.21
+++ src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java	5 Feb 2004 15:15:12 -0000
@@ -79,6 +79,7 @@
 import org.apache.slide.util.XMLValue;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.LabeledRevisionNotFoundException;
 import org.apache.slide.webdav.util.PreconditionViolationException;
@@ -91,6 +92,7 @@
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
 import org.apache.slide.webdav.util.resourcekind.Version;
 import org.apache.slide.webdav.util.resourcekind.VersionControlled;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -257,9 +259,10 @@
         
         isCollection = isCollection(resourcePath);
         try {
+            if ( WebdavEvent.LABEL.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.LABEL, new WebdavEvent(this));
+
             labelResource(resourcePath);
-        }
-        catch (NestedSlideException nestedSlideException) {
+        } catch (NestedSlideException nestedSlideException) {
             // If it's not a collection, we don't want to give a 207,
             // because it's silly, and it confuses many clients (such as
             // MS Web Folders).
@@ -302,6 +305,10 @@
             // throw any WebDAV exception to indicate the transaction wants to be aborted
             //
             throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
+        } catch( SlideException x ) {
+            int statusCode = getErrorCode((SlideException)x);
+            sendError( statusCode, x );
+            throw new WebdavException( statusCode );
         }
         finally {
             resp.setHeader(H_CACHE_CONTROL, NO_CACHE);
Index: src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java,v
retrieving revision 1.29
diff -w -u -w -r1.29 MkcolMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java	12 Dec 2003 02:59:22 -0000	1.29
+++ src/webdav/server/org/apache/slide/webdav/method/MkcolMethod.java	5 Feb 2004 15:15:15 -0000
@@ -78,9 +78,11 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.UriHandler;
 import org.apache.slide.webdav.util.VersioningHelper;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 
 
@@ -260,6 +262,8 @@
         resp.setStatus(WebdavStatus.SC_CREATED);
         
         try {
+            if ( WebdavEvent.MKCOL.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.MKCOL, new WebdavEvent(this));
+
             if (!isLockNull) {
                 SubjectNode collection = new SubjectNode();
                 structure.create(slideToken, collection, colName);
Index: src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java,v
retrieving revision 1.65
diff -w -u -w -r1.65 MoveMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java	24 Nov 2003 16:45:14 -0000	1.65
+++ src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java	5 Feb 2004 15:15:16 -0000
@@ -91,6 +91,7 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DaslConstants;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
@@ -104,6 +105,7 @@
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
 import org.apache.slide.webdav.util.resourcekind.VersionControlled;
 import org.apache.slide.webdav.util.resourcekind.Working;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -249,6 +251,7 @@
                 sendError( statusCode, getClass().getName()+".noOverwrite", new Object[]{destinationUri} );
                 throw new WebdavException( statusCode );
             }
+            if ( WebdavEvent.MOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.MOVE, new WebdavEvent(this));
 
             macro.move(slideToken, sourceUri, destinationUri, macroParameters, null, this, null, this);
 
Index: src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
retrieving revision 1.37
diff -w -u -w -r1.37 OptionsMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java	12 Dec 2003 02:59:22 -0000	1.37
+++ src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java	5 Feb 2004 15:15:16 -0000
@@ -74,6 +74,7 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.AclConstants;
 import org.apache.slide.webdav.util.BindConstants;
 import org.apache.slide.webdav.util.DeltavConstants;
@@ -83,6 +84,7 @@
 import org.apache.slide.webdav.util.WorkspacePathHandler;
 import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -205,6 +207,8 @@
         
         ResourceKind resourceKind = null;
         try {
+            if ( WebdavEvent.OPTIONS.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.OPTIONS, new WebdavEvent(this));
+
             NodeRevisionDescriptors revisionDescriptors =
                 content.retrieve(slideToken, resourceUri);
             NodeRevisionDescriptor revisionDescriptor =
Index: src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java,v
retrieving revision 1.95
diff -w -u -w -r1.95 PropFindMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java	29 Jan 2004 13:12:07 -0000	1.95
+++ src/webdav/server/org/apache/slide/webdav/method/PropFindMethod.java	5 Feb 2004 15:15:17 -0000
@@ -89,12 +89,14 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.AclConstants;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.LabeledRevisionNotFoundException;
 import org.apache.slide.webdav.util.PropertyRetrieverImpl;
 import org.apache.slide.webdav.util.VersioningHelper;
 import org.apache.slide.webdav.util.WebdavUtils;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -306,6 +308,7 @@
         ObjectNode resource = null;
         
         try {
+            if ( WebdavEvent.PROPFIND.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.PROPFIND, new WebdavEvent(this));
             resource = structure.retrieve(slideToken, resourcePath);
         } catch (StructureException e) {
             int statusCode = WebdavStatus.SC_NOT_FOUND;
Index: src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
retrieving revision 1.73
diff -w -u -w -r1.73 PropPatchMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java	22 Jan 2004 12:49:16 -0000	1.73
+++ src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java	5 Feb 2004 15:15:18 -0000
@@ -86,6 +86,7 @@
 import org.apache.slide.util.XMLValue;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.AclConstants;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
@@ -96,6 +97,7 @@
 import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
 import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.PropertyWriter;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
@@ -276,6 +278,7 @@
         }
 
         try {
+            if ( WebdavEvent.PROPPATCH.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.PROPPATCH, new WebdavEvent(this));
             
             VersioningHelper vHelp =
                 VersioningHelper.getVersioningHelper(slideToken, token, req, resp, getConfig() );
Index: src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
retrieving revision 1.69
diff -w -u -w -r1.69 PutMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/PutMethod.java	5 Dec 2003 16:13:05 -0000	1.69
+++ src/webdav/server/org/apache/slide/webdav/method/PutMethod.java	5 Feb 2004 15:15:19 -0000
@@ -84,6 +84,7 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.PropertyHelper;
@@ -94,6 +95,7 @@
 import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
 import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 
 /**
@@ -196,8 +198,11 @@
         }
         
         try {
+            // fire put event
+            if ( WebdavEvent.PUT.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.PUT, new WebdavEvent(this));
             
             try {
+
                 boolean isLockedNullResource = false;
                 
                 NodeRevisionDescriptors revisionDescriptors =
Index: src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java,v
retrieving revision 1.9
diff -w -u -w -r1.9 RebindMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java	12 Dec 2003 02:59:22 -0000	1.9
+++ src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java	5 Feb 2004 15:15:20 -0000
@@ -75,10 +75,12 @@
 import org.apache.slide.structure.ObjectNode;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.BindConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.UriHandler;
 import org.apache.slide.webdav.util.ViolatedPrecondition;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.JDOMException;
 
@@ -238,6 +240,8 @@
         }
 
         try {
+            if ( WebdavEvent.REBIND.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.REBIND, new WebdavEvent(this));
+
             checkPreconditions();
             structure.addBinding( slideToken, collectionNode, segment, sourceNode );
             structure.removeBinding( slideToken, sourceParentNode, sourceSegment );
Index: src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
retrieving revision 1.61
diff -w -u -w -r1.61 ReportMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java	1 Dec 2003 12:10:50 -0000	1.61
+++ src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java	5 Feb 2004 15:15:21 -0000
@@ -71,6 +71,7 @@
 import org.apache.slide.util.XMLValue;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.method.report.AbstractReport;
 import org.apache.slide.webdav.method.report.AclPrincipalPropSetReport;
 import org.apache.slide.webdav.method.report.ExpandPropertyReport;
@@ -83,6 +84,7 @@
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.VersioningHelper;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -247,6 +249,8 @@
         }
         
         try {
+            if ( WebdavEvent.REPORT.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.REPORT, new WebdavEvent(this));
+
             reportWorker.checkPreconditions(resourcePath, getDepth());
             Element rootElm;
             if (reportWorker instanceof PrincipalSearchPropertySetReport) {
Index: src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v
retrieving revision 1.35
diff -w -u -w -r1.35 SearchMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java	12 Dec 2003 02:59:22 -0000	1.35
+++ src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java	5 Feb 2004 15:15:22 -0000
@@ -86,11 +86,13 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.ComputedPropertyProvider;
 import org.apache.slide.webdav.util.PropertyRetriever;
 import org.apache.slide.webdav.util.PropertyRetrieverImpl;
 import org.apache.slide.webdav.util.WebdavConstants;
 import org.apache.slide.webdav.util.WebdavUtils;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -255,6 +257,8 @@
         SearchQueryResult result = null;
         
         try {
+            if ( WebdavEvent.SEARCH.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.SEARCH, new WebdavEvent(this));
+
             resp.setContentType (TEXT_XML_UTF_8);
             
             result = searchHelper.search (slideToken, searchQuery);
Index: src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java,v
retrieving revision 1.8
diff -w -u -w -r1.8 UnbindMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java	18 Sep 2003 11:01:07 -0000	1.8
+++ src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java	5 Feb 2004 15:15:22 -0000
@@ -73,9 +73,11 @@
 import org.apache.slide.structure.ObjectNode;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.BindConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.ViolatedPrecondition;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.JDOMException;
 
@@ -189,6 +191,8 @@
         }
 
         try {
+            if ( WebdavEvent.UNBIND.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.UNBIND, new WebdavEvent(this));
+
             checkPreconditions();
             structure.removeBinding( slideToken, collectionNode, segment );
         }
Index: src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java,v
retrieving revision 1.13
diff -w -u -w -r1.13 UncheckoutMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java	7 Sep 2003 15:52:39 -0000	1.13
+++ src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java	5 Feb 2004 15:15:23 -0000
@@ -67,9 +67,11 @@
 import org.apache.slide.common.ServiceAccessException;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.VersioningHelper;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.JDOMException;
 
@@ -159,6 +161,8 @@
         }
 
         try {
+            if ( WebdavEvent.UNCHECKOUT.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.UNCHECKOUT, new WebdavEvent(this));
+
             VersioningHelper vh = VersioningHelper.getVersioningHelper(
                 slideToken, token, req, resp, getConfig() );
             vh.uncheckout(resourcePath);
Index: src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v
retrieving revision 1.30
diff -w -u -w -r1.30 UnlockMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java	12 Dec 2003 02:59:22 -0000	1.30
+++ src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java	5 Feb 2004 15:15:23 -0000
@@ -82,6 +82,7 @@
 import org.apache.slide.util.Configuration;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.VersioningHelper;
@@ -89,6 +90,7 @@
 import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
 import org.apache.slide.webdav.util.resourcekind.CheckedOutVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 
 /**
@@ -170,6 +172,8 @@
         slideToken.setForceStoreEnlistment(true);
         
         try {
+            if ( WebdavEvent.UNLOCK.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.UNLOCK, new WebdavEvent(this));
+
             checkPreconditions();
             lock.unlock(slideToken, requestUri, lockId);
             
Index: src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v
retrieving revision 1.23
diff -w -u -w -r1.23 UpdateMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java	12 Dec 2003 02:59:22 -0000	1.23
+++ src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java	5 Feb 2004 15:15:24 -0000
@@ -82,6 +82,7 @@
 import org.apache.slide.structure.ObjectNode;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.LabeledRevisionNotFoundException;
 import org.apache.slide.webdav.util.PreconditionViolationException;
@@ -94,6 +95,7 @@
 import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
 import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.ResourceKind;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -271,9 +273,10 @@
         Element multistatusElement = new Element(E_MULTISTATUS, DNSP);
 
         try {
+            if ( WebdavEvent.UPDATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.UPDATE, new WebdavEvent(this));
+
             update(updateSourcePath, updateLabelName, resourcePath, getDepth(), multistatusElement);
-        }
-        catch (NestedSlideException nestedSlideException) {
+        } catch (NestedSlideException nestedSlideException) {
 
             if (!requestHeaders.isDefined(H_DEPTH)) {
                 // do not send a 207 multistatus if the depth header is not set
@@ -291,7 +294,12 @@
                 }
                 throw new WebdavException(getErrorCode(exception), false); // abort the TA
             }
+        } catch (SlideException e) {
+            int statusCode = getErrorCode( e );
+            sendError( statusCode, e );
+            throw new WebdavException( statusCode );
         }
+
 
         try {
             resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
Index: src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v
retrieving revision 1.23
diff -w -u -w -r1.23 VersionControlMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java	7 Sep 2003 15:52:39 -0000	1.23
+++ src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java	5 Feb 2004 15:15:24 -0000
@@ -71,10 +71,12 @@
 import org.apache.slide.macro.ForbiddenException;
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
+import org.apache.slide.webdav.event.WebdavEvent;
 import org.apache.slide.webdav.util.DeltavConstants;
 import org.apache.slide.webdav.util.PreconditionViolationException;
 import org.apache.slide.webdav.util.UriHandler;
 import org.apache.slide.webdav.util.VersioningHelper;
+import org.apache.slide.event.EventDispatcher;
 import org.apache.util.WebdavStatus;
 import org.jdom.Element;
 import org.jdom.JDOMException;
@@ -199,6 +201,7 @@
                         resourcePath,
                         new Exception("The resource path has been excluded from version-control") );
             }
+            if ( WebdavEvent.VERSION_CONTROL.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.VERSION_CONTROL, new WebdavEvent(this));
             
             VersioningHelper vh = VersioningHelper.getVersioningHelper(
                 slideToken, token, req, resp, getConfig() );
Index: src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
retrieving revision 1.64
diff -w -u -w -r1.64 PropertyHelper.java
--- src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java	29 Jan 2004 13:12:07 -0000	1.64
+++ src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java	5 Feb 2004 15:15:39 -0000
@@ -126,6 +126,7 @@
 import org.apache.slide.webdav.util.resourcekind.Version;
 import org.apache.slide.webdav.util.resourcekind.VersionHistory;
 import org.apache.slide.webdav.util.resourcekind.Workspace;
+import org.apache.slide.event.VetoException;
 import org.apache.util.MD5Encoder;
 import org.jdom.Attribute;
 import org.jdom.CDATA;
@@ -1722,6 +1723,7 @@
     public XMLValue computeCurrentuserPrivilegeSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String serverURL) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
         XMLValue xmlValue = new XMLValue();
         
+        try {
         NamespaceConfig config = nsaToken.getNamespaceConfig();
         Structure structure = nsaToken.getStructureHelper();
         ObjectNode object =  structure.retrieve(sToken, revisionDescriptors.getUri());
@@ -1730,7 +1732,6 @@
         Security security = nsaToken.getSecurityHelper();
         security.checkCredentials(sToken, object, config.getReadOwnPermissionsAction());
         
-        try {
             String actionsPath = config.getActionsPath();
             Uri actionsPathUri = nsaToken.getUri(sToken, actionsPath);
             ObjectNode actionsPathNode = actionsPathUri.getStore().retrieveObject(actionsPathUri);
@@ -1773,7 +1774,7 @@
      * @throws   ObjectNotFoundException
      * @throws   JDOMException
      */
-    public XMLValue computeAcl(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String serverURL) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
+    public XMLValue computeAcl(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String serverURL) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException, VetoException {
         
         XMLValue xmlValue = new XMLValue();
         
Index: src/webdav/server/org/apache/slide/webdav/util/UriHandler.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/UriHandler.java,v
retrieving revision 1.24
diff -w -u -w -r1.24 UriHandler.java
--- src/webdav/server/org/apache/slide/webdav/util/UriHandler.java	3 Dec 2002 10:15:13 -0000	1.24
+++ src/webdav/server/org/apache/slide/webdav/util/UriHandler.java	5 Feb 2004 15:15:42 -0000
@@ -81,6 +81,7 @@
 import org.apache.slide.content.RevisionDescriptorNotFoundException;
 import org.apache.slide.lock.ObjectLockedException;
 import org.apache.slide.security.AccessDeniedException;
+import org.apache.slide.event.VetoException;
 
 
     /**
@@ -135,7 +136,7 @@
     createNextHistoryUri( SlideToken sToken, NamespaceAccessToken nsaToken, UriHandler uh )
     throws ObjectNotFoundException, AccessDeniedException, ObjectLockedException,
     LinkedObjectNotFoundException, ServiceAccessException,
-    RevisionDescriptorNotFoundException, RevisionNotFoundException {
+    RevisionDescriptorNotFoundException, RevisionNotFoundException, VetoException {
         
         UriHandler result = null;
         String nsName = nsaToken.getName();
@@ -198,7 +199,7 @@
     createNextWorkingresourceUri( SlideToken sToken, NamespaceAccessToken nsaToken, UriHandler uh )
     throws ObjectNotFoundException, AccessDeniedException, ObjectLockedException,
     LinkedObjectNotFoundException, ServiceAccessException,
-    RevisionDescriptorNotFoundException, RevisionNotFoundException {
+    RevisionDescriptorNotFoundException, RevisionNotFoundException, VetoException {
         
         UriHandler result = null;
         String nsName = nsaToken.getName();
Index: src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
retrieving revision 1.96
diff -w -u -w -r1.96 VersioningHelper.java
--- src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java	29 Jan 2004 13:12:07 -0000	1.96
+++ src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java	5 Feb 2004 15:15:46 -0000
@@ -109,9 +109,6 @@
 import org.apache.slide.webdav.WebdavException;
 import org.apache.slide.webdav.WebdavServletConfig;
 import org.apache.slide.webdav.method.MethodNotAllowedException;
-import org.apache.slide.webdav.util.DeltavConstants;
-import org.apache.slide.webdav.util.PropertyHelper;
-import org.apache.slide.webdav.util.UriHandler;
 import org.apache.slide.webdav.util.resourcekind.AbstractResourceKind;
 import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlled;
 import org.apache.slide.webdav.util.resourcekind.CheckedInVersionControlledImpl;
@@ -127,6 +124,7 @@
 import org.apache.slide.webdav.util.resourcekind.Working;
 import org.apache.slide.webdav.util.resourcekind.WorkingImpl;
 import org.apache.slide.webdav.util.resourcekind.WorkspaceImpl;
+import org.apache.slide.event.VetoException;
 import org.apache.util.WebdavStatus;
 import org.jdom.Document;
 import org.jdom.Element;
@@ -533,7 +531,7 @@
      * @throws     ServiceAccessException
      * @throws     BadQueryException
      */
-    protected SearchQueryResult searchResourcesWithGivenHistory(String historyPath, String scope, int maxDepth) throws ServiceAccessException, BadQueryException {
+    protected SearchQueryResult searchResourcesWithGivenHistory(String historyPath, String scope, int maxDepth) throws ServiceAccessException, BadQueryException, VetoException {
         
         // make it a relative scope
         //      if (scope.startsWith("/")) {
@@ -1371,7 +1369,7 @@
      *
      * @return     the ViolatedPrecondition (if any).
      */
-    protected ViolatedPrecondition getCheckinPreconditionViolation(NodeProperty predSetProp, NodeRevisionDescriptors vhrNrds, boolean isForkOk, NodeRevisionDescriptor autoUpdNrd ) throws LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, RevisionDescriptorNotFoundException, JDOMException, IllegalArgumentException, ObjectNotFoundException, AccessDeniedException, IOException {
+    protected ViolatedPrecondition getCheckinPreconditionViolation(NodeProperty predSetProp, NodeRevisionDescriptors vhrNrds, boolean isForkOk, NodeRevisionDescriptor autoUpdNrd ) throws LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, RevisionDescriptorNotFoundException, JDOMException, IllegalArgumentException, ObjectNotFoundException, AccessDeniedException, IOException, VetoException {
         // use a non-blocking slide token.
         SlideToken stok = readonlySlideToken();
         
@@ -1455,7 +1453,7 @@
      *
      * @return     the violated precondition.
      */
-    protected String getForkBranch(NodeProperty predSetProp, NodeRevisionDescriptors vhrNrds, boolean isForkOk) throws LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, RevisionDescriptorNotFoundException, JDOMException, IllegalArgumentException, ObjectNotFoundException, AccessDeniedException, IOException {
+    protected String getForkBranch(NodeProperty predSetProp, NodeRevisionDescriptors vhrNrds, boolean isForkOk) throws LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, RevisionDescriptorNotFoundException, JDOMException, IllegalArgumentException, ObjectNotFoundException, AccessDeniedException, IOException, VetoException {
         
         String forkBranch = null;
         
Index: src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java,v
retrieving revision 1.13
diff -w -u -w -r1.13 WebdavUtils.java
--- src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java	2 Dec 2003 14:07:02 -0000	1.13
+++ src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java	5 Feb 2004 15:15:47 -0000
@@ -87,6 +87,7 @@
 import org.apache.slide.webdav.WebdavServletConfig;
 import org.apache.slide.webdav.method.MethodNotAllowedException;
 import org.apache.slide.webdav.util.UriHandler;
+import org.apache.slide.event.VetoException;
 import org.apache.util.URLUtil;
 import org.apache.util.WebdavStatus;
 
@@ -569,6 +570,9 @@
             return e.getStatusCode();
         } catch(MethodNotAllowedException e) {
             return WebdavStatus.SC_METHOD_NOT_ALLOWED;
+        } catch(VetoException e) {
+            // FIXME: Should be mapped to a matching error code
+            return WebdavStatus.SC_NOT_ACCEPTABLE;
         } catch(SlideException e) {
             //            e.printStackTrace();
             return WebdavStatus.SC_INTERNAL_SERVER_ERROR;
