Server Extension Programmer's Guide:
Sample Applications

This topic guides you through the following eRoom Server Extension applications:

Implement a custom command (MyCustomCommand)

This was written in ASP. The ASP file can be found under the Toolkit\Samples\CustomCommands subdirectory. It can be installed on any computer that has an eRoom server installed.

Implement a customer viewer (eRoom_TextViewer)

This was written in ASP. The ASP files can be found under the Toolkit\Samples\CustomViewers subdirectory. They can be installed on any computer that has an eRoom server installed.

Activate version tracking for all file uploads (SynchronousAutoVersion)

Log item events that occur (ItemLogger)

AutoVersion is written in C++ using VisualC++ 6.0. It has been compiled into a DLL that can be run on any computer that has an eRoom server installed. ItemLogger is written in Visual Basic 5.0. The files for both of these applications can be found under the Toolkit\Samples\Synchronous Events subdirectory.

Display a custom Create Member dialog (CreateUserUIEvent)

Display a custom Create Room Dialog (CreateRoomUIEvent)

Both of these handlers are written in ASP. The ASP files can be found under Toolkit\Samples\UIEvents. Either handler can be installed on any computer that has an eRoom server installed.

Implement a custom command (MyCustomCommand)


This ASP file displays the contents of the context object passed into the command from the eRoom Server.

Interfaces used

This application uses the following Server Access API interfaces: IERUCustomContext, IERURoom, IERUItem, IERUPrincipalItem, IERUFacility, and IERUUser.

Application files

Only one file is used in MyCustomCommand:

File name

Description

MyCustomCommand.asp

The ASP file that contains the custom command implementation.

 

Implement a custom viewer (eRoom_TextViewer)


These ASP files implement a custom viewer for files with the ".txt" extension.

Interfaces used

This application uses the following Server Access API interfaces: IERUCustomContext, IERURoom, IERUItem, IERUPrincipalItem, and IERUFacility.

Application files

The following table describes each of the files used in the custom viewer:

File name

Description

eRoom_TextViewer.asp

Contains a Main() subroutine that implements popup and standalone modes.

eRoom_TextViewer_class.asp

The class file that implements embedded mode.

 

Activate version tracking for all file uploads (SynchronousAutoVersion)


This is a synchronous event handler that turns on version tracking for every file that is uploaded to the eRoom Server. Autoversion uses the eRoom synchronous event handler mechanism so that it is notified every time a file is uploaded.

Interfaces used

This application uses the following Server Access API interfaces: IERUSynchronousEvent, IERUSEvent_AddFile_After, IERUItem, IERUFile, and IERUSynchronousEventRegister

This application implements the IERUEventHandler Server Access API interface.

Application files

The following table describes the files used in the SynchronousAutoVersion application:

File name

Description

SynchronousAutoVersion.dsp

The VisualC++ project file.

SynchronousAutoVersion.dsw

The VisualC++ workspace file.

SynchronousAutoVersion.cpp

Implements the entry points for the DLL.

SynchronousAutoVersion.def

Exports the entry points for the DLL.

SynchronousAutoVersionps.def

Exports the entry points for the proxy/stub DLL.

SynchronousAutoVersion.dll

The synchronousAutoVersion DLL.

SynchronousAutoVersionps.mk

The file that contains the build parameters.

SynchronousAutoVersion.idl

Defines the interface for the ERAutoversion COM object.

SynchronousAutoVersion.rc

Defines the resources for the application.

StdAfx.cpp

Precompiled header.

StdAfx.h

Precompiled header.

resource.h

Contains the resource IDs.

ERAutoversion.cpp

The class implementation for the ERAutoversion COM object.

ERAutoversion.h

Class definition for the ERAutoversion COM object.

ERAutoversion.rgs

The registry file.

 

Log item events that occur (ItemLogger)


This application handles the following synchronous events by tracing a message every time one of these events is triggered:  

  • erSynchEventType_ItemAdd,

  • erSynchEventType_ItemDelete

  • erSynchEventType_ItemModify

  • erSynchEventType_ItemMove

  • erSynchEventType_ItemCopy  

Interfaces used

This application uses the following Server Access API interfaces:

IERUTraceMessage, IERUSynchronousEvent, IERUSEvent_Item, IERUSEvent_ItemCopy,  IERUSEvent_ItemMove, IERUSEvent_Item.

This application implements the IERUEventHandler interface.

Application files

The following table describes each of the files used in the ItemLogger application:

File name

Description

clsItemLogger.cls

Subroutines that implement the IERUEventHandler interface.

Common.bas

Helper subroutines that convert between strings and enumeration values and that log the messages to eTrace.

Item.bas

The subroutine that handles the item add, item delete, and item modify events.

ItemCopy.bas

The subroutine that handles the item copy event.

ItemLogger.dll

The ItemLogger DLL.

ItemMoved.bas

The subroutine that handles the item moved event.

SynchronousEventsItemLogger.vbp

The Visual Basic project file.

 

Display a custom Create Member dialog (CreateUserUIEvent)


This ASP page pops up a dialog every time an eRoom user creates a user.  It allows for the eRoom user to either create a user immediately, cancel the action, or use the eRoom dialog to create the new user.

Interfaces used

This application uses the following Server Access API interfaces:

IERUMember, IERUCommunity.

Application files

Only one file is used in this application: CreateUserUIEvent.asp. This file contains the UI event handler implementation.

 

Display a custom Create Room Dialog (CreateRoomUIEvent)


This ASP page pops up a dialog every time an eRoom user creates a room. It allows for the eRoom user to either create a the room immediately, cancel the action, or use the eRoom dialog to create the new room.

Interfaces used

This application uses the following Server Access API interfaces:

IERUUser, IERUCommunity, IERUSiteFacility, IERUSite.

Application files

Only one file is used in this application: CreateRoomUIEvent.asp. This file contains the UI event handler implementation.