Clearspace API (2.5.18) Core Javadocs

com.jivesoftware.community.event
Class DocumentEvent

java.lang.Object
  extended by com.jivesoftware.community.event.DocumentEvent
All Implemented Interfaces:
com.jivesoftware.community.JiveEvent

public class DocumentEvent
extends Object
implements com.jivesoftware.community.JiveEvent

A class for Document events. This class will be passed to DocumentListeners whenever a document event is fired and contains all the pertinent information to the event.

Certain event types will populate the params Map with additional objects as outlined below:

Event TypeExtra Params
DOCUMENT_ADDEDNone
DOCUMENT_DELETEDNone
DOCUMENT_MOVED
NameValue
OriginalContainerThe original container
DestinationContainerThe destination container
DOCUMENT_RELATED_DOCUMENT_ADDED
NameValue
RelatedDocumentThe related document added
DOCUMENT_RELATED_DOCUMENT_DELETED
NameValue
RelatedDocumentThe related document to be deleted
DOCUMENT_RATED
NameValue
UserThe user rating the document
RatingA Rating object
DOCUMENT_MODIFIED
ReasonNameValue
ExternalID was modifiedTypeexternalIDModify
ExternalID was modifiedoriginalValueThe externalID before it was modified
Document type was modifiedTypedocumentTypeModify
Document type was modifiedoriginalValueThe ID of the document type before it was modified as a String
Author was changedTypeuserModify
Author was changedoriginalValueThe userID of the original author as a Long
Title was modifiedTypetitleModify
Title was modifiedoriginalValueThe title before it was modified

Description was modifiedTypedescriptionModify
Description was modifiedoriginalValueThe description before it was modified

Property was modifiedTypepropertyModify
Property was modifiedPropertyKeyThe name of the property
Property was modifiedoriginalValueThe property value before it was modified

Property was addedTypepropertyAdd
Property was addedPropertyKeyThe name of the new property

Property was deletedTypepropertyDelete
Property was deletedPropertyKeyThe name of the property that is going to be deleted

Document index was changedTypeIndexChange


Field Summary
static int BINARY_BODY_DOWNLOADED
          Event type for when a binary body is downloaded
static int DOCUMENT_ADDED
          Event type for whenever a document is added to a container.
static int DOCUMENT_DELETING
          Event type for whenever a document is deleted from a container.
static int DOCUMENT_EXPIRE_WARNING
          Event type for whenever a document is about to expire.
static int DOCUMENT_EXPIRED
          Event type for whenever a document expires.
static int DOCUMENT_MODIFIED
          Event type for whenever a document is modified.
static int DOCUMENT_MOVED
          Event type for whenever a document is moved.
static int DOCUMENT_RATED
          Event type for whenever a document is rated.
static int DOCUMENT_RELATED_DOCUMENT_ADDED
          Event type for whenever a related document is added to a document.
static int DOCUMENT_RELATED_DOCUMENT_DELETED
          Event type for whenever a related document is deleted from a document.
static int DOCUMENT_UNDELETED
          Event type for whenever a document is un-deleted from a container.
static int DOCUMENT_VIEWED
          Event type for when a document is marked as viewed
static int VERSION_ADDED
          Event type for when a version is added
static int VERSION_DELETING
          Event type for when a version is about to be deleted
static int VERSION_MODIFIED
          Event type for when a version is modified
 
Constructor Summary
DocumentEvent(int eventType, Document document, JiveContainer container, Map<String,? extends Object> params)
           
 
Method Summary
 Date getCreated()
           
 Date getDate()
           
 Document getDocument()
           
 int getEventType()
           
 JiveObject getIdentifiedObject()
          Return an EntityDescriptor if document is null and documentID is not.
 JiveContainer getJiveContainer()
           
 Map<String,? extends Object> getParams()
           
 JiveContentObject.Status getPreviousStatus()
           
 boolean isDocumentStateChanged()
           
 boolean isMinorRevision()
           
 void setCreated(Date created)
           
 void setDocumentStateChanged(boolean documentStateChanged)
           
 void setMinorRevision(boolean minorRevision)
           
 void setPreviousStatus(JiveContentObject.Status status)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOCUMENT_ADDED

