aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs56
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs24
2 files changed, 40 insertions, 40 deletions
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
212 212
213 rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty); 213 rdata.writer.WriteStartElement(String.Empty,"Asset",String.Empty);
214 214
215 rdata.writer.WriteAttributeString("id", asset.Metadata.ID); 215 rdata.writer.WriteAttributeString("id", asset.ID);
216 rdata.writer.WriteAttributeString("name", asset.Metadata.Name); 216 rdata.writer.WriteAttributeString("name", asset.Name);
217 rdata.writer.WriteAttributeString("desc", asset.Metadata.Description); 217 rdata.writer.WriteAttributeString("desc", asset.Description);
218 rdata.writer.WriteAttributeString("type", asset.Metadata.Type.ToString()); 218 rdata.writer.WriteAttributeString("type", asset.Type.ToString());
219 rdata.writer.WriteAttributeString("local", asset.Metadata.Local.ToString()); 219 rdata.writer.WriteAttributeString("local", asset.Local.ToString());
220 rdata.writer.WriteAttributeString("temporary", asset.Metadata.Temporary.ToString()); 220 rdata.writer.WriteAttributeString("temporary", asset.Temporary.ToString());
221 221
222 rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length); 222 rdata.writer.WriteBase64(asset.Data,0,asset.Data.Length);
223 223
@@ -268,19 +268,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
268 modified = (asset != null); 268 modified = (asset != null);
269 created = !modified; 269 created = !modified;
270 270
271 asset = new AssetBase(); 271 asset = new AssetBase();
272 asset.Metadata.FullID = uuid; 272 asset.FullID = uuid;
273 asset.Metadata.Name = xml.GetAttribute("name"); 273 asset.Name = xml.GetAttribute("name");
274 asset.Metadata.Description = xml.GetAttribute("desc"); 274 asset.Description = xml.GetAttribute("desc");
275 asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type")); 275 asset.Type = SByte.Parse(xml.GetAttribute("type"));
276 asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0; 276 asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
277 asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; 277 asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
278 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); 278 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
279 279
280 if (asset.Metadata.ID != rdata.Parameters[0]) 280 if (asset.ID != rdata.Parameters[0])
281 { 281 {
282 Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}", 282 Rest.Log.WarnFormat("{0} URI and payload disagree on UUID U:{1} vs P:{2}",
283 MsgId, rdata.Parameters[0], asset.Metadata.ID); 283 MsgId, rdata.Parameters[0], asset.ID);
284 } 284 }
285 285
286 Rest.AssetServices.AddAsset(asset); 286 Rest.AssetServices.AddAsset(asset);
@@ -294,14 +294,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
294 294
295 if (created) 295 if (created)
296 { 296 {
297 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 297 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
298 rdata.Complete(Rest.HttpStatusCodeCreated); 298 rdata.Complete(Rest.HttpStatusCodeCreated);
299 } 299 }
300 else 300 else
301 { 301 {
302 if (modified) 302 if (modified)
303 { 303 {
304 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 304 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
305 rdata.Complete(Rest.HttpStatusCodeOK); 305 rdata.Complete(Rest.HttpStatusCodeOK);
306 } 306 }
307 else 307 else
@@ -348,27 +348,27 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
348 modified = (asset != null); 348 modified = (asset != null);
349 created = !modified; 349 created = !modified;
350 350
351 asset = new AssetBase(); 351 asset = new AssetBase();
352 asset.Metadata.FullID = uuid; 352 asset.FullID = uuid;
353 asset.Metadata.Name = xml.GetAttribute("name"); 353 asset.Name = xml.GetAttribute("name");
354 asset.Metadata.Description = xml.GetAttribute("desc"); 354 asset.Description = xml.GetAttribute("desc");
355 asset.Metadata.Type = SByte.Parse(xml.GetAttribute("type")); 355 asset.Type = SByte.Parse(xml.GetAttribute("type"));
356 asset.Metadata.Local = Int32.Parse(xml.GetAttribute("local")) != 0; 356 asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
357 asset.Metadata.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; 357 asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
358 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); 358 asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
359 359
360 Rest.AssetServices.AddAsset(asset); 360 Rest.AssetServices.AddAsset(asset);
361 361
362 if (created) 362 if (created)
363 { 363 {
364 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 364 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
365 rdata.Complete(Rest.HttpStatusCodeCreated); 365 rdata.Complete(Rest.HttpStatusCodeCreated);
366 } 366 }
367 else 367 else
368 { 368 {
369 if (modified) 369 if (modified)
370 { 370 {
371 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.FullID)); 371 rdata.appendStatus(String.Format("<p> Modified asset {0}, UUID {1} <p>", asset.Name, asset.FullID));
372 rdata.Complete(Rest.HttpStatusCodeOK); 372 rdata.Complete(Rest.HttpStatusCodeOK);
373 } 373 }
374 else 374 else
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
index 853b004..9935046 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs
@@ -488,12 +488,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
488 foreach (AssetBase asset in entity.Assets) 488 foreach (AssetBase asset in entity.Assets)
489 { 489 {
490 Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", 490 Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
491 MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.Name); 491 MsgId, asset.ID, asset.Type, asset.Name);
492 Rest.AssetServices.AddAsset(asset); 492 Rest.AssetServices.AddAsset(asset);
493 493
494 created = true; 494 created = true;
495 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", 495 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>",
496 asset.Metadata.Name, asset.Metadata.ID)); 496 asset.Name, asset.ID));
497 497
498 if (Rest.DEBUG && Rest.DumpAsset) 498 if (Rest.DEBUG && Rest.DumpAsset)
499 { 499 {
@@ -691,14 +691,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
691 foreach (AssetBase asset in entity.Assets) 691 foreach (AssetBase asset in entity.Assets)
692 { 692 {
693 Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}", 693 Rest.Log.DebugFormat("{0} Rest asset: {1} {2} {3}",
694 MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.Name); 694 MsgId, asset.ID, asset.Type, asset.Name);
695 695
696 // The asset was validated during the collection process 696 // The asset was validated during the collection process
697 697
698 Rest.AssetServices.AddAsset(asset); 698 Rest.AssetServices.AddAsset(asset);
699 699
700 created = true; 700 created = true;
701 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.ID)); 701 rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Name, asset.ID));
702 702
703 if (Rest.DEBUG && Rest.DumpAsset) 703 if (Rest.DEBUG && Rest.DumpAsset)
704 { 704 {
@@ -1884,10 +1884,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
1884 1884
1885 asset = new AssetBase(uuid, name); 1885 asset = new AssetBase(uuid, name);
1886 1886
1887 asset.Metadata.Description = desc; 1887 asset.Description = desc;
1888 asset.Metadata.Type = type; // type == 0 == texture 1888 asset.Type = type; // type == 0 == texture
1889 asset.Metadata.Local = local; 1889 asset.Local = local;
1890 asset.Metadata.Temporary = temp; 1890 asset.Temporary = temp;
1891 1891
1892 b64string = ic.xml.ReadElementContentAsString(); 1892 b64string = ic.xml.ReadElementContentAsString();
1893 1893
@@ -2039,10 +2039,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
2039 2039
2040 if (ic.Asset != null) 2040 if (ic.Asset != null)
2041 { 2041 {
2042 if (ic.Asset.Metadata.Name == String.Empty) 2042 if (ic.Asset.Name == String.Empty)
2043 ic.Asset.Metadata.Name = ic.Item.Name; 2043 ic.Asset.Name = ic.Item.Name;
2044 if (ic.Asset.Metadata.Description == String.Empty) 2044 if (ic.Asset.Description == String.Empty)
2045 ic.Asset.Metadata.Description = ic.Item.Description; 2045 ic.Asset.Description = ic.Item.Description;
2046 } 2046 }
2047 2047
2048 // Assign permissions 2048 // Assign permissions