aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
diff options
context:
space:
mode:
authorDr Scofield2008-09-18 15:49:52 +0000
committerDr Scofield2008-09-18 15:49:52 +0000
commit978b8af77702f1e2129ad18e247273a8dd20778d (patch)
tree423d9f85844f4b5d79044fc95e1973369aa1c626 /OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
parentadds support to delete a region completely and offers that (diff)
downloadopensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.zip
opensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.tar.gz
opensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.tar.bz2
opensim-SC-978b8af77702f1e2129ad18e247273a8dd20778d.tar.xz
Adds REST interface for setting avatar appearance. cleans up a couple
of places in the REST inventory code.
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs29
1 files changed, 17 insertions, 12 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
index d352655..6791cba 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
@@ -66,7 +66,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
66 66
67 if (!qPrefix.StartsWith(Rest.UrlPathSeparator)) 67 if (!qPrefix.StartsWith(Rest.UrlPathSeparator))
68 { 68 {
69 qPrefix = Rest.Prefix + Rest.UrlPathSeparator + qPrefix; 69 Rest.Log.InfoFormat("{0} Domain is relative, adding absolute prefix", MsgId);
70 qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
71 Rest.Log.InfoFormat("{0} Domain is now <{1}>", MsgId, qPrefix);
70 } 72 }
71 73
72 // Register interface using the absolute URI. 74 // Register interface using the absolute URI.
@@ -262,7 +264,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
262 // TODO 264 // TODO
263 // If something went wrong in inventory processing the thread could stall here 265 // If something went wrong in inventory processing the thread could stall here
264 // indefinitely. There should be a watchdog timer to fail the request if the 266 // indefinitely. There should be a watchdog timer to fail the request if the
265 // response is not recieved in a timely fashion. 267 // response is not received in a timely fashion.
266 268
267 rdata.uuid = rdata.userProfile.ID; 269 rdata.uuid = rdata.userProfile.ID;
268 270
@@ -330,7 +332,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
330 default : 332 default :
331 Rest.Log.WarnFormat("{0} Method {1} not supported for {2}", 333 Rest.Log.WarnFormat("{0} Method {1} not supported for {2}",
332 MsgId, rdata.method, rdata.path); 334 MsgId, rdata.method, rdata.path);
333 rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, rdata.method+" not supported"); 335 rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed,
336 String.Format("{0} not supported", rdata.method));
334 break; 337 break;
335 } 338 }
336 } 339 }
@@ -591,8 +594,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
591 if (created) 594 if (created)
592 { 595 {
593 // Must include a location header with a URI that identifies the new resource. 596 // Must include a location header with a URI that identifies the new resource.
594 rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}/{2}", 597 rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}/{3}",
595 rdata.hostname+":"+rdata.port,rdata.path,newnode)); 598 rdata.hostname, rdata.port,rdata.path,newnode));
596 rdata.Complete(Rest.HttpStatusCodeCreated); 599 rdata.Complete(Rest.HttpStatusCodeCreated);
597 } 600 }
598 else 601 else
@@ -607,7 +610,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
607 } 610 }
608 } 611 }
609 612
610 rdata.Respond("Inventory " + rdata.method + ": Normal completion"); 613 rdata.Respond(String.Format("Profile {0} : Normal completion", rdata.method));
611 } 614 }
612 else 615 else
613 { 616 {
@@ -872,7 +875,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
872 } 875 }
873 } 876 }
874 877
875 rdata.Respond("Inventory " + rdata.method + ": Normal completion"); 878 rdata.Respond(String.Format("Profile {0} : Normal completion", rdata.method));
879
876 } 880 }
877 881
878 /// <summary> 882 /// <summary>
@@ -927,7 +931,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
927 } 931 }
928 932
929 rdata.Complete(); 933 rdata.Complete();
930 rdata.Respond("Inventory " + rdata.method + ": Normal completion"); 934 rdata.Respond(String.Format("Profile {0} : Normal completion", rdata.method));
931 } 935 }
932 936
933#endregion method-specific processing 937#endregion method-specific processing
@@ -1061,7 +1065,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
1061 1065
1062 Rest.Log.DebugFormat("{0} {1}: Resource {2} not found", 1066 Rest.Log.DebugFormat("{0} {1}: Resource {2} not found",
1063 MsgId, rdata.method, rdata.path); 1067 MsgId, rdata.method, rdata.path);
1064 rdata.Fail(Rest.HttpStatusCodeNotFound, "resource "+rdata.path+" not found"); 1068 rdata.Fail(Rest.HttpStatusCodeNotFound,
1069 String.Format("resource {0}:{1} not found", rdata.method, rdata.path));
1065 1070
1066 return null; /* Never reached */ 1071 return null; /* Never reached */
1067 } 1072 }
@@ -1189,9 +1194,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
1189 { 1194 {
1190 // Fetching an Item has a special significance. In this 1195 // Fetching an Item has a special significance. In this
1191 // case we also want to fetch the associated asset. 1196 // case we also want to fetch the associated asset.
1192 // To make it interesting, we'll d this via redirection. 1197 // To make it interesting, we'll do this via redirection.
1193 string asseturl = "http://" + rdata.hostname + ":" + rdata.port + 1198 string asseturl = String.Format("http://{0}:{1}/{2}{3}{4}", rdata.hostname, rdata.port,
1194 "/admin/assets" + Rest.UrlPathSeparator + ifound.AssetID.ToString(); 1199 "admin/assets",Rest.UrlPathSeparator,ifound.AssetID.ToString());
1195 rdata.Redirect(asseturl,Rest.PERMANENT); 1200 rdata.Redirect(asseturl,Rest.PERMANENT);
1196 Rest.Log.DebugFormat("{0} Never Reached", MsgId); 1201 Rest.Log.DebugFormat("{0} Never Reached", MsgId);
1197 } 1202 }