public override void ExecuteAction(ServiceLib.Classes.ServicePlugin.ExecutionContext context) { if (context.RequestParameters.ContainsKey("PluginId") && context.RequestParameters.ContainsKey("PluginBitness")) { using (Client client = new Client(PluginListener.DatabaseConfig)) { var plugin = client.GetPlugin(context.RequestParameters["PluginId"]); if (false == plugin.IsProvisioned) { throw new Exception("The requested plugin is not available for your client."); } String bitness = (context.RequestParameters["PluginBitness"].Contains("64")) ? "x64" : "x86"; //provisioningpath always contains a placeholder for the bitness otherwise it will fail String provPath = client.GetProvisioningPath(plugin.ProvisioningId); if (File.Exists(String.Format(provPath, bitness))) { context.WriteFileResponse(new FileInfo(String.Format(provPath, bitness))); } else { throw new FileNotFoundException(plugin.Name + " update container not found on server"); } } } else { throw new Exception("Missing plugin-id parameter"); } }
public override void ExecuteAction(ServiceLib.Classes.ServicePlugin.ExecutionContext context) { using (var client = new Client(PluginListener.DatabaseConfig)) { context.WriteJsonResponse(this.Serialize(client.GetDbConfigValue("last_change_date"))); } }
public override void ExecuteAction(ServiceLib.Classes.ServicePlugin.ExecutionContext context) { using (var client = new Client(PluginListener.DatabaseConfig)) { var pluginList = client.GetUseablePlugins(context.ClientVersion, context.Session[Key.ClientChannel].ToString()); foreach (var plugin in pluginList) { plugin.PluginType = client.GetPluginType(plugin.TypeId); plugin.Author = client.GetAuthor(plugin.AuthorId); plugin.PluginVersion = client.GetVersion(plugin.VersionId); plugin.RequiredBeRemoteVersion = client.GetVersion(plugin.RequiredBeRemoteVersionId); //plugin.Groups = client.GetPluginGroups(plugin.Id); plugin.SearchTerms = client.GetPluginSearchTerms(plugin.Id); } context.WriteJsonResponse(this.Serialize(pluginList)); } }