aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2009-08-18 22:36:03 -0700
committerDiva Canto2009-08-18 22:36:03 -0700
commite5f33e75055a8f83cf4e11a6120774cb90dbc3be (patch)
treec7c8fd3b0a8ece30c39d2fac9929779bc9abc6e8 /OpenSim
parentjhurliman's patch in http://opensimulator.org/mantis/view.php?id=4024 (diff)
downloadopensim-SC-e5f33e75055a8f83cf4e11a6120774cb90dbc3be.zip
opensim-SC-e5f33e75055a8f83cf4e11a6120774cb90dbc3be.tar.gz
opensim-SC-e5f33e75055a8f83cf4e11a6120774cb90dbc3be.tar.bz2
opensim-SC-e5f33e75055a8f83cf4e11a6120774cb90dbc3be.tar.xz
GetFolderItems implemented. It's not being called, but it might.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs11
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs3
-rw-r--r--OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs13
-rw-r--r--OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs7
-rw-r--r--OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs17
5 files changed, 48 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 492598e..3649097 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -290,7 +290,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
290 290
291 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 291 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
292 { 292 {
293 return new List<InventoryItemBase>(); 293 if (IsLocalGridUser(userID))
294 return m_GridService.GetFolderItems(userID, folderID);
295 else
296 {
297 UUID sessionID = GetSessionID(userID);
298 string uri = GetUserInventoryURI(userID) + "/" + userID;
299 return m_HGService.GetFolderItems(uri, folderID, sessionID);
300 }
294 } 301 }
295 302
296 public override bool AddFolder(InventoryFolderBase folder) 303 public override bool AddFolder(InventoryFolderBase folder)
@@ -487,7 +494,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
487 { 494 {
488 return true; 495 return true;
489 } 496 }
490 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user is foreign({0} - {1})", userInventoryServerURI, uri); 497 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri);
491 return false; 498 return false;
492 } 499 }
493 500
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
index bef716b..522f680 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs
@@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
212 212
213 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 213 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
214 { 214 {
215 return new List<InventoryItemBase>(); 215 UUID sessionID = GetSessionID(userID);
216 return m_RemoteConnector.GetFolderItems(userID.ToString(), folderID, sessionID);
216 } 217 }
217 218
218 public override bool AddFolder(InventoryFolderBase folder) 219 public override bool AddFolder(InventoryFolderBase folder)
diff --git a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
index 94b4ad9..75fa516 100644
--- a/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/HGInventoryServiceConnector.cs
@@ -214,6 +214,19 @@ namespace OpenSim.Services.Connectors.Inventory
214 return false; 214 return false;
215 } 215 }
216 216
217 public List<InventoryItemBase> GetFolderItems(string id, UUID folderID, UUID sessionID)
218 {
219 string url = string.Empty;
220 string userID = string.Empty;
221
222 if (StringToUrlAndUserID(id, out url, out userID))
223 {
224 ISessionAuthInventoryService connector = GetConnector(url);
225 return connector.GetFolderItems(userID, folderID, sessionID);
226 }
227 return new List<InventoryItemBase>();
228 }
229
217 public bool AddItem(string id, InventoryItemBase item, UUID sessionID) 230 public bool AddItem(string id, InventoryItemBase item, UUID sessionID)
218 { 231 {
219 string url = string.Empty; 232 string url = string.Empty;
diff --git a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
index f50bcf5..7f051f3 100644
--- a/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
+++ b/OpenSim/Services/Connectors/Inventory/ISessionAuthInventoryService.cs
@@ -96,6 +96,13 @@ namespace OpenSim.Services.Connectors
96 bool PurgeFolder(string userID, InventoryFolderBase folder, UUID session_id); 96 bool PurgeFolder(string userID, InventoryFolderBase folder, UUID session_id);
97 97
98 /// <summary> 98 /// <summary>
99 /// Get items from a folder.
100 /// </summary>
101 /// <param name="folder"></param>
102 /// <returns>true if the folder was successfully purged</returns>
103 List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID session_id);
104
105 /// <summary>
99 /// Add a new item to the user's inventory 106 /// Add a new item to the user's inventory
100 /// </summary> 107 /// </summary>
101 /// <param name="item"></param> 108 /// <param name="item"></param>
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
index 5d94eac..5aa4b30 100644
--- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
@@ -334,6 +334,23 @@ namespace OpenSim.Services.Connectors
334 return false; 334 return false;
335 } 335 }
336 336
337 public List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID sessionID)
338 {
339 try
340 {
341 InventoryFolderBase folder = new InventoryFolderBase(folderID, new UUID(userID));
342 return SynchronousRestSessionObjectPoster<InventoryFolderBase, List<InventoryItemBase>>.BeginPostObject(
343 "POST", m_ServerURI + "/GetItems/", folder, sessionID.ToString(), userID);
344 }
345 catch (Exception e)
346 {
347 m_log.ErrorFormat("[INVENTORY CONNECTOR]: Get folder items operation failed, {0} {1}",
348 e.Source, e.Message);
349 }
350
351 return null;
352 }
353
337 public bool AddItem(string userID, InventoryItemBase item, UUID sessionID) 354 public bool AddItem(string userID, InventoryItemBase item, UUID sessionID)
338 { 355 {
339 try 356 try