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) switch (command)
{ {
// agent // agent
case "foo": case "list_plugins":
break; return HandleListPlugins(request);
case "bar": case "plugin_info":
return HandlePluginInfo(request);
break; break;
default: default:
@ -97,7 +98,20 @@ namespace OpenSim.Server.Handlers.Integration
return FailureResult(); 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 #region utility
// These are in IntegrationUtils.cs for plugins
private byte[] FailureResult() private byte[] FailureResult()
{ {
return FailureResult(String.Empty); return FailureResult(String.Empty);

View File

@ -35,10 +35,12 @@ using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData;
using Nini.Config; using Nini.Config;
using log4net; using log4net;
using Mono.Addins; using Mono.Addins;
using Ux = OpenSim.Services.IntegrationService.IUtils;
namespace OpenSim.Services.IntegrationService namespace OpenSim.Services.IntegrationService
{ {
@ -115,7 +117,6 @@ namespace OpenSim.Services.IntegrationService
MainConsole.Instance.Commands.AddCommand("Integration", true, MainConsole.Instance.Commands.AddCommand("Integration", true,
"show info", "show info \"plugin name\"","Show detailed information for plugin", "show info", "show info \"plugin name\"","Show detailed information for plugin",
HandleConsoleShowAddinInfo); HandleConsoleShowAddinInfo);
} }
#region console handlers #region console handlers
@ -173,7 +174,6 @@ namespace OpenSim.Services.IntegrationService
{ {
m_PluginManager.AddRepository(cmd); m_PluginManager.AddRepository(cmd);
} }
return; return;
} }
@ -219,5 +219,17 @@ namespace OpenSim.Services.IntegrationService
} }
} }
#endregion #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(); 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) public string InstallPlugin(string[] args)
{ {
PackageCollection pack = new PackageCollection(); PackageCollection pack = new PackageCollection();
@ -76,10 +70,8 @@ namespace OpenSim.Services.IntegrationService
pack.Add(p); pack.Add(p);
} }
ResolveDependencies(ps, pack, out toUninstall, out unresolved); ResolveDependencies(ps, pack, out toUninstall, out unresolved);
if(Install(ps, pack) == true) if(Install(ps, pack) == true)
{ {
m_Registry.Update(ps); m_Registry.Update(ps);
@ -112,7 +104,6 @@ namespace OpenSim.Services.IntegrationService
{ {
MainConsole.Instance.OutputFormat("* {0} rev. {1}", addin.Name, addin.Version); MainConsole.Instance.OutputFormat("* {0} rev. {1}", addin.Name, addin.Version);
} }
return; return;
} }
@ -174,10 +165,8 @@ namespace OpenSim.Services.IntegrationService
} }
AddinRepository rep = reps[n]; AddinRepository rep = reps[n];
//return "TEST";
Repositories.SetRepositoryEnabled(rep.Url, true); Repositories.SetRepositoryEnabled(rep.Url, true);
return; return;
//return DisableRepository();
} }
public void DisableRepository(string[] args) public void DisableRepository(string[] args)
@ -198,10 +187,8 @@ namespace OpenSim.Services.IntegrationService
} }
AddinRepository rep = reps[n]; AddinRepository rep = reps[n];
//return "TEST";
Repositories.SetRepositoryEnabled(rep.Url, false); Repositories.SetRepositoryEnabled(rep.Url, false);
return; return;
//return DisableRepository();
} }
public ArrayList ListRepositories() public ArrayList ListRepositories()
@ -231,7 +218,6 @@ namespace OpenSim.Services.IntegrationService
list.Add(sb.ToString()); list.Add(sb.ToString());
n++; n++;
} }
return list; return list;
} }

View File

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