Some work on web interface

Adding some web handlers to manage plugins. Returns json for integration into external processing.
integration
BlueWall 2012-04-07 14:52:02 -04:00
parent 931c28888b
commit 7a686ef124
4 changed files with 33 additions and 19 deletions

View File

@ -78,10 +78,11 @@ namespace OpenSim.Server.Handlers.Integration
switch (command)
{
// agent
case "foo":
break;
case "list_plugins":
return HandleListPlugins(request);
case "bar":
case "plugin_info":
return HandlePluginInfo(request);
break;
default:
@ -97,7 +98,20 @@ namespace OpenSim.Server.Handlers.Integration
return FailureResult();
}
#region web handlers
private byte[] HandleListPlugins(OSDMap request)
{
return m_IntegrationService.HandleWebListPlugins(request);
}
private byte[] HandlePluginInfo(OSDMap request)
{
return m_IntegrationService.HandleWebPluginInfo(request);
}
#endregion web handlers
#region utility
// These are in IntegrationUtils.cs for plugins
private byte[] FailureResult()
{
return FailureResult(String.Empty);

View File

@ -35,10 +35,12 @@ using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using Nini.Config;
using log4net;
using Mono.Addins;
using Ux = OpenSim.Services.IntegrationService.IUtils;
namespace OpenSim.Services.IntegrationService
{
@ -115,7 +117,6 @@ namespace OpenSim.Services.IntegrationService
MainConsole.Instance.Commands.AddCommand("Integration", true,
"show info", "show info \"plugin name\"","Show detailed information for plugin",
HandleConsoleShowAddinInfo);
}
#region console handlers
@ -173,7 +174,6 @@ namespace OpenSim.Services.IntegrationService
{
m_PluginManager.AddRepository(cmd);
}
return;
}
@ -219,5 +219,17 @@ namespace OpenSim.Services.IntegrationService
}
}
#endregion
#region web handlers
public byte[] HandleWebListPlugins(OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebPluginInfo(OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
#endregion
}
}

View File

@ -49,12 +49,6 @@ namespace OpenSim.Services.IntegrationService
m_Registry.Update();
}
// public PluginManager(string registry_path)
// {
// m_Registry = new AddinRegistry(registry_path);
// m_Service = new SetupService(m_Registry);
// }
//
public string InstallPlugin(string[] args)
{
PackageCollection pack = new PackageCollection();
@ -76,10 +70,8 @@ namespace OpenSim.Services.IntegrationService
pack.Add(p);
}
ResolveDependencies(ps, pack, out toUninstall, out unresolved);
if(Install(ps, pack) == true)
{
m_Registry.Update(ps);
@ -112,7 +104,6 @@ namespace OpenSim.Services.IntegrationService
{
MainConsole.Instance.OutputFormat("* {0} rev. {1}", addin.Name, addin.Version);
}
return;
}
@ -174,10 +165,8 @@ namespace OpenSim.Services.IntegrationService
}
AddinRepository rep = reps[n];
//return "TEST";
Repositories.SetRepositoryEnabled(rep.Url, true);
return;
//return DisableRepository();
}
public void DisableRepository(string[] args)
@ -198,10 +187,8 @@ namespace OpenSim.Services.IntegrationService
}
AddinRepository rep = reps[n];
//return "TEST";
Repositories.SetRepositoryEnabled(rep.Url, false);
return;
//return DisableRepository();
}
public ArrayList ListRepositories()
@ -231,7 +218,6 @@ namespace OpenSim.Services.IntegrationService
list.Add(sb.ToString());
n++;
}
return list;
}

View File

@ -36,6 +36,8 @@ namespace OpenSim.Services.Interfaces
{
public interface IIntegrationService
{
byte[] HandleWebListPlugins(OSDMap request);
byte[] HandleWebPluginInfo(OSDMap request);
}
}