mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Added two new methods to IIventoryService -- GetFolderForType and GetFolderContent. Some meat to it, but not completed. None of this code is called anywhere yet.
This commit is contained in:
@@ -120,6 +120,48 @@ namespace OpenSim.Services.Connectors.Inventory
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user folder for the given folder-type
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public List<InventoryFolderBase> GetSystemFolders(string id, UUID sessionID)
|
||||
{
|
||||
m_log.Debug("[HGInventory]: GetSystemFolders " + id);
|
||||
string url = string.Empty;
|
||||
string userID = string.Empty;
|
||||
|
||||
if (StringToUrlAndUserID(id, out url, out userID))
|
||||
{
|
||||
ISessionAuthInventoryService connector = GetConnector(url);
|
||||
return connector.GetSystemFolders(userID, sessionID);
|
||||
}
|
||||
|
||||
return new List<InventoryFolderBase>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets everything (folders and items) inside a folder
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="folderID"></param>
|
||||
/// <returns></returns>
|
||||
public InventoryCollection GetFolderContent(string id, UUID folderID, UUID sessionID)
|
||||
{
|
||||
m_log.Debug("[HGInventory]: GetSystemFolders " + id);
|
||||
string url = string.Empty;
|
||||
string userID = string.Empty;
|
||||
|
||||
if (StringToUrlAndUserID(id, out url, out userID))
|
||||
{
|
||||
ISessionAuthInventoryService connector = GetConnector(url);
|
||||
return connector.GetFolderContent(userID, folderID, sessionID);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool AddFolder(string id, InventoryFolderBase folder, UUID sessionID)
|
||||
{
|
||||
string url = string.Empty;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenMetaverse;
|
||||
@@ -50,6 +51,22 @@ namespace OpenSim.Services.Connectors
|
||||
/// <param name="callback"></param>
|
||||
void GetUserInventory(string userID, UUID session_id, InventoryReceiptCallback callback);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user folder for the given folder-type
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
List<InventoryFolderBase> GetSystemFolders(string userID, UUID session_id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets everything (folders and items) inside a folder
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="folderID"></param>
|
||||
/// <returns></returns>
|
||||
InventoryCollection GetFolderContent(string userID, UUID folderID, UUID session_id);
|
||||
|
||||
/// <summary>
|
||||
/// Add a new folder to the user's inventory
|
||||
/// </summary>
|
||||
|
||||
@@ -155,6 +155,50 @@ namespace OpenSim.Services.Connectors
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user folder for the given folder-type
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public List<InventoryFolderBase> GetSystemFolders(string userID, UUID sessionID)
|
||||
{
|
||||
try
|
||||
{
|
||||
return SynchronousRestSessionObjectPoster<string, List<InventoryFolderBase>>.BeginPostObject(
|
||||
"GET", m_ServerURI + "/SystemFolders/", userID, sessionID.ToString(), userID.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}",
|
||||
e.Source, e.Message);
|
||||
}
|
||||
|
||||
return new List<InventoryFolderBase>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets everything (folders and items) inside a folder
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="folderID"></param>
|
||||
/// <returns></returns>
|
||||
public InventoryCollection GetFolderContent(string userID, UUID folderID, UUID sessionID)
|
||||
{
|
||||
try
|
||||
{
|
||||
return SynchronousRestSessionObjectPoster<UUID, InventoryCollection>.BeginPostObject(
|
||||
"GET", m_ServerURI + "/GetFolderContents/", folderID, sessionID.ToString(), userID.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderForType operation failed, {0} {1}",
|
||||
e.Source, e.Message);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool AddFolder(string userID, InventoryFolderBase folder, UUID sessionID)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -106,6 +106,16 @@ namespace OpenSim.Services.Connectors
|
||||
{
|
||||
}
|
||||
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user