Skip to main content
Skip table of contents

Customisation in Greentree

PlugIn Methods

There are a number of PlugIn events available to allow you to customise the Request/Response pipeline, and to implement your own custom resources for custom behaviour or implementation of custom data classes.

PlugInObjectLinkManager::eventApiCustomiseRequestUse this to intercept an incoming GET or POST request and perform custom behaviour.
PlugInObjectLinkManager::eventApiCustomiseResponseUse this to intercept the response from a GET or POST request and perform custom behaviour.
PlugInObjectLinkManager::eventApiHandleAuthenticationUse this to intercept requests and perform custom authentication.  Use this to perform your own authentication scheme.

Use this to provide your own resource to accept and process HTTP requests as required. Must return a class that implements ApiHttpResourceIF

PlugInObjectLinkManager::gtApiExtendIncomingObjectCalled after POST processing has been performed, allowing you to perform custom update/insert processing after standard implementation has been performed
PlugInObjectLinkManager::gtApiExtendOutgoingObjectCalled just prior to returning the HTTP response, allows you to add data to the HTTP response
PlugInObjectLinkManager::gtApiResolveIncomingObjectCalled before POST processing to allow you to perform custom validation on the incoming data



The API makes use of Greentree Interfaces which are exposed in a Package called ApiHttpInterfacePackage

ApiHttpResourceIFImplement this interface on a class that is returned from the plugin event eventApiGetResourceClass
ApiHttpRequestMessageIFThis is the type of message that is prepared and passed in to your ApiHttpResourceIF to wrap a HTTP Request
ApiHttpResponseMessageIFThis is the return type used to respond to a HTTP Request on your ApiHttpResourceIF implementation.
ApiHttpConfigurationIFGives you acess to the API configuration


Jade Dynamic Objects

The implementation of the API uses JadeDynamicObject and JadeDynamicObjectArray type objects to pass around the data.  By the time you see the data in the Greentree pipeline, the format (JSON or XML) has been deserialised into properties of a JadeDynamicObject.  You then deal with the JadeDynamicObject to read values that have been POSTed, and you add properties to a JadeDynamicObject to be serialised to JSON or XML and returned to the client


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.