From 76c0935ec744f2d230489398f879eb7f42b11d37 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 17 Feb 2009 01:36:44 +0000 Subject: - 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 --- .../Rest/Inventory/RestAssetServices.cs | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index 2996030..3475d32 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs @@ -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("

Created asset {0}, UUID {1}

", asset.Metadata.Name, asset.Metadata.FullID)); + rdata.appendStatus(String.Format("

Created asset {0}, UUID {1}

", asset.Name, asset.FullID)); rdata.Complete(Rest.HttpStatusCodeCreated); } else { if (modified) { - rdata.appendStatus(String.Format("

Modified asset {0}, UUID {1}

", asset.Metadata.Name, asset.Metadata.FullID)); + rdata.appendStatus(String.Format("

Modified asset {0}, UUID {1}

", 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("

Created asset {0}, UUID {1}

", asset.Metadata.Name, asset.Metadata.FullID)); + rdata.appendStatus(String.Format("

Created asset {0}, UUID {1}

", asset.Name, asset.FullID)); rdata.Complete(Rest.HttpStatusCodeCreated); } else { if (modified) { - rdata.appendStatus(String.Format("

Modified asset {0}, UUID {1}

", asset.Metadata.Name, asset.Metadata.FullID)); + rdata.appendStatus(String.Format("

Modified asset {0}, UUID {1}

", asset.Name, asset.FullID)); rdata.Complete(Rest.HttpStatusCodeOK); } else -- cgit v1.1