diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs similarity index 82% rename from OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs rename to OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs index 8c701448c6..f445b97bc1 100644 --- a/OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs @@ -33,32 +33,58 @@ using System.Collections.Specialized; using System.Net; using System.Text; using System.Web; -using ExtensionLoader; using OpenMetaverse; using HttpServer; +using OpenSim.Framework; -namespace OpenSim.Grid.AssetInventoryServer.Extensions +namespace OpenSim.Grid.AssetInventoryServer.Plugins { - public class BrowseFrontend : IExtension + public class BrowseFrontendPlugin : IAssetInventoryServerPlugin { AssetInventoryServer server; - public BrowseFrontend() + public BrowseFrontendPlugin() { } - public void Start(AssetInventoryServer server) + #region IPlugin implementation + + public void Initialise(AssetInventoryServer server) { this.server = server; // Request for / or /?... server.HttpServer.AddHandler("get", null, @"(^/$)|(^/\?.*)", BrowseRequestHandler); + + Logger.Log.Info("[ASSET] Browser Frontend loaded."); } - public void Stop() + /// + /// Initialises asset interface + /// + public void Initialise() + { + Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); + throw new PluginNotInitialisedException(Name); + } + + public void Dispose() { } + public string Version + { + // TODO: this should be something meaningful and not hardcoded? + get { return "0.1"; } + } + + public string Name + { + get { return "AssetInventoryServer Browse asset frontend"; } + } + + #endregion IPlugin implementation + bool BrowseRequestHandler(IHttpClientContext client, IHttpRequest request, IHttpResponse response) { const int ASSETS_PER_PAGE = 25; diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/ReferenceFrontend.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/ReferenceFrontendPlugin.cs similarity index 90% rename from OpenSim/Grid/AssetInventoryServer/Extensions/ReferenceFrontend.cs rename to OpenSim/Grid/AssetInventoryServer/Plugins/ReferenceFrontendPlugin.cs index df6bd95aca..fddc385511 100644 --- a/OpenSim/Grid/AssetInventoryServer/Extensions/ReferenceFrontend.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/ReferenceFrontendPlugin.cs @@ -31,22 +31,24 @@ using System; using System.Collections.Generic; using System.Net; using System.Xml; -using ExtensionLoader; using OpenMetaverse; using OpenMetaverse.StructuredData; using HttpServer; +using OpenSim.Framework; -namespace OpenSim.Grid.AssetInventoryServer.Extensions +namespace OpenSim.Grid.AssetInventoryServer.Plugins { - public class ReferenceFrontend : IExtension + public class ReferenceFrontendPlugin : IAssetInventoryServerPlugin { AssetInventoryServer server; - public ReferenceFrontend() + public ReferenceFrontendPlugin() { } - public void Start(AssetInventoryServer server) + #region IPlugin implementation + + public void Initialise(AssetInventoryServer server) { this.server = server; @@ -60,12 +62,36 @@ namespace OpenSim.Grid.AssetInventoryServer.Extensions // Asset creation server.HttpServer.AddHandler("post", null, "^/createasset", CreateRequestHandler); + + Logger.Log.Info("[ASSET] Reference Frontend loaded."); } - public void Stop() + /// + /// Initialises asset interface + /// + public void Initialise() + { + Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); + throw new PluginNotInitialisedException(Name); + } + + public void Dispose() { } + public string Version + { + // TODO: this should be something meaningful and not hardcoded? + get { return "0.1"; } + } + + public string Name + { + get { return "AssetInventoryServer Reference asset frontend"; } + } + + #endregion IPlugin implementation + bool MetadataRequestHandler(IHttpClientContext client, IHttpRequest request, IHttpResponse response) { UUID assetID; diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml b/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml index 089c6a2f36..0ec28deb5c 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml @@ -10,4 +10,10 @@ + + + + + + diff --git a/prebuild.xml b/prebuild.xml index cfa2b92a13..83e31f2b38 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -797,8 +797,13 @@ ../../../../bin/ + + + + +