mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
- remove the Metadata property from AssetBase and return all previous
properties as before - prefix private variables with m_ in AssetBase.cs - related to Mantis #3122, as mentioned in https://lists.berlios.de/pipermail/opensim-dev/2009-February/005088.html - all services will likely need to be upgraded after this commit
This commit is contained in:
@@ -212,12 +212,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty);
|
||||
|
||||
rdata.writer.WriteAttributeString("id", asset.Metadata.ID);
|
||||
rdata.writer.WriteAttributeString("name", asset.Metadata.Name);
|
||||
rdata.writer.WriteAttributeString("desc", asset.Metadata.Description);
|
||||
rdata.writer.WriteAttributeString("type", asset.Metadata.Type.ToString());
|
||||
rdata.writer.WriteAttributeString("local", asset.Metadata.Local.ToString());
|
||||
rdata.writer.WriteAttributeString("temporary", asset.Metadata.Temporary.ToString());
|
||||
rdata.writer.WriteAttributeString("id", asset.ID);
|
||||
rdata.writer.WriteAttributeString("name", asset.Name);
|
||||
rdata.writer.WriteAttributeString("desc", asset.Description);
|
||||
rdata.writer.WriteAttributeString("type", asset.Type.ToString());
|
||||
rdata.writer.WriteAttributeString("local", asset.Local.ToString());
|
||||
rdata.writer.WriteAttributeString("temporary", asset.Temporary.ToString());
|
||||
|
||||
rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length);
|
||||
|
||||
@@ -268,19 +268,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
modified = (asset != null);
|
||||
created = !modified;
|
||||
|
||||
asset = new AssetBase();
|
||||
asset.Metadata.FullID = uuid;
|
||||
asset.Metadata.Name = xml.GetAttribute("name");
|
||||
asset.Metadata.Description = xml.GetAttribute("desc");
|
||||
asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type"));
|
||||
asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
|
||||
asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
|
||||
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
|
||||
asset = new AssetBase();
|
||||
asset.FullID = uuid;
|
||||
asset.Name = xml.GetAttribute("name");
|
||||
asset.Description = xml.GetAttribute("desc");
|
||||
asset.Type = SByte.Parse(xml.GetAttribute("type"));
|
||||
asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
|
||||
asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
|
||||
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
|
||||
|
||||
if (asset.Metadata.ID != rdata.Parameters[0])
|
||||
if (asset.ID != rdata.Parameters[0])
|
||||
{
|
||||
Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}",
|
||||
MsgId, rdata.Parameters[0], asset.Metadata.ID);
|
||||
MsgId, rdata.Parameters[0], asset.ID);
|
||||
}
|
||||
|
||||
Rest.AssetServices.AddAsset(asset);
|
||||
@@ -294,14 +294,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
if (created)
|
||||
{
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID));
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
|
||||
rdata.Complete(Rest.HttpStatusCodeCreated);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (modified)
|
||||
{
|
||||
rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID));
|
||||
rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
|
||||
rdata.Complete(Rest.HttpStatusCodeOK);
|
||||
}
|
||||
else
|
||||
@@ -348,27 +348,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
modified = (asset != null);
|
||||
created = !modified;
|
||||
|
||||
asset = new AssetBase();
|
||||
asset.Metadata.FullID = uuid;
|
||||
asset.Metadata.Name = xml.GetAttribute("name");
|
||||
asset.Metadata.Description = xml.GetAttribute("desc");
|
||||
asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type"));
|
||||
asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
|
||||
asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
|
||||
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
|
||||
asset = new AssetBase();
|
||||
asset.FullID = uuid;
|
||||
asset.Name = xml.GetAttribute("name");
|
||||
asset.Description = xml.GetAttribute("desc");
|
||||
asset.Type = SByte.Parse(xml.GetAttribute("type"));
|
||||
asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
|
||||
asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
|
||||
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
|
||||
|
||||
Rest.AssetServices.AddAsset(asset);
|
||||
|
||||
if (created)
|
||||
{
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID));
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
|
||||
rdata.Complete(Rest.HttpStatusCodeCreated);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (modified)
|
||||
{
|
||||
rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID));
|
||||
rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
|
||||
rdata.Complete(Rest.HttpStatusCodeOK);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -488,12 +488,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
foreach (AssetBase asset in entity.Assets)
|
||||
{
|
||||
Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
|
||||
MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.Name);
|
||||
MsgId, asset.ID, asset.Type, asset.Name);
|
||||
Rest.AssetServices.AddAsset(asset);
|
||||
|
||||
created = true;
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>",
|
||||
asset.Metadata.Name, asset.Metadata.ID));
|
||||
asset.Name, asset.ID));
|
||||
|
||||
if (Rest.DEBUG && Rest.DumpAsset)
|
||||
{
|
||||
@@ -691,14 +691,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
foreach (AssetBase asset in entity.Assets)
|
||||
{
|
||||
Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
|
||||
MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.Name);
|
||||
MsgId, asset.ID, asset.Type, asset.Name);
|
||||
|
||||
// The asset was validated during the collection process
|
||||
|
||||
Rest.AssetServices.AddAsset(asset);
|
||||
|
||||
created = true;
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.ID));
|
||||
rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.ID));
|
||||
|
||||
if (Rest.DEBUG && Rest.DumpAsset)
|
||||
{
|
||||
@@ -1884,10 +1884,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
asset = new AssetBase(uuid, name);
|
||||
|
||||
asset.Metadata.Description = desc;
|
||||
asset.Metadata.Type = type; // type == 0 == texture
|
||||
asset.Metadata.Local = local;
|
||||
asset.Metadata.Temporary = temp;
|
||||
asset.Description = desc;
|
||||
asset.Type = type; // type == 0 == texture
|
||||
asset.Local = local;
|
||||
asset.Temporary = temp;
|
||||
|
||||
b64string = ic.xml.ReadElementContentAsString();
|
||||
|
||||
@@ -2039,10 +2039,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
if (ic.Asset != null)
|
||||
{
|
||||
if (ic.Asset.Metadata.Name == String.Empty)
|
||||
ic.Asset.Metadata.Name = ic.Item.Name;
|
||||
if (ic.Asset.Metadata.Description == String.Empty)
|
||||
ic.Asset.Metadata.Description = ic.Item.Description;
|
||||
if (ic.Asset.Name == String.Empty)
|
||||
ic.Asset.Name = ic.Item.Name;
|
||||
if (ic.Asset.Description == String.Empty)
|
||||
ic.Asset.Description = ic.Item.Description;
|
||||
}
|
||||
|
||||
// Assign permissions
|
||||
|
||||
Reference in New Issue
Block a user