FSCRPCWP ;SLC/STAFF-NOIS RPC Web Page ;7/23/98 13:07 ;;1.1;NOIS;;Sep 06, 1998 ; LOADCALL(IN,OUT) ; from FSCRPX (RPCLoadWebCall) N CALL,CNT,KEYWORDS,LINE,NUM,ONETWO,SUBJECT,ZERO S CALL=+$G(^TMP("FSCRPC",$J,"INPUT",1)) S ZERO=$G(^FSCD("CALL",CALL,0)) I '$L(ZERO) Q S ONETWO=$G(^FSCD("CALL",CALL,120)) S SUBJECT=$G(^FSCD("CALL",CALL,1)) S KEYWORDS=$G(^FSCD("CALL",CALL,1.5)) S ^TMP("FSCRPC",$J,"OUTPUT",1)=ZERO,^(2)=ONETWO,^(3)=SUBJECT,^(4)=KEYWORDS S CNT=4 I $O(^FSCD("CALL",CALL,30,0)) D .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{DESC}}}" .S NUM=0 F S NUM=$O(^FSCD("CALL",CALL,30,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D ..S CNT=CNT+1 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}" I $O(^FSCD("CALL",CALL,80,0)) D .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{RES}}}" .S NUM=0 F S NUM=$O(^FSCD("CALL",CALL,80,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D ..S CNT=CNT+1 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}" Q ; LOADWEB(IN,OUT) ; from FSCRPX (RPCLoadWeb) N CNT,ID,KEYWORDS,LINE,NUM,ONETWO,SUBJECT,ZERO S ID=+$G(^TMP("FSCRPC",$J,"INPUT",1)) S ZERO=$G(^FSCD("WEB",ID,0)) I '$L(ZERO) Q S SUBJECT=$G(^FSCD("WEB",ID,1)) S ONETWO="",KEYWORDS="" S ^TMP("FSCRPC",$J,"OUTPUT",1)=ZERO,^(2)=ONETWO,^(3)=SUBJECT,^(4)=KEYWORDS S CNT=4 I $O(^FSCD("WEB",ID,2,0)) D .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{DESC}}}" .S NUM=0 F S NUM=$O(^FSCD("WEB",ID,2,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D ..S CNT=CNT+1 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}" I $O(^FSCD("WEB",ID,3,0)) D .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{RES}}}" .S NUM=0 F S NUM=$O(^FSCD("WEB",ID,3,NUM)) Q:NUM<1 S LINE=$G(^(NUM,0)) D ..S CNT=CNT+1 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE .S CNT=CNT+1 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{{{}}}" Q ; SAVEWEB(IN,OUT) ; from FSCRPX (RPCSaveWeb) N CNT,ID,LINE,NEWPACK,NUM,PACKAGE,TITLE K FIELDS,^TMP("FSC WP",$J) S PACKAGE=+^TMP("FSCRPC",$J,"INPUT",1) I $O(^FSCD("WEB","C",PACKAGE,0)) S NEWPACK=0 E S NEWPACK=1 S TITLE=^TMP("FSCRPC",$J,"INPUT",2) S NOW=$$NOW^XLFDT() L +^FSCD("WEB",0):20 I '$T Q S ID=1+$P(^FSCD("WEB",0),U,3) F Q:'$D(^FSCD("WEB",ID,0)) S ID=ID+1 S $P(^FSCD("WEB",0),U,3)=ID,$P(^(0),U,4)=$P(^(0),U,4)+1 S ^FSCD("WEB",ID,0)="P"_ID_U_PACKAGE_U_DUZ_U_NOW_U_DUZ_U_NOW L -^FSCD("WEB",0) S ^FSCD("WEB",ID,1)=TITLE D PROCESS^FSCRPCNC(.FIELDS) I $O(^TMP("FSC WP",$J,"DESC",0)) D .K ^FSCD("WEB",ID,2) .S (CNT,NUM)=0 F S NUM=$O(^TMP("FSC WP",$J,"DESC",NUM)) Q:NUM<1 S LINE=^(NUM) D ..S CNT=CNT+1 ..S ^FSCD("WEB",ID,2,CNT,0)=LINE .S ^FSCD("WEB",ID,2,0)="^^"_CNT_U_CNT_U_DT_U I $O(^TMP("FSC WP",$J,"RES",0)) D .K ^FSCD("WEB",ID,3) .S (CNT,NUM)=0 F S NUM=$O(^TMP("FSC WP",$J,"RES",NUM)) Q:NUM<1 S LINE=^(NUM) D ..S CNT=CNT+1 ..S ^FSCD("WEB",ID,3,CNT,0)=LINE .S ^FSCD("WEB",ID,3,0)="^^"_CNT_U_CNT_U_DT_U S DIK="^FSCD(""WEB"",",DA=ID D IX1^DIK K FIELDS,^TMP("FSC WP",$J) SEND S CNT=0 I NEWPACK D MAIN^FSCRPCW1(.CNT) D PACK^FSCRPCW2(PACK,.CNT) D SOL^FSCRPCW3(ID,.CNT) Q ; WEBIEN(IN,OUT) ; from FSCRPXU (RPCWebIEN) N LINE S LINE=$G(^TMP("FSCRPC",$J,"INPUT",1)) S ^TMP("FSCRPC",$J,"OUTPUT",1)=$$IEN(LINE) Q ; IEN(URL) ; $$(url) -> valid web ien else -1 N AURL,BACK,FRONT,IEN S ADDRESS=$P($G(^FSC("PARAM",1,1.8)),U,2) I '$L(ADDRESS) Q -1 S AURL="" I $L($P(URL,":",3,99)) D .S FRONT=$P(URL,":",1,2),BACK=$P(URL,":",3,99),BACK=$P(BACK,"/",2,99) .S AURL=FRONT_"/"_BACK S IEN=+$P(URL,ADDRESS_"p",2) I $D(^FSCD("WEB",IEN,0)) Q IEN I $L(AURL) S IEN=+$P(AURL,ADDRESS_"p",2) I $D(^FSCD("WEB",IEN,0)) Q IEN Q -1 ; TEST ; W $$IEN("http://152.131.1.116:80/nois/p22.htm") Q DELWEB(IN,OUT) ; from FSCRPXU (RPCDeleteWeb) Q