Add %age area column to vacancies section.
[capital-apms-progress.git] / rplctn / b-reptrg.w
blobfb75f4b81b7138a65a36b24fa3459fa38e66004f
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 /* Connected Databases
4 ttpl PROGRESS
5 */
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
8 /*------------------------------------------------------------------------
10 File:
12 Description: from BROWSER.W - Basic SmartBrowser Object Template
14 Input Parameters:
15 <none>
17 Output Parameters:
18 <none>
20 ------------------------------------------------------------------------*/
21 /* This .W file was created with the Progress UIB. */
22 /*----------------------------------------------------------------------*/
24 /* Create an unnamed pool to store all the widgets created
25 by this procedure. This is a good default which assures
26 that this procedure's triggers and internal procedures
27 will execute in this procedure's storage, and that proper
28 cleanup will occur on deletion of the procedure. */
30 CREATE WIDGET-POOL.
32 /* *************************** Definitions ************************** */
34 /* Parameters Definitions --- */
36 /* Local Variable Definitions --- */
38 DEF VAR current-triggers AS CHAR FORMAT "X(3)" LABEL "Currently" NO-UNDO.
39 DEF VAR df-name AS CHAR NO-UNDO INIT "rplctn\reptrig.df".
41 /* _UIB-CODE-BLOCK-END */
42 &ANALYZE-RESUME
45 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
47 /* ******************** Preprocessor Definitions ******************** */
49 &Scoped-define PROCEDURE-TYPE SmartBrowser
51 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
53 /* Name of first Frame and/or Browse and/or first Query */
54 &Scoped-define FRAME-NAME F-Main
55 &Scoped-define BROWSE-NAME br_table
57 /* Internal Tables (found by Frame, Query & Browse Queries) */
58 &Scoped-define INTERNAL-TABLES ReplTrigger
60 /* Define KEY-PHRASE in case it is used by any query. */
61 &Scoped-define KEY-PHRASE TRUE
63 /* Definitions for BROWSE br_table */
64 &Scoped-define FIELDS-IN-QUERY-br_table ReplTrigger.TableToRepl ~
65 ReplTrigger.Activity current-triggers @ current-triggers
66 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table ReplTrigger.TableToRepl ~
67 ReplTrigger.Activity
68 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table~
69 ~{&FP1}TableToRepl ~{&FP2}TableToRepl ~{&FP3}~
70 ~{&FP1}Activity ~{&FP2}Activity ~{&FP3}
71 &Scoped-define ENABLED-TABLES-IN-QUERY-br_table ReplTrigger
72 &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-br_table ReplTrigger
73 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH ReplTrigger WHERE ~{&KEY-PHRASE} NO-LOCK ~
74 ~{&SORTBY-PHRASE}.
75 &Scoped-define TABLES-IN-QUERY-br_table ReplTrigger
76 &Scoped-define FIRST-TABLE-IN-QUERY-br_table ReplTrigger
79 /* Definitions for FRAME F-Main */
81 /* Standard List Definitions */
82 &Scoped-Define ENABLED-OBJECTS br_table RECT-1 cmb_table tgl_create ~
83 tgl_modify tgl_delete
84 &Scoped-Define DISPLAYED-OBJECTS cmb_table tgl_create tgl_modify tgl_delete
86 /* Custom List Definitions */
87 /* List-1,List-2,List-3,List-4,List-5,List-6 */
89 /* _UIB-PREPROCESSOR-BLOCK-END */
90 &ANALYZE-RESUME
93 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
94 /* Actions: ? adm/support/keyedit.w ? ? ? */
95 /* STRUCTURED-DATA
96 <KEY-OBJECT>
97 &BROWSE-NAME
98 </KEY-OBJECT>
99 <FOREIGN-KEYS>
100 </FOREIGN-KEYS
101 ><EXECUTING-CODE>
102 **************************
103 * Set attributes related to FOREIGN KEYS
105 RUN set-attribute-list (
106 'Keys-Accepted = "",
107 Keys-Supplied = ""':U).
108 /**************************
109 </EXECUTING-CODE> */
111 /* _UIB-CODE-BLOCK-END */
112 &ANALYZE-RESUME
114 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
115 /* Actions: ? adm/support/advqedit.w ? ? ? */
116 /* STRUCTURED-DATA
117 <KEY-OBJECT>
118 &BROWSE-NAME
119 </KEY-OBJECT>
120 <SORTBY-OPTIONS>
121 </SORTBY-OPTIONS>
122 <SORTBY-RUN-CODE>
123 ************************
124 * Set attributes related to SORTBY-OPTIONS */
125 RUN set-attribute-list (
126 'SortBy-Options = ""':U).
127 /************************
128 </SORTBY-RUN-CODE>
129 <FILTER-ATTRIBUTES>
130 </FILTER-ATTRIBUTES> */
132 /* _UIB-CODE-BLOCK-END */
133 &ANALYZE-RESUME
136 /* *********************** Control Definitions ********************** */
139 /* Definitions of the field level widgets */
140 DEFINE VARIABLE cmb_table AS CHARACTER FORMAT "X(256)":U
141 VIEW-AS COMBO-BOX INNER-LINES 15
142 LIST-ITEMS " "
143 SIZE 17.14 BY 1 NO-UNDO.
145 DEFINE RECTANGLE RECT-1
146 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
147 SIZE 16.57 BY 4.
149 DEFINE VARIABLE tgl_create AS LOGICAL INITIAL no
150 LABEL "Create"
151 VIEW-AS TOGGLE-BOX
152 SIZE 8 BY 1 NO-UNDO.
154 DEFINE VARIABLE tgl_delete AS LOGICAL INITIAL no
155 LABEL "Delete"
156 VIEW-AS TOGGLE-BOX
157 SIZE 8 BY 1 NO-UNDO.
159 DEFINE VARIABLE tgl_modify AS LOGICAL INITIAL no
160 LABEL "Modify"
161 VIEW-AS TOGGLE-BOX
162 SIZE 8 BY 1 NO-UNDO.
164 /* Query definitions */
165 &ANALYZE-SUSPEND
166 DEFINE QUERY br_table FOR
167 ReplTrigger SCROLLING.
168 &ANALYZE-RESUME
170 /* Browse definitions */
171 DEFINE BROWSE br_table
172 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
173 QUERY br_table NO-LOCK DISPLAY
174 ReplTrigger.TableToRepl
175 ReplTrigger.Activity COLUMN-LABEL "Rules"
176 current-triggers @ current-triggers
177 ENABLE
178 ReplTrigger.TableToRepl
179 ReplTrigger.Activity
180 /* _UIB-CODE-BLOCK-END */
181 &ANALYZE-RESUME
182 WITH NO-ASSIGN NO-ROW-MARKERS SEPARATORS SIZE 38.29 BY 15.6
183 BGCOLOR 15 FONT 10.
186 /* ************************ Frame Definitions *********************** */
188 DEFINE FRAME F-Main
189 br_table AT ROW 1 COL 1
190 cmb_table AT ROW 2.2 COL 38.43 COLON-ALIGNED NO-LABEL
191 tgl_create AT ROW 4.6 COL 43.29
192 tgl_modify AT ROW 5.6 COL 43.29
193 tgl_delete AT ROW 6.6 COL 43.29
194 "Table:" VIEW-AS TEXT
195 SIZE 8 BY 1 AT ROW 1.2 COL 40.43
196 "Replicate Changes on:" VIEW-AS TEXT
197 SIZE 15.43 BY 1 AT ROW 3.6 COL 41
198 RECT-1 AT ROW 4 COL 40.43
199 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
200 SIDE-LABELS NO-UNDERLINE THREE-D
201 AT COL 1 ROW 1 SCROLLABLE
202 FONT 10.
205 /* *********************** Procedure Settings ************************ */
207 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
208 /* Settings for THIS-PROCEDURE
209 Type: SmartBrowser
210 Allow: Basic,Browse
211 Frames: 1
212 Add Fields to: EXTERNAL-TABLES
213 Other Settings: PERSISTENT-ONLY COMPILE
216 /* This procedure should always be RUN PERSISTENT. Report the error, */
217 /* then cleanup and return. */
218 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
219 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
220 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
221 RETURN.
222 END.
224 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
226 /* ************************* Create Window ************************** */
228 &ANALYZE-SUSPEND _CREATE-WINDOW
229 /* DESIGN Window definition (used by the UIB)
230 CREATE WINDOW B-table-Win ASSIGN
231 HEIGHT = 16.6
232 WIDTH = 61.86.
233 /* END WINDOW DEFINITION */
235 &ANALYZE-RESUME
238 /* *************** Runtime Attributes and UIB Settings ************** */
240 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
241 /* SETTINGS FOR WINDOW B-table-Win
242 NOT-VISIBLE,,RUN-PERSISTENT */
243 /* SETTINGS FOR FRAME F-Main
244 NOT-VISIBLE Size-to-Fit */
245 /* BROWSE-TAB br_table 1 F-Main */
246 ASSIGN
247 FRAME F-Main:SCROLLABLE = FALSE
248 FRAME F-Main:HIDDEN = TRUE.
250 /* _RUN-TIME-ATTRIBUTES-END */
251 &ANALYZE-RESUME
254 /* Setting information for Queries and Browse Widgets fields */
256 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
257 /* Query rebuild information for BROWSE br_table
258 _TblList = "ttpl.ReplTrigger"
259 _Options = "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
260 _FldNameList[1] > ttpl.ReplTrigger.TableToRepl
261 "ReplTrigger.TableToRepl" ? ? "character" ? ? ? ? ? ? yes ?
262 _FldNameList[2] > ttpl.ReplTrigger.Activity
263 "ReplTrigger.Activity" "Rules" ? "character" ? ? ? ? ? ? yes ?
264 _FldNameList[3] > "_<CALC>"
265 "current-triggers @ current-triggers" ? ? ? ? ? ? ? ? ? no ?
266 _Query is NOT OPENED
267 */ /* BROWSE br_table */
268 &ANALYZE-RESUME
270 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
271 /* Query rebuild information for FRAME F-Main
272 _Options = "NO-LOCK"
273 _Query is NOT OPENED
274 */ /* FRAME F-Main */
275 &ANALYZE-RESUME
280 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
281 /* ************************* Included-Libraries *********************** */
283 {src/adm/method/browser.i}
284 {inc/method/m-drlvwr.i}
286 /* _UIB-CODE-BLOCK-END */
287 &ANALYZE-RESUME
292 /* ************************ Control Triggers ************************ */
294 &Scoped-define BROWSE-NAME br_table
295 &Scoped-define SELF-NAME br_table
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
297 ON ROW-DISPLAY OF br_table IN FRAME F-Main
299 current-triggers:FGCOLOR IN BROWSE {&BROWSE-NAME} = 2.
300 END.
302 /* _UIB-CODE-BLOCK-END */
303 &ANALYZE-RESUME
306 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
307 ON ROW-ENTRY OF br_table IN FRAME F-Main
309 /* This code displays initial values for newly added or copied rows. */
310 {src/adm/template/brsentry.i}
311 END.
313 /* _UIB-CODE-BLOCK-END */
314 &ANALYZE-RESUME
317 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
318 ON ROW-LEAVE OF br_table IN FRAME F-Main
320 /* Do not disable this code or no updates will take place except
321 by pressing the Save button on an Update SmartPanel. */
322 {src/adm/template/brsleave.i}
323 END.
325 /* _UIB-CODE-BLOCK-END */
326 &ANALYZE-RESUME
329 &Scoped-define SELF-NAME ReplTrigger.TableToRepl
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ReplTrigger.TableToRepl br_table _BROWSE-COLUMN B-table-Win
331 ON LEAVE OF ReplTrigger.TableToRepl IN BROWSE br_table /* Table */
333 IF NOT AVAILABLE ReplTrigger THEN RETURN.
335 DEF VAR widg-ent AS WIDGET-HANDLE NO-UNDO.
336 widg-ent = LAST-EVENT:WIDGET-ENTER.
337 /* Check to see if delete was pressed - Crude */
338 IF VALID-HANDLE( widg-ent ) AND
339 INDEX( REPLACE( widg-ent:LABEL, "&", "" ), "delete" ) <> 0 THEN RETURN.
341 IF NOT CAN-FIND( FIRST _File WHERE _File._File-Name = SELF:SCREEN-VALUE ) THEN DO:
342 MESSAGE "The table" SELF:SCREEN-VALUE "does not exist!"
343 VIEW-AS ALERT-BOX ERROR TITLE "Invalid Table Name".
344 RETURN NO-APPLY.
345 END.
346 END.
348 /* _UIB-CODE-BLOCK-END */
349 &ANALYZE-RESUME
352 &Scoped-define SELF-NAME cmb_table
353 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_table B-table-Win
354 ON VALUE-CHANGED OF cmb_table IN FRAME F-Main
356 RUN table-changed.
357 END.
359 /* _UIB-CODE-BLOCK-END */
360 &ANALYZE-RESUME
363 &Scoped-define SELF-NAME tgl_create
364 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tgl_create B-table-Win
365 ON VALUE-CHANGED OF tgl_create IN FRAME F-Main /* Create */
367 RUN options-changed.
368 END.
370 /* _UIB-CODE-BLOCK-END */
371 &ANALYZE-RESUME
374 &Scoped-define SELF-NAME tgl_delete
375 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tgl_delete B-table-Win
376 ON VALUE-CHANGED OF tgl_delete IN FRAME F-Main /* Delete */
378 RUN options-changed.
379 END.
381 /* _UIB-CODE-BLOCK-END */
382 &ANALYZE-RESUME
385 &Scoped-define SELF-NAME tgl_modify
386 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tgl_modify B-table-Win
387 ON VALUE-CHANGED OF tgl_modify IN FRAME F-Main /* Modify */
389 RUN options-changed.
390 END.
392 /* _UIB-CODE-BLOCK-END */
393 &ANALYZE-RESUME
396 &UNDEFINE SELF-NAME
398 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
401 /* *************************** Main Block *************************** */
403 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
404 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
405 &ENDIF
407 ON FIND OF ReplTrigger OVERRIDE DO:
408 FIND _File WHERE _File._File-Name = ReplTrigger.TableToRepl
409 NO-LOCK NO-ERROR.
411 IF AVAILABLE _File THEN DO:
412 current-triggers =
413 ( IF CAN-FIND( _File-Trig WHERE _File-Trig._File-Recid = RECID( _File )
414 AND _File-Trig._Event = "REPLICATION-CREATE" )
415 THEN "C" ELSE "" ) +
416 ( IF CAN-FIND( _File-Trig WHERE _File-Trig._File-Recid = RECID( _File )
417 AND _File-Trig._Event = "REPLICATION-WRITE" )
418 THEN "M" ELSE "" ) +
419 ( IF CAN-FIND( _File-Trig WHERE _File-Trig._File-Recid = RECID( _File )
420 AND _File-Trig._Event = "REPLICATION-DELETE" )
421 THEN "D" ELSE "" ).
422 END.
423 IF current-triggers = "" THEN current-triggers = "---".
424 END.
426 ReplTrigger.Activity:READ-ONLY IN BROWSE {&BROWSE-NAME} = Yes.
427 ReplTrigger.TableToRepl:READ-ONLY IN BROWSE {&BROWSE-NAME} = Yes.
429 /* _UIB-CODE-BLOCK-END */
430 &ANALYZE-RESUME
433 /* ********************** Internal Procedures *********************** */
435 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
436 PROCEDURE adm-row-available :
437 /*------------------------------------------------------------------------------
438 Purpose: Dispatched to this procedure when the Record-
439 Source has a new row available. This procedure
440 tries to get the new row (or foriegn keys) from
441 the Record-Source and process it.
442 Parameters: <none>
443 ------------------------------------------------------------------------------*/
445 /* Define variables needed by this internal procedure. */
446 {src/adm/template/row-head.i}
448 /* Process the newly available records (i.e. display fields,
449 open queries, and/or pass records on to any RECORD-TARGETS). */
450 {src/adm/template/row-end.i}
452 END PROCEDURE.
454 /* _UIB-CODE-BLOCK-END */
455 &ANALYZE-RESUME
458 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE clear-all-rules B-table-Win
459 PROCEDURE clear-all-rules :
460 /*------------------------------------------------------------------------------
461 Purpose:
462 ------------------------------------------------------------------------------*/
464 FOR EACH ReplTrigger EXCLUSIVE-LOCK:
465 ReplTrigger.Activity = "".
466 END.
468 RUN dispatch( 'open-query':U ).
470 END PROCEDURE.
472 /* _UIB-CODE-BLOCK-END */
473 &ANALYZE-RESUME
476 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
477 PROCEDURE disable_UI :
478 /*------------------------------------------------------------------------------
479 Purpose: DISABLE the User Interface
480 Parameters: <none>
481 Notes: Here we clean-up the user-interface by deleting
482 dynamic widgets we have created and/or hide
483 frames. This procedure is usually called when
484 we are ready to "clean-up" after running.
485 ------------------------------------------------------------------------------*/
486 /* Hide all frames. */
487 HIDE FRAME F-Main.
488 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
489 END PROCEDURE.
491 /* _UIB-CODE-BLOCK-END */
492 &ANALYZE-RESUME
495 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE force-all-rules B-table-Win
496 PROCEDURE force-all-rules :
497 /*------------------------------------------------------------------------------
498 Purpose:
499 ------------------------------------------------------------------------------*/
501 FOR EACH ReplTrigger EXCLUSIVE-LOCK:
502 ReplTrigger.Activity = "CMD".
503 END.
505 RUN dispatch( 'open-query':U ).
507 END PROCEDURE.
509 /* _UIB-CODE-BLOCK-END */
510 &ANALYZE-RESUME
513 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-value-changed B-table-Win
514 PROCEDURE inst-value-changed :
515 /*------------------------------------------------------------------------------
516 Purpose:
517 Parameters: <none>
518 Notes:
519 ------------------------------------------------------------------------------*/
521 RUN trigger-changed.
522 RUN set-link-attributes IN sys-mgr( THIS-PROCEDURE, "delete-record", "SENSITIVE = " +
523 IF AVAILABLE ReplTrigger THEN "Yes" ELSE "No" ).
526 END PROCEDURE.
528 /* _UIB-CODE-BLOCK-END */
529 &ANALYZE-RESUME
532 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-add-record B-table-Win
533 PROCEDURE local-add-record :
534 /*------------------------------------------------------------------------------
535 Purpose:
536 Parameters: <none>
537 Notes:
538 ------------------------------------------------------------------------------*/
540 RUN dispatch( 'add-record':U ).
541 RUN table-changed.
543 END PROCEDURE.
545 /* _UIB-CODE-BLOCK-END */
546 &ANALYZE-RESUME
549 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-destroy B-table-Win
550 PROCEDURE local-destroy :
551 /*------------------------------------------------------------------------------
552 Purpose: Override standard ADM method
553 Notes:
554 ------------------------------------------------------------------------------*/
556 /* Code placed here will execute PRIOR to standard behavior. */
557 IF AVAILABLE ReplTrigger THEN RUN dispatch( 'update-record':U ).
559 /* Dispatch standard ADM method. */
560 RUN dispatch IN THIS-PROCEDURE ( INPUT 'destroy':U ) .
562 /* Code placed here will execute AFTER standard behavior. */
564 END PROCEDURE.
566 /* _UIB-CODE-BLOCK-END */
567 &ANALYZE-RESUME
570 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE match-database B-table-Win
571 PROCEDURE match-database :
572 /*------------------------------------------------------------------------------
573 Purpose: Regenerate the dump rules according to the database triggers
574 ------------------------------------------------------------------------------*/
576 IF AVAILABLE ReplTrigger THEN RUN dispatch( 'update-record':U ).
578 MESSAGE
579 "Are you sure you want to regenerate this table" SKIP
580 "from the existing database triggers?"
581 VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO TITLE "Proceed ?"
582 UPDATE regenerate-it AS LOGI.
584 IF NOT regenerate-it THEN RETURN.
586 RUN rplctn/db2rptrg.p .
588 RUN dispatch( 'open-query':U ).
590 END PROCEDURE.
592 /* _UIB-CODE-BLOCK-END */
593 &ANALYZE-RESUME
596 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE options-changed B-table-Win
597 PROCEDURE options-changed :
598 /*------------------------------------------------------------------------------
599 Purpose:
600 Parameters: <none>
601 Notes:
602 ------------------------------------------------------------------------------*/
604 DO WITH FRAME {&FRAME-NAME}:
605 IF NOT AVAILABLE ReplTrigger THEN RETURN.
606 DEF VAR act AS CHAR NO-UNDO.
607 ASSIGN FRAME {&FRAME-NAME} tgl_create tgl_modify tgl_delete.
608 act = ( IF tgl_create THEN "C" ELSE "" ) +
609 ( IF tgl_modify THEN "M" ELSE "" ) +
610 ( IF tgl_delete THEN "D" ELSE "" ).
611 ReplTrigger.Activity:SCREEN-VALUE IN BROWSE {&BROWSE-NAME} = act.
612 /* Ensure that the record gets updated */
613 RUN dispatch( 'update-record':U ).
614 END.
616 END PROCEDURE.
618 /* _UIB-CODE-BLOCK-END */
619 &ANALYZE-RESUME
622 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-initialize B-table-Win
623 PROCEDURE pre-initialize :
624 /*------------------------------------------------------------------------------
625 Purpose:
626 ------------------------------------------------------------------------------*/
628 /* Populate the table name combo */
630 FOR EACH _File WHERE NOT _File._File-Name BEGINS "_" NO-LOCK:
631 IF cmb_table:ADD-LAST( _File._File-Name ) IN FRAME {&FRAME-NAME} THEN.
632 END.
634 END PROCEDURE.
636 /* _UIB-CODE-BLOCK-END */
637 &ANALYZE-RESUME
640 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE regenerate-df B-table-Win
641 PROCEDURE regenerate-df :
642 /*------------------------------------------------------------------------------
643 Purpose: Regenerate a schema df file containing all
644 of the instructions necessary to add replication
645 triggers to all of the tables that have dump rules
646 Parameters: <none>
647 Notes:
648 ------------------------------------------------------------------------------*/
650 IF AVAILABLE ReplTrigger THEN RUN dispatch( 'update-record':U ).
652 MESSAGE
653 "You should only regenerate the replication schema" SKIP
654 "from a pre-production database." SKIP(1)
655 "Are you sure you want to continue?"
656 VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO TITLE "Proceed ?"
657 UPDATE regenerate-it AS LOGI.
659 IF NOT regenerate-it THEN RETURN.
661 RUN rplctn\mkreptrg.p( df-name ).
662 MESSAGE
663 "Schema regeneration complete!" SKIP(1)
664 "You need to load the schema df:" SKIP
665 " " df-name SKIP
666 "into all replication databases" SKIP
667 "and recompile all/appropriate" SKIP
668 "programs"
669 VIEW-AS ALERT-BOX INFORMATION.
671 END PROCEDURE.
673 /* _UIB-CODE-BLOCK-END */
674 &ANALYZE-RESUME
677 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE replicate-out B-table-Win
678 PROCEDURE replicate-out :
679 /*------------------------------------------------------------------------------
680 Purpose:
681 ------------------------------------------------------------------------------*/
682 RUN notify( 'set-busy,container-source':U ).
683 RUN rplctn/repldump.p .
684 RUN notify( 'set-idle,container-source':U ).
685 MESSAGE "Data for outward replication dumped to file".
686 END PROCEDURE.
688 /* _UIB-CODE-BLOCK-END */
689 &ANALYZE-RESUME
692 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
693 PROCEDURE send-records :
694 /*------------------------------------------------------------------------------
695 Purpose: Send record ROWID's for all tables used by
696 this file.
697 Parameters: see template/snd-head.i
698 ------------------------------------------------------------------------------*/
700 /* Define variables needed by this internal procedure. */
701 {src/adm/template/snd-head.i}
703 /* For each requested table, put it's ROWID in the output list. */
704 {src/adm/template/snd-list.i "ReplTrigger"}
706 /* Deal with any unexpected table requests before closing. */
707 {src/adm/template/snd-end.i}
709 END PROCEDURE.
711 /* _UIB-CODE-BLOCK-END */
712 &ANALYZE-RESUME
715 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
716 PROCEDURE state-changed :
717 /* -----------------------------------------------------------
718 Purpose:
719 Parameters: <none>
720 Notes:
721 -------------------------------------------------------------*/
722 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
723 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
725 CASE p-state:
726 /* Object instance CASEs can go here to replace standard behavior
727 or add new cases. */
728 {src/adm/template/bstates.i}
729 END CASE.
730 END PROCEDURE.
732 /* _UIB-CODE-BLOCK-END */
733 &ANALYZE-RESUME
736 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE table-changed B-table-Win
737 PROCEDURE table-changed :
738 /*------------------------------------------------------------------------------
739 Purpose:
740 Parameters: <none>
741 Notes:
742 ------------------------------------------------------------------------------*/
744 DO WITH FRAME {&FRAME-NAME}:
745 ReplTrigger.TableToRepl:SCREEN-VALUE IN BROWSE {&BROWSE-NAME} = INPUT cmb_table.
746 /* Ensure that the record gets updated */
747 RUN dispatch( 'update-record':U ).
748 IF BROWSE {&BROWSE-NAME}:REFRESH() THEN.
749 END.
751 END PROCEDURE.
753 /* _UIB-CODE-BLOCK-END */
754 &ANALYZE-RESUME
757 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE trigger-changed B-table-Win
758 PROCEDURE trigger-changed :
759 /*------------------------------------------------------------------------------
760 Purpose:
761 Parameters: <none>
762 Notes:
763 ------------------------------------------------------------------------------*/
765 DO WITH FRAME {&FRAME-NAME}:
766 DEF VAR act AS CHAR NO-UNDO.
767 act = INPUT BROWSE {&BROWSE-NAME} ReplTrigger.Activity.
768 tgl_create = INDEX( act, "C" ) <> 0.
769 tgl_modify = INDEX( act, "M" ) <> 0.
770 tgl_delete = INDEX( act, "D" ) <> 0.
771 cmb_table:SCREEN-VALUE = INPUT BROWSE {&BROWSE-NAME} ReplTrigger.TableToRepl.
772 DISPLAY
773 tgl_create
774 tgl_modify
775 tgl_delete
776 WITH FRAME {&FRAME-NAME}.
777 END.
779 END PROCEDURE.
781 /* _UIB-CODE-BLOCK-END */
782 &ANALYZE-RESUME