AsynchronousEventHandlerBase Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Provides a base class for event handlers that handles asynchronous events in Content Studio.
Inheritance Hierarchy

SystemObject
  ContentStudio.EventActions.AsynchronousEventHandlersAsynchronousEventHandlerBase
    More...

Namespace: ContentStudio.EventActions.AsynchronousEventHandlers
Assembly: AsynchronousEventHandlers (in AsynchronousEventHandlers.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public abstract class AsynchronousEventHandlerBase : ICSAsyncEventHandler, 
	IDisposable

The AsynchronousEventHandlerBase type exposes the following members.

Constructors

  NameDescription
Protected methodAsynchronousEventHandlerBase
Initializes a new instance of the AsynchronousEventHandlerBase class.
Top
Properties

  NameDescription
Protected propertyCallerEmailAddress
Gets or sets the caller email address. Currently (CS 5.2 SP1) this property is not implemented and always returns null (Nothing in Visual Basic).
Protected propertyCallerIdentifier
Gets the internal Content Studio identifier of the caller.
Protected propertyCallerLogOnName
Gets the login name of the calling user.
Protected propertyCallerName
Gets the name of the caller.
Protected propertyCallerSessionId
Gets the caller's session id.
Protected propertyCallerSid
Gets or sets the SecurityIdentifier of the calling user. Currently (CS 5.2 SP1) this property is not implemented and always returns null (Nothing in Visual Basic).
Protected propertyCallerUserKey
Gets or sets the caller's user key. Currently (CS 5.2 SP1) this property is not implemented and always returns null (Nothing in Visual Basic).
Protected propertyCategoryId
Gets the category id.
Protected propertyConnectionId
Gets the connection id.
Protected propertyCredentials
Gets the credentials passed in to the event handler.
Protected propertyDocumentId
Gets the document id.
Protected propertyDocumentName
Gets the name of the document. This is the name including the path relative the site root ex. System/Stylesheets/IE_Style
Protected propertyDocumentTitle
Gets the document title which is the name of the document without the path ex. IE_Style
Protected propertyEncodingName
Gets the encoding name of the document. This value can be null (Nothing in Visual Basic).
Protected propertyEventId
Gets the numeric event identifier.
Protected propertyEventName
Gets the name of the event.
Protected propertyEventTimestamp
Gets A date time value that indicates when the event was triggered in Content Studio.
Protected propertyExtendedPropertyCount
Gets the number of extended properties.
Protected propertyExtendedPropertyNames
Gets the extended property names.
Protected propertyExternalDocumentId
Gets the document identifier of an object that has been scheduled by an external provider.
Protected propertyFileName
Gets the name of the document's file on disc. Ex. C:\Content Studio\CS52\Sites\Site52\System\Stylesheets\F0B85EEC-925B-4A70-8D95-D14D48C76978.aspx
Protected propertyGuoid
Gets the document GUOID (Global object unique identifier) in its string format.
Protected propertyMessageId
Gets the unique message id.
Protected propertyQueueId
Gets the queue identifier. Service manager can inject this value when it handles the job
Protected propertyStatus
Gets or sets the status to report back to Content Studio after a successful operation. This message will be recorded in the Content Studio event log.
Protected propertyTimeOut
Gets the time out value that was provided to the event handler.
Top
Methods

  NameDescription
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
Protected methodDoWork
When implemented in derived class performs the actual work in the event handler.
Public methodEquals (Inherited from Object.)
Protected methodExistsExtendedProperty
Determines whether the specified extended property exists.
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the AsynchronousEventHandlerBase is reclaimed by garbage collection.
(Overrides ObjectFinalize.)
Protected methodFinish
This method gets called after that the event handler work operation has been completed.
Protected methodGetExtendedPropertyValue(Type, String)
Gets the extended property value as a specific data type.
Protected methodGetExtendedPropertyValueT(String)
Gets the extended property value as a specific data type.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodInit
When overridden in derived classes, performs custom initialization.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodParseCustomData
When overridden in derived classes, developers can use this method to get the custom data passed in to the event handler.
Protected methodCode exampleParseInputXml
Parses the event data xml passed in the event handler.
Protected methodCode examplePreInit
Initializes the value of the passed event handler properties to their corresponding properties.
Public methodToString (Inherited from Object.)
Protected methodValidateEvent
When implemented in derived classes, examines the event that triggered this event handler and returns a value that specifies whether the handler is valid for the event executed.
Top
Remarks

This class was introduced in Content Studio version 5.2 SP1.

Even though you can derive directly from this base class when you create an asynchronous event handler in Content Studio version 5.2 SP1 and later, unless your event handler should be able to handle multiple events, it is recommended to use some of the specialized derived class as a base class for your event handler implementation.

For more information see the See Also section in this document.

Examples

The following code shows an event handler that handles the OnDocumentSave asynchronous event in Content Studio. The handler checks that only callers authenticated by a specific domain can perform the action. It the reports the result of the operation to Content Studio.

public class MyOnDocumentSaveAsyncHandler : AsynchronousEventHandlerBase
{
    string status;
    protected override void DoWork()
    {
        //Check the permission, only members in a specific domain can execute the 
        //operation.
        if (!CallerLogOnName.StartsWith(@"MyDomain\", StringComparison.OrdinalIgnoreCase))
        {
            //Create a message that indicates that the operation was a failure
            //but the event handler itself did not fail.
            status = String.Format("Operation was not performed, Permission denied for user '{0}'.", CallerLogOnName);
            return;
        }

        //Do some work here.
        // 
        // 

        //create a success message to return to Content Studio
        status = String.Format("The operation has been performed by '{0}'.", CallerLogOnName);
    }

    protected override string Finish()
    {
        //Tell Content Studio about the outcome of the operation
        Status = status;
    }

    protected override bool ValidateEvent(int csEvent)
    {
        //Make sure that only OnDocumentSave (csEvent is 11)
        //can be handled by this event handler.
        return csEvent == 11;
    }
}
See Also

Reference

Other Resources

Inheritance Hierarchy

SystemObject
  ContentStudio.EventActions.AsynchronousEventHandlersAsynchronousEventHandlerBase
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentApproveAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentCheckInAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentCheckoutAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentCreateAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentDeleteAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentDestroyAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentExpireAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentPublishAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentRejectAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentRevisionAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentSaveAsyncHandler
    ContentStudio.EventActions.AsynchronousEventHandlersDocumentUnPublishAsyncHandler