GetFolderItems implemented. It's not being called, but it might.

arthursv
Diva Canto 2009-08-18 22:36:03 -07:00
parent 124f66bfc2
commit e5f33e7505
5 changed files with 48 additions and 3 deletions

View File

@ -290,7 +290,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
{
return new List<InventoryItemBase>();
if (IsLocalGridUser(userID))
return m_GridService.GetFolderItems(userID, folderID);
else
{
UUID sessionID = GetSessionID(userID);
string uri = GetUserInventoryURI(userID) + "/" + userID;
return m_HGService.GetFolderItems(uri, folderID, sessionID);
}
}
public override bool AddFolder(InventoryFolderBase folder)
@ -487,7 +494,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{
return true;
}
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user is foreign({0} - {1})", userInventoryServerURI, uri);
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri);
return false;
}

View File

@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
{
return new List<InventoryItemBase>();
UUID sessionID = GetSessionID(userID);
return m_RemoteConnector.GetFolderItems(userID.ToString(), folderID, sessionID);
}
public override bool AddFolder(InventoryFolderBase folder)

View File

@ -214,6 +214,19 @@ namespace OpenSim.Services.Connectors.Inventory
return false;
}
public List<InventoryItemBase> GetFolderItems(string id, UUID folderID, UUID sessionID)
{
string url = string.Empty;
string userID = string.Empty;
if (StringToUrlAndUserID(id, out url, out userID))
{
ISessionAuthInventoryService connector = GetConnector(url);
return connector.GetFolderItems(userID, folderID, sessionID);
}
return new List<InventoryItemBase>();
}
public bool AddItem(string id, InventoryItemBase item, UUID sessionID)
{
string url = string.Empty;

View File

@ -95,6 +95,13 @@ namespace OpenSim.Services.Connectors
/// <returns>true if the folder was successfully purged</returns>
bool PurgeFolder(string userID, InventoryFolderBase folder, UUID session_id);
/// <summary>
/// Get items from a folder.
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully purged</returns>
List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID session_id);
/// <summary>
/// Add a new item to the user's inventory
/// </summary>

View File

@ -334,6 +334,23 @@ namespace OpenSim.Services.Connectors
return false;
}
public List<InventoryItemBase> GetFolderItems(string userID, UUID folderID, UUID sessionID)
{
try
{
InventoryFolderBase folder = new InventoryFolderBase(folderID, new UUID(userID));
return SynchronousRestSessionObjectPoster<InventoryFolderBase, List<InventoryItemBase>>.BeginPostObject(
"POST", m_ServerURI + "/GetItems/", folder, sessionID.ToString(), userID);
}
catch (Exception e)
{
m_log.ErrorFormat("[INVENTORY CONNECTOR]: Get folder items operation failed, {0} {1}",
e.Source, e.Message);
}
return null;
}
public bool AddItem(string userID, InventoryItemBase item, UUID sessionID)
{
try