From 3525195bc9b5fdfd9799411edd452981ef1f4ebd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 11 Jun 2010 21:52:43 +0100 Subject: 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 --- .../Inventory/Archiver/Tests/InventoryArchiverTests.cs | 4 ++-- .../Framework/Library/LocalInventoryService.cs | 6 ++++-- .../Inventory/BaseInventoryConnector.cs | 2 ++ .../ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 15 ++++++++++----- .../Inventory/LocalInventoryServiceConnector.cs | 5 +++++ .../Inventory/RemoteInventoryServiceConnector.cs | 5 +++++ .../Inventory/RemoteXInventoryServiceConnector.cs | 17 +++++++++++------ 7 files changed, 39 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region') 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 itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), new Dictionary(), new List()); - InventoryFolderBase folder1Post - = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); + InventoryFolderBase folder1Post = scene.InventoryService.GetFolder(folder1.ID, ua1.PrincipalID); Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); + /* InventoryFolderBase folder2 = 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 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -229,12 +229,14 @@ namespace OpenSim.Region.CoreModules.Framework.Library /// public InventoryItemBase GetItem(InventoryItemBase item) { return null; } + public InventoryFolderBase GetFolder(UUID folderId, UUID userId) { return null; } + /// /// Get a folder, given by its UUID /// /// /// - public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; } + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; } /// /// 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 public abstract InventoryItemBase GetItem(InventoryItemBase item); + public abstract InventoryFolderBase GetFolder(UUID folderId, UUID userId); + public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder); /// 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 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -470,7 +470,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return connector.DeleteItems(ownerID, itemIDs); } - public InventoryItemBase GetItem(InventoryItemBase item) + public InventoryItemBase GetItem(InventoryItemBase item) { if (item == null) return null; @@ -486,7 +486,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return connector.GetItem(item); } - public InventoryFolderBase GetFolder(InventoryFolderBase folder) + public InventoryFolderBase GetFolder(UUID folderId, UUID userId) + { + return GetFolder(new InventoryFolderBase(folderId, userId)); + } + + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { if (folder == null) return null; @@ -503,12 +508,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return connector.GetFolder(folder); } - public bool HasInventoryForUser(UUID userID) + public bool HasInventoryForUser(UUID userID) { return false; } - public List GetActiveGestures(UUID userId) + public List GetActiveGestures(UUID userId) { return new List(); } 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 return item; } + public InventoryFolderBase GetFolder(UUID folderId, UUID userId) + { + return GetFolder(new InventoryFolderBase(folderId, userId)); + } + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { 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 return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); } + public override InventoryFolderBase GetFolder(UUID folderId, UUID userId) + { + return GetFolder(new InventoryFolderBase(folderId, userId)); + } + public override InventoryFolderBase GetFolder(InventoryFolderBase folder) { 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 } - public bool DeleteItems(UUID ownerID, List itemIDs) + public bool DeleteItems(UUID ownerID, List itemIDs) { if (itemIDs == null) return false; @@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.DeleteItems(ownerID, itemIDs); } - public InventoryItemBase GetItem(InventoryItemBase item) + public InventoryItemBase GetItem(InventoryItemBase item) { m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); if (item == null) @@ -271,7 +271,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.GetItem(item); } - public InventoryFolderBase GetFolder(InventoryFolderBase folder) + public InventoryFolderBase GetFolder(UUID folderId, UUID userId) + { + return GetFolder(new InventoryFolderBase(folderId, userId)); + } + + public InventoryFolderBase GetFolder(InventoryFolderBase folder) { m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); if (folder == null) @@ -280,17 +285,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.GetFolder(folder); } - public bool HasInventoryForUser(UUID userID) + public bool HasInventoryForUser(UUID userID) { return false; } - public List GetActiveGestures(UUID userId) + public List GetActiveGestures(UUID userId) { return new List(); } - public int GetAssetPermissions(UUID userID, UUID assetID) + public int GetAssetPermissions(UUID userID, UUID assetID) { return m_RemoteConnector.GetAssetPermissions(userID, assetID); } -- cgit v1.1