Mantis#1514. Thank you kindly, Boscata for an InventoryServer patch

to allow the InventoryServer to work with MSSQL..
0.6.0-stable
Charles Krinke 2008-06-11 14:02:16 +00:00
parent aba396cb32
commit 7821cca2f5
5 changed files with 47 additions and 1 deletions

View File

@ -379,7 +379,7 @@ namespace OpenSim.Framework.Communications.Cache
baseFolder.Type = (short) type;
baseFolder.Version = RootFolder.Version;
m_commsManager.InventoryService.AddFolder(baseFolder);
m_commsManager.InventoryService.UpdateFolder(baseFolder);
}
else
{

View File

@ -57,6 +57,13 @@ namespace OpenSim.Framework.Communications
/// <returns>true if the folder was successfully added</returns>
bool AddFolder(InventoryFolderBase folder);
/// <summary>
/// Update a folder in the user's inventory
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully updated</returns>
bool UpdateFolder(InventoryFolderBase folder);
/// <summary>
/// Move an inventory folder to a new location
/// </summary>

View File

@ -198,6 +198,21 @@ namespace OpenSim.Framework.Communications
return true;
}
// See IInventoryServices
public bool UpdateFolder(InventoryFolderBase folder)
{
m_log.DebugFormat(
"[AGENT INVENTORY]: Updating folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.updateInventoryFolder(folder);
}
// FIXME: Should return false on failure
return true;
}
// See IInventoryServices
public bool MoveFolder(InventoryFolderBase folder)
{

View File

@ -96,6 +96,10 @@ namespace OpenSim.Grid.InventoryServer
new RestDeserialisehandler<InventoryFolderBase, bool>(
"POST", "/NewFolder/", m_inventoryService.AddFolder));
m_httpServer.AddStreamHandler(
new RestDeserialisehandler<InventoryFolderBase, bool>(
"POST", "/UpdateFolder/", m_inventoryService.UpdateFolder));
m_httpServer.AddStreamHandler(
new RestDeserialisehandler<InventoryFolderBase, bool>(
"POST", "/MoveFolder/", m_inventoryService.MoveFolder));

View File

@ -175,6 +175,26 @@ namespace OpenSim.Region.Communications.OGS1
return false;
}
/// <summary>
/// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
/// </summary>
/// <param name="folder"></param>
public bool UpdateFolder(InventoryFolderBase folder)
{
try
{
return SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
"POST", _inventoryServerUrl + "/UpdateFolder/", folder);
}
catch (WebException e)
{
m_log.ErrorFormat("[OGS1 INVENTORY SERVICE]: Update inventory folder operation failed, {0} {1}",
e.Source, e.Message);
}
return false;
}
/// <summary>
/// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
/// </summary>