* stop inventory item creation via REST falling over on any included assets that are not inline (UUID only)

* make rest inventory item xml output use 'invtype' for inventory type rather than just 'type'.  This makes it symmetrical with input xml
0.6.1-post-fixes
Justin Clarke Casey 2008-12-01 18:09:04 +00:00
parent 5a0fa4f34c
commit 4699cd7957
1 changed files with 93 additions and 93 deletions

View File

@ -1293,9 +1293,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
/// <summary> /// <summary>
/// This method generates XML that describes an instance of InventoryItemBase. /// This method generates XML that describes an instance of InventoryItemBase.
/// </summary> /// </summary>
/// <param name=rdata>HTTP service request work area</param> /// <param name="rdata">HTTP service request work area</param>
/// <param name=i>The item to be formatted</param> /// <param name="i">The item to be formatted</param>
/// <param name=indent>Pretty print indentation</param> /// <param name="indent">Pretty print indentation</param>
private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent) private void formatItem(InventoryRequestData rdata, InventoryItemBase i, string indent)
{ {
Rest.Log.DebugFormat("{0} Item : {1} {2} {3} Type = {4}, AssetType = {5}", Rest.Log.DebugFormat("{0} Item : {1} {2} {3} Type = {4}, AssetType = {5}",
@ -1310,7 +1310,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
rdata.writer.WriteAttributeString("owner", String.Empty, i.Owner.ToString()); rdata.writer.WriteAttributeString("owner", String.Empty, i.Owner.ToString());
rdata.writer.WriteAttributeString("creator", String.Empty, i.Creator.ToString()); rdata.writer.WriteAttributeString("creator", String.Empty, i.Creator.ToString());
rdata.writer.WriteAttributeString("creationdate", String.Empty, i.CreationDate.ToString()); rdata.writer.WriteAttributeString("creationdate", String.Empty, i.CreationDate.ToString());
rdata.writer.WriteAttributeString("type", String.Empty, i.InvType.ToString()); rdata.writer.WriteAttributeString("invtype", String.Empty, i.InvType.ToString());
rdata.writer.WriteAttributeString("assettype", String.Empty, i.AssetType.ToString()); rdata.writer.WriteAttributeString("assettype", String.Empty, i.AssetType.ToString());
rdata.writer.WriteAttributeString("groupowned", String.Empty, i.GroupOwned.ToString()); rdata.writer.WriteAttributeString("groupowned", String.Empty, i.GroupOwned.ToString());
rdata.writer.WriteAttributeString("groupid", String.Empty, i.GroupID.ToString()); rdata.writer.WriteAttributeString("groupid", String.Empty, i.GroupID.ToString());
@ -1459,6 +1459,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
case XmlNodeType.Element: case XmlNodeType.Element:
Rest.Log.DebugFormat("{0} StartElement: <{1}>", Rest.Log.DebugFormat("{0} StartElement: <{1}>",
MsgId, ic.xml.Name); MsgId, ic.xml.Name);
switch (ic.xml.Name) switch (ic.xml.Name)
{ {
case "Folder": case "Folder":
@ -1486,6 +1487,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
MsgId, ic.xml.Name); MsgId, ic.xml.Name);
break; break;
} }
// This stinks, but the ReadElement call above not only reads // This stinks, but the ReadElement call above not only reads
// the imbedded data, but also consumes the end tag for Asset // the imbedded data, but also consumes the end tag for Asset
// and moves the element pointer on to the containing Item's // and moves the element pointer on to the containing Item's
@ -1786,8 +1788,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
Rest.Log.DebugFormat("{0} Interpret asset element", MsgId); Rest.Log.DebugFormat("{0} Interpret asset element", MsgId);
AssetBase asset = null;
string name = String.Empty; string name = String.Empty;
string desc = String.Empty; string desc = String.Empty;
sbyte type = (sbyte) AssetType.Unknown; sbyte type = (sbyte) AssetType.Unknown;
@ -1807,7 +1807,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
ic.xml.MoveToAttribute(i); ic.xml.MoveToAttribute(i);
switch (ic.xml.Name) switch (ic.xml.Name)
{ {
case "name" : case "name" :
name = ic.xml.Value; name = ic.xml.Value;
break; break;
@ -1871,6 +1870,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
else else
{ {
AssetBase asset = null;
string b64string = null; string b64string = null;
// Generate a UUID if none were given, and generally none should // Generate a UUID if none were given, and generally none should
@ -1912,10 +1912,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{ {
ic.Item.AssetID = uuid; ic.Item.AssetID = uuid;
} }
}
ic.Push(asset); ic.Push(asset);
} }
}
/// <summary> /// <summary>
/// Store any permissions information provided by the request. /// Store any permissions information provided by the request.