Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
scl-gen Parameter SampleParameter Value1:Integer Value2:int Value3:dec Value4:log Value5

 


Requirements

The scaffolding utility is implemented using the scl-gen batch script. This batch script is located in the Consultingwerk/Studio/Scaffolding folder of the SmartComponent Library and should be added to the Windows PATH.

...

Code Block
languagec#
/*------------------------------------------------------------------------
    File        : OrdersInMonthQuery
    Purpose     :
    Syntax      :
    Description :
    Author(s)   : 
    Created     : 27.09.2017 21:29:10
    Notes       :
  ----------------------------------------------------------------------*/

USING Consultingwerk.OERA.* FROM PROPATH .

{Consultingwerk/products.i}

CLASS Test.OrdersInMonthQuery
    INHERITS NamedQueryParameter:

    /*------------------------------------------------------------------------------
        Purpose: Constructor for the OrdersInMonthQuery class
        Notes:
        @param pcMonth The Month query parameter
        @param pcYear The Year query parameter
    ------------------------------------------------------------------------------*/
    CONSTRUCTOR PUBLIC OrdersInMonthQuery (pcMonth AS CHARACTER,
                                           pcYear AS CHARACTER):
        SUPER ("OrdersInMonth":U).

        THIS-OBJECT:Parameters:Add ("Month":U, pcMonth) .
        THIS-OBJECT:Parameters:Add ("Year":U, pcYear) .

    END CONSTRUCTOR.

END CLASS.

Value Object

...

The following scaffolding command creates a cache for value objectsan immutable value object.

Code Block
scl-gen ValueObject ValueObjectCacheWeightValueObject CharacterHolderCache Consultingwerk.CharacterHolderWeight:decimal Unit

This creates the class file CharacterHolderCacheWeightValueObject.cls in the current directory:

Code Block
languageabl
/*------------------------------------------------------------------------
    File        : CharacterHolderCacheWeightValueObject
    Purpose     :
    Syntax      :
    Description :
    Author(s)   : 
    Created     : 2728.1205.20182019 2306:5853:0157
    Notes       :
  ----------------------------------------------------------------------*/

BLOCK-LEVEL ON ERROR UNDO, THROW.

{Consultingwerk/products.i}

USING Consultingwerk.Framework.Base.**                          FROM PROPATH .
USING Test.*                                    FROM PROPATH .
USING Progress.Lang.*                           FROM PROPATH .

{Consultingwerk/products.i}

CLASS Test.CharacterHolderCacheWeightValueObject
    INHERITS ValueObjectCacheBaseValueObject:

    {Consultingwerk/Framework/Base//**
     * Purpose: Returns the Weight value
     * Notes:
     */
    DEFINE PUBLIC PROPERTY Weight AS DECIMAL NO-UNDO 
    GET.
    PRIVATE SET.    

    /**
     * Purpose: Returns the Unit value
     * Notes:
     */
    DEFINE PUBLIC PROPERTY Unit AS CHARACTER NO-UNDO 
    GET.
    PRIVATE SET.    

    /**
     * Purpose: Constructor for the WeightValueObject class
     * Notes:
     * @param pWeight The value for the Weight property   
     * @param pUnit The value for the Unit property   
     */
    CONSTRUCTOR PUBLIC WeightValueObject (pWeight AS DECIMAL, pUnit AS CHARACTER):

        ASSIGN THIS-OBJECT:Weight = pWeight
               THIS-OBJECT:Unit = pUnit
                .

    END CONSTRUCTOR.

END CLASS.

Value Object Cache

The following scaffolding command creates a cache for value objects.

Code Block
scl-gen ValueObjectCache CharacterHolderCache Consultingwerk.CharacterHolder

This creates the class file CharacterHolderCache.cls in the current directory:

Code Block
languageabl
/*------------------------------------------------------------------------
    File        : CharacterHolderCache
    Purpose     :
    Syntax      :
    Description :
    Author(s)   : 
    Created     : 27.12.2018 23:58:01
    Notes       :
  ----------------------------------------------------------------------*/

BLOCK-LEVEL ON ERROR UNDO, THROW.

USING Consultingwerk.Framework.Base.*           FROM PROPATH .
USING Test.*                                    FROM PROPATH .
USING Progress.Lang.*                           FROM PROPATH .

{Consultingwerk/products.i}

CLASS Test.CharacterHolderCache
    INHERITS ValueObjectCacheBase:

    {Consultingwerk/Framework/Base/GenericValueObjectCache.i CharacterHolderCache Consultingwerk.CharacterHolder}

END CLASS.

...

Create an External Tools Configuration with the followinig settings:

SettingValue
NameCLI Console
Location${env_var:ComSpec}
Working Directory${resource_loc}
Allocate ConsoleChecked
Launch in BackgroundChecked

This configuration should be used in the following way: 

...

Now you can execute the scl-gen tools from the Console view: