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

File:SwaggerHelper
Purpose:Delegate Class Providing Common Helper Methods
Author(s):Martyn Kemp / Consultingwerk Ltd.
Created:Tue Sep 19 09:41:04 BST 2017
Notes:Supports the "SwaggerRequests" custom log entry type for
detailled error logging
/* 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
+ CHARACTER AblTypeToCatalogType (character) Converts the given ABL Data Type into a Json Catalog type
+ AddBufferFields (handle, JsonObject, character) Adds the temp-table field to the given JsonObject
+ CHARACTER FindTemplate (character) Locates a template file
+ Progress.Json.ObjectModel.JsonObject GetAnnotationSchema (character, character) Retrieves Schema Definitions defined with the Class Annotation
+ Progress.Json.ObjectModel.JsonArray GetArrayValue (character) Returns the JSON Array for the given value
+ Consultingwerk.OERA.BusinessEntityDescriptor.IBusinessEntityDescriptor GetBusinessEntityDescriptor (character, handle) Generates a Business Entity Descriptor for the given Dataset
+ Progress.Json.ObjectModel.JsonObject GetDatasetSchema (handle, logical, IBusinessEntityDescriptor) Returns the JSON Schema description for the ProDataset
+ CHARACTER GetDescriptionAnnotation (character) Retreives the Business Entity Description Annotation
+ Progress.Json.ObjectModel.JsonObject GetEnumProperties (Class, ValueFromEnum) Retreives the Enum Attributes for the specified Enum Class
+ CHARACTER GetEnumValues (Class, ValueFromEnum) Retreives the Enum Attributes for the specified Enum Class
+ Progress.Json.ObjectModel.JsonObject GetHeaderDetails () Returns the Swagger Header Details defined in a Template File
+ Progress.Json.ObjectModel.JsonObject GetPathResponse (character) Returns the JSON Path Response
+ Progress.Json.ObjectModel.JsonObject GetRestfulDatasetSchema (character, handle, logical, IBusinessEntityDescriptor) Returns the JSON RESTful Schema description for the ProDataset
+ LOGICAL HasAnnotationSchema (character, character) Checks if a schema definition has been defined for the Class Annotation
+ LogError (character, Error) LogManager Error Logging
+ Progress.Json.ObjectModel.JsonObject SetDescription (character) Returns the JSON Description
+ Progress.Json.ObjectModel.JsonObject SetResponseSchema (character) Returns the JSON Response Schema

Top Constructor Summary
Options Name Purpose
+ SwaggerHelper () Default constructor.


Method Detail
Top

PUBLIC CHARACTER AblTypeToCatalogType (character)

Purpose: Converts the given ABL Data Type into a Json Catalog type
Notes:

Parameters:
pcAblType CHARACTER
The ABL Data Type
Returns CHARACTER
The Json Catalog data type
Top

PUBLIC AddBufferFields (handle, JsonObject, character)

Purpose: Adds the temp-table field to the given JsonObject
Notes:

Parameters:
phBuffer HANDLE
The handle of the temp-table buffer
poJsonObject Progress.Json.ObjectModel.JsonObject
The JsonObject to add the field to
pcFields CHARACTER
The CAN-DO list of fields to add to the JsonObject to
Top

PUBLIC CHARACTER FindTemplate (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

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

Purpose: Retrieves Schema Definitions defined with the Class Annotation
Notes: If the @ParameterSchema Annotation is blank, then we pass back a generic JSON Object

Parameters:
pcClassName CHARACTER
pcRequestMethod CHARACTER
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject representing the schema
Top

PUBLIC Progress.Json.ObjectModel.JsonArray GetArrayValue (character)

Purpose: Returns the JSON Array for the given value
Notes:

Parameters:
cValue CHARACTER
The Array Value
Returns Progress.Json.ObjectModel.JsonArray
The JsonArray Values
Top

PUBLIC Consultingwerk.OERA.BusinessEntityDescriptor.IBusinessEntityDescriptor GetBusinessEntityDescriptor (character, handle)

Purpose: Generates a Business Entity Descriptor for the given Dataset
Notes:

Parameters:
pcEntityName CHARACTER
The name of the business entity
phDataset HANDLE
The current Business Entity Dataset
Returns Consultingwerk.OERA.BusinessEntityDescriptor.IBusinessEntityDescriptor
The BusinessEntityDescriptor
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetDatasetSchema (handle, logical, IBusinessEntityDescriptor)

Purpose: Returns the JSON Schema description for the ProDataset
Notes: Does not include the schema envelope

Parameters:
phDataset HANDLE
The ProDataset to return the schema for
lEnforceNested LOGICAL
Indicate whether the EnforceNestedRelations is used
oBusinessEntityDescriptor Consultingwerk.OERA.BusinessEntityDescriptor.IBusinessEntityDescriptor
The Business Entity Descriptor
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject representing the schema
Top

PUBLIC CHARACTER GetDescriptionAnnotation (character)

Purpose: Retreives the Business Entity Description Annotation
Notes: If the Description Annotation is blank, then we set the description to the
Business Entity name
The Catch Block is inplace so if ObjectAssert:IsValid fails, we still
continue and populate the description and generate a swagger file

Parameters:
pcEntityName CHARACTER
The Business Entity Name
Returns CHARACTER
The Business Entity Description Annotation
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetEnumProperties (Class, ValueFromEnum)

Purpose: Retreives the Enum Attributes for the specified Enum Class
Notes:

Parameters:
poClass Progress.Lang.Class
the Progress.Lang.Class of the Enum
poValueFrom Consultingwerk.Util.Enum.ValueFromEnum
The ValueFromEnum member that describes if the ValueList items will use the Enum's value (integer) or name as the data value
Returns Progress.Json.ObjectModel.JsonObject
The JSON Object containing the enum Details
Top

PUBLIC CHARACTER GetEnumValues (Class, ValueFromEnum)

Purpose: Retreives the Enum Attributes for the specified Enum Class
Notes:

Parameters:
poClass Progress.Lang.Class
the Progress.Lang.Class of the Enum
poValueFrom Consultingwerk.Util.Enum.ValueFromEnum
The ValueFromEnum member that describes if the ValueList items will use the Enum's value (integer) or name as the data value
Returns CHARACTER
Character delimited list containing the Enum Values
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetHeaderDetails ()

Purpose: Returns the Swagger Header Details defined in a Template File
Notes: Details shall be retrieved from the Swaggerfile.json Template file

Returns Progress.Json.ObjectModel.JsonObject
The JSON Object containing the header Details
Top

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

Purpose: Returns the JSON Path Response
Notes:

Parameters:
pcDefinition CHARACTER
Definition Response Name
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject for the Paths Response
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetRestfulDatasetSchema (character, handle, logical, IBusinessEntityDescriptor)

Purpose: Returns the JSON RESTful Schema description for the ProDataset
Notes: Does not include the schema envelope

Parameters:
pcSchemaName CHARACTER
The Schema Name to attach to Schema Definition
phDataset HANDLE
The ProDataset to return the schema for
lEnforceNested LOGICAL
Indicate whether the EnforceNestedRelations is used
oBusinessEntityDescriptor Consultingwerk.OERA.BusinessEntityDescriptor.IBusinessEntityDescriptor
The Business Entity Descriptor
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject representing the schema
Top

PUBLIC LOGICAL HasAnnotationSchema (character, character)

Purpose: Checks if a schema definition has been defined for the Class Annotation
Notes:

Parameters:
pcClassName CHARACTER
The Class Name
pcRequestMethod CHARACTER
The Request Method Name
Returns LOGICAL
Logical value indicating if a schema definition has been defined for the Class Annotation
Top

PUBLIC LogError (character, Error)

Purpose: LogManager Error Logging
Notes:

Parameters:
pcOperation CHARACTER
Operation Name
poError Progress.Lang.Error
Error Object
Top

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

Purpose: Returns the JSON Description
Notes:

Parameters:
pcDescription CHARACTER
Description Value for the JsonObject
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject for the Description Node
Top

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

Purpose: Returns the JSON Response Schema
Notes:

Parameters:
pcDataset CHARACTER
Description Value for the Definitions Dataset Node
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject for the Definitions Dataset Node


Constructor Detail
Top

PUBLIC SwaggerHelper ()

Purpose: Default constructor.
Notes: There's no need to create instances of the helper classes



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