From 49a5a00b8083ab5c2bdaa6a4c2528cc6e0989641 Mon Sep 17 00:00:00 2001
From: MW
Date: Wed, 13 Feb 2008 14:45:13 +0000
Subject: Added a method to access a named folder in a users inventory, to the
inventory Database interfaces. This could be useful for adding a item to a
users inventory from say a web front end application or some other third
party application. [note the method is only currently implemented in the
sqlite provider]
---
OpenSim/Framework/Communications/IInventoryServices.cs | 8 ++++++++
.../Framework/Communications/InventoryServiceBase.cs | 6 ++++++
.../Communications/Local/LocalInventoryService.cs | 17 +++++++++++++++++
.../Region/Communications/OGS1/OGS1InventoryService.cs | 5 +++++
4 files changed, 36 insertions(+)
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index ddb19ba..0e09613 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -88,5 +88,13 @@ namespace OpenSim.Framework.Communications
///
///
List RequestFirstLevelFolders(LLUUID userID);
+
+ ///
+ /// Returns the named folder in that users inventory, returns null if folder is not found.
+ ///
+ ///
+ ///
+ ///
+ InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName);
}
}
\ No newline at end of file
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 74c07e1..c8748fa 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -141,6 +141,12 @@ namespace OpenSim.Framework.Communications
}
// See IInventoryServices
+ public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
+ {
+ return null;
+ }
+
+ // See IInventoryServices
public void CreateNewUserInventory(LLUUID user)
{
InventoryFolderBase existingRootFolder = RequestUsersRoot(user);
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index 35eb89a..77a2a6e 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -100,6 +100,23 @@ namespace OpenSim.Region.Communications.Local
}
}
+ public override InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
+ {
+ List folders = RequestFirstLevelFolders(userID);
+ InventoryFolderBase requestedFolder = null;
+
+ //need to make sure we send root folder first
+ foreach (InventoryFolderBase folder in folders)
+ {
+ if (folder.name == folderName)
+ {
+ requestedFolder = folder;
+ break;
+ }
+ }
+
+ return requestedFolder;
+ }
///
/// Send the given inventory folder and its item contents back to the requester.
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 81689ed..8ff62d0 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -175,6 +175,11 @@ namespace OpenSim.Region.Communications.OGS1
return null;
}
+ public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
+ {
+ return null;
+ }
+
public void CreateNewUserInventory(LLUUID user)
{
}
--
cgit v1.1