11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <Export generator =" Cache" version =" 25" zv =" Cache for Windows (x86-64) 2015.1.1 (Build 505U )" ts =" 2015-12-21 13:52:46 " >
2+ <Export generator =" Cache" version =" 25" zv =" Cache for Windows (x86-64) 2015.3 (Build 215U )" ts =" 2015-12-27 13:48:44 " >
33<Class name =" WebTerminal.Engine" >
44<Description >
55Cache WEB Terminal version X.X.X/*build.replace:pkg.version*/ core.
66This class is the server-side core of the terminal application.</Description >
77<Super >%CSP.WebSocket,Trace,Autocomplete</Super >
8- <TimeChanged >63907,49887.419268 </TimeChanged >
8+ <TimeChanged >63913,49707.26915 </TimeChanged >
99<TimeCreated >63891,56786.028532</TimeCreated >
1010<DependsOn >Common</DependsOn >
1111
@@ -617,6 +617,12 @@ Main method for every new client.</Description>
617617 do ..SendData($NAMESPACE, ..#ClientPrompt)
618618 }
619619
620+ } elseif (action = ..#ServerActionRename) {
621+
622+ set ^WebTerminal("Name") = data
623+ do ..SendData("56", ..#ClientOutputLocalized)
624+ do ..SendData($NAMESPACE, ..#ClientPrompt)
625+
620626 } else { // something scary
621627
622628 do ..SendData("38", ..#ClientOutputLocalized)
@@ -629,19 +635,41 @@ Main method for every new client.</Description>
629635]]> </Implementation >
630636</Method >
631637
638+ <Method name =" SendLoginInfo" >
639+ <Description >
640+ This method sends basic login info to the user. Use this method to set client variables
641+ during the WebTerminal initialization.</Description >
642+ <Implementation ><![CDATA[
643+ set obj = ##class(%ZEN.proxyObject).%New()
644+ set obj.username = $USERNAME
645+ set obj.name = $get(^WebTerminal("Name"))
646+
647+ // "pretty" json formatter
648+ set data = "{""system"":""" _ $SYSTEM _ """"
649+ set key = $order(obj.%data(""))
650+ while (key '= "") {
651+ set data = data _ ","""_key_""":"""_obj.%data(key)_""""
652+ set key = $order(obj.%data(key))
653+ }
654+ set data = data _ "}"
655+
656+ do ..SendData(data, ..#ClientLoginInfo)
657+ ]]> </Implementation >
658+ </Method >
659+
632660<Method name =" Server" >
633661<Description >
634662New connection established: require auth key, login and start client loop.</Description >
635663<ReturnType >%Status</ReturnType >
636664<Implementation ><![CDATA[
637665
638- /*UNCOMMENT ON RELEASE!*/
639666 if ($$$ISOK(..RequireAuthorization())) {
640667
641668 set ..CurrentNamespace = $Znspace
642669
643670 do ..SendData("1", ..#ClientAuthorizationStatus)
644671 do ..SendData(..CurrentNamespace, ..#ClientChangeNamespace)
672+ do ..SendLoginInfo()
645673
646674 use $io:(/NOXY:/BREAK):"^" _ ..InitialZName
647675 do ..ClientLoop()
0 commit comments