Page tree

Versions Compared

Key

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

...

Code Block
titleSample: TestContextWrapperImpl
linenumberstrue
collapsetrue
USING Progress.Lang.*.
USING Akioma.Swat.OERA.ContextTest.ITestContextWrapper FROM PROPATH.
USING Akioma.Swat.OERA.Context.BaseContextWrapperImpl FROM PROPATH.
USING Akioma.Swat.SessionManager FROM PROPATH.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS Test.TestContextWrapperImpl
    INHERITS BaseContextWrapperImpl
    IMPLEMENTS ITestContextWrapper : 
    
	DEFINE PUBLIC PROPERTY TestProperty1 AS CHARACTER NO-UNDO
    GET ():
        IF NOT IsValidateSessionContext ("Get":U) THEN
            RETURN ?.
        RETURN GetSessionContextField ("TestProperty1"):BUFFER-VALUE .
    END GET .
    SET (arg AS CHARACTER):
        IsValidateSessionContext ("Set":U).
        GetSessionContextField ("TestProperty1"):BUFFER-VALUE = arg .
    END SET.
??
	DEFINE PUBLIC PROPERTY TestProperty2 AS CHARACTER NO-UNDO
    GET ():
        IF NOT IsValidateSessionContext ("Get":U) THEN
            RETURN ?.
        RETURN GetSessionContextField ("TestProperty2"):BUFFER-VALUE .
    END GET .
    SET (arg AS CHARACTER):
        IsValidateSessionContext ("Set":U).
        GetSessionContextField ("TestProperty2"):BUFFER-VALUE = arg .
    END SET.
    
    CONSTRUCTOR TestContextWrapperImpl():
        SUPER().
        THIS-OBJECT:ContextTableName = "eTestSessionContext".
    END CONSTRUCTOR.

END CLASS.

 

Once all the classes are available the services file needs to be updated to use them:

Code Block
titleSample: Services file entries
linenumberstrue
collapsetrue
	<ttServiceLoaderRow>
		<Order>210</Order>
		<ServiceTypeName>Consultingwerk.Framework.Server.IContextDatasetStore</ServiceTypeName>
		<ServiceClassName>Akioma.Swat.OERA.Context.SwatContextDatasetStore</ServiceClassName>
	</ttServiceLoaderRow>
	<ttServiceLoaderRow>
		<Order>211</Order>
		<ServiceTypeName>Consultingwerk.OERA.Context.IContextDatasetFactory</ServiceTypeName>
		<ServiceClassName>Test.TestContextDatasetFactory</ServiceClassName>
	</ttServiceLoaderRow>