aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-06-11 21:52:43 +0100
committerJustin Clark-Casey (justincc)2010-06-11 21:55:18 +0100
commit3525195bc9b5fdfd9799411edd452981ef1f4ebd (patch)
treeb1749b64b68def578c061496a9be8d3641e215a0
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-3525195bc9b5fdfd9799411edd452981ef1f4ebd.zip
opensim-SC-3525195bc9b5fdfd9799411edd452981ef1f4ebd.tar.gz
opensim-SC-3525195bc9b5fdfd9799411edd452981ef1f4ebd.tar.bz2
opensim-SC-3525195bc9b5fdfd9799411edd452981ef1f4ebd.tar.xz
Allow IInventoryService.GetFolder(folderId, userId) as well as GetFolder(InventoryFolderBase folder)
This involves no wire changes since the methods often just construct an InventoryFolderBase under the hood. This is in line with other methods that alraedy allow requests via uuid
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs15
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs17
-rw-r--r--OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs5
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs5
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs7
-rw-r--r--OpenSim/Services/Interfaces/IInventoryService.cs8
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs17
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs5
-rw-r--r--OpenSim/Tests/Common/Mock/MockInventoryService.cs5
14 files changed, 84 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 00bd27a..d003d2d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -575,9 +575,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
575 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), 575 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
576 new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>()); 576 new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>());
577 577
578 InventoryFolderBase folder1Post 578 InventoryFolderBase folder1Post = scene.InventoryService.GetFolder(folder1.ID, ua1.PrincipalID);
579 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
580 Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); 579 Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID));
580
581 /* 581 /*
582 InventoryFolderBase folder2 582 InventoryFolderBase folder2
583 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); 583 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b");
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs
index 49589fd..112ccd8 100644
--- a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs
+++ b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -229,12 +229,14 @@ namespace OpenSim.Region.CoreModules.Framework.Library
229 /// <returns></returns> 229 /// <returns></returns>
230 public InventoryItemBase GetItem(InventoryItemBase item) { return null; } 230 public InventoryItemBase GetItem(InventoryItemBase item) { return null; }
231 231
232 public InventoryFolderBase GetFolder(UUID folderId, UUID userId) { return null; }
233
232 /// <summary> 234 /// <summary>
233 /// Get a folder, given by its UUID 235 /// Get a folder, given by its UUID
234 /// </summary> 236 /// </summary>
235 /// <param name="folder"></param> 237 /// <param name="folder"></param>
236 /// <returns></returns> 238 /// <returns></returns>
237 public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; } 239 public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; }
238 240
239 /// <summary> 241 /// <summary>
240 /// Does the given user have an inventory structure? 242 /// Does the given user have an inventory structure?
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
index 1e51187..5b13d58 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
@@ -205,6 +205,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
205 205
206 public abstract InventoryItemBase GetItem(InventoryItemBase item); 206 public abstract InventoryItemBase GetItem(InventoryItemBase item);
207 207
208 public abstract InventoryFolderBase GetFolder(UUID folderId, UUID userId);
209
208 public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder); 210 public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder);
209 211
210 /// <summary> 212 /// <summary>
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index e09db15..fc30347 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -470,7 +470,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
470 return connector.DeleteItems(ownerID, itemIDs); 470 return connector.DeleteItems(ownerID, itemIDs);
471 } 471 }
472 472
473 public InventoryItemBase GetItem(InventoryItemBase item) 473 public InventoryItemBase GetItem(InventoryItemBase item)
474 { 474 {
475 if (item == null) 475 if (item == null)
476 return null; 476 return null;
@@ -486,7 +486,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
486 return connector.GetItem(item); 486 return connector.GetItem(item);
487 } 487 }
488 488
489 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 489 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
490 {
491 return GetFolder(new InventoryFolderBase(folderId, userId));
492 }
493
494 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
490 { 495 {
491 if (folder == null) 496 if (folder == null)
492 return null; 497 return null;
@@ -503,12 +508,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
503 return connector.GetFolder(folder); 508 return connector.GetFolder(folder);
504 } 509 }
505 510
506 public bool HasInventoryForUser(UUID userID) 511 public bool HasInventoryForUser(UUID userID)
507 { 512 {
508 return false; 513 return false;
509 } 514 }
510 515
511 public List<InventoryItemBase> GetActiveGestures(UUID userId) 516 public List<InventoryItemBase> GetActiveGestures(UUID userId)
512 { 517 {
513 return new List<InventoryItemBase>(); 518 return new List<InventoryItemBase>();
514 } 519 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 22bd04c..76be791 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -267,6 +267,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
267 return item; 267 return item;
268 } 268 }
269 269
270 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
271 {
272 return GetFolder(new InventoryFolderBase(folderId, userId));
273 }
274
270 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 275 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
271 { 276 {
272 return m_InventoryService.GetFolder(folder); 277 return m_InventoryService.GetFolder(folder);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index aa3b30d..6d43280 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -307,6 +307,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
307 return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); 307 return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID);
308 } 308 }
309 309
310 public override InventoryFolderBase GetFolder(UUID folderId, UUID userId)
311 {
312 return GetFolder(new InventoryFolderBase(folderId, userId));
313 }
314
310 public override InventoryFolderBase GetFolder(InventoryFolderBase folder) 315 public override InventoryFolderBase GetFolder(InventoryFolderBase folder)
311 { 316 {
312 if (folder == null) 317 if (folder == null)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index 277060d..b1e21a1 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
250 } 250 }
251 251
252 252
253 public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) 253 public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
254 { 254 {
255 if (itemIDs == null) 255 if (itemIDs == null)
256 return false; 256 return false;
@@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
260 return m_RemoteConnector.DeleteItems(ownerID, itemIDs); 260 return m_RemoteConnector.DeleteItems(ownerID, itemIDs);
261 } 261 }
262 262
263 public InventoryItemBase GetItem(InventoryItemBase item) 263 public InventoryItemBase GetItem(InventoryItemBase item)
264 { 264 {
265 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); 265 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID);
266 if (item == null) 266 if (item == null)
@@ -271,7 +271,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
271 return m_RemoteConnector.GetItem(item); 271 return m_RemoteConnector.GetItem(item);
272 } 272 }
273 273
274 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 274 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
275 {
276 return GetFolder(new InventoryFolderBase(folderId, userId));
277 }
278
279 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
275 { 280 {
276 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); 281 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID);
277 if (folder == null) 282 if (folder == null)
@@ -280,17 +285,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
280 return m_RemoteConnector.GetFolder(folder); 285 return m_RemoteConnector.GetFolder(folder);
281 } 286 }
282 287
283 public bool HasInventoryForUser(UUID userID) 288 public bool HasInventoryForUser(UUID userID)
284 { 289 {
285 return false; 290 return false;
286 } 291 }
287 292
288 public List<InventoryItemBase> GetActiveGestures(UUID userId) 293 public List<InventoryItemBase> GetActiveGestures(UUID userId)
289 { 294 {
290 return new List<InventoryItemBase>(); 295 return new List<InventoryItemBase>();
291 } 296 }
292 297
293 public int GetAssetPermissions(UUID userID, UUID assetID) 298 public int GetAssetPermissions(UUID userID, UUID assetID)
294 { 299 {
295 return m_RemoteConnector.GetAssetPermissions(userID, assetID); 300 return m_RemoteConnector.GetAssetPermissions(userID, assetID);
296 } 301 }
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
index a7aa138..5a23687 100644
--- a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs
@@ -171,6 +171,11 @@ namespace OpenSim.Services.Connectors
171 { 171 {
172 return null; 172 return null;
173 } 173 }
174
175 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
176 {
177 return null;
178 }
174 179
175 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 180 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
176 { 181 {
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
index e25e7eb..e7acb59 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
@@ -431,6 +431,11 @@ namespace OpenSim.Services.Connectors
431 return null; 431 return null;
432 } 432 }
433 433
434 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
435 {
436 return GetFolder(new InventoryFolderBase(folderId, userId));
437 }
438
434 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 439 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
435 { 440 {
436 try 441 try
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index dc68259..6bf43d5 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -314,6 +314,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
314 m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Item " + item.ID + " owned by " + item.Owner + " not found"); 314 m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Item " + item.ID + " owned by " + item.Owner + " not found");
315 return null; 315 return null;
316 } 316 }
317
318 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
319 {
320 return GetFolder(new InventoryFolderBase(folderId, userId));
321 }
317 322
318 /// <summary> 323 /// <summary>
319 /// Get a folder, given by its UUID 324 /// Get a folder, given by its UUID
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs
index 1b78fb3..b0ffd8f 100644
--- a/OpenSim/Services/Interfaces/IInventoryService.cs
+++ b/OpenSim/Services/Interfaces/IInventoryService.cs
@@ -170,6 +170,14 @@ namespace OpenSim.Services.Interfaces
170 InventoryItemBase GetItem(InventoryItemBase item); 170 InventoryItemBase GetItem(InventoryItemBase item);
171 171
172 /// <summary> 172 /// <summary>
173 /// Get a folder.
174 /// </summary>
175 /// <param name="folderId"></param>
176 /// <param name="userId"></param>
177 /// <returns></returns>
178 InventoryFolderBase GetFolder(UUID folderId, UUID userId);
179
180 /// <summary>
173 /// Get a folder, given by its UUID 181 /// Get a folder, given by its UUID
174 /// </summary> 182 /// </summary>
175 /// <param name="folder"></param> 183 /// <param name="folder"></param>
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
index fbcd663..9f1c4a4 100644
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ b/OpenSim/Services/InventoryService/InventoryService.cs
@@ -439,15 +439,20 @@ namespace OpenSim.Services.InventoryService
439 m_log.DebugFormat("[INVENTORY SERVICE]: GetItem failed to find item {0}", item.ID); 439 m_log.DebugFormat("[INVENTORY SERVICE]: GetItem failed to find item {0}", item.ID);
440 return null; 440 return null;
441 } 441 }
442 442
443 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) 443 public virtual InventoryFolderBase GetFolder(UUID folderId, UUID userId)
444 { 444 {
445 InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID); 445 InventoryFolderBase result = m_Database.getInventoryFolder(folderId);
446 if (result != null) 446 if (result != null)
447 return result; 447 return result;
448 448
449 m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID); 449 m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folderId);
450 return null; 450 return null;
451 }
452
453 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
454 {
455 return GetFolder(folder.ID, folder.Owner);
451 } 456 }
452 457
453 public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) 458 public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index af831fd..00aadc5 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -368,6 +368,11 @@ namespace OpenSim.Services.InventoryService
368 368
369 return ConvertToOpenSim(items[0]); 369 return ConvertToOpenSim(items[0]);
370 } 370 }
371
372 public virtual InventoryFolderBase GetFolder(UUID folderId, UUID userId)
373 {
374 return GetFolder(new InventoryFolderBase(folderId, userId));
375 }
371 376
372 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) 377 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
373 { 378 {
diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs
index 1ea4bc1..fc27487 100644
--- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs
+++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs
@@ -162,6 +162,11 @@ namespace OpenSim.Tests.Common.Mock
162 { 162 {
163 return null; 163 return null;
164 } 164 }
165
166 public InventoryFolderBase GetFolder(UUID folderId, UUID userId)
167 {
168 return null;
169 }
165 170
166 public InventoryFolderBase GetFolder(InventoryFolderBase folder) 171 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
167 { 172 {