diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/BrowseFrontendPlugin.cs (renamed from OpenSim/Grid/AssetInventoryServer/Extensions/BrowseFrontend.cs) | 38 | ||||
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/ReferenceFrontendPlugin.cs (renamed from OpenSim/Grid/AssetInventoryServer/Extensions/ReferenceFrontend.cs) | 38 | ||||
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml | 6 |
3 files changed, 70 insertions, 12 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; |
diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/ReferenceFrontend.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/ReferenceFrontendPlugin.cs index df6bd95..fddc385 100644 --- a/OpenSim/Grid/AssetInventoryServer/Extensions/ReferenceFrontend.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/ReferenceFrontendPlugin.cs | |||
@@ -31,22 +31,24 @@ using System; | |||
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Xml; | 33 | using System.Xml; |
34 | using ExtensionLoader; | ||
35 | using OpenMetaverse; | 34 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | 35 | using OpenMetaverse.StructuredData; |
37 | using HttpServer; | 36 | using HttpServer; |
37 | using OpenSim.Framework; | ||
38 | 38 | ||
39 | namespace OpenSim.Grid.AssetInventoryServer.Extensions | 39 | namespace OpenSim.Grid.AssetInventoryServer.Plugins |
40 | { | 40 | { |
41 | public class ReferenceFrontend : IExtension<AssetInventoryServer> | 41 | public class ReferenceFrontendPlugin : IAssetInventoryServerPlugin |
42 | { | 42 | { |
43 | AssetInventoryServer server; | 43 | AssetInventoryServer server; |
44 | 44 | ||
45 | public ReferenceFrontend() | 45 | public ReferenceFrontendPlugin() |
46 | { | 46 | { |
47 | } | 47 | } |
48 | 48 | ||
49 | public void Start(AssetInventoryServer server) | 49 | #region IPlugin implementation |
50 | |||
51 | public void Initialise(AssetInventoryServer server) | ||
50 | { | 52 | { |
51 | this.server = server; | 53 | this.server = server; |
52 | 54 | ||
@@ -60,12 +62,36 @@ namespace OpenSim.Grid.AssetInventoryServer.Extensions | |||
60 | 62 | ||
61 | // Asset creation | 63 | // Asset creation |
62 | server.HttpServer.AddHandler("post", null, "^/createasset", CreateRequestHandler); | 64 | server.HttpServer.AddHandler("post", null, "^/createasset", CreateRequestHandler); |
65 | |||
66 | Logger.Log.Info("[ASSET] Reference Frontend loaded."); | ||
67 | } | ||
68 | |||
69 | /// <summary> | ||
70 | /// <para>Initialises asset interface</para> | ||
71 | /// </summary> | ||
72 | public void Initialise() | ||
73 | { | ||
74 | Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); | ||
75 | throw new PluginNotInitialisedException(Name); | ||
76 | } | ||
77 | |||
78 | public void Dispose() | ||
79 | { | ||
80 | } | ||
81 | |||
82 | public string Version | ||
83 | { | ||
84 | // TODO: this should be something meaningful and not hardcoded? | ||
85 | get { return "0.1"; } | ||
63 | } | 86 | } |
64 | 87 | ||
65 | public void Stop() | 88 | public string Name |
66 | { | 89 | { |
90 | get { return "AssetInventoryServer Reference asset frontend"; } | ||
67 | } | 91 | } |
68 | 92 | ||
93 | #endregion IPlugin implementation | ||
94 | |||
69 | bool MetadataRequestHandler(IHttpClientContext client, IHttpRequest request, IHttpResponse response) | 95 | bool MetadataRequestHandler(IHttpClientContext client, IHttpRequest request, IHttpResponse response) |
70 | { | 96 | { |
71 | UUID assetID; | 97 | UUID assetID; |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml b/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml index 089c6a2..0ec28de 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Resources/AssetInventoryServerPlugins.addin.xml | |||
@@ -10,4 +10,10 @@ | |||
10 | <Extension path="/OpenSim/AssetInventoryServer/MetricsProvider"> | 10 | <Extension path="/OpenSim/AssetInventoryServer/MetricsProvider"> |
11 | <Plugin id="AssetInventoryMetrics" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.NullMetricsPlugin" /> | 11 | <Plugin id="AssetInventoryMetrics" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.NullMetricsPlugin" /> |
12 | </Extension> | 12 | </Extension> |
13 | <Extension path="/OpenSim/AssetInventoryServer/Frontend"> | ||
14 | <Plugin id="BrowseFrontend" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.BrowseFrontendPlugin" /> | ||
15 | </Extension> | ||
16 | <Extension path="/OpenSim/AssetInventoryServer/Frontend"> | ||
17 | <Plugin id="ReferenceFrontend" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.ReferenceFrontendPlugin" /> | ||
18 | </Extension> | ||
13 | </Addin> | 19 | </Addin> |