relax

Class APIService

lucee.Component
    extended by relax.APIService

Copyright Ortus Solutions, Corp, All rights reserved www.ortussolutions.com --- The DSL Service

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    struct APIDefinitions
          Storage for API Definitions.

    • access = public
    • returntype = any
    true false
    any log


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any moduleService


    • access = public
    • returntype = any
    • inject = coldbox:moduleService
    true false
    boolean sessionsEnabled
          Flag that tell us if the underlying application leverages session scope.

    • access = public
    • returntype = any
    true false
    struct settings
          The relax module's settings.

    • access = public
    • returntype = any
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init(any settings)
          Constructor.
    Method Summary
    APIService clearUserData()
         Clears user data.
    any getAPI(any name)
         Get an API definition.
    string getAPIDefinitions()
    string getDefaultAPIName()
         Get the name of the default API.
    any getLoadedAPI()
         Get the loaded API representation.
    string getLoadedAPIName()
         Get the loaded API name.
    string getLog()
    string getModuleService()
    string getSessionsEnabled()
    string getSettings()
    string getWirebox()
    private any injectMixin(any name, any UDF)
         Injection method.
    private boolean isLegacyAPI(any dataCFC)
         Verifies if we have a legacy API or swagger.
    boolean isLoadedAPI()
         Checks if an API is loaded or not, usually by checking the user's data.
    query listAPIs()
         Get a listing of all the APIs in the resources folder.
    any loadAPI(any name)
         Load an API into the service and get its representation.
    private any loadDSLAPI(any dataCFC)
         Run Defaults and processing setup on a legacy DSL.
    private any loadOpenAPI(string definitionFile)
         Load an open api definition file via the Swagger SDK Parser object.
    private any newResponse()
         New response struct for importers.
    struct processAPIImport(struct collection)
         Import a relax API.
    APIService processConfiguration(any dataCFC)
         Process a relax configure method by injecting our Document.
    any setAPIDefinitions(struct APIDefinitions)
    any setLog(any log)
    any setModuleService(any moduleService)
    any setSessionsEnabled(boolean sessionsEnabled)
    any setSettings(struct settings)
    any setWirebox(any wirebox)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any settings)

    Constructor

    Parameters:
    settings - The relax module settings needed

    Property Detail

    APIDefinitions

    property struct APIDefinitions

    Storage for API Definitions

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    log

    property any log

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    moduleService

    property any moduleService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:moduleService
    serializable - true

    sessionsEnabled

    property boolean sessionsEnabled

    Flag that tell us if the underlying application leverages session scope

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    settings

    property struct settings

    The relax module's settings

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    clearUserData

    public APIService clearUserData()

    Clears user data


    getAPI

    public any getAPI(any name)

    Get an API definition

    Parameters:
    name - The name of the API to get.

    getAPIDefinitions

    public string getAPIDefinitions()


    getDefaultAPIName

    public string getDefaultAPIName()

    Get the name of the default API


    getLoadedAPI

    public any getLoadedAPI()

    Get the loaded API representation


    getLoadedAPIName

    public string getLoadedAPIName()

    Get the loaded API name


    getLog

    public string getLog()


    getModuleService

    public string getModuleService()


    getSessionsEnabled

    public string getSessionsEnabled()


    getSettings

    public string getSettings()


    getWirebox

    public string getWirebox()


    injectMixin

    private any injectMixin(any name, any UDF)

    Injection method

    Parameters:
    name - Name of function
    UDF - The UDF to inject

    isLegacyAPI

    private boolean isLegacyAPI(any dataCFC)

    Verifies if we have a legacy API or swagger

    Parameters:
    dataCFC - The CFC instance

    isLoadedAPI

    public boolean isLoadedAPI()

    Checks if an API is loaded or not, usually by checking the user's data


    listAPIs

    public query listAPIs()

    Get a listing of all the APIs in the resources folder


    loadAPI

    public any loadAPI(any name)

    Load an API into the service and get its representation. This can be a Relax.cfc or a Relax.json representation.

    Parameters:
    name - The API to load

    loadDSLAPI

    private any loadDSLAPI(any dataCFC)

    Run Defaults and processing setup on a legacy DSL

    Parameters:
    dataCFC - The legacy DSL

    loadOpenAPI

    private any loadOpenAPI(string definitionFile)

    Load an open api definition file via the Swagger SDK Parser object

    Parameters:
    definitionFile - The definition file to load

    newResponse

    private any newResponse()

    New response struct for importers


    processAPIImport

    public struct processAPIImport(struct collection)

    Import a relax API

    Parameters:
    collection - The collection which includes the API name and JSON representation

    processConfiguration

    public APIService processConfiguration(any dataCFC)

    Process a relax configure method by injecting our Document.cfc methods first

    Parameters:
    dataCFC - The data CFC to process

    setAPIDefinitions

    public any setAPIDefinitions(struct APIDefinitions)

    Parameters:
    APIDefinitions

    setLog

    public any setLog(any log)

    Parameters:
    log

    setModuleService

    public any setModuleService(any moduleService)

    Parameters:
    moduleService

    setSessionsEnabled

    public any setSessionsEnabled(boolean sessionsEnabled)

    Parameters:
    sessionsEnabled

    setSettings

    public any setSettings(struct settings)

    Parameters:
    settings

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox