Click or drag to resize

GSuiteEngineAsync Class

IT Hit WebDAV Classes Reference
Enables documents editing in Google G Suite online editors.
Inheritance Hierarchy
SystemObject
  ITHit.ServerEngineAsyncIHierarchyItemBase
    ITHit.GSuite.ServerGSuiteEngineAsync

Namespace:  ITHit.GSuite.Server
Assembly:  ITHit.GSuite.Server (in ITHit.GSuite.Server.dll) Version: 13.3.13068
Syntax
public class GSuiteEngineAsync : EngineAsync<IHierarchyItemBase>

The GSuiteEngineAsync type exposes the following members.

Constructors
  NameDescription
Public methodGSuiteEngineAsync(String, String)
Initializes an instance of this class.
Public methodGSuiteEngineAsync(String, String, String)
Initializes an instance of this class.
Top
Properties
  NameDescription
Public propertyCalculateContentLength
Indicates if response content length is calculated. Default is true.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Public propertyContentEncoding
Gets or sets the HTTP character set of the output stream. Default is UTF-8.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Public propertyCorsAllowedFor
Enables or disables CORS.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Public propertyCode exampleLicense
Gets or sets the license text.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Public propertyLogger
ILogger instance which engine will use for logging.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Public propertyOutputXmlFormatting
Specifies whether XML written to the output will be formatted. Default is false.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Public propertyUseFullUris
Specifies whether engine shall use full or relative urls. Default is true.
(Inherited from EngineAsyncTHierarchyItemAsync.)
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRegisterMethodHandler
Registers custom method handler.
(Overrides EngineAsyncTHierarchyItemAsyncRegisterMethodHandler(String, IMethodHandlerTHierarchyItemAsync).)
Public methodRunAsync
Processes requests to edit document in G Suite editor and generates response.
(Overrides EngineAsyncTHierarchyItemAsyncRunAsync(ContextAsyncTHierarchyItemAsync).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

This class initiates editing in Google G Suite online editors, receives notifications from Google Drive about document changes and updates documents in your storage. The engine makes calls to your implementations of ContextAsyncTHierarchyItem and [!:ITHit.Server.IHierarchyItemBaseAsync] interfaces reading file content from your storage, sending it to Google Drive and updating file content from Google Drive when a file is modified. The engine automatically deletes the file from Google Drive when editing is finished.

Optionally, the engine can lock the document in your storage with shared WebDAV lock when a new user joins document editing and unlock when the user finishes editing. When all users finish editing the document is deleted from Google Drive. If the engine receives a request to lock the document it will use WebDAV locking interface [!:ITHit.WebDAV.Server.Class2.ILockAsync] to lock the document. If WebDAV locking is not supported on the item (the [!:ITHit.WebDAV.Server.Class2.ILockAsync] interface is not implemented) or if the WebDAV Class 2 module license is not found, the request to edit the document fails.

In each HTTP request, you will create a separate instance of your class derived from ContextAsyncTHierarchyItem class and pass it to the RunAsync(ContextAsyncIHierarchyItemBase) method. Via the context, the engine receives all necessary information about the hosting environment.

You must set License property before you can use the engine.

All updates invoked within one request execution shall be inside a single transaction. Transaction can be committed or rollbacked in BeforeResponseAsync method, which is called right before starting sending a response to the client. After this method is called, no methods of interfaces which update state will be called by the engine. However, methods which read state can be called.

Thread Safety
Method RunAsync(ContextAsyncIHierarchyItemBase) is threadsafe. All other members are NOT threadsafe. You can create a single instance of this class, initialize it once and use to serve all requests from different threads.
See Also