aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-01-06 22:00:19 +0000
committerMelanie2010-01-06 22:00:19 +0000
commit6d061d9f398adfa193f25c43604b517ad0d756a2 (patch)
treec1d14d93b53e483e9b2092112f475b563fb708d1
parentAdding a skeleton for the XInventoryInConnector, counterpart to the already (diff)
downloadopensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.zip
opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.tar.gz
opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.tar.bz2
opensim-SC-6d061d9f398adfa193f25c43604b517ad0d756a2.tar.xz
Complete the XInventoryConnector. Flesh out the skeleton for the
XInventoryInConnector
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs225
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs50
2 files changed, 268 insertions, 7 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 8c6eca7..b48e30e 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -92,7 +92,7 @@ namespace OpenSim.Server.Handlers.Asset
92 sr.Close(); 92 sr.Close();
93 body = body.Trim(); 93 body = body.Trim();
94 94
95 //m_log.DebugFormat("[XXX]: query String: {0}", body); 95 m_log.DebugFormat("[XXX]: query String: {0}", body);
96 96
97 try 97 try
98 { 98 {
@@ -107,8 +107,44 @@ namespace OpenSim.Server.Handlers.Asset
107 107
108 switch (method) 108 switch (method)
109 { 109 {
110 case "TEST": 110 case "CREATEUSERINVENTORY":
111 return HandleTest(request); 111 return HandleCreateUserInventory(request);
112 case "GETINVENTORYSKELETON":
113 return HandleGetInventorySkeleton(request);
114 case "GETROOTFOLDER":
115 return HandleGetRootFolder(request);
116 case "GETFOLDERFORTYPE":
117 return HandleGetFolderForType(request);
118 case "GETFOLDERCONTENT":
119 return HandleGetFolderContent(request);
120 case "GETFOLDERITEMS":
121 return HandleGetFolderItems(request);
122 case "ADDFOLDER":
123 return HandleAddFolder(request);
124 case "UPDATEFOLDER":
125 return HandleUpdateFolder(request);
126 case "MOVEFOLDER":
127 return HandleMoveFolder(request);
128 case "DELETEFOLDERS":
129 return HandleDeleteFolders(request);
130 case "PURGEFOLDER":
131 return HandlePurgeFolder(request);
132 case "ADDITEM":
133 return HandleAddItem(request);
134 case "UPDATEITEM":
135 return HandleUpdateItem(request);
136 case "MOVEITEMS":
137 return HandleMoveItems(request);
138 case "DELETEITEMS":
139 return HandleDeleteItems(request);
140 case "GETITEM":
141 return HandleGetItem(request);
142 case "GETFOLDER":
143 return HandleGetFolder(request);
144 case "GETACTIVEGESTURES":
145 return HandleGetActiveGestures(request);
146 case "GETASSETPERMISSIONS":
147 return HandleGetAssetPermissions(request);
112 } 148 }
113 m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); 149 m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method);
114 } 150 }
@@ -153,15 +189,194 @@ namespace OpenSim.Server.Handlers.Asset
153 return ms.ToArray(); 189 return ms.ToArray();
154 } 190 }
155 191
156 byte[] HandleTest(Dictionary<string,object> request) 192 byte[] HandleCreateUserInventory(Dictionary<string,object> request)
157 { 193 {
158 Dictionary<string,object> result = new Dictionary<string,object>(); 194 Dictionary<string,object> result = new Dictionary<string,object>();
159 195
160 string xmlString = ServerUtils.BuildXmlResponse(result); 196 string xmlString = ServerUtils.BuildXmlResponse(result);
161 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); 197 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
162 UTF8Encoding encoding = new UTF8Encoding(); 198 UTF8Encoding encoding = new UTF8Encoding();
163 return encoding.GetBytes(xmlString); 199 return encoding.GetBytes(xmlString);
164 } 200 }
165 201
202 byte[] HandleGetInventorySkeleton(Dictionary<string,object> request)
203 {
204 Dictionary<string,object> result = new Dictionary<string,object>();
205
206 string xmlString = ServerUtils.BuildXmlResponse(result);
207 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
208 UTF8Encoding encoding = new UTF8Encoding();
209 return encoding.GetBytes(xmlString);
210 }
211
212 byte[] HandleGetRootFolder(Dictionary<string,object> request)
213 {
214 Dictionary<string,object> result = new Dictionary<string,object>();
215
216 string xmlString = ServerUtils.BuildXmlResponse(result);
217 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
218 UTF8Encoding encoding = new UTF8Encoding();
219 return encoding.GetBytes(xmlString);
220 }
221
222 byte[] HandleGetFolderForType(Dictionary<string,object> request)
223 {
224 Dictionary<string,object> result = new Dictionary<string,object>();
225
226 string xmlString = ServerUtils.BuildXmlResponse(result);
227 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
228 UTF8Encoding encoding = new UTF8Encoding();
229 return encoding.GetBytes(xmlString);
230 }
231
232 byte[] HandleGetFolderContent(Dictionary<string,object> request)
233 {
234 Dictionary<string,object> result = new Dictionary<string,object>();
235
236 string xmlString = ServerUtils.BuildXmlResponse(result);
237 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
238 UTF8Encoding encoding = new UTF8Encoding();
239 return encoding.GetBytes(xmlString);
240 }
241
242 byte[] HandleGetFolderItems(Dictionary<string,object> request)
243 {
244 Dictionary<string,object> result = new Dictionary<string,object>();
245
246 string xmlString = ServerUtils.BuildXmlResponse(result);
247 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
248 UTF8Encoding encoding = new UTF8Encoding();
249 return encoding.GetBytes(xmlString);
250 }
251
252 byte[] HandleAddFolder(Dictionary<string,object> request)
253 {
254 Dictionary<string,object> result = new Dictionary<string,object>();
255
256 string xmlString = ServerUtils.BuildXmlResponse(result);
257 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
258 UTF8Encoding encoding = new UTF8Encoding();
259 return encoding.GetBytes(xmlString);
260 }
261
262 byte[] HandleUpdateFolder(Dictionary<string,object> request)
263 {
264 Dictionary<string,object> result = new Dictionary<string,object>();
265
266 string xmlString = ServerUtils.BuildXmlResponse(result);
267 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
268 UTF8Encoding encoding = new UTF8Encoding();
269 return encoding.GetBytes(xmlString);
270 }
271
272 byte[] HandleMoveFolder(Dictionary<string,object> request)
273 {
274 Dictionary<string,object> result = new Dictionary<string,object>();
275
276 string xmlString = ServerUtils.BuildXmlResponse(result);
277 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
278 UTF8Encoding encoding = new UTF8Encoding();
279 return encoding.GetBytes(xmlString);
280 }
281
282 byte[] HandleDeleteFolders(Dictionary<string,object> request)
283 {
284 Dictionary<string,object> result = new Dictionary<string,object>();
285
286 string xmlString = ServerUtils.BuildXmlResponse(result);
287 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
288 UTF8Encoding encoding = new UTF8Encoding();
289 return encoding.GetBytes(xmlString);
290 }
291
292 byte[] HandlePurgeFolder(Dictionary<string,object> request)
293 {
294 Dictionary<string,object> result = new Dictionary<string,object>();
295
296 string xmlString = ServerUtils.BuildXmlResponse(result);
297 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
298 UTF8Encoding encoding = new UTF8Encoding();
299 return encoding.GetBytes(xmlString);
300 }
301
302 byte[] HandleAddItem(Dictionary<string,object> request)
303 {
304 Dictionary<string,object> result = new Dictionary<string,object>();
305
306 string xmlString = ServerUtils.BuildXmlResponse(result);
307 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
308 UTF8Encoding encoding = new UTF8Encoding();
309 return encoding.GetBytes(xmlString);
310 }
311
312 byte[] HandleUpdateItem(Dictionary<string,object> request)
313 {
314 Dictionary<string,object> result = new Dictionary<string,object>();
315
316 string xmlString = ServerUtils.BuildXmlResponse(result);
317 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
318 UTF8Encoding encoding = new UTF8Encoding();
319 return encoding.GetBytes(xmlString);
320 }
321
322 byte[] HandleMoveItems(Dictionary<string,object> request)
323 {
324 Dictionary<string,object> result = new Dictionary<string,object>();
325
326 string xmlString = ServerUtils.BuildXmlResponse(result);
327 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
328 UTF8Encoding encoding = new UTF8Encoding();
329 return encoding.GetBytes(xmlString);
330 }
331
332 byte[] HandleDeleteItems(Dictionary<string,object> request)
333 {
334 Dictionary<string,object> result = new Dictionary<string,object>();
335
336 string xmlString = ServerUtils.BuildXmlResponse(result);
337 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
338 UTF8Encoding encoding = new UTF8Encoding();
339 return encoding.GetBytes(xmlString);
340 }
341
342 byte[] HandleGetItem(Dictionary<string,object> request)
343 {
344 Dictionary<string,object> result = new Dictionary<string,object>();
345
346 string xmlString = ServerUtils.BuildXmlResponse(result);
347 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
348 UTF8Encoding encoding = new UTF8Encoding();
349 return encoding.GetBytes(xmlString);
350 }
351
352 byte[] HandleGetFolder(Dictionary<string,object> request)
353 {
354 Dictionary<string,object> result = new Dictionary<string,object>();
355
356 string xmlString = ServerUtils.BuildXmlResponse(result);
357 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
358 UTF8Encoding encoding = new UTF8Encoding();
359 return encoding.GetBytes(xmlString);
360 }
361
362 byte[] HandleGetActiveGestures(Dictionary<string,object> request)
363 {
364 Dictionary<string,object> result = new Dictionary<string,object>();
365
366 string xmlString = ServerUtils.BuildXmlResponse(result);
367 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
368 UTF8Encoding encoding = new UTF8Encoding();
369 return encoding.GetBytes(xmlString);
370 }
371
372 byte[] HandleGetAssetPermissions(Dictionary<string,object> request)
373 {
374 Dictionary<string,object> result = new Dictionary<string,object>();
375
376 string xmlString = ServerUtils.BuildXmlResponse(result);
377 m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
378 UTF8Encoding encoding = new UTF8Encoding();
379 return encoding.GetBytes(xmlString);
380 }
166 } 381 }
167} 382}
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
index aac1a83..40acd6d 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
@@ -149,12 +149,58 @@ namespace OpenSim.Services.Connectors
149 149
150 public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) 150 public InventoryCollection GetFolderContent(UUID principalID, UUID folderID)
151 { 151 {
152 return null; 152 Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT",
153 new Dictionary<string,object> {
154 { "PRINCIPAL", principalID.ToString() },
155 { "FOLDER", folderID.ToString() }
156 });
157
158 if (ret == null)
159 return null;
160
161 if (ret.Count == 0)
162 return null;
163
164
165 InventoryCollection inventory = new InventoryCollection();
166 inventory.Folders = new List<InventoryFolderBase>();
167 inventory.Items = new List<InventoryItemBase>();
168 inventory.UserID = principalID;
169
170 Dictionary<string,object> folders =
171 (Dictionary<string,object>)ret["FOLDERS"];
172 Dictionary<string,object> items =
173 (Dictionary<string,object>)ret["ITEMS"];
174
175 foreach (Object o in folders.Values)
176 inventory.Folders.Add(BuildFolder((Dictionary<string,object>)o));
177 foreach (Object o in items.Values)
178 inventory.Items.Add(BuildItem((Dictionary<string,object>)o));
179
180 return inventory;
153 } 181 }
154 182
155 public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) 183 public List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID)
156 { 184 {
157 return null; 185 Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT",
186 new Dictionary<string,object> {
187 { "PRINCIPAL", principalID.ToString() },
188 { "FOLDER", folderID.ToString() }
189 });
190
191 if (ret == null)
192 return null;
193
194 if (ret.Count == 0)
195 return null;
196
197
198 List<InventoryItemBase> items = new List<InventoryItemBase>();
199
200 foreach (Object o in ret.Values)
201 items.Add(BuildItem((Dictionary<string,object>)o));
202
203 return items;
158 } 204 }
159 205
160 public bool AddFolder(InventoryFolderBase folder) 206 public bool AddFolder(InventoryFolderBase folder)