diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs (renamed from OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs) | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs index 8c70144..f445b97 100644 --- a/OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs | |||
@@ -33,32 +33,58 @@ using System.Collections.Specialized; | |||
33 | using System.Net; | 33 | using System.Net; |
34 | using System.Text; | 34 | using System.Text; |
35 | using System.Web; | 35 | using System.Web; |
36 | using ExtensionLoader; | ||
37 | using OpenMetaverse; | 36 | using OpenMetaverse; |
38 | using HttpServer; | 37 | using HttpServer; |
38 | using OpenSim.Framework; | ||
39 | 39 | ||
40 | namespace OpenSim.Grid.AssetInventoryServer.Extensions | 40 | namespace OpenSim.Grid.AssetInventoryServer.Plugins |
41 | { | 41 | { |
42 | public class BrowseFrontend : IExtension<AssetInventoryServer> | 42 | public class BrowseFrontendPlugin : IAssetInventoryServerPlugin |
43 | { | 43 | { |
44 | AssetInventoryServer server; | 44 | AssetInventoryServer server; |
45 | 45 | ||
46 | public BrowseFrontend() | 46 | public BrowseFrontendPlugin() |
47 | { | 47 | { |
48 | } | 48 | } |
49 | 49 | ||
50 | public void Start(AssetInventoryServer server) | 50 | #region IPlugin implementation |
51 | |||
52 | public void Initialise(AssetInventoryServer server) | ||
51 | { | 53 | { |
52 | this.server = server; | 54 | this.server = server; |
53 | 55 | ||
54 | // Request for / or /?... | 56 | // Request for / or /?... |
55 | server.HttpServer.AddHandler("get", null, @"(^/$)|(^/\?.*)", BrowseRequestHandler); | 57 | server.HttpServer.AddHandler("get", null, @"(^/$)|(^/\?.*)", BrowseRequestHandler); |
58 | |||
59 | Logger.Log.Info("[ASSET] Browser Frontend loaded."); | ||
60 | } | ||
61 | |||
62 | /// <summary> | ||
63 | /// <para>Initialises asset interface</para> | ||
64 | /// </summary> | ||
65 | public void Initialise() | ||
66 | { | ||
67 | Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); | ||
68 | throw new PluginNotInitialisedException(Name); | ||
69 | } | ||
70 | |||
71 | public void Dispose() | ||
72 | { | ||
73 | } | ||
74 | |||
75 | public string Version | ||
76 | { | ||
77 | // TODO: this should be something meaningful and not hardcoded? | ||
78 | get { return "0.1"; } | ||
56 | } | 79 | } |
57 | 80 | ||
58 | public void Stop() | 81 | public string Name |
59 | { | 82 | { |
83 | get { return "AssetInventoryServer Browse asset frontend"; } | ||
60 | } | 84 | } |
61 | 85 | ||
86 | #endregion IPlugin implementation | ||
87 | |||
62 | bool BrowseRequestHandler(IHttpClientContext client, IHttpRequest request, IHttpResponse response) | 88 | bool BrowseRequestHandler(IHttpClientContext client, IHttpRequest request, IHttpResponse response) |
63 | { | 89 | { |
64 | const int ASSETS_PER_PAGE = 25; | 90 | const int ASSETS_PER_PAGE = 25; |