From 9ac8d2de794f2942e028722fb62911d44d97514b Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Wed, 26 May 2010 19:26:30 +0200
Subject: Just because there is an agent update handler, that doesn't mean
there is a pre agent update handler. Null check these separately.
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e67428d..0945bce 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4918,14 +4918,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
arg.SessionID = x.SessionID;
arg.State = x.State;
UpdateAgent handlerAgentUpdate = OnAgentUpdate;
+ UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
lastarg = arg; // save this set of arguments for nexttime
- if (handlerAgentUpdate != null)
- {
+ if (handlerPreAgentUpdate != null)
OnPreAgentUpdate(this, arg);
+ if (handlerAgentUpdate != null)
OnAgentUpdate(this, arg);
- }
handlerAgentUpdate = null;
+ handlerPreAgentUpdate = null;
}
}
--
cgit v1.1
From 6b6425aa5ee66df3e4cad3c4453854ff4a087aa8 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 27 May 2010 19:48:21 +0200
Subject: Comment noisy "CONNECTION DEBUGGING" messages, because they push more
important stuff off screen too fast
---
OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 2 +-
.../Framework/EntityTransfer/EntityTransferModule.cs | 14 +++++++++++++-
OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 14 +++++++-------
OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 14 +++++++-------
4 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
index bdbd284..aa88836 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// the bucket, otherwise false
public bool RemoveTokens(int amount, out bool dripSucceeded)
{
- if (maxBurst == 0)
+ if (true) //maxBurst == 0)
{
dripSucceeded = true;
return true;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index ef37f63..fa49f9f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -436,7 +436,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
KillEntity(sp.Scene, sp.LocalId);
- sp.MakeChildAgent();
+ // MT wrapped this in a try because I've been seeing an
+ // eception here, but no line number. Need to see if SP is
+ // valid. This may move the exception to another place
+ // where it can be debugged better.
+ try
+ {
+ sp.MakeChildAgent();
+ }
+ catch(Exception e)
+ {
+ m_log.Error("Exception on MakeChildAgent: " + e.ToString());
+ }
+
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index 17d7850..e50481a 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -61,13 +61,13 @@ namespace OpenSim.Server.Handlers.Hypergrid
public Hashtable Handler(Hashtable request)
{
- m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
-
- m_log.Debug("---------------------------");
- m_log.Debug(" >> uri=" + request["uri"]);
- m_log.Debug(" >> content-type=" + request["content-type"]);
- m_log.Debug(" >> http-method=" + request["http-method"]);
- m_log.Debug("---------------------------\n");
+// m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
+//
+// m_log.Debug("---------------------------");
+// m_log.Debug(" >> uri=" + request["uri"]);
+// m_log.Debug(" >> content-type=" + request["content-type"]);
+// m_log.Debug(" >> http-method=" + request["http-method"]);
+// m_log.Debug("---------------------------\n");
Hashtable responsedata = new Hashtable();
responsedata["content_type"] = "text/html";
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index ab3250d..191acc9 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -61,13 +61,13 @@ namespace OpenSim.Server.Handlers.Simulation
public Hashtable Handler(Hashtable request)
{
- m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
-
- m_log.Debug("---------------------------");
- m_log.Debug(" >> uri=" + request["uri"]);
- m_log.Debug(" >> content-type=" + request["content-type"]);
- m_log.Debug(" >> http-method=" + request["http-method"]);
- m_log.Debug("---------------------------\n");
+// m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
+//
+// m_log.Debug("---------------------------");
+// m_log.Debug(" >> uri=" + request["uri"]);
+// m_log.Debug(" >> content-type=" + request["content-type"]);
+// m_log.Debug(" >> http-method=" + request["http-method"]);
+// m_log.Debug("---------------------------\n");
Hashtable responsedata = new Hashtable();
responsedata["content_type"] = "text/html";
--
cgit v1.1
From a48d7f62a7e3af1aae2437668c484d4d0d1d92e5 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 27 May 2010 19:02:20 +0100
Subject: Revert "Comment noisy "CONNECTION DEBUGGING" messages, because they
push more"
Some other stuff snuck in.
This reverts commit 4cc533e7ad94d148351c16f48afd2a688a64c48a.
---
OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 2 +-
.../Framework/EntityTransfer/EntityTransferModule.cs | 14 +-------------
OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 14 +++++++-------
OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 14 +++++++-------
4 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
index aa88836..bdbd284 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// the bucket, otherwise false
public bool RemoveTokens(int amount, out bool dripSucceeded)
{
- if (true) //maxBurst == 0)
+ if (maxBurst == 0)
{
dripSucceeded = true;
return true;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index fa49f9f..ef37f63 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -436,19 +436,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
KillEntity(sp.Scene, sp.LocalId);
- // MT wrapped this in a try because I've been seeing an
- // eception here, but no line number. Need to see if SP is
- // valid. This may move the exception to another place
- // where it can be debugged better.
- try
- {
- sp.MakeChildAgent();
- }
- catch(Exception e)
- {
- m_log.Error("Exception on MakeChildAgent: " + e.ToString());
- }
-
+ sp.MakeChildAgent();
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index e50481a..17d7850 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -61,13 +61,13 @@ namespace OpenSim.Server.Handlers.Hypergrid
public Hashtable Handler(Hashtable request)
{
-// m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
-//
-// m_log.Debug("---------------------------");
-// m_log.Debug(" >> uri=" + request["uri"]);
-// m_log.Debug(" >> content-type=" + request["content-type"]);
-// m_log.Debug(" >> http-method=" + request["http-method"]);
-// m_log.Debug("---------------------------\n");
+ m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
+
+ m_log.Debug("---------------------------");
+ m_log.Debug(" >> uri=" + request["uri"]);
+ m_log.Debug(" >> content-type=" + request["content-type"]);
+ m_log.Debug(" >> http-method=" + request["http-method"]);
+ m_log.Debug("---------------------------\n");
Hashtable responsedata = new Hashtable();
responsedata["content_type"] = "text/html";
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 191acc9..ab3250d 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -61,13 +61,13 @@ namespace OpenSim.Server.Handlers.Simulation
public Hashtable Handler(Hashtable request)
{
-// m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
-//
-// m_log.Debug("---------------------------");
-// m_log.Debug(" >> uri=" + request["uri"]);
-// m_log.Debug(" >> content-type=" + request["content-type"]);
-// m_log.Debug(" >> http-method=" + request["http-method"]);
-// m_log.Debug("---------------------------\n");
+ m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
+
+ m_log.Debug("---------------------------");
+ m_log.Debug(" >> uri=" + request["uri"]);
+ m_log.Debug(" >> content-type=" + request["content-type"]);
+ m_log.Debug(" >> http-method=" + request["http-method"]);
+ m_log.Debug("---------------------------\n");
Hashtable responsedata = new Hashtable();
responsedata["content_type"] = "text/html";
--
cgit v1.1
From ecc77e3886d1dbffc06ae728437292a6169e0fa3 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 27 May 2010 20:08:12 +0200
Subject: Comment noisy "CONNECTION DEBUGGING" messages, because they push more
important stuff off screen too fast. Clean this time
---
OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 14 +++++++-------
OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index 17d7850..e50481a 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -61,13 +61,13 @@ namespace OpenSim.Server.Handlers.Hypergrid
public Hashtable Handler(Hashtable request)
{
- m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
-
- m_log.Debug("---------------------------");
- m_log.Debug(" >> uri=" + request["uri"]);
- m_log.Debug(" >> content-type=" + request["content-type"]);
- m_log.Debug(" >> http-method=" + request["http-method"]);
- m_log.Debug("---------------------------\n");
+// m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
+//
+// m_log.Debug("---------------------------");
+// m_log.Debug(" >> uri=" + request["uri"]);
+// m_log.Debug(" >> content-type=" + request["content-type"]);
+// m_log.Debug(" >> http-method=" + request["http-method"]);
+// m_log.Debug("---------------------------\n");
Hashtable responsedata = new Hashtable();
responsedata["content_type"] = "text/html";
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index ab3250d..191acc9 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -61,13 +61,13 @@ namespace OpenSim.Server.Handlers.Simulation
public Hashtable Handler(Hashtable request)
{
- m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
-
- m_log.Debug("---------------------------");
- m_log.Debug(" >> uri=" + request["uri"]);
- m_log.Debug(" >> content-type=" + request["content-type"]);
- m_log.Debug(" >> http-method=" + request["http-method"]);
- m_log.Debug("---------------------------\n");
+// m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called");
+//
+// m_log.Debug("---------------------------");
+// m_log.Debug(" >> uri=" + request["uri"]);
+// m_log.Debug(" >> content-type=" + request["content-type"]);
+// m_log.Debug(" >> http-method=" + request["http-method"]);
+// m_log.Debug("---------------------------\n");
Hashtable responsedata = new Hashtable();
responsedata["content_type"] = "text/html";
--
cgit v1.1
From 8fb706716ba0162210d6030f3e7b5b6636b35651 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 27 May 2010 20:08:48 +0200
Subject: Prevent a null ref
---
OpenSim/Region/Framework/Scenes/SceneViewer.cs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs
index c6cf4cc..15bc33d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs
@@ -84,6 +84,9 @@ namespace OpenSim.Region.Framework.Scenes
while (m_pendingObjects != null && m_pendingObjects.Count > 0)
{
SceneObjectGroup g = m_pendingObjects.Dequeue();
+ // Yes, this can really happen
+ if (g == null)
+ continue;
// This is where we should check for draw distance
// do culling and stuff. Problem with that is that until
--
cgit v1.1
From d53057c2c7dfc7762fec99144289edf472e05bc6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 May 2010 16:26:14 +0100
Subject: hopefully get "nant test" passing again by replacing
data.sqlite/mysql references in .nant/local.include with
OpenSim.Data.Tests.dll
---
.nant/local.include | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/.nant/local.include b/.nant/local.include
index 97353e0..0b6f9fe 100644
--- a/.nant/local.include
+++ b/.nant/local.include
@@ -127,15 +127,10 @@
-
-
+
+
-
-
-
-
-
-
+
@@ -297,14 +292,9 @@
-
-
-
-
-
-
-
-
+
+
+
@@ -313,8 +303,7 @@
-
-
+
--
cgit v1.1
From 596001632b346f7b57fef746dfcee2cd4bacb2b4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 May 2010 17:53:57 +0100
Subject: remove redundant ScenePresence.QueuePartForUpdate() - every place in
the code calls SceneViewer.QueuePartForUpdate() directly
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3964b0b..45375b0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -784,15 +784,6 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
- ///
- /// Add the part to the queue of parts for which we need to send an update to the client
- ///
- ///
- public void QueuePartForUpdate(SceneObjectPart part)
- {
- m_sceneViewer.QueuePartForUpdate(part);
- }
-
public uint GenerateClientFlags(UUID ObjectID)
{
return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
--
cgit v1.1
From 877fe774ef718c96c65d9e56c1229338f94c78cb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 May 2010 17:58:51 +0100
Subject: Simplify AddFullUpdateToAvatars()/AddPartialUpdateToAvatars() by
calling the object's corresponding single avatar update method, rather than
calling the sceneviewer directly
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2357c6b..b36b9bf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1278,10 +1278,13 @@ namespace OpenSim.Region.Framework.Scenes
{
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
- avatar.SceneViewer.QueuePartForUpdate(this);
+ AddFullUpdateToAvatar(avatar);
});
}
+ ///
+ /// Tell the scene presence that it should send updates for this part to its client
+ ///
public void AddFullUpdateToAvatar(ScenePresence presence)
{
presence.SceneViewer.QueuePartForUpdate(this);
@@ -1302,7 +1305,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
- avatar.SceneViewer.QueuePartForUpdate(this);
+ AddTerseUpdateToAvatar(avatar);
});
}
--
cgit v1.1
From 565db4635f0e99cbd647cc8ba0ad963e2d1869fc Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 May 2010 18:30:33 +0100
Subject: add a smidgen more log debug information in the form of the operating
system version
---
OpenSim/Framework/Servers/BaseOpenSimServer.cs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 655df9d..f0f8d01 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -286,7 +286,11 @@ namespace OpenSim.Framework.Servers
EnhanceVersionInformation();
- m_log.Info("[STARTUP]: Version: " + m_version + "\n");
+ m_log.Info("[STARTUP]: OpenSimulator version: " + m_version + Environment.NewLine);
+ // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
+ // the clr version number doesn't match the project version number under Mono.
+ //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
+ m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
StartupSpecific();
--
cgit v1.1
From 1042ce72831780869a649bec57e95ec717d7a5a1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 May 2010 18:42:25 +0100
Subject: comment out large chunks of appearance/inventory region access
services to eliminate warnings that this code is unused
---
.../Rest/Inventory/RestAppearanceServices.cs | 302 +++---
.../Rest/Inventory/RestInventoryServices.cs | 1014 ++++++++++----------
2 files changed, 656 insertions(+), 660 deletions(-)
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
index b70a511..4369216 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
@@ -39,8 +39,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public class RestAppearanceServices : IRest
{
-
- private static readonly int PARM_USERID = 0;
+// private static readonly int PARM_USERID = 0;
// private static readonly int PARM_PATH = 1;
@@ -64,6 +63,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.InfoFormat("{0} Domain is relative, adding absolute prefix", MsgId);
qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
+ qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
Rest.Log.InfoFormat("{0} Domain is now <{1}>", MsgId, qPrefix);
}
@@ -294,31 +294,31 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
///
/// HTTP service request work area
- private void DoGet(AppearanceRequestData rdata)
- {
- AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
-
- if (adata == null)
- {
- rdata.Fail(Rest.HttpStatusCodeNoContent,
- String.Format("appearance data not found for user {0} {1}",
- rdata.userProfile.FirstName, rdata.userProfile.SurName));
- }
- rdata.userAppearance = adata.ToAvatarAppearance(rdata.userProfile.ID);
-
- rdata.initXmlWriter();
-
- FormatUserAppearance(rdata);
-
- // Indicate a successful request
-
- rdata.Complete();
-
- // Send the response to the user. The body will be implicitly
- // constructed from the result of the XML writer.
-
- rdata.Respond(String.Format("Appearance {0} Normal completion", rdata.method));
- }
+// private void DoGet(AppearanceRequestData rdata)
+// {
+// AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
+//
+// if (adata == null)
+// {
+// rdata.Fail(Rest.HttpStatusCodeNoContent,
+// String.Format("appearance data not found for user {0} {1}",
+// rdata.userProfile.FirstName, rdata.userProfile.SurName));
+// }
+// rdata.userAppearance = adata.ToAvatarAppearance(rdata.userProfile.ID);
+//
+// rdata.initXmlWriter();
+//
+// FormatUserAppearance(rdata);
+//
+// // Indicate a successful request
+//
+// rdata.Complete();
+//
+// // Send the response to the user. The body will be implicitly
+// // constructed from the result of the XML writer.
+//
+// rdata.Respond(String.Format("Appearance {0} Normal completion", rdata.method));
+// }
///
/// POST adds NEW information to the user profile database.
@@ -326,112 +326,112 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// characteristics supplied in the request.
///
- private void DoExtend(AppearanceRequestData rdata)
- {
-
- bool created = false;
- bool modified = false;
- string newnode = String.Empty;
-
- Rest.Log.DebugFormat("{0} POST ENTRY", MsgId);
-
- //AvatarAppearance old = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
-
- rdata.userAppearance = new AvatarAppearance();
-
- // Although the following behavior is admitted by HTTP I am becoming
- // increasingly doubtful that it is appropriate for REST. If I attempt to
- // add a new record, and it already exists, then it seems to me that the
- // attempt should fail, rather than update the existing record.
- AvatarData adata = null;
- if (GetUserAppearance(rdata))
- {
- modified = rdata.userAppearance != null;
- created = !modified;
- adata = new AvatarData(rdata.userAppearance);
- Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
- // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
- }
- else
- {
- created = true;
- adata = new AvatarData(rdata.userAppearance);
- Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
- // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
- }
-
- if (created)
- {
- newnode = String.Format("{0} {1}", rdata.userProfile.FirstName,
- rdata.userProfile.SurName);
- // Must include a location header with a URI that identifies the new resource.
-
- rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}{3}{4}",
- rdata.hostname,rdata.port,rdata.path,Rest.UrlPathSeparator, newnode));
- rdata.Complete(Rest.HttpStatusCodeCreated);
-
- }
- else
- {
- if (modified)
- {
- rdata.Complete(Rest.HttpStatusCodeOK);
- }
- else
- {
- rdata.Complete(Rest.HttpStatusCodeNoContent);
- }
- }
-
- rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
-
- }
+// private void DoExtend(AppearanceRequestData rdata)
+// {
+//
+// bool created = false;
+// bool modified = false;
+// string newnode = String.Empty;
+//
+// Rest.Log.DebugFormat("{0} POST ENTRY", MsgId);
+//
+// //AvatarAppearance old = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
+//
+// rdata.userAppearance = new AvatarAppearance();
+//
+// // Although the following behavior is admitted by HTTP I am becoming
+// // increasingly doubtful that it is appropriate for REST. If I attempt to
+// // add a new record, and it already exists, then it seems to me that the
+// // attempt should fail, rather than update the existing record.
+// AvatarData adata = null;
+// if (GetUserAppearance(rdata))
+// {
+// modified = rdata.userAppearance != null;
+// created = !modified;
+// adata = new AvatarData(rdata.userAppearance);
+// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
+// // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
+// }
+// else
+// {
+// created = true;
+// adata = new AvatarData(rdata.userAppearance);
+// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
+// // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
+// }
+//
+// if (created)
+// {
+// newnode = String.Format("{0} {1}", rdata.userProfile.FirstName,
+// rdata.userProfile.SurName);
+// // Must include a location header with a URI that identifies the new resource.
+//
+// rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}{3}{4}",
+// rdata.hostname,rdata.port,rdata.path,Rest.UrlPathSeparator, newnode));
+// rdata.Complete(Rest.HttpStatusCodeCreated);
+//
+// }
+// else
+// {
+// if (modified)
+// {
+// rdata.Complete(Rest.HttpStatusCodeOK);
+// }
+// else
+// {
+// rdata.Complete(Rest.HttpStatusCodeNoContent);
+// }
+// }
+//
+// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
+//
+// }
///
/// This updates the user's appearance. not all aspects need to be provided,
/// only those supplied will be changed.
///
- private void DoUpdate(AppearanceRequestData rdata)
- {
-
- // REFACTORING PROBLEM This was commented out. It doesn't work for 0.7
-
- //bool created = false;
- //bool modified = false;
-
-
- //rdata.userAppearance = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
-
- //// If the user exists then this is considered a modification regardless
- //// of what may, or may not be, specified in the payload.
-
- //if (rdata.userAppearance != null)
- //{
- // modified = true;
- // Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance);
- // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
- //}
-
- //if (created)
- //{
- // rdata.Complete(Rest.HttpStatusCodeCreated);
- //}
- //else
- //{
- // if (modified)
- // {
- // rdata.Complete(Rest.HttpStatusCodeOK);
- // }
- // else
- // {
- // rdata.Complete(Rest.HttpStatusCodeNoContent);
- // }
- //}
-
- rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
-
- }
+// private void DoUpdate(AppearanceRequestData rdata)
+// {
+//
+// // REFACTORING PROBLEM This was commented out. It doesn't work for 0.7
+//
+// //bool created = false;
+// //bool modified = false;
+//
+//
+// //rdata.userAppearance = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
+//
+// //// If the user exists then this is considered a modification regardless
+// //// of what may, or may not be, specified in the payload.
+//
+// //if (rdata.userAppearance != null)
+// //{
+// // modified = true;
+// // Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance);
+// // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
+// //}
+//
+// //if (created)
+// //{
+// // rdata.Complete(Rest.HttpStatusCodeCreated);
+// //}
+// //else
+// //{
+// // if (modified)
+// // {
+// // rdata.Complete(Rest.HttpStatusCodeOK);
+// // }
+// // else
+// // {
+// // rdata.Complete(Rest.HttpStatusCodeNoContent);
+// // }
+// //}
+//
+// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
+//
+// }
///
/// Delete the specified user's appearance. This actually performs a reset
@@ -439,31 +439,29 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// Existing ownership is preserved. All prior updates are lost and can not
/// be recovered.
///
-
- private void DoDelete(AppearanceRequestData rdata)
- {
- AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
-
- if (adata != null)
- {
- AvatarAppearance old = adata.ToAvatarAppearance(rdata.userProfile.ID);
- rdata.userAppearance = new AvatarAppearance();
- rdata.userAppearance.Owner = old.Owner;
- adata = new AvatarData(rdata.userAppearance);
-
- Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
-
- rdata.Complete();
- }
- else
- {
-
- rdata.Complete(Rest.HttpStatusCodeNoContent);
- }
-
- rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
-
- }
+// private void DoDelete(AppearanceRequestData rdata)
+// {
+// AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
+//
+// if (adata != null)
+// {
+// AvatarAppearance old = adata.ToAvatarAppearance(rdata.userProfile.ID);
+// rdata.userAppearance = new AvatarAppearance();
+// rdata.userAppearance.Owner = old.Owner;
+// adata = new AvatarData(rdata.userAppearance);
+//
+// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
+//
+// rdata.Complete();
+// }
+// else
+// {
+//
+// rdata.Complete(Rest.HttpStatusCodeNoContent);
+// }
+//
+// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
+// }
#endregion method-specific processing
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
index 10f387d..a4135db 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
@@ -45,10 +45,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
public class RestInventoryServices : IRest
{
- private static readonly int PARM_USERID = 0;
+// private static readonly int PARM_USERID = 0;
private static readonly int PARM_PATH = 1;
- private bool enabled = false;
+// private bool enabled = false;
private string qPrefix = "inventory";
private static readonly string PRIVATE_ROOT_NAME = "My Inventory";
@@ -79,7 +79,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// Activate if everything went OK
- enabled = true;
+// enabled = true;
Rest.Log.InfoFormat("{0} Inventory services initialization complete", MsgId);
}
@@ -100,7 +100,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
public void Close()
{
- enabled = false;
+// enabled = false;
Rest.Log.InfoFormat("{0} Inventory services closing down", MsgId);
}
@@ -139,7 +139,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// A consolidated HTTP request work area
private void DoInventory(RequestData hdata)
{
- InventoryRequestData rdata = (InventoryRequestData) hdata;
+// InventoryRequestData rdata = (InventoryRequestData) hdata;
Rest.Log.DebugFormat("{0} DoInventory ENTRY", MsgId);
@@ -354,32 +354,32 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// corresponding subtree based upon node name.
///
/// HTTP service request work area
- private void DoGet(InventoryRequestData rdata)
- {
- rdata.initXmlWriter();
-
- rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty);
-
- // If there are additional parameters, then these represent
- // a path relative to the root of the inventory. This path
- // must be traversed before we format the sub-tree thus
- // identified.
-
- traverse(rdata, rdata.root, PARM_PATH);
-
- // Close all open elements
-
- rdata.writer.WriteFullEndElement();
-
- // Indicate a successful request
-
- rdata.Complete();
-
- // Send the response to the user. The body will be implicitly
- // constructed from the result of the XML writer.
-
- rdata.Respond(String.Format("Inventory {0} Normal completion", rdata.method));
- }
+// private void DoGet(InventoryRequestData rdata)
+// {
+// rdata.initXmlWriter();
+//
+// rdata.writer.WriteStartElement(String.Empty,"Inventory",String.Empty);
+//
+// // If there are additional parameters, then these represent
+// // a path relative to the root of the inventory. This path
+// // must be traversed before we format the sub-tree thus
+// // identified.
+//
+// traverse(rdata, rdata.root, PARM_PATH);
+//
+// // Close all open elements
+//
+// rdata.writer.WriteFullEndElement();
+//
+// // Indicate a successful request
+//
+// rdata.Complete();
+//
+// // Send the response to the user. The body will be implicitly
+// // constructed from the result of the XML writer.
+//
+// rdata.Respond(String.Format("Inventory {0} Normal completion", rdata.method));
+// }
///
/// In the case of the inventory, and probably in general,
@@ -419,210 +419,210 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// context identified by the URI.
///
/// HTTP service request work area
- private void DoExtend(InventoryRequestData rdata)
- {
- bool created = false;
- bool modified = false;
- string newnode = String.Empty;
-
- // Resolve the context node specified in the URI. Entity
- // data will be ADDED beneath this node. rdata already contains
- // information about the current content of the user's
- // inventory.
-
- Object InventoryNode = getInventoryNode(rdata, rdata.root, PARM_PATH, Rest.Fill);
-
- // Processing depends upon the type of inventory node
- // identified in the URI. This is the CONTEXT for the
- // change. We either got a context or we threw an
- // exception.
-
- // It follows that we can only add information if the URI
- // has identified a folder. So only a type of folder is supported
- // in this case.
-
- if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
- typeof(InventoryFolderImpl) == InventoryNode.GetType())
- {
- // Cast the context node appropriately.
-
- InventoryFolderBase context = (InventoryFolderBase) InventoryNode;
-
- Rest.Log.DebugFormat("{0} {1}: Resource(s) will be added to folder {2}",
- MsgId, rdata.method, rdata.path);
-
- // Reconstitute the inventory sub-tree from the XML supplied in the entity.
- // The result is a stand-alone inventory subtree, not yet integrated into the
- // existing tree. An inventory collection consists of three components:
- // [1] A (possibly empty) set of folders.
- // [2] A (possibly empty) set of items.
- // [3] A (possibly empty) set of assets.
- // If all of these are empty, then the POST is a harmless no-operation.
-
- XmlInventoryCollection entity = ReconstituteEntity(rdata);
-
- // Inlined assets can be included in entity. These must be incorporated into
- // the asset database before we attempt to update the inventory. If anything
- // fails, return a failure to requestor.
-
- if (entity.Assets.Count > 0)
- {
- Rest.Log.DebugFormat("{0} Adding {1} assets to server",
- MsgId, entity.Assets.Count);
-
- foreach (AssetBase asset in entity.Assets)
- {
- Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
- MsgId, asset.ID, asset.Type, asset.Name);
- Rest.AssetServices.Store(asset);
-
- created = true;
- rdata.appendStatus(String.Format("
Created asset {0}, UUID {1}
",
- asset.Name, asset.ID));
-
- if (Rest.DEBUG && Rest.DumpAsset)
- {
- Rest.Dump(asset.Data);
- }
- }
- }
-
- // Modify the context using the collection of folders and items
- // returned in the XmlInventoryCollection.
-
- foreach (InventoryFolderBase folder in entity.Folders)
- {
- InventoryFolderBase found;
-
- // If the parentID is zero, then this folder is going
- // into the root folder identified by the URI. The requestor
- // may have already set the parent ID explicitly, in which
- // case we don't have to do it here.
-
- if (folder.ParentID == UUID.Zero || folder.ParentID == context.ID)
- {
- if (newnode != String.Empty)
- {
- Rest.Log.DebugFormat("{0} Too many resources", MsgId);
- rdata.Fail(Rest.HttpStatusCodeBadRequest, "only one root entity is allowed");
- }
- folder.ParentID = context.ID;
- newnode = folder.Name;
- }
-
- // Search the existing inventory for an existing entry. If
- // we have one, we need to decide if it has really changed.
- // It could just be present as (unnecessary) context, and we
- // don't want to waste time updating the database in that
- // case, OR, it could be being moved from another location
- // in which case an update is most certainly necessary.
-
- found = null;
-
- foreach (InventoryFolderBase xf in rdata.folders)
- {
- // Compare identifying attribute
- if (xf.ID == folder.ID)
- {
- found = xf;
- break;
- }
- }
-
- if (found != null && FolderHasChanged(folder,found))
- {
- Rest.Log.DebugFormat("{0} Updating existing folder", MsgId);
- Rest.InventoryServices.MoveFolder(folder);
-
- modified = true;
- rdata.appendStatus(String.Format("
",
- folder.Name, folder.ID));
- }
- }
-
- // Now we repeat a similar process for the items included
- // in the entity.
-
- foreach (InventoryItemBase item in entity.Items)
- {
- InventoryItemBase found = null;
-
- // If the parentID is zero, then this is going
- // directly into the root identified by the URI.
-
- if (item.Folder == UUID.Zero)
- {
- item.Folder = context.ID;
- }
-
- // Determine whether this is a new item or a
- // replacement definition.
-
- foreach (InventoryItemBase xi in rdata.items)
- {
- // Compare identifying attribute
- if (xi.ID == item.ID)
- {
- found = xi;
- break;
- }
- }
-
- if (found != null && ItemHasChanged(item, found))
- {
- Rest.Log.DebugFormat("{0} Updating item {1} {2} {3} {4} {5}",
- MsgId, item.ID, item.AssetID, item.InvType, item.AssetType, item.Name);
- Rest.InventoryServices.UpdateItem(item);
- modified = true;
- rdata.appendStatus(String.Format("
", item.Name, item.ID));
- }
- }
-
- if (created)
- {
- // Must include a location header with a URI that identifies the new resource.
- rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}/{3}",
- rdata.hostname, rdata.port,rdata.path,newnode));
- rdata.Complete(Rest.HttpStatusCodeCreated);
- }
- else
- {
- if (modified)
- {
- rdata.Complete(Rest.HttpStatusCodeOK);
- }
- else
- {
- rdata.Complete(Rest.HttpStatusCodeNoContent);
- }
- }
-
- rdata.Respond(String.Format("Profile {0} : Normal completion", rdata.method));
- }
- else
- {
- Rest.Log.DebugFormat("{0} {1}: Resource {2} is not a valid context: {3}",
- MsgId, rdata.method, rdata.path, InventoryNode.GetType());
- rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid resource context");
- }
- }
+// private void DoExtend(InventoryRequestData rdata)
+// {
+// bool created = false;
+// bool modified = false;
+// string newnode = String.Empty;
+//
+// // Resolve the context node specified in the URI. Entity
+// // data will be ADDED beneath this node. rdata already contains
+// // information about the current content of the user's
+// // inventory.
+//
+// Object InventoryNode = getInventoryNode(rdata, rdata.root, PARM_PATH, Rest.Fill);
+//
+// // Processing depends upon the type of inventory node
+// // identified in the URI. This is the CONTEXT for the
+// // change. We either got a context or we threw an
+// // exception.
+//
+// // It follows that we can only add information if the URI
+// // has identified a folder. So only a type of folder is supported
+// // in this case.
+//
+// if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
+// typeof(InventoryFolderImpl) == InventoryNode.GetType())
+// {
+// // Cast the context node appropriately.
+//
+// InventoryFolderBase context = (InventoryFolderBase) InventoryNode;
+//
+// Rest.Log.DebugFormat("{0} {1}: Resource(s) will be added to folder {2}",
+// MsgId, rdata.method, rdata.path);
+//
+// // Reconstitute the inventory sub-tree from the XML supplied in the entity.
+// // The result is a stand-alone inventory subtree, not yet integrated into the
+// // existing tree. An inventory collection consists of three components:
+// // [1] A (possibly empty) set of folders.
+// // [2] A (possibly empty) set of items.
+// // [3] A (possibly empty) set of assets.
+// // If all of these are empty, then the POST is a harmless no-operation.
+//
+// XmlInventoryCollection entity = ReconstituteEntity(rdata);
+//
+// // Inlined assets can be included in entity. These must be incorporated into
+// // the asset database before we attempt to update the inventory. If anything
+// // fails, return a failure to requestor.
+//
+// if (entity.Assets.Count > 0)
+// {
+// Rest.Log.DebugFormat("{0} Adding {1} assets to server",
+// MsgId, entity.Assets.Count);
+//
+// foreach (AssetBase asset in entity.Assets)
+// {
+// Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
+// MsgId, asset.ID, asset.Type, asset.Name);
+// Rest.AssetServices.Store(asset);
+//
+// created = true;
+// rdata.appendStatus(String.Format("
Created asset {0}, UUID {1}
",
+// asset.Name, asset.ID));
+//
+// if (Rest.DEBUG && Rest.DumpAsset)
+// {
+// Rest.Dump(asset.Data);
+// }
+// }
+// }
+//
+// // Modify the context using the collection of folders and items
+// // returned in the XmlInventoryCollection.
+//
+// foreach (InventoryFolderBase folder in entity.Folders)
+// {
+// InventoryFolderBase found;
+//
+// // If the parentID is zero, then this folder is going
+// // into the root folder identified by the URI. The requestor
+// // may have already set the parent ID explicitly, in which
+// // case we don't have to do it here.
+//
+// if (folder.ParentID == UUID.Zero || folder.ParentID == context.ID)
+// {
+// if (newnode != String.Empty)
+// {
+// Rest.Log.DebugFormat("{0} Too many resources", MsgId);
+// rdata.Fail(Rest.HttpStatusCodeBadRequest, "only one root entity is allowed");
+// }
+// folder.ParentID = context.ID;
+// newnode = folder.Name;
+// }
+//
+// // Search the existing inventory for an existing entry. If
+// // we have one, we need to decide if it has really changed.
+// // It could just be present as (unnecessary) context, and we
+// // don't want to waste time updating the database in that
+// // case, OR, it could be being moved from another location
+// // in which case an update is most certainly necessary.
+//
+// found = null;
+//
+// foreach (InventoryFolderBase xf in rdata.folders)
+// {
+// // Compare identifying attribute
+// if (xf.ID == folder.ID)
+// {
+// found = xf;
+// break;
+// }
+// }
+//
+// if (found != null && FolderHasChanged(folder,found))
+// {
+// Rest.Log.DebugFormat("{0} Updating existing folder", MsgId);
+// Rest.InventoryServices.MoveFolder(folder);
+//
+// modified = true;
+// rdata.appendStatus(String.Format("
",
+// folder.Name, folder.ID));
+// }
+// }
+//
+// // Now we repeat a similar process for the items included
+// // in the entity.
+//
+// foreach (InventoryItemBase item in entity.Items)
+// {
+// InventoryItemBase found = null;
+//
+// // If the parentID is zero, then this is going
+// // directly into the root identified by the URI.
+//
+// if (item.Folder == UUID.Zero)
+// {
+// item.Folder = context.ID;
+// }
+//
+// // Determine whether this is a new item or a
+// // replacement definition.
+//
+// foreach (InventoryItemBase xi in rdata.items)
+// {
+// // Compare identifying attribute
+// if (xi.ID == item.ID)
+// {
+// found = xi;
+// break;
+// }
+// }
+//
+// if (found != null && ItemHasChanged(item, found))
+// {
+// Rest.Log.DebugFormat("{0} Updating item {1} {2} {3} {4} {5}",
+// MsgId, item.ID, item.AssetID, item.InvType, item.AssetType, item.Name);
+// Rest.InventoryServices.UpdateItem(item);
+// modified = true;
+// rdata.appendStatus(String.Format("
", item.Name, item.ID));
+// }
+// }
+//
+// if (created)
+// {
+// // Must include a location header with a URI that identifies the new resource.
+// rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}/{3}",
+// rdata.hostname, rdata.port,rdata.path,newnode));
+// rdata.Complete(Rest.HttpStatusCodeCreated);
+// }
+// else
+// {
+// if (modified)
+// {
+// rdata.Complete(Rest.HttpStatusCodeOK);
+// }
+// else
+// {
+// rdata.Complete(Rest.HttpStatusCodeNoContent);
+// }
+// }
+//
+// rdata.Respond(String.Format("Profile {0} : Normal completion", rdata.method));
+// }
+// else
+// {
+// Rest.Log.DebugFormat("{0} {1}: Resource {2} is not a valid context: {3}",
+// MsgId, rdata.method, rdata.path, InventoryNode.GetType());
+// rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid resource context");
+// }
+// }
///
/// PUT updates the URI-identified element in the inventory. This
@@ -646,243 +646,242 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// during the reconstitution process.
///
/// HTTP service request work area
- private void DoUpdate(InventoryRequestData rdata)
- {
- int count = 0;
- bool created = false;
- bool modified = false;
-
- // Resolve the inventory node that is to be modified.
- // rdata already contains information about the current
- // content of the user's inventory.
-
- Object InventoryNode = getInventoryNode(rdata, rdata.root, PARM_PATH, Rest.Fill);
-
- // As long as we have a node, then we have something
- // meaningful to do, unlike POST. So we reconstitute the
- // subtree before doing anything else. Note that we
- // etiher got a valid node or we threw an exception.
-
- XmlInventoryCollection entity = ReconstituteEntity(rdata);
-
- // Incorporate any inlined assets first. Any failures
- // will terminate the request.
-
- if (entity.Assets.Count > 0)
- {
- Rest.Log.DebugFormat("{0} Adding {1} assets to server",
- MsgId, entity.Assets.Count);
-
- foreach (AssetBase asset in entity.Assets)
- {
- Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
- MsgId, asset.ID, asset.Type, asset.Name);
-
- // The asset was validated during the collection process
-
- Rest.AssetServices.Store(asset);
-
- created = true;
- rdata.appendStatus(String.Format("
Created asset {0}, UUID {1}
", asset.Name, asset.ID));
-
- if (Rest.DEBUG && Rest.DumpAsset)
- {
- Rest.Dump(asset.Data);
- }
- }
- }
-
- // The URI specifies either a folder or an item to be updated.
- //
- // The root node in the entity will replace the node identified
- // by the URI. This means the parent will remain the same, but
- // any or all attributes associated with the named element
- // will change.
- //
- // If the inventory collection contains an element with a zero
- // parent ID, then this is taken to be the replacement for the
- // named node. The collection MAY also specify an explicit
- // parent ID, in this case it MAY identify the same parent as
- // the current node, or it MAY specify a different parent,
- // indicating that the folder is being moved in addition to any
- // other modifications being made.
-
- if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
- typeof(InventoryFolderImpl) == InventoryNode.GetType())
- {
- bool rfound = false;
- InventoryFolderBase uri = (InventoryFolderBase) InventoryNode;
- InventoryFolderBase xml = null;
-
- // If the entity to be replaced resolved to be the root
- // directory itself (My Inventory), then make sure that
- // the supplied data include as appropriately typed and
- // named folder. Note that we can;t rule out the possibility
- // of a sub-directory being called "My Inventory", so that
- // is anticipated.
-
- if (uri == rdata.root)
- {
- foreach (InventoryFolderBase folder in entity.Folders)
- {
- if ((rfound = (folder.Name == PRIVATE_ROOT_NAME)))
- {
- if ((rfound = (folder.ParentID == UUID.Zero)))
- break;
- }
- }
-
- if (!rfound)
- {
- Rest.Log.DebugFormat("{0} {1}: Path <{2}> will result in loss of inventory",
- MsgId, rdata.method, rdata.path);
- rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid inventory structure");
- }
- }
-
- // Scan the set of folders in the entity collection for an
- // entry that matches the context folder. It is assumed that
- // the only reliable indicator of this is a zero UUID (using
- // implicit context), or the parent's UUID matches that of the
- // URI designated node (explicit context). We don't allow
- // ambiguity in this case because this is POST and we are
- // supposed to be modifying a specific node.
- // We assign any element IDs required as an economy; we don't
- // want to iterate over the fodler set again if it can be
- // helped.
-
- foreach (InventoryFolderBase folder in entity.Folders)
- {
- if (folder.ParentID == uri.ParentID ||
- folder.ParentID == UUID.Zero)
- {
- folder.ParentID = uri.ParentID;
- xml = folder;
- count++;
- }
- }
-
- // More than one entry is ambiguous. Other folders should be
- // added using the POST verb.
-
- if (count > 1)
- {
- Rest.Log.DebugFormat("{0} {1}: Request for <{2}> is ambiguous",
- MsgId, rdata.method, rdata.path);
- rdata.Fail(Rest.HttpStatusCodeConflict, "context is ambiguous");
- }
-
- // Exactly one entry means we ARE replacing the node
- // identified by the URI. So we delete the old folder
- // by moving it to the trash and then purging it.
- // We then add all of the folders and items we
- // included in the entity. The subtree has been
- // modified.
-
- if (count == 1)
- {
- InventoryFolderBase TrashCan = GetTrashCan(rdata);
-
- // All went well, so we generate a UUID is one is
- // needed.
-
- if (xml.ID == UUID.Zero)
- {
- xml.ID = UUID.Random();
- }
-
- uri.ParentID = TrashCan.ID;
- Rest.InventoryServices.MoveFolder(uri);
- Rest.InventoryServices.PurgeFolder(TrashCan);
- modified = true;
- }
-
- // Now, regardelss of what they represent, we
- // integrate all of the elements in the entity.
-
- foreach (InventoryFolderBase f in entity.Folders)
- {
- rdata.appendStatus(String.Format("
Moving folder {0} UUID {1}
", f.Name, f.ID));
- Rest.InventoryServices.MoveFolder(f);
- }
-
- foreach (InventoryItemBase it in entity.Items)
- {
- rdata.appendStatus(String.Format("
Storing item {0} UUID {1}
", it.Name, it.ID));
- Rest.InventoryServices.AddItem(it);
- }
- }
-
- ///
- /// URI specifies an item to be updated
- ///
- ///
- /// The entity must contain a single item node to be
- /// updated. ID and Folder ID must be correct.
- ///
-
- else
- {
- InventoryItemBase uri = (InventoryItemBase) InventoryNode;
- InventoryItemBase xml = null;
-
- if (entity.Folders.Count != 0)
- {
- Rest.Log.DebugFormat("{0} {1}: Request should not contain any folders <{2}>",
- MsgId, rdata.method, rdata.path);
- rdata.Fail(Rest.HttpStatusCodeBadRequest, "folder is not allowed");
- }
-
- if (entity.Items.Count > 1)
- {
- Rest.Log.DebugFormat("{0} {1}: Entity contains too many items <{2}>",
- MsgId, rdata.method, rdata.path);
- rdata.Fail(Rest.HttpStatusCodeBadRequest, "too may items");
- }
-
- xml = entity.Items[0];
-
- if (xml.ID == UUID.Zero)
- {
- xml.ID = UUID.Random();
- }
-
- // If the folder reference has changed, then this item is
- // being moved. Otherwise we'll just delete the old, and
- // add in the new.
-
- // Delete the old item
-
- List uuids = new List();
- uuids.Add(uri.ID);
- Rest.InventoryServices.DeleteItems(uri.Owner, uuids);
-
- // Add the new item to the inventory
-
- Rest.InventoryServices.AddItem(xml);
-
- rdata.appendStatus(String.Format("
Storing item {0} UUID {1}
", xml.Name, xml.ID));
- }
-
- if (created)
- {
- rdata.Complete(Rest.HttpStatusCodeCreated);
- }
- else
- {
- if (modified)
- {
- rdata.Complete(Rest.HttpStatusCodeOK);
- }
- else
- {
- rdata.Complete(Rest.HttpStatusCodeNoContent);
- }
- }
-
- rdata.Respond(String.Format("Profile {0} : Normal completion", rdata.method));
-
- }
+// private void DoUpdate(InventoryRequestData rdata)
+// {
+// int count = 0;
+// bool created = false;
+// bool modified = false;
+//
+// // Resolve the inventory node that is to be modified.
+// // rdata already contains information about the current
+// // content of the user's inventory.
+//
+// Object InventoryNode = getInventoryNode(rdata, rdata.root, PARM_PATH, Rest.Fill);
+//
+// // As long as we have a node, then we have something
+// // meaningful to do, unlike POST. So we reconstitute the
+// // subtree before doing anything else. Note that we
+// // etiher got a valid node or we threw an exception.
+//
+// XmlInventoryCollection entity = ReconstituteEntity(rdata);
+//
+// // Incorporate any inlined assets first. Any failures
+// // will terminate the request.
+//
+// if (entity.Assets.Count > 0)
+// {
+// Rest.Log.DebugFormat("{0} Adding {1} assets to server",
+// MsgId, entity.Assets.Count);
+//
+// foreach (AssetBase asset in entity.Assets)
+// {
+// Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
+// MsgId, asset.ID, asset.Type, asset.Name);
+//
+// // The asset was validated during the collection process
+//
+// Rest.AssetServices.Store(asset);
+//
+// created = true;
+// rdata.appendStatus(String.Format("
Created asset {0}, UUID {1}
", asset.Name, asset.ID));
+//
+// if (Rest.DEBUG && Rest.DumpAsset)
+// {
+// Rest.Dump(asset.Data);
+// }
+// }
+// }
+//
+// // The URI specifies either a folder or an item to be updated.
+// //
+// // The root node in the entity will replace the node identified
+// // by the URI. This means the parent will remain the same, but
+// // any or all attributes associated with the named element
+// // will change.
+// //
+// // If the inventory collection contains an element with a zero
+// // parent ID, then this is taken to be the replacement for the
+// // named node. The collection MAY also specify an explicit
+// // parent ID, in this case it MAY identify the same parent as
+// // the current node, or it MAY specify a different parent,
+// // indicating that the folder is being moved in addition to any
+// // other modifications being made.
+//
+// if (typeof(InventoryFolderBase) == InventoryNode.GetType() ||
+// typeof(InventoryFolderImpl) == InventoryNode.GetType())
+// {
+// bool rfound = false;
+// InventoryFolderBase uri = (InventoryFolderBase) InventoryNode;
+// InventoryFolderBase xml = null;
+//
+// // If the entity to be replaced resolved to be the root
+// // directory itself (My Inventory), then make sure that
+// // the supplied data include as appropriately typed and
+// // named folder. Note that we can;t rule out the possibility
+// // of a sub-directory being called "My Inventory", so that
+// // is anticipated.
+//
+// if (uri == rdata.root)
+// {
+// foreach (InventoryFolderBase folder in entity.Folders)
+// {
+// if ((rfound = (folder.Name == PRIVATE_ROOT_NAME)))
+// {
+// if ((rfound = (folder.ParentID == UUID.Zero)))
+// break;
+// }
+// }
+//
+// if (!rfound)
+// {
+// Rest.Log.DebugFormat("{0} {1}: Path <{2}> will result in loss of inventory",
+// MsgId, rdata.method, rdata.path);
+// rdata.Fail(Rest.HttpStatusCodeBadRequest, "invalid inventory structure");
+// }
+// }
+//
+// // Scan the set of folders in the entity collection for an
+// // entry that matches the context folder. It is assumed that
+// // the only reliable indicator of this is a zero UUID (using
+// // implicit context), or the parent's UUID matches that of the
+// // URI designated node (explicit context). We don't allow
+// // ambiguity in this case because this is POST and we are
+// // supposed to be modifying a specific node.
+// // We assign any element IDs required as an economy; we don't
+// // want to iterate over the fodler set again if it can be
+// // helped.
+//
+// foreach (InventoryFolderBase folder in entity.Folders)
+// {
+// if (folder.ParentID == uri.ParentID ||
+// folder.ParentID == UUID.Zero)
+// {
+// folder.ParentID = uri.ParentID;
+// xml = folder;
+// count++;
+// }
+// }
+//
+// // More than one entry is ambiguous. Other folders should be
+// // added using the POST verb.
+//
+// if (count > 1)
+// {
+// Rest.Log.DebugFormat("{0} {1}: Request for <{2}> is ambiguous",
+// MsgId, rdata.method, rdata.path);
+// rdata.Fail(Rest.HttpStatusCodeConflict, "context is ambiguous");
+// }
+//
+// // Exactly one entry means we ARE replacing the node
+// // identified by the URI. So we delete the old folder
+// // by moving it to the trash and then purging it.
+// // We then add all of the folders and items we
+// // included in the entity. The subtree has been
+// // modified.
+//
+// if (count == 1)
+// {
+// InventoryFolderBase TrashCan = GetTrashCan(rdata);
+//
+// // All went well, so we generate a UUID is one is
+// // needed.
+//
+// if (xml.ID == UUID.Zero)
+// {
+// xml.ID = UUID.Random();
+// }
+//
+// uri.ParentID = TrashCan.ID;
+// Rest.InventoryServices.MoveFolder(uri);
+// Rest.InventoryServices.PurgeFolder(TrashCan);
+// modified = true;
+// }
+//
+// // Now, regardelss of what they represent, we
+// // integrate all of the elements in the entity.
+//
+// foreach (InventoryFolderBase f in entity.Folders)
+// {
+// rdata.appendStatus(String.Format("
Moving folder {0} UUID {1}
", f.Name, f.ID));
+// Rest.InventoryServices.MoveFolder(f);
+// }
+//
+// foreach (InventoryItemBase it in entity.Items)
+// {
+// rdata.appendStatus(String.Format("
Storing item {0} UUID {1}
", it.Name, it.ID));
+// Rest.InventoryServices.AddItem(it);
+// }
+// }
+//
+// ///
+// /// URI specifies an item to be updated
+// ///
+// ///
+// /// The entity must contain a single item node to be
+// /// updated. ID and Folder ID must be correct.
+// ///
+//
+// else
+// {
+// InventoryItemBase uri = (InventoryItemBase) InventoryNode;
+// InventoryItemBase xml = null;
+//
+// if (entity.Folders.Count != 0)
+// {
+// Rest.Log.DebugFormat("{0} {1}: Request should not contain any folders <{2}>",
+// MsgId, rdata.method, rdata.path);
+// rdata.Fail(Rest.HttpStatusCodeBadRequest, "folder is not allowed");
+// }
+//
+// if (entity.Items.Count > 1)
+// {
+// Rest.Log.DebugFormat("{0} {1}: Entity contains too many items <{2}>",
+// MsgId, rdata.method, rdata.path);
+// rdata.Fail(Rest.HttpStatusCodeBadRequest, "too may items");
+// }
+//
+// xml = entity.Items[0];
+//
+// if (xml.ID == UUID.Zero)
+// {
+// xml.ID = UUID.Random();
+// }
+//
+// // If the folder reference has changed, then this item is
+// // being moved. Otherwise we'll just delete the old, and
+// // add in the new.
+//
+// // Delete the old item
+//
+// List uuids = new List();
+// uuids.Add(uri.ID);
+// Rest.InventoryServices.DeleteItems(uri.Owner, uuids);
+//
+// // Add the new item to the inventory
+//
+// Rest.InventoryServices.AddItem(xml);
+//
+// rdata.appendStatus(String.Format("