Added two new "trusted" url handlers to the Inventory server, to allow the user server to get a list of items in a folder and add a new item.
parent
bf4ccf3858
commit
b62b9af6b0
|
@ -192,15 +192,15 @@ namespace OpenSim.Grid.InventoryServer
|
|||
invCollection.Folders = allFolders;
|
||||
invCollection.Items = allItems;
|
||||
|
||||
// foreach (InventoryFolderBase folder in invCollection.Folders)
|
||||
// {
|
||||
// m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID);
|
||||
// }
|
||||
//
|
||||
// foreach (InventoryItemBase item in invCollection.Items)
|
||||
// {
|
||||
// m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder);
|
||||
// }
|
||||
// foreach (InventoryFolderBase folder in invCollection.Folders)
|
||||
// {
|
||||
// m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID);
|
||||
// }
|
||||
//
|
||||
// foreach (InventoryItemBase item in invCollection.Items)
|
||||
// {
|
||||
// m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder);
|
||||
// }
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items",
|
||||
|
@ -209,6 +209,22 @@ namespace OpenSim.Grid.InventoryServer
|
|||
return invCollection;
|
||||
}
|
||||
|
||||
public List<InventoryItemBase> GetFolderItems(Guid folderID)
|
||||
{
|
||||
List<InventoryItemBase> allItems = new List<InventoryItemBase>();
|
||||
|
||||
|
||||
List<InventoryItemBase> items = RequestFolderItems(new UUID(folderID));
|
||||
|
||||
if (items != null)
|
||||
{
|
||||
allItems.InsertRange(0, items);
|
||||
}
|
||||
m_log.InfoFormat(
|
||||
"[GRID AGENT INVENTORY]: Sending back inventory response containing {0} items", allItems.Count.ToString());
|
||||
return allItems;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Guid to UUID wrapper for same name IInventoryServices method
|
||||
/// </summary>
|
||||
|
@ -233,7 +249,7 @@ namespace OpenSim.Grid.InventoryServer
|
|||
|
||||
return CreateNewUserInventory(userID);
|
||||
}
|
||||
|
||||
|
||||
public List<InventoryItemBase> GetActiveGestures(Guid rawUserID)
|
||||
{
|
||||
UUID userID = new UUID(rawUserID);
|
||||
|
|
|
@ -109,6 +109,14 @@ namespace OpenSim.Grid.InventoryServer
|
|||
new RestDeserialiseSecureHandler<InventoryItemBase, bool>(
|
||||
"POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession));
|
||||
|
||||
m_httpServer.AddStreamHandler(
|
||||
new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>(
|
||||
"POST", "/GetItems/", m_inventoryService.GetFolderItems, m_inventoryService.CheckTrustSource));
|
||||
|
||||
m_httpServer.AddStreamHandler(
|
||||
new RestDeserialiseTrustedHandler<InventoryItemBase, bool>(
|
||||
"POST", "/AddNewItem/", m_inventoryService.AddItem, m_inventoryService.CheckTrustSource));
|
||||
|
||||
m_httpServer.AddStreamHandler(
|
||||
new RestDeserialiseSecureHandler<InventoryItemBase, bool>(
|
||||
"POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession));
|
||||
|
|
Loading…
Reference in New Issue