public static final int DOCUMENT_ADDED
Event type for whenever a document is added to a container.

See Also:
Constant Field Values

DOCUMENT_DELETING

public static final int DOCUMENT_DELETING
Event type for whenever a document is deleted from a container.

See Also:
Constant Field Values

DOCUMENT_UNDELETED

public static final int DOCUMENT_UNDELETED
Event type for whenever a document is un-deleted from a container.

See Also:
Constant Field Values

DOCUMENT_MOVED

public static final int DOCUMENT_MOVED
Event type for whenever a document is moved.

See Also:
Constant Field Values

DOCUMENT_MODIFIED

public static final int DOCUMENT_MODIFIED
Event type for whenever a document is modified.

See Also:
Constant Field Values

DOCUMENT_EXPIRE_WARNING

public static final int DOCUMENT_EXPIRE_WARNING
Event type for whenever a document is about to expire.

See Also:
Constant Field Values

DOCUMENT_EXPIRED

public static final int DOCUMENT_EXPIRED
Event type for whenever a document expires.

See Also:
Constant Field Values

DOCUMENT_RELATED_DOCUMENT_ADDED

public static final int DOCUMENT_RELATED_DOCUMENT_ADDED
Event type for whenever a related document is added to a document.

See Also:
Constant Field Values

DOCUMENT_RELATED_DOCUMENT_DELETED

public static final int DOCUMENT_RELATED_DOCUMENT_DELETED
Event type for whenever a related document is deleted from a document.

See Also:
Constant Field Values

DOCUMENT_RATED

public static final int DOCUMENT_RATED
Event type for whenever a document is rated.

See Also:
Constant Field Values

DOCUMENT_VIEWED

public static final int DOCUMENT_VIEWED
Event type for when a document is marked as viewed

See Also:
Constant Field Values

VERSION_ADDED

public static final int VERSION_ADDED
Event type for when a version is added

See Also:
Constant Field Values

VERSION_MODIFIED

public static final int VERSION_MODIFIED
Event type for when a version is modified

See Also:
Constant Field Values

VERSION_DELETING

public static final int VERSION_DELETING
Event type for when a version is about to be deleted

See Also:
Constant Field Values

BINARY_BODY_DOWNLOADED

public static final int BINARY_BODY_DOWNLOADED
Event type for when a binary body is downloaded

See Also:
Constant Field Values
Constructor Detail

DocumentEvent

public DocumentEvent(int eventType,
                     Document document,
                     JiveContainer container,
                     Map<String,? extends Object> params)
Method Detail

getEventType

public int getEventType()
Specified by:
getEventType in interface com.jivesoftware.community.JiveEvent

getDocument

public Document getDocument()

getJiveContainer

public JiveContainer getJiveContainer()

getParams

public Map<String,? extends Object> getParams()
Specified by:
getParams in interface com.jivesoftware.community.JiveEvent

getDate

public Date getDate()
Specified by:
getDate in interface com.jivesoftware.community.JiveEvent

getCreated

public Date getCreated()

setCreated

public void setCreated(Date created)

setPreviousStatus

public void setPreviousStatus(JiveContentObject.Status status)

getPreviousStatus

public JiveContentObject.Status getPreviousStatus()

isDocumentStateChanged

public boolean isDocumentStateChanged()

setDocumentStateChanged

public void setDocumentStateChanged(boolean documentStateChanged)

isMinorRevision

public boolean isMinorRevision()

setMinorRevision

public void setMinorRevision(boolean minorRevision)

getIdentifiedObject

public JiveObject getIdentifiedObject()
Return an EntityDescriptor if document is null and documentID is not.

Returns:
if document is null, an EntityDescriptor, otherwise the document itself.

toString

public String toString()
Overrides:
toString in class Object

Clearspace Project Page

Copyright © 1999-2007 Jive Software.