Content Management Guide

CHAPTER 11

Working with WebDAV Events

This chapter describes how to handle events related to WebDAV operations and activities. It has these sections:

For more information    This chapter assumes familiarity with the exteNd Director event model and event handling. For more information, see the chapter on working with events in Developing exteNd Director Applications.

 
Top of page

About WebDAV events

The WebDAV API events are an extension of the base exteNd Director event model framework, consisting of state change events, event producers, and event listeners (including vetoable listeners). The API for WebDAV events is defined in the com.sssw.webdav.event.api package.

 
Top of section

Event types

The API defines a set of state changed events related to WebDAV operations. Event IDs are exposed on the individual event classes as well as on the com.sssw.webdav.event.api.EbiConstants interface. There are also generic state change events defined in com.sssw.fw.event.api.EbiotateChangeEvent.

Below is a list of event IDs defined in com.sssw.webdav.event.api.EbiConstants:

For more information    For more information about WebDAV operations, see Supported WebDAV methods.

WebDAV operation

Event ID constant

Copy collections and resources

COPY_EVENT_ID

Delete collections or resources

DELETE_EVENT_ID

Retrieve collections or resources

GET_EVENT_ID

Retrieve header only

HEAD_EVENT_ID

Create a lock specified by the lockinfo XML element on the Request-URI.

LOCK_EVENT_ID

Create collection

MKCOL_EVENT_ID

Move resources or collections

MOVE_EVENT_ID

Return methods that can be called on resources and collections

OPTIONS_EVENT_ID

Download resources and collections from the client

POST_EVENT_ID

Retrieve properties on resources and collections

PROPFIND_EVENT_ID

Set and/or remove properties on server-side resources and collections

PROPPATCH_EVENT_ID

Upload resources and collections from the client

PUT_EVENT_ID

Remove a lock identified in the Lock-Token request header of the Request-URI.

UNLOCK_EVENT_ID

 
Top of page

Registering for WebDAV events

Procedure To subscribe to WebDAV events:

You can register for a specified type or types of events using this version of addStateChangeListener():

  public boolean addStateChangeListener(
     BitSet events, EbiStateChangeListener listener)

where events is a bit set of event IDs.

Use the event IDs specified in com.sssw.webdav.event.api.EbiConstants. For example, this code registers for create, delete and move operations on collections and resources:

  EbiStateChangeProducer producer = new EbiStateChangeProducer()
  // Instantiate a Java BitSet and populate it
  BitSet events = new BitSet();
  events.set(EbiConstants.MKCOL_EVENT_ID_ID);
  events.set(EbiConstants.DELETE_EVENT_ID);
  events.set(EbiConstants.MOVE_EVENT_ID);
  // Add listener
  producer.addStateChangeListener(events, Mylistener);

 
Top of page

Enabling WebDAV events

Procedure To enable or disable WebDAV events:

  1. Open config.xml in your exteNd Director project.

  2. Find this property:

      com.sssw.webdav.events.enable.Default
    
  3. Set the value to true for enable or false for disable.

  4. Redeploy your project.



Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...