diff options
author | Mike Mazur | 2009-02-04 00:01:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-04 00:01:36 +0000 |
commit | 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch) | |
tree | a90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 2dce706..aa222bb 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs | |||
@@ -353,7 +353,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
353 | default : | 353 | default : |
354 | Rest.Log.WarnFormat("{0} Method {1} not supported for {2}", | 354 | Rest.Log.WarnFormat("{0} Method {1} not supported for {2}", |
355 | MsgId, rdata.method, rdata.path); | 355 | MsgId, rdata.method, rdata.path); |
356 | rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, | 356 | rdata.Fail(Rest.HttpStatusCodeMethodNotAllowed, |
357 | String.Format("{0} not supported", rdata.method)); | 357 | String.Format("{0} not supported", rdata.method)); |
358 | break; | 358 | break; |
359 | } | 359 | } |
@@ -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.ID, asset.Type, asset.Name); | 491 | MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.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.Name, asset.ID)); | 496 | asset.Metadata.Name, asset.Metadata.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.ID, asset.Type, asset.Name); | 694 | MsgId, asset.Metadata.ID, asset.Metadata.Type, asset.Metadata.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.Name, asset.ID)); | 701 | rdata.appendStatus(String.Format("<p> Created asset {0}, UUID {1} <p>", asset.Metadata.Name, asset.Metadata.ID)); |
702 | 702 | ||
703 | if (Rest.DEBUG && Rest.DumpAsset) | 703 | if (Rest.DEBUG && Rest.DumpAsset) |
704 | { | 704 | { |
@@ -1083,7 +1083,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1083 | 1083 | ||
1084 | Rest.Log.DebugFormat("{0} {1}: Resource {2} not found", | 1084 | Rest.Log.DebugFormat("{0} {1}: Resource {2} not found", |
1085 | MsgId, rdata.method, rdata.path); | 1085 | MsgId, rdata.method, rdata.path); |
1086 | rdata.Fail(Rest.HttpStatusCodeNotFound, | 1086 | rdata.Fail(Rest.HttpStatusCodeNotFound, |
1087 | String.Format("resource {0}:{1} not found", rdata.method, rdata.path)); | 1087 | String.Format("resource {0}:{1} not found", rdata.method, rdata.path)); |
1088 | 1088 | ||
1089 | return null; /* Never reached */ | 1089 | return null; /* Never reached */ |
@@ -1324,7 +1324,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1324 | rdata.writer.WriteAttributeString("everyone", String.Empty, i.EveryOnePermissions.ToString("X")); | 1324 | rdata.writer.WriteAttributeString("everyone", String.Empty, i.EveryOnePermissions.ToString("X")); |
1325 | rdata.writer.WriteAttributeString("base", String.Empty, i.BasePermissions.ToString("X")); | 1325 | rdata.writer.WriteAttributeString("base", String.Empty, i.BasePermissions.ToString("X")); |
1326 | rdata.writer.WriteEndElement(); | 1326 | rdata.writer.WriteEndElement(); |
1327 | 1327 | ||
1328 | rdata.writer.WriteElementString("Asset", i.AssetID.ToString()); | 1328 | rdata.writer.WriteElementString("Asset", i.AssetID.ToString()); |
1329 | 1329 | ||
1330 | rdata.writer.WriteEndElement(); | 1330 | rdata.writer.WriteEndElement(); |
@@ -1458,7 +1458,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1458 | case XmlNodeType.Element: | 1458 | case XmlNodeType.Element: |
1459 | Rest.Log.DebugFormat("{0} StartElement: <{1}>", | 1459 | Rest.Log.DebugFormat("{0} StartElement: <{1}>", |
1460 | MsgId, ic.xml.Name); | 1460 | MsgId, ic.xml.Name); |
1461 | 1461 | ||
1462 | switch (ic.xml.Name) | 1462 | switch (ic.xml.Name) |
1463 | { | 1463 | { |
1464 | case "Folder": | 1464 | case "Folder": |
@@ -1486,7 +1486,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1486 | MsgId, ic.xml.Name); | 1486 | MsgId, ic.xml.Name); |
1487 | break; | 1487 | break; |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | // This stinks, but the ReadElement call above not only reads | 1490 | // This stinks, but the ReadElement call above not only reads |
1491 | // the imbedded data, but also consumes the end tag for Asset | 1491 | // the imbedded data, but also consumes the end tag for Asset |
1492 | // and moves the element pointer on to the containing Item's | 1492 | // and moves the element pointer on to the containing Item's |
@@ -1498,7 +1498,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1498 | Validate(ic); | 1498 | Validate(ic); |
1499 | } | 1499 | } |
1500 | break; | 1500 | break; |
1501 | 1501 | ||
1502 | case XmlNodeType.EndElement : | 1502 | case XmlNodeType.EndElement : |
1503 | switch (ic.xml.Name) | 1503 | switch (ic.xml.Name) |
1504 | { | 1504 | { |
@@ -1526,7 +1526,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1526 | break; | 1526 | break; |
1527 | } | 1527 | } |
1528 | break; | 1528 | break; |
1529 | 1529 | ||
1530 | default: | 1530 | default: |
1531 | Rest.Log.DebugFormat("{0} Ignoring: <{1}>:<{2}>", | 1531 | Rest.Log.DebugFormat("{0} Ignoring: <{1}>:<{2}>", |
1532 | MsgId, ic.xml.NodeType, ic.xml.Value); | 1532 | MsgId, ic.xml.NodeType, ic.xml.Value); |
@@ -1868,7 +1868,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1868 | // only if the size is non-zero. | 1868 | // only if the size is non-zero. |
1869 | 1869 | ||
1870 | else | 1870 | else |
1871 | { | 1871 | { |
1872 | AssetBase asset = null; | 1872 | AssetBase asset = null; |
1873 | string b64string = null; | 1873 | string b64string = null; |
1874 | 1874 | ||
@@ -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.Description = desc; | 1887 | asset.Metadata.Description = desc; |
1888 | asset.Type = type; // type == 0 == texture | 1888 | asset.Metadata.Type = type; // type == 0 == texture |
1889 | asset.Local = local; | 1889 | asset.Metadata.Local = local; |
1890 | asset.Temporary = temp; | 1890 | asset.Metadata.Temporary = temp; |
1891 | 1891 | ||
1892 | b64string = ic.xml.ReadElementContentAsString(); | 1892 | b64string = ic.xml.ReadElementContentAsString(); |
1893 | 1893 | ||
@@ -1911,8 +1911,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
1911 | { | 1911 | { |
1912 | ic.Item.AssetID = uuid; | 1912 | ic.Item.AssetID = uuid; |
1913 | } | 1913 | } |
1914 | 1914 | ||
1915 | ic.Push(asset); | 1915 | ic.Push(asset); |
1916 | } | 1916 | } |
1917 | } | 1917 | } |
1918 | 1918 | ||
@@ -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.Name == String.Empty) | 2042 | if (ic.Asset.Metadata.Name == String.Empty) |
2043 | ic.Asset.Name = ic.Item.Name; | 2043 | ic.Asset.Metadata.Name = ic.Item.Name; |
2044 | if (ic.Asset.Description == String.Empty) | 2044 | if (ic.Asset.Metadata.Description == String.Empty) |
2045 | ic.Asset.Description = ic.Item.Description; | 2045 | ic.Asset.Metadata.Description = ic.Item.Description; |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | // Assign permissions | 2048 | // Assign permissions |
@@ -2139,7 +2139,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
2139 | try | 2139 | try |
2140 | { | 2140 | { |
2141 | ic.Asset.Data = OpenJPEG.EncodeFromImage(temp, true); | 2141 | ic.Asset.Data = OpenJPEG.EncodeFromImage(temp, true); |
2142 | } | 2142 | } |
2143 | catch (DllNotFoundException) | 2143 | catch (DllNotFoundException) |
2144 | { | 2144 | { |
2145 | Rest.Log.ErrorFormat("OpenJpeg is not installed correctly on this system. Asset Data is emtpy for {0}", ic.Item.Name); | 2145 | Rest.Log.ErrorFormat("OpenJpeg is not installed correctly on this system. Asset Data is emtpy for {0}", ic.Item.Name); |
@@ -2201,7 +2201,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
2201 | 2201 | ||
2202 | /// <summary> | 2202 | /// <summary> |
2203 | /// This is the callback method required by the inventory watchdog. The | 2203 | /// This is the callback method required by the inventory watchdog. The |
2204 | /// requestor issues an inventory request and then blocks until the | 2204 | /// requestor issues an inventory request and then blocks until the |
2205 | /// request completes, or this method signals the monitor. | 2205 | /// request completes, or this method signals the monitor. |
2206 | /// </summary> | 2206 | /// </summary> |
2207 | 2207 | ||