Using Event Hooks And API Roundtable TSMS

3y ago
86 Views
3 Downloads
200.74 KB
7 Pages
Last View : 13d ago
Last Download : 3m ago
Upload by : Karl Gosselin
Transcription

Using Event Hooks and APIRoundtable TSMSRoundtable Development TeamTUGBOATSOFTWARE

Table of ContentsTable of Contents . 11Introduction . 22Intercepting Roundtable Events . 232.1The Event Procedure . 22.2Example – Enforcing Update Notes. 3Using the Roundtable API. 43.1The API Procedure . 43.2Example – Creating a Task . 43.2.13.2.23.2.33.2.44Initializing the API . 4Making the API Call . 5Shutting Down the API . 5The Entire Procedure . 5Conclusion . 6

1 IntroductionRoundtable TSMS delivers Software Configuration Management benefits to yourOpenEdge development environment. The Roundtable event hook extensions andapplication programming interface allow you to take those benefits one step further byautomating processes as well as enhancing or overriding default behavior. SinceRoundtable is written in the OpenEdge ABL, all event hook and API coding is also doneusing the ABL!The Roundtable event hook extensions allow you to customize behavior without havingto modify Roundtable source code. All event hooks are implemented through a singleevent procedure. Each time an event occurs in Roundtable, such as checking-in anObject or creating a Task, Roundtable publishes both before and after context of thisevent to the event procedure. This allows you to build single point of intercept for allevent hooks.The Roundtable API is also designed for simplicity and portability by providing a singleentry point for all API calls. This methodology insulates your custom applications fromchanges made to Roundtable core architecture and ensures that your customizations willcontinue to work with upgrades and service packs.This white paper provides a head start on using the Roundtable GUI client or server eventhandler and API in Roundtable TSMS 9.1D and greater.2 Intercepting Roundtable EventsThe Roundtable event handler extension makes use of the ABL PUBLISH andSUBSCRIBE statements.2.1 The Event ProcedureRoundtable publishes before and after context to the Roundtable event handler procedure.This procedure is deployed as source and is located in rtb install dir /rtb events.p.Every time a supported event occurs, the following parameters are published in activeOpenEdge session to the event handler R.LOGICAL INIT YES.Parameter Descriptionp eventp contextp otherp okThe name of event.The context in which the hook was called, such as the ROWID of the recordbeing acted upon.Additional context information that may be needed by programs intercepting thehook, such as the Workspace currently selected during the intercepted event.Setting to FALSE will allow you to cancel default behavior from the “before”event hooks.2

Please see the Roundtable TSMS User Guide or the comments at the top of rtb events.pfor a complete description of published events and the data passed in each parameter.2.2 Example – Enforcing Update NotesA common example of enhancing default behavior would be to disallow the check-in ofan Object version that does not have update notes. This simple customization ensuresthat developers document changes that they made to an Object version.PROCEDURE evRtbUserEvent ---------------------------Purpose:Roundtable Event HandlerParameters: PeventPcontextPotherPokNotes:RETURN a value from this procedure to return an error messageto the ---------------------------------*/DEFINE INPUT PARAMETER PeventAS CHARACTER.DEFINE INPUT PARAMETER Pcontext AS CHARACTER.DEFINE INPUT PARAMETER PotherAS CHARACTER.DEFINE OUTPUT PARAMETER PokAS LOGICAL INIT YES.DEFINE VARIABLE cError AS CHARACTER NO-UNDO INITIAL "".IF Pevent "checkinObjectBefore" THEN EHANDLEHANDLENO-UNDO.NO-UNDO.NO-UNDO.NO-UNDO./*Use Roundtable proxy procedures to get the Object and Version data*/RUN rtb/proxy/p/rtbGetObjectByRowid.p(INPUT Pcontext, OUTPUT TABLE-HANDLE hObj).hObjBuf hObj:DEFAULT-BUFFER-HANDLE.hObjBuf:FIND-FIRST.RUN rtb/proxy/p/rtbGetVersionByRowid.p(INPUT hObjBuf::objVersionRowid, OUTPUT TABLE-HANDLE hVer).hVerBuf hVer:DEFAULT-BUFFER-HANDLE.hVerBuf:FIND-FIRST./*If not update notes are present, set the error message*/IF hVerBuf::upd-notes "" THEN DO:cError "Object version update notes cannot be blank!".pOk FALSE.END.DELETE OBJECT hVer NO-ERROR.DELETE OBJECT hObj NO-ERROR.END.RETURN cError.END PROCEDURE.3

