NamesGVExportImpl.Mesa
Last modified by Swinehart, March 5, 1985 5:25:31 pm PST
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandToolExtras USING [ NumArgs, ArgN ],
ExplicitExport USING [ ExportExplicitly ],
NamesGVImpExp,
NamesGVRpcControl USING [ ExportInterface ],
NamesGVRpcServerImpl USING [ ServerDispatcher ],
IO,
Log USING [ Problem, ReportFR ],
Names USING [ CurrentRName, CurrentPasskey, ROPE ],
RPC USING [ ExportFailed, matchAllVersions ],
UserProfile USING [ Token ]
;
NamesGVExportImpl: CEDAR PROGRAM
IMPORTS Commander, CommandToolExtras, ExplicitExport, IO, Log, RPC, Names, NamesGVRpcControl, NamesGVRpcServerImpl, UserProfile
EXPORTS NamesGVImpExp
SHARES NamesGVRpcServerImpl = {
OPEN IO;
Data
ROPE: TYPE= Names.ROPE;
exported: BOOLFALSE;
Import Procedure
GVExport: PUBLIC PROC [instance: ROPENIL] RETURNS [success: BOOL] = {
ENABLE
RPC.ExportFailed => { Log.Problem["Couldn't export NamesGV.Lark"]; CONTINUE; };
IF instance=NIL THEN
instance ← UserProfile.Token[key: "ThrushServerInstance", default: "Morley.Lark"];
IF exported THEN {
Log.ReportFR[remark: "ExportInterface[NamesGV.Lark, %s] already done", where: $System, a1: rope[instance]];
RETURN;
};
NamesGVRpcControl.ExportInterface [
interfaceName: [
type: "NamesGV.Lark",
instance: instance
],
user: Names.CurrentRName[],
password: Names.CurrentPasskey[]
];
ExplicitExport.ExportExplicitly["NamesGV.Lark", instance, RPC.matchAllVersions, RPC.matchAllVersions, NamesGVRpcServerImpl.ServerDispatcher];
exported ← TRUE;
Log.ReportFR[remark: "ExportInterface[NamesGV.Lark, %s]", a1: rope[instance], where: $System];
};
User command
CmdGVExport: Commander.CommandProc = {
[]←GVExport[IF CommandToolExtras.NumArgs[cmd]#0 THEN CommandToolExtras.ArgN[cmd,1] ELSE NIL];
};
Initialization
Commander.Register["GVExport", CmdGVExport, "Supply a remote NamesGV."];
}.