- Timestamp:
- Mar 27, 2010, 1:31:47 AM (15 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMXP.m
r727 r728 102 102 I $$GET1^DIQ(C0CXPF,TEMPID_",",C0CXTFLD,,OUTXML)'=OUTXML D Q ; 103 103 . W "ERROR RETRIEVING TEMPLATE",! 104 Q 105 ; 106 COPYWP(ZFLD,ZSRCREC,ZDESTREC,ZSRCF,ZDESTF) ; COPIES A WORD PROCESSING FIELD 107 ; FROM ONE RECORD TO ANOTHER RECORD 108 ; ZFLD IS EITHER A NUMBERIC FIELD OR A NAME IN ZSRCF 109 ; ZSRCF IS THE SOURCE FILE, IN FILE REDIRECT FORMAT 110 ; IF ZSRCF IS OMMITED, THE DEFAULT C0C XML MISC FILE WILL BE ASSUMED 111 ; ZDESTF IS DESTINATION FILE. IF OMMITED, IS ASSUMED TO BE THE SAME 112 ; A ZSRCF 113 I '$D(ZSRCF) D ; 114 . S ZSRCF="ZSRCF" 115 . D INITFARY^C0CSOAP(ZSRCF) 116 I '$D(ZDESTF) D ; 117 . S ZDESTF="ZDESTF" 118 . M @ZDESTF=@ZSRCF 119 N ZSF,ZDF,ZSFREF,ZDFREF 120 S ZSF=@ZSRCF@("XML FILE NUMBER") 121 S ZSFREF=$$FILEREF^C0CRNF(ZSF) 122 S ZDF=@ZDESTF@("XML FILE NUMBER") 123 S ZDFREF=$$FILEREF^C0CRNF(ZDF) 124 N ZSIEN,ZDIEN 125 S ZSIEN=$O(@ZSFREF@("B",ZSRCREC,"")) 126 I ZSIEN="" W !,"ERROR SOURCE RECORD NOT FOUND" Q ; 127 S ZDIEN=$O(@ZDFREF@("B",ZDESTREC,"")) 128 I ZDIEN="" W !,"ERROR DESTINATION RECORD NOT FOUND" Q ; 129 N ZFLDNUM 130 I +ZFLD=0 S ZFLDNUM=@ZSRCF@(ZFLD) ; IF FIELD IS PASSED BY NAME 131 E S ZFLDNUM=ZFLD ; IF FIELD IS PASSED BY NUMBER 132 N ZWP,ZWPN 133 S ZWPN=$$GET1^DIQ(ZSF,ZSIEN_",",ZFLDNUM,,"ZWP") ; GET WP FROM SOURCE 134 I ZWPN'="ZWP" W !,"ERROR SOURCE FIELD EMPTY" Q ; 135 D WP^DIE(ZDF,ZDIEN_",",ZFLDNUM,,"ZWP") ; PUT WP FIELD TO DEST 104 136 Q 105 137 ; -
ccr/trunk/p/C0CSOAP.m
r718 r728 68 68 Q 69 69 ; 70 SOAP(C0CRTN,C0CTID,C0CVA,C0CVOR,ALTXML ) ; MAKES A SOAP CALL FOR70 SOAP(C0CRTN,C0CTID,C0CVA,C0CVOR,ALTXML,IFARY) ; MAKES A SOAP CALL FOR 71 71 ; TEMPLATE ID C0CTID 72 72 ; RETURNS THE XML RESULT IN C0CRTN, PASSED BY NAME … … 110 110 ; END ARTIFACTS 111 111 ; 112 D INITFARY("C0CF") ; SET FILE NUMBER AND PARAMATERS 112 I '$D(IFARY) D INITFARY("C0CF") ; SET FILE NUMBER AND PARAMATERS 113 E D ; 114 . K C0CF 115 . M C0CF=@IFARY 113 116 S C0CXF=C0CF("XML FILE NUMBER") ; FILE NUMBER FOR THE XML TEMPLATE FILE 114 117 I +C0CTID=0 D ; A STRING WAS PASSED FOR THE TEMPLATE NAME … … 139 142 I $G(C0CPROXY) S C0CURL=C0CPURL 140 143 K C0CRSLT,C0CRHDR 144 B 141 145 S ok=$$httpPOST^%zewdGTM(C0CURL,.XML,C0CMIME,.C0CRSLT,.HEADER,"",.gpl5,.C0CRHDR) 142 146 K C0CRXML 143 147 D NORMAL("C0CRXML","C0CRSLT(1)") ;RETURN XML IN AN ARRAY 144 N C0CFR S C0CFR= C0CF("REPLY TEMPLATE")148 N C0CFR S C0CFR=$G(C0CF("REPLY TEMPLATE")) 145 149 S C0CR=$$GET1^DIQ(C0CXF,C0CUTID_",",C0CFR,"I") ; REPLY TEMPLATE 146 150 ; reply templates are optional and are specified by populating a -
ccr/trunk/p/C0CXPATH.m
r664 r728 340 340 N TMP,I,J,QXPATH 341 341 S FIRST=1 342 I '$D(@IARY@(0)) D ; LINE COUNT NOT IN ZERO NODE 343 . S @IARY@(0)=$O(@IARY@("//"),-1) ; THIS SHOULD USUALLY WORK 342 344 S LAST=@IARY@(0) ; FIRST AND LAST DEFAULT TO ROOT 343 345 I XPATH'="//" D ; NOT A ROOT QUERY … … 461 463 I $G(DEBUG) W "DOING INSERT ",INSXML,INSNEW,INSXPATH,! 462 464 I $G(DEBUG) F G1=1:1:@INSXML@(0) W @INSXML@(G1),! 463 I '$D(@INSXML@( 0)) D ; INSERT INTO AN EMPTY ARRAY465 I '$D(@INSXML@(1)) D ; INSERT INTO AN EMPTY ARRAY 464 466 . D CP^C0CXPATH(INSNEW,INSXML) ; JUST COPY INTO THE OUTPUT 465 I $D(@INSXML@(0)) D ; IF ORIGINAL ARRAY IS NOT EMPTY 467 I $D(@INSXML@(1)) D ; IF ORIGINAL ARRAY IS NOT EMPTY 468 . I '$D(@INSXML@(0)) S @INSXML@(0)=$O(@INSXML@(""),-1) ;SET LENGTH 466 469 . I $D(INSXPATH) D ; XPATH PROVIDED 467 470 . . D QOPEN("INSBLD",INSXML,INSXPATH) ; COPY THE BEFORE … … 469 472 . I '$D(INSXPATH) D ; NO XPATH PROVIDED, OPEN AT ROOT 470 473 . . D QOPEN("INSBLD",INSXML,"//") ; OPEN WITH ROOT XPATH 474 . I '$D(@INSNEW@(0)) S @INSNEW@(0)=$O(@INSNEW@(""),-1) ;SIZE OF XML 471 475 . D QUEUE("INSBLD",INSNEW,1,@INSNEW@(0)) ; COPY IN NEW XML 472 476 . I $D(INSXPATH) D ; XPATH PROVIDED … … 527 531 . D QUEUE("REBLD",REXML,XLAST+1,@REXML@(0)) ; THE REST 528 532 I $G(DEBUG) W "REPLACE PREBUILD",! 533 I $G(DEBUG) D PARY("REBLD") 534 D BUILD("REBLD","RTMP") 535 K @REXML ; KILL WHAT WAS THERE 536 D CP("RTMP",REXML) ; COPY IN THE RESULT 537 Q 538 ; 539 DELETE(REXML,REXPATH) ; DELETE THE XML AT THE XPATH POINT 540 ; REXML IS PASSED BY NAME XPATH IS A VALUE 541 N REBLD,XFIRST,XLAST,OLD,XNODE,RETMP 542 S OLD=$NA(^TMP($J,"REPLACE_OLD")) 543 D QUERY(REXML,REXPATH,OLD) ; CREATE INDEX, TEST XPATH, MAKE OLD 544 S XNODE=@REXML@(REXPATH) ; PULL OUT FIRST AND LAST LINE PTRS 545 S XFIRST=$P(XNODE,"^",1) 546 S XLAST=$P(XNODE,"^",2) 547 D QUEUE("REBLD",REXML,1,XFIRST-1) ; THE BEFORE 548 D QUEUE("REBLD",REXML,XLAST+1,@REXML@(0)) ; THE REST 529 549 I $G(DEBUG) D PARY("REBLD") 530 550 D BUILD("REBLD","RTMP")
Note:
See TracChangeset
for help on using the changeset viewer.