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;
GVExport:
PUBLIC
PROC [instance:
ROPE←
NIL]
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];
};
}.