Since the rtb object ROWID is passed via Pcontext, it could have been possible to lookup in the rtb object and rtb ver records directly. However, direct access of theRoundtable repository database is discouraged unless absolutely necessary.3 Using the Roundtable APIThe Roundtable API provides access to common Roundtable functionality through asingle procedure. The API can be run either stand-alone or from within an activeRoundtable session.3.1 The API ProcedureThe Roundtable API procedure is deployed as source and is located in rtb installdir /rtb/p/rtb api.p. Complete details on using the API can be found in the definitionssection of the API procedure.3.2 Example – Creating a Task3.2.1 Initializing the APIIn its most basic form, initializing the API is just a matter running the API procedurepersistently and obtaining its handle. In this example, it is assumed that we are runningthe API as a stand-alone process therefore there are additional initialization steps neededto set the environment./*Roundtable add task API example*/&SCOPED-DEFINE RTB -UNDO.NO-UNDO.IF NOT CONNECTED("rtb") THENCONNECT -db rtb.db -1.ASSIGNcDlcPath PROPATH /* Preserve the default PROPATH */PROPATH {&RTB} "," cDlcPath.RUN rtb/p/rtb api.p PERSISTENT SET hApi.RUN login IN hApi(INPUT "sysop",/* User */INPUT "password", /* Password */OUTPUT iSid,/* Session-Id */OUTPUT cError).RUN set paths IN hApi(INPUT {&RTB},/* RTB Install Path */INPUT cDlcPath,/* Default PROPATH */OUTPUT cError).4

3.2.2 Making the API CallOnce the API procedure is running, it is now just a matter of calling the appropriateroutine in hApi with the appropriate parameters. The following example creates a newTask in the Roundtable repository.RUN add task IN hApi(INPUT "devel",INPUT "sysop",INPUT "sysop",INPUT "Task summary",INPUT "",INPUT "Task description",INPUT "Central",INPUT "",OUTPUT rTaskRecid,OUTPUT cError)./*/*/*/*/*/*/*/*/*Task Workspace */Task User */Task Manager */Task Summary */User Ref */Task Description */Share Status */Task Directory */rtb task RECID */3.2.3 Shutting Down the APIWhen you are done, you should log out of the Roundtable session and delete the APIprocedure that is running persistently.RUN logout IN hApi(INPUT iSid,/* Session-Id */OUTPUT cError).DELETE PROCEDURE hApi NO-ERROR.3.2.4 The Entire ProcedureBelow is the entire add task API example. Please note that this is not a productionquality example. It would be up to you to add necessary error checking and otheroptimizations. For this white paper, I wanted to keep the code as simple as possible./*Roundtable add task API example*/&SCOPED-DEFINE RTB -UNDO.NO-UNDO.IF NOT CONNECTED("rtb") THENCONNECT -db rtb.db -1.ASSIGNcDlcPath PROPATH /* Preserve the default PROPATH */PROPATH {&RTB} "," cDlcPath.RUN rtb/p/rtb api.p PERSISTENT SET hApi.RUN login IN hApi(INPUT "sysop",/* User */INPUT "password", /* Password */OUTPUT iSid,/* Session-Id */OUTPUT cError).RUN set paths IN hApi(INPUT {&RTB},/* RTB Install Path */INPUT cDlcPath,/* Default PROPATH */OUTPUT cError).5

