NamesGVExportImpl.Mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last modified by Swinehart, May 18, 1986 4:30:36 pm PDT
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandTool USING [ NextArgument ],
LupineRuntime USING [ BindingError ],
NamesGVImpExp,
NamesGVRpcControl USING [ ExportInterface, UnexportInterface ],
IO,
ProcessProps USING [ GetProp ],
Rope USING [ ROPE ],
RPC USING [ ExportFailed, matchAllVersions ],
UserProfile USING [ Token ],
VoiceUtils USING [ CurrentRName, CurrentPasskey, MakeRName, Problem, ReportFR ]
;
NamesGVExportImpl: CEDAR PROGRAM
IMPORTS Commander, CommandTool, IO, LupineRuntime, NamesGVRpcControl, ProcessProps, RPC, UserProfile, VoiceUtils
EXPORTS NamesGVImpExp = {
OPEN IO;
Data
ROPE: TYPE= Rope.ROPE;
gvWorkingDirectory: PUBLIC ROPENIL;
Import Procedure
GVExport: PUBLIC PROC [instance: ROPENIL] RETURNS [success: BOOL] = {
ENABLE
RPC.ExportFailed => { VoiceUtils.Problem["Couldn't export NamesGV.Lark"]; CONTINUE; };
gvWorkingDirectory ← NARROW[ProcessProps.GetProp[$WorkingDirectory]];
IF instance=NIL THEN
instance ← UserProfile.Token[key: "ThrushServerInstance", default: "Strowger.Lark"];
instance ← VoiceUtils.MakeRName[instance, rName];
NamesGVRpcControl.UnexportInterface[!LupineRuntime.BindingError=> CONTINUE];
NamesGVRpcControl.ExportInterface [
interfaceName: [
type: "NamesGV.Lark",
instance: instance
],
user: VoiceUtils.CurrentRName[],
password: VoiceUtils.CurrentPasskey[]
];
VoiceUtils.ReportFR[remark: "ExportInterface[NamesGV.Lark, %s]", a1: rope[instance], where: $System];
};
User command
CmdGVExport: Commander.CommandProc = {
[]←GVExport[CommandTool.NextArgument[cmd]];
};
Initialization
Commander.Register["GVExport", CmdGVExport, "Supply a remote NamesGV."];
}.