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.

0.6.1-post-fixes
MW 2008-12-02 11:15:08 +00:00
parent bf4ccf3858
commit b62b9af6b0
2 changed files with 34 additions and 10 deletions

View File

@ -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>

View File

@ -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));