RUN add task IN hApi(INPUT "devel",INPUT "sysop",INPUT "sysop",INPUT "Task summary",INPUT "",INPUT "Task description",INPUT "Central",INPUT "",OUTPUT rTaskRecid,OUTPUT cError)./*/*/*/*/*/*/*/*/*Task Workspace */Task User */Task Manager */Task Summary */User Ref */Task Description */Share Status */Task Directory */rtb task RECID */RUN logout IN hApi(INPUT iSid,/* Session-Id */OUTPUT cError).DELETE PROCEDURE hApi NO-ERROR.RETURN.4 ConclusionUsing the Roundtable TSMS event handler or API is fairly straight-forward and simple.By combining your OpenEdge ABL expertise with your Roundtable knowledge, you willsoon be on your way to creating useful and time-saving extensions and customizations.Good luck!6

The Roundtable API procedure is deployed as source and is located in /rtb/p/rtb_api.p. Complete details on using the API can be found in the definitions section of the API procedure. 3.2 Example – Creating a Task 3.2.1 Initializing the API In its most basic form, initializing the API is just a matter running the API procedure

Related Documents:

EYES Screw Eyes 4, 14 Storm Window Eyes 13 HOOKS Clothesline Hooks 18 (Lag Thread, Machine Thread, Plate Style) Coat & Hat Hooks 21 Cup Hooks, Brass 13 Curtain Rod Hooks 15 Gate Hooks with Eyes or Staples 17 Safety Gate Hooks 17 Hammock Hooks 19 (Lag Thread, Plate Style) Parallel Hooks 15 Peg Hooks 22 - 24 Planter Hooks 17 Porch Swing Hooks 19 .File Size: 872KB

Event 406 - Windows Server 2019 58 Event 410 58 Event 411 59 Event 412 60 Event 413 60 Event 418 60 Event 420 61 Event 424 61 Event 431 61 Event 512 62 Event 513 62 Event 515 63 Event 516 63 Event 1102 64 Event 1200 64 Event 1201 64 Event 1202 64 Event 1203 64 Event 1204 64

FLY TYING HOOK SIZING CHART Roundbend Treble Hooks Octopus Hooks www.jannsnetcraft.com Aberdeen Jig Hooks Turned Down Eye Sproat Hooks Central Draught Hooks 60 Bend Jig Hooks Mustad 3261 Live Bait Hook and Ice Jig Hook 3261GL - Ice, Live Bait 3261NI - Ice, Live Bait 3261BR - Live Bait Only. 1/64" SIZE METRIC (MM) FRACTION INCHES

api 20 e rapid 20e api 20 ne api campy api nh api staph api 20 strep api coryne api listeriaapi 20 c aux api 20 a rapid id 32 a api 50 ch api 50 chb/e 50 chl reagents to be ordered. strips ref microorganisms suspension inoculum transfer medium i

Latest API exams,latest API-571 dumps,API-571 pdf,API-571 vce,API-571 dumps,API-571 exam questions,API-571 new questions,API-571 actual tests,API-571 practice tests,API-571 real exam questions Created Date

The hooks infrastructure is separatede in two parts, the hook dispatcher, and the actual hooks. The dispatcher is in charge of deciding which hooks to run for each event, and gives the final review on the change. The hooks themselves are the ones that actually do checks (or any other action needed) and where the actual login you

3 API Industry Guide on API Design Apiary - Apiary jump-started the modern API design movement by making API definitions more than just about API documentation, allowing API designers to define APIs in the machine-readable API definition format API blueprint, then mock, share, and publish

Std. 12th Economics Smart Notes, Commerce and Arts (MH Board) Author: Target Publications Subject: Economics Keywords: economics notes class 12, 12th commerce, 12th economics book , 12th commerce books, class 12 economics book, maharashtra state board books for 12th, smart notes, 12th std economics book , 12th economics book maharashtra board, 12th economics guide , maharashtra hsc board .