Namespace: Consultingwerk.OERA.Swagger
Class 
SwaggerRestEntitiesGenerator Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.OERA.Swagger.ISwaggerRestEntitiesGenerator

File:SwaggerRestEntitiesGenerator
Purpose:Swagger REST Entities Generation
Author(s):Martyn Kemp / Consultingwerk Ltd.
Created:Mon Sep 11 13:58:38 BST 2017
/* Mike Fechner, Consultingwerk Ltd. 13.09.2017
Preprocessor variables for SmartComponentLibrary, WinKit and SmartFramework
based on Consultingwerk/packages.i now



Top Method Summary
Options Name Purpose
+ Progress.Json.ObjectModel.JsonObject AddComponentsSchema (JsonObject) Returns the Catalog for the Restful Services
# AddRestfulFields (handle, JsonObject, IRestAddress, character) Adds Fields to the given JSON Object
# AddStringField (JsonObject, character) Adds a Type node to the input JSON Object
# CHARACTER FindHtmlTemplate (character) Locates a template file
# Progress.Json.ObjectModel.JsonObject GenerateEnumObject (Class, character, character) Generates Enum Object Definition
# Progress.Json.ObjectModel.JsonObject GenerateEnumResponseObject (Class, character) Generates Enum Response Definition
# Progress.Json.ObjectModel.JsonObject GenerateHeaderObject (character, character, character, character) Generates the Definition Header Details
# Progress.Json.ObjectModel.JsonArray GenerateInvokeMethodPathProperties (character) Generates the Definition Header Details
# Progress.Json.ObjectModel.JsonObject GenerateInvokeMethodProperties (JsonObject, JsonArray, JsonObject, character, character, character, character, character) Generates Invoke Method Properties
# Progress.Json.ObjectModel.JsonObject GenerateSwaggerRestfulAnnotations (character, character) Returns the Swagger Restful Services Annotations
# CHARACTER GetBasePath () Returns the Url suffix (/web/Entities) appended to the servers address
# GetBusinessServiceEntities () Populates a temp table with Restful Business Tasks Services
# Progress.Json.ObjectModel.JsonObject GetCountOperation (character, character, character, character) Returns the JSON Count Operation
# Progress.Json.ObjectModel.JsonObject GetDefinitionCount () Returns the JSON Schema Count Definitions for the Entity
# GetFilterParameters (JsonArray) Constructs JSON Filter Parameters Array
+ Progress.Json.ObjectModel.JsonObject GetInvokeMethodResponses (JsonObject, character, character, character, character) Returns the JSON Invoke Method Response
+ Progress.Json.ObjectModel.JsonObject GetInvokeResponseSchema (character, character, character, character) Returns the JSON Invoke Method Response Schema
# Progress.Json.ObjectModel.JsonArray GetParameters (character, logical, logical, character, character, character) Returns the JSON Parameters Array
# Progress.Json.ObjectModel.JsonObject GetPathOperations (character, character, character, character, logical, character, character, character, character, logical, logical, logical) Returns the JSON Path Operations
# Progress.Json.ObjectModel.JsonObject GetResponseObject (character, character) Returns the JSON Parameters Array
# CHARACTER GetSchemaDefinition (handle, character, character) Returns the Schema Definition value
# GetServiceEntities (character) Populates a temp table with Restful Service Entities
# Progress.Json.ObjectModel.JsonObject GetServiceOperations (JsonObject) Returns the Catalog for the Restful Services
+ LONGCHAR GetSwaggerRestfulHtml (character) Returns the Swagger Web page contents for the Restful Services
+ Progress.Json.ObjectModel.JsonObject GetSwaggerRestfulServices (character) Returns the Catalog for the Restful Services
+ Progress.Json.ObjectModel.JsonObject GetSwaggerRestfulServices (character, character) Returns the Catalog for the Restful Services
- InitializeObjectReferences () Initializes Object References
# ProcessBusinessTasks (JsonObject) Generates Swagger/OpenAPI definitions for Business Tasks
# ProcessLinks (JsonObject, handle, character) Processes the Links
# ProcessRelations (JsonObject, handle, IRestAddress) Processes the child relations of the given record
# ProcessRestfulMethods (JsonObject, JsonObject, character, character, character, character) Processes Restful Methods for the Business Entity
# Progress.Json.ObjectModel.JsonArray SchemaTags () Initializes Object References
+ SetQueryParameters (JsonArray) Set the Swagger Response Schema Object
+ SetRestfulResponseSchema (handle, JsonObject, IRestAddress) Set the Swagger Response Schema Object
- VerifyResponseSchema (JsonObject, JsonObject) Checks the resultant Response Schema value and if necessary update the value

Top Property Summary
Options Name Purpose
# Consultingwerk.OERA.RestResource.IRestAddress CurrentRegisteredAddress
# HANDLE DatasetHandle
# CHARACTER EntityName


Method Detail
Top

PUBLIC Progress.Json.ObjectModel.JsonObject AddComponentsSchema (JsonObject)

Purpose: Returns the Catalog for the Restful Services
Notes:

Parameters:
oObject Progress.Json.ObjectModel.JsonObject
The parent JSON Object
Returns Progress.Json.ObjectModel.JsonObject
The JSON Object containing the Restful Services Operations
Top

PROTECTED AddRestfulFields (handle, JsonObject, IRestAddress, character)

Purpose: Adds Fields to the given JSON Object
Notes:

Parameters:
phBuffer HANDLE
The handle of the Buffer
poRecord Progress.Json.ObjectModel.JsonObject
The JsonObject to add the fields to
poRestAddress Consultingwerk.OERA.RestResource.IRestAddress
The IRestAddress instance describing the format of the current record
pcFields CHARACTER
The fields as provided by the consumer
Top

PROTECTED AddStringField (JsonObject, character)

Purpose: Adds a Type node to the input JSON Object
Notes:

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JSON Object to assign a Type node to
pcValue CHARACTER
The value to assign to the new JSON Object Node
Top

PROTECTED CHARACTER FindHtmlTemplate (character)

Purpose: Locates a template file
Notes:

Parameters:
pcRelativeFileName CHARACTER
The relative file name of the template to return
Returns CHARACTER
The absolute file name of the template
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GenerateEnumObject (Class, character, character)

Purpose: Generates Enum Object Definition
Notes:

Parameters:
poClass Progress.Lang.Class
The Enum Class Object
pcRequestMode CHARACTER
The Request Method
pcProperty CHARACTER
The Enum Name Property
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject containing Enum Details
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GenerateEnumResponseObject (Class, character)

Purpose: Generates Enum Response Definition
Notes:

Parameters:
poClass Progress.Lang.Class
The Enum Class Object
pcProperty CHARACTER
The Enum Name Property
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject containing Enum Response Details
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GenerateHeaderObject (character, character, character, character)

Purpose: Generates the Definition Header Details
Notes:

Parameters:
pcEntityname CHARACTER
The Business Entity Name
pcSummary CHARACTER
The Summary Details
pcDescription CHARACTER
The definition description
pcOperationID CHARACTER
The Operation ID
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject containing Definition Header Details
Top

PROTECTED Progress.Json.ObjectModel.JsonArray GenerateInvokeMethodPathProperties (character)

Purpose: Generates the Definition Header Details
Notes:

Parameters:
pcParameters CHARACTER
The definition path parameters
Returns Progress.Json.ObjectModel.JsonArray
The JsonArray containing Path Parameters
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GenerateInvokeMethodProperties (JsonObject, JsonArray, JsonObject, character, character, character, character, character)

Purpose: Generates Invoke Method Properties
Notes:

Parameters:
poOperation Progress.Json.ObjectModel.JsonObject
The JsonObject representing the operation
poArray Progress.Json.ObjectModel.JsonArray
Input / Output Json Array of Invoke Method Properties
poMaster Progress.Json.ObjectModel.JsonObject
The JsonObject representing the Masetr
pcClassName CHARACTER
The Entity Class Name
pcMethodName CHARACTER
The name of the Business Entity Method
pcParameterClassName CHARACTER
pcRequestMode CHARACTER
The Invoke Request Method
pcParameters CHARACTER
The Parameter list for the Invoke Method
Returns Progress.Json.ObjectModel.JsonObject
The Request object
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GenerateSwaggerRestfulAnnotations (character, character)

Purpose: Returns the Swagger Restful Services Annotations
Notes:

Parameters:
pcServiceURI CHARACTER
The Service URI
pcEntity CHARACTER
The Business Entity
Returns Progress.Json.ObjectModel.JsonObject
The JSON Object describing the Swagger Restful Services Annotations
Top

PROTECTED CHARACTER GetBasePath ()

Purpose: Returns the Url suffix (/web/Entities) appended to the
servers address
Notes:

Returns CHARACTER
The Url suffix
Top

PROTECTED GetBusinessServiceEntities ()

Purpose: Populates a temp table with Restful Business Tasks Services
Notes:

Top

PROTECTED Progress.Json.ObjectModel.JsonObject GetCountOperation (character, character, character, character)

Purpose: Returns the JSON Count Operation
Notes:

Parameters:
pcEntityname CHARACTER
The Business Entity name
pcDatasetName CHARACTER
The Dataset Name
pcParameters CHARACTER
The Parameters
pcSchemaDefinition CHARACTER
The schema definition
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject for the Path Operation
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GetDefinitionCount ()

Purpose: Returns the JSON Schema Count Definitions for the Entity
Notes:

Returns Progress.Json.ObjectModel.JsonObject
The JsonObject representing the Definitions Count schema
Top

PROTECTED GetFilterParameters (JsonArray)

Purpose: Constructs JSON Filter Parameters Array
Notes:

Parameters:
oParameters Progress.Json.ObjectModel.JsonArray
The JsonArray for Filter Parameters
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetInvokeMethodResponses (JsonObject, character, character, character, character)

Purpose: Returns the JSON Invoke Method Response
Notes:

Parameters:
poMaster Progress.Json.ObjectModel.JsonObject
The reference to the response Json Object so far
pcClassName CHARACTER
The Class Name
pcParameterClassName CHARACTER
The Parameter Class Name
pcRequestMethod CHARACTER
The Request Method
pcResponse CHARACTER
The Response (comma delimited list) of Responses
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject containing Invoke Method Response Details
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetInvokeResponseSchema (character, character, character, character)

Purpose: Returns the JSON Invoke Method Response Schema
Notes:

Parameters:
pcClassName CHARACTER
The Class Name
pcParameterClassName CHARACTER
The Parameter Class Name
pcRequestMethod CHARACTER
The Request Method
pcResponse CHARACTER
The Response (comma delimited list) of Responses
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject containing Invoke Method Response Schema Details
Top

PROTECTED Progress.Json.ObjectModel.JsonArray GetParameters (character, logical, logical, character, character, character)

Purpose: Returns the JSON Parameters Array
Notes:

Parameters:
pcParameters CHARACTER
The comma delimited list of Filter Parameters
plCollection LOGICAL
Is the Parameter request type a record or collection
plParameters LOGICAL
Are Body Response Parameters required
pcName CHARACTER
The Parameter ID Name
pcSchema CHARACTER
The Scheme Definition Name
pcDescription CHARACTER
The Parameter Description
Returns Progress.Json.ObjectModel.JsonArray
The JsonArray for Parameters Array
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GetPathOperations (character, character, character, character, logical, character, character, character, character, logical, logical, logical)

Purpose: Returns the JSON Path Operations
Notes:

Parameters:
pcEntityname CHARACTER
The Business Entity name
pcDatasetName CHARACTER
The Dataset Name
pcTableName CHARACTER
The Top Level Dataset Table Name
pcSchemaDefinition CHARACTER
The schema definition
plNonStandardDefinition LOGICAL
Indicate whether Standard or Non Standard Schema
pcVerb CHARACTER
The Verb
pcDescription CHARACTER
The Description
pcOperationId CHARACTER
The Operation ID
pcParameters CHARACTER
The Parameters
plCollection LOGICAL
Collection
plConsumes LOGICAL
Consumable
plParameters LOGICAL
Has parameters
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject for the Path Operation
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GetResponseObject (character, character)

Purpose: Returns the JSON Parameters Array
Notes:

Parameters:
pcSchema CHARACTER
The Scheme Definition Name
pcDescription CHARACTER
The Parameter Description
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject for the Response Object
Top

PROTECTED CHARACTER GetSchemaDefinition (handle, character, character)

Purpose: Returns the Schema Definition value
Notes:

Parameters:
hDataset HANDLE
The Dataset handle
pcSchemaName CHARACTER
The Schema Name to be defined within the Schema Definition
pcTable CHARACTER
The Table to be defined within the Schema Definition
Returns CHARACTER
The Schema Definition value
Top

PROTECTED GetServiceEntities (character)

Purpose: Populates a temp table with Restful Service Entities
Notes: The Business Entity Parameter is optional, if left empty, then ALL Entities are defined

Parameters:
pcEntity CHARACTER
The Business Entity to be used for Definition File Generation
Top

PROTECTED Progress.Json.ObjectModel.JsonObject GetServiceOperations (JsonObject)

Purpose: Returns the Catalog for the Restful Services
Notes:

Parameters:
oParent Progress.Json.ObjectModel.JsonObject
The parent JSON Object
Returns Progress.Json.ObjectModel.JsonObject
The JSON Object containing the Restful Services Operations
Top

PUBLIC LONGCHAR GetSwaggerRestfulHtml (character)

Purpose: Returns the Swagger Web page contents for the Restful Services
Notes: Defaults to the count method type of the .restapplicationsettings file

Parameters:
pcServiceURI CHARACTER
The Service URI
Returns LONGCHAR
The Longchar containing the Swagger Web page contents
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetSwaggerRestfulServices (character)

Purpose: Returns the Catalog for the Restful Services
Notes:

Parameters:
pcServiceURI CHARACTER
The Service URI
Returns Progress.Json.ObjectModel.JsonObject
The JSON Object describing the Catalog for the Restful Services
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetSwaggerRestfulServices (character, character)

Purpose: Returns the Catalog for the Restful Services
Notes:

Parameters:
pcServiceURI CHARACTER
The Service URI
pcEntity CHARACTER
The Business Entity
Returns Progress.Json.ObjectModel.JsonObject
The JSON Object describing the Catalog for the Restful Services
Top

PRIVATE InitializeObjectReferences ()

Purpose: Initializes Object References
Notes:

Top

PROTECTED ProcessBusinessTasks (JsonObject)

Purpose: Generates Swagger/OpenAPI definitions for Business Tasks
Notes:

Parameters:
poObject Progress.Json.ObjectModel.JsonObject
The JsonObject to add the links to
Top

PROTECTED ProcessLinks (JsonObject, handle, character)

Purpose: Processes the Links
Notes:

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to add the links to
phBuffer HANDLE
The parent record buffer
pcLinks CHARACTER
The list of links
Top

PROTECTED ProcessRelations (JsonObject, handle, IRestAddress)

Purpose: Processes the child relations of the given record
Notes:

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The Json of the parent record
phBuffer HANDLE
The handle of the parent record
poRestAddress Consultingwerk.OERA.RestResource.IRestAddress
The IRestAddress instance describing the REST Address
Top

PROTECTED ProcessRestfulMethods (JsonObject, JsonObject, character, character, character, character)

Purpose: Processes Restful Methods for the Business Entity
Notes:

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The Json of the parent record
poParent Progress.Json.ObjectModel.JsonObject
INPUT-OUTPUT Parent Json Object
pcEntityName CHARACTER
The Business Entity Name
pcEntityAddress CHARACTER
The Entity REST Address
pcParameters CHARACTER
List of Query Parameters
pcSchemaName CHARACTER
The Entity Schema Name
Top

PROTECTED Progress.Json.ObjectModel.JsonArray SchemaTags ()

Purpose: Initializes Object References
Notes:

Returns Progress.Json.ObjectModel.JsonArray
The JSON Array for the Schema Tags
Top

PUBLIC SetQueryParameters (JsonArray)

Purpose: Set the Swagger Response Schema Object
Notes:

Parameters:
poParameters Progress.Json.ObjectModel.JsonArray
The Parameters JSON Array to add the Query Parameters
Top

PUBLIC SetRestfulResponseSchema (handle, JsonObject, IRestAddress)

Purpose: Set the Swagger Response Schema Object
Notes:

Parameters:
phDataset HANDLE
The Dataset handle
poResponse Progress.Json.ObjectModel.JsonObject
The Current JSON Object to set the Response Schema to
poRestAddress Consultingwerk.OERA.RestResource.IRestAddress
The Current Rest Address
Top

PRIVATE VerifyResponseSchema (JsonObject, JsonObject)

Purpose: Checks the resultant Response Schema value and if necessary update the value
Notes:

Parameters:
poMaster Progress.Json.ObjectModel.JsonObject
The Master JSON Object to set the Response Schema to
poType Progress.Json.ObjectModel.JsonObject
The Response Schema JSON Object


Property Detail
Top

PROTECTED Consultingwerk.OERA.RestResource.IRestAddress CurrentRegisteredAddress


Returns Consultingwerk.OERA.RestResource.IRestAddress
Top

PROTECTED HANDLE DatasetHandle


Returns HANDLE
Top

PROTECTED CHARACTER EntityName


Returns CHARACTER


©2006-2020 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       04.02.2020 23:15:02