Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into arthursv
commit
9c9fa51b0f
|
@ -532,6 +532,11 @@ namespace OpenSim.Framework.Communications.Tests
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DeleteFolders(UUID ownerID, List<UUID> ids)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public bool PurgeFolder(InventoryFolderBase folder)
|
public bool PurgeFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -576,7 +576,7 @@ namespace OpenSim.Framework.Console
|
||||||
|
|
||||||
public void Prompt()
|
public void Prompt()
|
||||||
{
|
{
|
||||||
string line = ReadLine(m_defaultPrompt, true, true);
|
string line = ReadLine(m_defaultPrompt + "# ", true, true);
|
||||||
|
|
||||||
if (line != String.Empty)
|
if (line != String.Empty)
|
||||||
{
|
{
|
||||||
|
@ -592,7 +592,7 @@ namespace OpenSim.Framework.Console
|
||||||
|
|
||||||
public override string ReadLine(string p, bool isCommand, bool e)
|
public override string ReadLine(string p, bool isCommand, bool e)
|
||||||
{
|
{
|
||||||
System.Console.Write("{0}", prompt);
|
System.Console.Write("{0}", p);
|
||||||
string cmdinput = System.Console.ReadLine();
|
string cmdinput = System.Console.ReadLine();
|
||||||
|
|
||||||
if (isCommand)
|
if (isCommand)
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace OpenSim.Framework.Console
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DefaultPrompt
|
public string DefaultPrompt
|
||||||
{
|
{
|
||||||
set { m_defaultPrompt = value + "# "; }
|
set { m_defaultPrompt = value; }
|
||||||
get { return m_defaultPrompt; }
|
get { return m_defaultPrompt; }
|
||||||
}
|
}
|
||||||
protected string m_defaultPrompt;
|
protected string m_defaultPrompt;
|
||||||
|
@ -123,7 +123,7 @@ namespace OpenSim.Framework.Console
|
||||||
|
|
||||||
public virtual string ReadLine(string p, bool isCommand, bool e)
|
public virtual string ReadLine(string p, bool isCommand, bool e)
|
||||||
{
|
{
|
||||||
System.Console.Write("{0}", prompt);
|
System.Console.Write("{0}", p);
|
||||||
string cmdinput = System.Console.ReadLine();
|
string cmdinput = System.Console.ReadLine();
|
||||||
|
|
||||||
return cmdinput;
|
return cmdinput;
|
||||||
|
|
|
@ -217,6 +217,12 @@ namespace OpenSim.Framework.Console
|
||||||
id.AppendChild(xmldoc.CreateTextNode(sessionID.ToString()));
|
id.AppendChild(xmldoc.CreateTextNode(sessionID.ToString()));
|
||||||
|
|
||||||
rootElement.AppendChild(id);
|
rootElement.AppendChild(id);
|
||||||
|
|
||||||
|
XmlElement prompt = xmldoc.CreateElement("", "Prompt", "");
|
||||||
|
prompt.AppendChild(xmldoc.CreateTextNode(DefaultPrompt));
|
||||||
|
|
||||||
|
rootElement.AppendChild(prompt);
|
||||||
|
|
||||||
rootElement.AppendChild(MainConsole.Instance.Commands.GetXml(xmldoc));
|
rootElement.AppendChild(MainConsole.Instance.Commands.GetXml(xmldoc));
|
||||||
|
|
||||||
reply["str_response_string"] = xmldoc.InnerXml;
|
reply["str_response_string"] = xmldoc.InnerXml;
|
||||||
|
|
|
@ -260,7 +260,7 @@ namespace OpenSim.Framework
|
||||||
IClientAPI remoteClient, List<UUID> itemIDs);
|
IClientAPI remoteClient, List<UUID> itemIDs);
|
||||||
|
|
||||||
public delegate void RemoveInventoryFolder(
|
public delegate void RemoveInventoryFolder(
|
||||||
IClientAPI remoteClient, UUID folderID);
|
IClientAPI remoteClient, List<UUID> folderIDs);
|
||||||
|
|
||||||
public delegate void RequestAsset(IClientAPI remoteClient, RequestAssetArgs transferRequest);
|
public delegate void RequestAsset(IClientAPI remoteClient, RequestAssetArgs transferRequest);
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
WebRequest request = WebRequest.Create(requestUrl);
|
WebRequest request = WebRequest.Create(requestUrl);
|
||||||
request.Method = verb;
|
request.Method = verb;
|
||||||
request.ContentType = "text/xml";
|
request.ContentType = "text/xml";
|
||||||
|
request.Timeout = 20000;
|
||||||
|
|
||||||
MemoryStream buffer = new MemoryStream();
|
MemoryStream buffer = new MemoryStream();
|
||||||
|
|
||||||
|
@ -98,7 +99,9 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
{
|
{
|
||||||
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
||||||
deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream());
|
deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream());
|
||||||
|
resp.Close();
|
||||||
}
|
}
|
||||||
|
requestStream.Close();
|
||||||
return deserial;
|
return deserial;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
WebRequest request = WebRequest.Create(requestUrl);
|
WebRequest request = WebRequest.Create(requestUrl);
|
||||||
request.Method = verb;
|
request.Method = verb;
|
||||||
|
|
||||||
if (verb == "POST")
|
if ((verb == "POST") || (verb == "PUT"))
|
||||||
{
|
{
|
||||||
request.ContentType = "text/xml";
|
request.ContentType = "text/xml";
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications.Cache
|
namespace OpenSim.Grid.InventoryServer
|
||||||
{
|
{
|
||||||
public class AuthedSessionCache
|
public class AuthedSessionCache
|
||||||
{
|
{
|
|
@ -30,8 +30,10 @@ using System.Reflection;
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Data;
|
using OpenSim.Data;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Communications;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Grid.InventoryServer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abstract base class used by local and grid implementations of an inventory service.
|
/// Abstract base class used by local and grid implementations of an inventory service.
|
|
@ -65,6 +65,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
{
|
{
|
||||||
ArgvConfigSource argvSource = new ArgvConfigSource(args);
|
ArgvConfigSource argvSource = new ArgvConfigSource(args);
|
||||||
argvSource.AddSwitch("Startup", "console", "c");
|
argvSource.AddSwitch("Startup", "console", "c");
|
||||||
|
argvSource.AddSwitch("Startup", "xmlfile", "x");
|
||||||
|
|
||||||
IConfig startupConfig = argvSource.Configs["Startup"];
|
IConfig startupConfig = argvSource.Configs["Startup"];
|
||||||
if (startupConfig != null)
|
if (startupConfig != null)
|
||||||
|
|
|
@ -7090,14 +7090,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (OnRemoveInventoryFolder != null)
|
if (OnRemoveInventoryFolder != null)
|
||||||
{
|
{
|
||||||
handlerRemoveInventoryFolder = null;
|
handlerRemoveInventoryFolder = null;
|
||||||
|
List<UUID> uuids = new List<UUID>();
|
||||||
foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
|
foreach (RemoveInventoryFolderPacket.FolderDataBlock datablock in removeFolder.FolderData)
|
||||||
{
|
{
|
||||||
handlerRemoveInventoryFolder = OnRemoveInventoryFolder;
|
uuids.Add(datablock.FolderID);
|
||||||
|
}
|
||||||
if (handlerRemoveInventoryFolder != null)
|
handlerRemoveInventoryFolder = OnRemoveInventoryFolder;
|
||||||
{
|
if (handlerRemoveInventoryFolder != null)
|
||||||
handlerRemoveInventoryFolder(this, datablock.FolderID);
|
{
|
||||||
}
|
handlerRemoveInventoryFolder(this, uuids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -7114,14 +7115,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (OnRemoveInventoryFolder != null)
|
if (OnRemoveInventoryFolder != null)
|
||||||
{
|
{
|
||||||
handlerRemoveInventoryFolder = null;
|
handlerRemoveInventoryFolder = null;
|
||||||
|
List<UUID> uuids = new List<UUID>();
|
||||||
foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData)
|
foreach (RemoveInventoryObjectsPacket.FolderDataBlock datablock in removeObject.FolderData)
|
||||||
{
|
{
|
||||||
handlerRemoveInventoryFolder = OnRemoveInventoryFolder;
|
uuids.Add(datablock.FolderID);
|
||||||
|
}
|
||||||
if (handlerRemoveInventoryFolder != null)
|
handlerRemoveInventoryFolder = OnRemoveInventoryFolder;
|
||||||
{
|
if (handlerRemoveInventoryFolder != null)
|
||||||
handlerRemoveInventoryFolder(this, datablock.FolderID);
|
{
|
||||||
}
|
handlerRemoveInventoryFolder(this, uuids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
/// <returns>true if the folder was successfully moved</returns>
|
/// <returns>true if the folder was successfully moved</returns>
|
||||||
public abstract bool MoveFolder(InventoryFolderBase folder);
|
public abstract bool MoveFolder(InventoryFolderBase folder);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a list of inventory folders (from trash)
|
||||||
|
/// </summary>
|
||||||
|
public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Purge an inventory folder of all its items and subfolders.
|
/// Purge an inventory folder of all its items and subfolders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -330,6 +330,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
|
||||||
|
{
|
||||||
|
if (folderIDs == null)
|
||||||
|
return false;
|
||||||
|
if (folderIDs.Count == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (IsLocalGridUser(ownerID))
|
||||||
|
return m_GridService.DeleteFolders(ownerID, folderIDs);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UUID sessionID = GetSessionID(ownerID);
|
||||||
|
string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString();
|
||||||
|
return m_HGService.DeleteFolders(uri, folderIDs, sessionID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool MoveFolder(InventoryFolderBase folder)
|
public override bool MoveFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
if (folder == null)
|
if (folder == null)
|
||||||
|
|
|
@ -258,6 +258,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
return m_InventoryService.MoveFolder(folder);
|
return m_InventoryService.MoveFolder(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
|
||||||
|
{
|
||||||
|
return m_InventoryService.DeleteFolders(ownerID, folderIDs);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Purge an inventory folder of all its items and subfolders.
|
/// Purge an inventory folder of all its items and subfolders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -243,6 +243,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID);
|
return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
|
||||||
|
{
|
||||||
|
if (folderIDs == null)
|
||||||
|
return false;
|
||||||
|
if (folderIDs.Count == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
UUID sessionID = GetSessionID(ownerID);
|
||||||
|
return m_RemoteConnector.DeleteFolders(ownerID.ToString(), folderIDs, sessionID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public override bool PurgeFolder(InventoryFolderBase folder)
|
public override bool PurgeFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
if (folder == null)
|
if (folder == null)
|
||||||
|
|
|
@ -789,23 +789,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes an inventory folder. Although there is a packet in the Linden protocol for this, it may be
|
/// Removes an inventory folder. This packet is sent when the user
|
||||||
/// legacy and not currently used (purge folder is used to remove folders from trash instead).
|
/// right-clicks a folder that's already in trash and chooses "purge"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
/// <param name="folderID"></param>
|
/// <param name="folderID"></param>
|
||||||
private void RemoveInventoryFolder(IClientAPI remoteClient, UUID folderID)
|
private void RemoveInventoryFolder(IClientAPI remoteClient, List<UUID> folderIDs)
|
||||||
{
|
{
|
||||||
// Unclear is this handler is ever called by the Linden client, but it might
|
m_log.DebugFormat("[SCENE INVENTORY]: RemoveInventoryFolders count {0}", folderIDs.Count);
|
||||||
|
InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs);
|
||||||
InventoryFolderBase folder = new InventoryFolderBase(folderID);
|
|
||||||
folder.Owner = remoteClient.AgentId;
|
|
||||||
InventoryFolderBase trash = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder);
|
|
||||||
if (trash != null)
|
|
||||||
{
|
|
||||||
folder.ParentID = trash.ID;
|
|
||||||
InventoryService.MoveFolder(folder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SceneObjectGroup GetGroupByPrim(uint localID)
|
private SceneObjectGroup GetGroupByPrim(uint localID)
|
||||||
|
|
|
@ -552,7 +552,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
|
public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
|
||||||
{
|
{
|
||||||
InventoryFolderBase folder = new InventoryFolderBase(folderID);
|
InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
|
||||||
folder = InventoryService.GetFolder(folder);
|
folder = InventoryService.GetFolder(folder);
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,6 +104,10 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||||
new RestDeserialiseSecureHandler<InventoryFolderBase, bool>(
|
new RestDeserialiseSecureHandler<InventoryFolderBase, bool>(
|
||||||
"POST", "/PurgeFolder/", m_InventoryService.PurgeFolder, CheckAuthSession));
|
"POST", "/PurgeFolder/", m_InventoryService.PurgeFolder, CheckAuthSession));
|
||||||
|
|
||||||
|
m_httpServer.AddStreamHandler(
|
||||||
|
new RestDeserialiseSecureHandler<List<Guid>, bool>(
|
||||||
|
"POST", "/DeleteFolders/", DeleteFolders, CheckAuthSession));
|
||||||
|
|
||||||
m_httpServer.AddStreamHandler(
|
m_httpServer.AddStreamHandler(
|
||||||
new RestDeserialiseSecureHandler<List<Guid>, bool>(
|
new RestDeserialiseSecureHandler<List<Guid>, bool>(
|
||||||
"POST", "/DeleteItem/", DeleteItems, CheckAuthSession));
|
"POST", "/DeleteItem/", DeleteItems, CheckAuthSession));
|
||||||
|
@ -143,6 +147,9 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||||
m_httpServer.AddStreamHandler(
|
m_httpServer.AddStreamHandler(
|
||||||
new RestDeserialiseSecureHandler<List<InventoryItemBase>, bool>(
|
new RestDeserialiseSecureHandler<List<InventoryItemBase>, bool>(
|
||||||
"POST", "/MoveItems/", MoveItems, CheckAuthSession));
|
"POST", "/MoveItems/", MoveItems, CheckAuthSession));
|
||||||
|
|
||||||
|
m_httpServer.AddStreamHandler(new InventoryServerMoveItemsHandler(m_InventoryService));
|
||||||
|
|
||||||
|
|
||||||
// for persistent active gestures
|
// for persistent active gestures
|
||||||
m_httpServer.AddStreamHandler(
|
m_httpServer.AddStreamHandler(
|
||||||
|
@ -251,6 +258,15 @@ namespace OpenSim.Server.Handlers.Inventory
|
||||||
return m_InventoryService.GetAssetPermissions(item.Owner, item.AssetID);
|
return m_InventoryService.GetAssetPermissions(item.Owner, item.AssetID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DeleteFolders(List<Guid> items)
|
||||||
|
{
|
||||||
|
List<UUID> uuids = new List<UUID>();
|
||||||
|
foreach (Guid g in items)
|
||||||
|
uuids.Add(new UUID(g));
|
||||||
|
// oops we lost the user info here. Bad bad handlers
|
||||||
|
return m_InventoryService.DeleteFolders(UUID.Zero, uuids);
|
||||||
|
}
|
||||||
|
|
||||||
public bool DeleteItems(List<Guid> items)
|
public bool DeleteItems(List<Guid> items)
|
||||||
{
|
{
|
||||||
List<UUID> uuids = new List<UUID>();
|
List<UUID> uuids = new List<UUID>();
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using Nini.Config;
|
||||||
|
using log4net;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using OpenSim.Server.Base;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
|
using OpenMetaverse;
|
||||||
|
|
||||||
|
namespace OpenSim.Server.Handlers.Inventory
|
||||||
|
{
|
||||||
|
public class InventoryServerMoveItemsHandler : BaseStreamHandler
|
||||||
|
{
|
||||||
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
private IInventoryService m_InventoryService;
|
||||||
|
|
||||||
|
public InventoryServerMoveItemsHandler(IInventoryService service) :
|
||||||
|
base("PUT", "/inventory")
|
||||||
|
{
|
||||||
|
m_InventoryService = service;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte[] Handle(string path, Stream request,
|
||||||
|
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
|
{
|
||||||
|
XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>));
|
||||||
|
List<InventoryItemBase> items = (List<InventoryItemBase>)xs.Deserialize(request);
|
||||||
|
|
||||||
|
bool result = false;
|
||||||
|
string[] p = SplitParams(path);
|
||||||
|
|
||||||
|
if (p.Length > 0)
|
||||||
|
{
|
||||||
|
UUID ownerID = UUID.Zero;
|
||||||
|
UUID.TryParse(p[0], out ownerID);
|
||||||
|
result = m_InventoryService.MoveItems(ownerID, items);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_log.WarnFormat("[MOVEITEMS HANDLER]: ownerID not provided in request. Unable to serve.");
|
||||||
|
|
||||||
|
xs = new XmlSerializer(typeof(bool));
|
||||||
|
return ServerUtils.SerializeResult(xs, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -201,6 +201,19 @@ namespace OpenSim.Services.Connectors.Inventory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DeleteFolders(string id, List<UUID> folders, UUID sessionID)
|
||||||
|
{
|
||||||
|
string url = string.Empty;
|
||||||
|
string userID = string.Empty;
|
||||||
|
|
||||||
|
if (StringToUrlAndUserID(id, out url, out userID))
|
||||||
|
{
|
||||||
|
ISessionAuthInventoryService connector = GetConnector(url);
|
||||||
|
return connector.DeleteFolders(userID, folders, sessionID);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID)
|
public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID)
|
||||||
{
|
{
|
||||||
string url = string.Empty;
|
string url = string.Empty;
|
||||||
|
|
|
@ -88,6 +88,11 @@ namespace OpenSim.Services.Connectors
|
||||||
/// <returns>true if the folder was successfully moved</returns>
|
/// <returns>true if the folder was successfully moved</returns>
|
||||||
bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id);
|
bool MoveFolder(string userID, InventoryFolderBase folder, UUID session_id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a list of inventory folders (from trash)
|
||||||
|
/// </summary>
|
||||||
|
bool DeleteFolders(string userID, List<UUID> folders, UUID session_id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Purge an inventory folder of all its items and subfolders.
|
/// Purge an inventory folder of all its items and subfolders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -229,6 +229,11 @@ namespace OpenSim.Services.Connectors
|
||||||
return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject(
|
return SynchronousRestSessionObjectPoster<Guid, InventoryCollection>.BeginPostObject(
|
||||||
"POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString());
|
"POST", m_ServerURI + "/GetFolderContent/", folderID.Guid, sessionID.ToString(), userID.ToString());
|
||||||
}
|
}
|
||||||
|
catch (TimeoutException e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[INVENTORY CONNECTOR]: GetFolderContent operation to {0} timed out {0} {1}.", m_ServerURI,
|
||||||
|
e.Source, e.Message);
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// Maybe we're talking to an old inventory server. Try this other thing.
|
// Maybe we're talking to an old inventory server. Try this other thing.
|
||||||
|
@ -308,6 +313,25 @@ namespace OpenSim.Services.Connectors
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DeleteFolders(string userID, List<UUID> folderIDs, UUID sessionID)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<Guid> guids = new List<Guid>();
|
||||||
|
foreach (UUID u in folderIDs)
|
||||||
|
guids.Add(u.Guid);
|
||||||
|
return SynchronousRestSessionObjectPoster<List<Guid>, bool>.BeginPostObject(
|
||||||
|
"POST", m_ServerURI + "/DeleteFolders/", guids, sessionID.ToString(), userID);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[INVENTORY CONNECTOR]: Delete inventory folders operation failed, {0} {1}",
|
||||||
|
e.Source, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID)
|
public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -397,13 +421,28 @@ namespace OpenSim.Services.Connectors
|
||||||
|
|
||||||
private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID)
|
private void MoveItemsAsync(string userID, List<InventoryItemBase> items, UUID sessionID)
|
||||||
{
|
{
|
||||||
|
if (items == null)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[INVENTORY CONNECTOR]: request to move items got a null list.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject(
|
//SynchronousRestSessionObjectPoster<List<InventoryItemBase>, bool>.BeginPostObject(
|
||||||
"POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString());
|
// "POST", m_ServerURI + "/MoveItems/", items, sessionID.ToString(), userID.ToString());
|
||||||
|
|
||||||
|
//// Success
|
||||||
|
//return;
|
||||||
|
string uri = m_ServerURI + "/inventory/" + userID;
|
||||||
|
if (SynchronousRestObjectRequester.
|
||||||
|
MakeRequest<List<InventoryItemBase>, bool>("PUT", uri, items))
|
||||||
|
m_log.DebugFormat("[INVENTORY CONNECTOR]: move {0} items poster succeeded {1}", items.Count, uri);
|
||||||
|
else
|
||||||
|
m_log.DebugFormat("[INVENTORY CONNECTOR]: move {0} items poster failed {1}", items.Count, uri); ;
|
||||||
|
|
||||||
// Success
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -466,12 +505,12 @@ namespace OpenSim.Services.Connectors
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase item, UUID sessionID)
|
public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase folder, UUID sessionID)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject(
|
return SynchronousRestSessionObjectPoster<InventoryFolderBase, InventoryFolderBase>.BeginPostObject(
|
||||||
"POST", m_ServerURI + "/QueryFolder/", item, sessionID.ToString(), item.Owner.ToString());
|
"POST", m_ServerURI + "/QueryFolder/", folder, sessionID.ToString(), userID);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,6 +136,12 @@ namespace OpenSim.Services.Connectors
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool PurgeFolder(InventoryFolderBase folder)
|
public bool PurgeFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -121,6 +121,14 @@ namespace OpenSim.Services.Interfaces
|
||||||
/// <returns>true if the folder was successfully moved</returns>
|
/// <returns>true if the folder was successfully moved</returns>
|
||||||
bool MoveFolder(InventoryFolderBase folder);
|
bool MoveFolder(InventoryFolderBase folder);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete an item from the user's inventory
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <returns>true if the item was successfully deleted</returns>
|
||||||
|
//bool DeleteItem(InventoryItemBase item);
|
||||||
|
bool DeleteFolders(UUID userID, List<UUID> folderIDs);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Purge an inventory folder of all its items and subfolders.
|
/// Purge an inventory folder of all its items and subfolders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -425,15 +425,27 @@ namespace OpenSim.Services.InventoryService
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual InventoryFolderBase GetFolder(InventoryFolderBase item)
|
public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
InventoryFolderBase result = m_Database.getInventoryFolder(item.ID);
|
InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
|
||||||
|
{
|
||||||
|
foreach (UUID id in folderIDs)
|
||||||
|
{
|
||||||
|
InventoryFolderBase folder = new InventoryFolderBase(id, ownerID);
|
||||||
|
PurgeFolder(folder);
|
||||||
|
m_Database.deleteInventoryFolder(id);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Purge a folder of all items items and subfolders.
|
/// Purge a folder of all items items and subfolders.
|
||||||
///
|
///
|
||||||
|
|
|
@ -128,6 +128,11 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DeleteFolders(UUID ownerID, List<UUID> ids)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public bool PurgeFolder(InventoryFolderBase folder)
|
public bool PurgeFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
<Addin id="OpenSim.Grid.AssetInventoryServer" isroot="true" version="0.1">
|
|
||||||
<Runtime>
|
|
||||||
<Import assembly="OpenSim.Grid.AssetInventoryServer.exe" />
|
|
||||||
<Import assembly="OpenSim.Framework.dll" />
|
|
||||||
</Runtime>
|
|
||||||
<ExtensionPoint path="/OpenSim/AssetInventoryServer/Frontend">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.AssetInventoryServer.IAssetInventoryServerPlugin" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path="/OpenSim/AssetInventoryServer/AssetStorageProvider">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.AssetInventoryServer.IAssetStorageProvider" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path="/OpenSim/AssetInventoryServer/InventoryStorageProvider">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.AssetInventoryServer.IInventoryStorageProvider" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path="/OpenSim/AssetInventoryServer/AuthenticationProvider">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.AssetInventoryServer.IAuthenticationProvider" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path="/OpenSim/AssetInventoryServer/AuthorizationProvider">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.AssetInventoryServer.IAuthorizationProvider" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path="/OpenSim/AssetInventoryServer/MetricsProvider">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Grid.AssetInventoryServer.IMetricsProvider" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
</Addin>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<configuration>
|
|
||||||
<configSections>
|
|
||||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
|
||||||
</configSections>
|
|
||||||
<appSettings>
|
|
||||||
</appSettings>
|
|
||||||
<log4net>
|
|
||||||
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date{HH:mm:ss} - %message%newline" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
|
|
||||||
<file value="OpenSim.Grid.AssetInventoryServer.log" />
|
|
||||||
<appendToFile value="true" />
|
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
|
||||||
<conversionPattern value="%date %-5level - %logger %message%newline" />
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- if you'd like to know what NHibernate is doing more set value="DEBUG" -->
|
|
||||||
<logger name="NHibernate" additivity="false">
|
|
||||||
<level value="INFO"/>
|
|
||||||
<appender-ref ref="NHibernateFileLog"/>
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<root>
|
|
||||||
<level value="DEBUG" />
|
|
||||||
<appender-ref ref="Console" />
|
|
||||||
<appender-ref ref="LogFileAppender" />
|
|
||||||
</root>
|
|
||||||
</log4net>
|
|
||||||
</configuration>
|
|
Loading…
Reference in New Issue