aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorDr Scofield2008-08-15 07:33:58 +0000
committerDr Scofield2008-08-15 07:33:58 +0000
commit08c5c712001adc422b22082171987dbf3c9b9118 (patch)
tree6f12e88c53f0e7543a77d4b5062e763d3e16174d /OpenSim/ApplicationPlugins
parentFrom: Richard Alimi <ralimi@us.ibm.com> (diff)
downloadopensim-SC_OLD-08c5c712001adc422b22082171987dbf3c9b9118.zip
opensim-SC_OLD-08c5c712001adc422b22082171987dbf3c9b9118.tar.gz
opensim-SC_OLD-08c5c712001adc422b22082171987dbf3c9b9118.tar.bz2
opensim-SC_OLD-08c5c712001adc422b22082171987dbf3c9b9118.tar.xz
From: Richard Alimi <ralimi@us.ibm.com>
The following patch implements adding prims to a region using the Xml2 format.
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
index e6131f1..6e3d1ff 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
@@ -73,6 +73,28 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
73 73
74 if (String.IsNullOrEmpty(param)) return CreateRegion(httpRequest, httpResponse); 74 if (String.IsNullOrEmpty(param)) return CreateRegion(httpRequest, httpResponse);
75 75
76 // Parse region ID and other parameters
77 param = param.TrimEnd(new char[]{'/'});
78 string[] comps = param.Split('/');
79 LLUUID regionID = (LLUUID)comps[0];
80
81 m_log.DebugFormat("{0} POST region UUID {1}", MsgID, regionID.ToString());
82 if (LLUUID.Zero == regionID) throw new Exception("missing region ID");
83
84 Scene scene = null;
85 App.SceneManager.TryGetScene(regionID, out scene);
86 if (null == scene) return Failure(httpResponse, OSHttpStatusCode.ClientErrorNotFound,
87 "POST", "cannot find region {0}", regionID.ToString());
88
89 if (2 == comps.Length) {
90 // check for {prims}
91 switch (comps[1].ToLower())
92 {
93 case "prims":
94 return LoadPrims(request, httpRequest, httpResponse, scene);
95 }
96 }
97
76 return Failure(httpResponse, OSHttpStatusCode.ClientErrorNotFound, 98 return Failure(httpResponse, OSHttpStatusCode.ClientErrorNotFound,
77 "POST", "url {0} not supported", param); 99 "POST", "url {0} not supported", param);
78 } 100 }
@@ -95,6 +117,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
95 117
96 return XmlWriterResult; 118 return XmlWriterResult;
97 } 119 }
120
121 public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
122 {
123 scene.LoadPrimsFromXml2(new StringReader(requestBody), true);
124 return "";
125 }
126
98 #endregion POST methods 127 #endregion POST methods
99 } 128 }
100} 129}