Tcl OData Documentation — OData Service Provider Class

NAME
odata::Provider — class representing an OData Service Provider
SYNOPSIS
CLASS HIERARCHY
DESCRIPTION
CONSTRUCTOR
DESTRUCTOR
EXPORTED METHODS
provider add itemType itemName ?args...?
provider associate itemType itemName handlerCommand
provider delete itemType itemName
provider dispatch url
provider export
provider import metaData
provider info subCommand ?arg ...?
actions
action unboundActionName
entitySets
entitySet entitySetName
functions
function unboundFunctionName
properties
property propertyNAme
types
type typeName
provider load parsedServiceDefinition
provider redefine collectionName
provider set servicePropertyName value
NON-EXPORTED METHODS
EXAMPLES
SEE ALSO

NAME

odata::Provider — class representing an OData Service Provider

SYNOPSIS

package require TclOO

odata::Provider serviceName

CLASS HIERARCHY


Please see the parent class for inherited methods.

DESCRIPTION

The provider class creates an object instance for an OData service provider. The created instance is then configured to define the service and the code that handles

When a queried, the web server should invoke the dispatch method of the instance and return the appropriate result(s) as indicated by the results of the dispatch method.

CONSTRUCTOR

The constructor of the odata::Provider class takes a single argument which is the name of the OData service.

DESTRUCTOR

The odata::Service class' destructor will delete all remaining odata::EntitySet and odata::Entity instances created by this service.

EXPORTED METHODS

provider add itemType itemName ?args...??

Add the item named itemName of the type itemType to the provider, where itemType is:

action
Add an unbound action to the service. This type will take one additional optional argument, parameterDict, which is a parameter dictionary that defines the action.
entitySet
Add an entity set to the service.This takes one additional optional argument, a dictionary describing the type.
function
Add an unbound function to the service. This type will take one additional optional argument, parameterDict, which is a parameter dictionary that defines the function.
type
Add an type to the service. This takes one additional optional argument, a dictionary describing the type.

provider associate itemType itemName handlerCommand

This associates a command, handlerCommand, to handle request/invokcations of the item. , where itemType is:

action
See Unbound Action/Function Command Interface Specificationfor details.
entitySet
See Entity Handler Command Interface Specification for details.
function
See Unbound Action/Function Command Interface Specificationfor details.
type
Add an type to the service. This takes one additional optional argument, a dictionary describing the type.

provider delete itemType itemName

Remove from the service definition the item specified by itemName and of the type specified by itemType, where itemType is one of:

provider dispatch url

This subcommand is called by the web server to have a cause the service to process a request.

provider export

This command returns the "parsed" definition of the service. It can be saved (e.g. to a file) and later used by the load subcommand.

provider import metaData

Parse a Common Schema Definition Language (CSDL) that describes the service to define the service. When using this approch, you must associate handlers to the Entity Sets, Unbound Actions and Unbound Functions.

provider info subCommand ?arg ...?
This method is used to query information about the service and its compontents. Valid subCommand are:

actions
Returns a list of unbound actions advertised by the service.

action unboundActionName
Returns a dictionary (see parameter dictionary) describing the parameters and return value of the action with the name unboundActionName. If no such action exists, an error will be raised.

entitySets
Returns a list of entiy sets advertised by the service.

entitySet entitySetName
Returns a dictionary describing entitySetName. The dictionary is structured as follows:
Handler
The name of the registered handler command.
Type
The type of items (aka entities) that compose the entity set.
Singleton
A boolean indicating if this entity set represents a singleton.

functions
Returns a list of unbound functions advertised by the service.

function unboundFunctionName
Returns a dictionary (see parameter dictionary) describing the parameters and return value of the function with the name unbounFunctionName. If no such fuction exists, an error will be raised.

properties
Returns a list of services properties of the service.

property propertyNAme
Returns the value of the service property specified by propertyName.

types
Returns a list of types that the service uses.

type typeName item
This subcommand returns dictionary describing type. Valid keys are:

    properties
    Returns a list of the pairs that are the property name and its data type for this type.

    relationships
    Returns a list of other types that this type has a relationship to.

    keys
    Returns a list of the properties that are keys, if any, for this type.

provider load parsedServiceDefinition

Load a parsedServiceDefinition, produced by the export subcommand, to define the service.

provider redefine entityNameSet

This subcommand is used to discard and redefine the definition of an EntitySet.

provider set servicePropertyName value

This command is used to set the value of a service property, supported properties are:

ServiceBaseURL
The base URL prepended to all of the service URLs by the web server.

NON-EXPORTED METHODS

While the odata::Provider class has several non-exported methods, the are considered "private" and as such their APIs are subject to change without notice and not supported; thus the non-exported methods should not be used.

EXAMPLES

SEE ALSO

OData, odata::OData Entity Handler Command Interface Specification and Unbound Action/Function Command Interface Specification

Parameter Dictionary

This dictionary has the following structure (note either key may be absent if not used by the action/function):

Handler
The name of the registered handler command.
Inputs
A dictionary representing the input parameters. The keys are the parameter name and the value is a dictionary with the following keys:
Type (this key is always present)
The type of what item is to be passed in.
Nullable (this key is always present)
A boolean indicating if the parameter is optional.
MaxLength
Specifies the maximum length of the parameter value. The percise meaning is dependent on the actual parameter type.
Precision
Specifies the precision of the parameter value. The percise meaning is dependent on the actual return type.
Scale
Specifies the precision of the parameter value. The percise meaning is dependent on the actual return type.
SRID
Identifies which spatial reference system is applied to parameter value. This is only present for spatial data types.

Returns
A dictionary representing with the following keys:
Class (this key is always present)
The class of what is returned. It will be either Collection or Item.
Type (this key is always present)
The type of what item(s) returned.
Nullable (this key is always present)
A boolean indicating if a null value or empty collection may be returned.
MaxLength
Specifies the maximum length of the return value. The percise meaning is dependent on the actual return type.
Precision
Specifies the precision of the return value. The percise meaning is dependent on the actual return type.
Scale
Specifies the precision of the return value. The percise meaning is dependent on the actual return type.
SRID
Identifies which spatial reference system is applied to returned value. This is only present for spatial data types.

Copyright © 2017 Gerald W. Lester