comment out large chunks of appearance/inventory region access services to eliminate warnings that this code is unused
parent
565db4635f
commit
1042ce7283
|
@ -39,8 +39,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
|
|
||||||
public class RestAppearanceServices : IRest
|
public class RestAppearanceServices : IRest
|
||||||
{
|
{
|
||||||
|
// private static readonly int PARM_USERID = 0;
|
||||||
private static readonly int PARM_USERID = 0;
|
|
||||||
|
|
||||||
// private static readonly int PARM_PATH = 1;
|
// private static readonly int PARM_PATH = 1;
|
||||||
|
|
||||||
|
@ -64,6 +63,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
{
|
{
|
||||||
Rest.Log.InfoFormat("{0} Domain is relative, adding absolute prefix", MsgId);
|
Rest.Log.InfoFormat("{0} Domain is relative, adding absolute prefix", MsgId);
|
||||||
qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
|
qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
|
||||||
|
qPrefix = String.Format("{0}{1}{2}", Rest.Prefix, Rest.UrlPathSeparator, qPrefix);
|
||||||
Rest.Log.InfoFormat("{0} Domain is now <{1}>", MsgId, qPrefix);
|
Rest.Log.InfoFormat("{0} Domain is now <{1}>", MsgId, qPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,31 +294,31 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name=rdata>HTTP service request work area</param>
|
/// <param name=rdata>HTTP service request work area</param>
|
||||||
|
|
||||||
private void DoGet(AppearanceRequestData rdata)
|
// private void DoGet(AppearanceRequestData rdata)
|
||||||
{
|
// {
|
||||||
AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
|
// AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
|
||||||
|
//
|
||||||
if (adata == null)
|
// if (adata == null)
|
||||||
{
|
// {
|
||||||
rdata.Fail(Rest.HttpStatusCodeNoContent,
|
// rdata.Fail(Rest.HttpStatusCodeNoContent,
|
||||||
String.Format("appearance data not found for user {0} {1}",
|
// String.Format("appearance data not found for user {0} {1}",
|
||||||
rdata.userProfile.FirstName, rdata.userProfile.SurName));
|
// rdata.userProfile.FirstName, rdata.userProfile.SurName));
|
||||||
}
|
// }
|
||||||
rdata.userAppearance = adata.ToAvatarAppearance(rdata.userProfile.ID);
|
// rdata.userAppearance = adata.ToAvatarAppearance(rdata.userProfile.ID);
|
||||||
|
//
|
||||||
rdata.initXmlWriter();
|
// rdata.initXmlWriter();
|
||||||
|
//
|
||||||
FormatUserAppearance(rdata);
|
// FormatUserAppearance(rdata);
|
||||||
|
//
|
||||||
// Indicate a successful request
|
// // Indicate a successful request
|
||||||
|
//
|
||||||
rdata.Complete();
|
// rdata.Complete();
|
||||||
|
//
|
||||||
// Send the response to the user. The body will be implicitly
|
// // Send the response to the user. The body will be implicitly
|
||||||
// constructed from the result of the XML writer.
|
// // constructed from the result of the XML writer.
|
||||||
|
//
|
||||||
rdata.Respond(String.Format("Appearance {0} Normal completion", rdata.method));
|
// rdata.Respond(String.Format("Appearance {0} Normal completion", rdata.method));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// POST adds NEW information to the user profile database.
|
/// POST adds NEW information to the user profile database.
|
||||||
|
@ -326,96 +326,50 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
/// characteristics supplied in the request.
|
/// characteristics supplied in the request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
private void DoExtend(AppearanceRequestData rdata)
|
// private void DoExtend(AppearanceRequestData rdata)
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
bool created = false;
|
|
||||||
bool modified = false;
|
|
||||||
string newnode = String.Empty;
|
|
||||||
|
|
||||||
Rest.Log.DebugFormat("{0} POST ENTRY", MsgId);
|
|
||||||
|
|
||||||
//AvatarAppearance old = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
|
|
||||||
|
|
||||||
rdata.userAppearance = new AvatarAppearance();
|
|
||||||
|
|
||||||
// Although the following behavior is admitted by HTTP I am becoming
|
|
||||||
// increasingly doubtful that it is appropriate for REST. If I attempt to
|
|
||||||
// add a new record, and it already exists, then it seems to me that the
|
|
||||||
// attempt should fail, rather than update the existing record.
|
|
||||||
AvatarData adata = null;
|
|
||||||
if (GetUserAppearance(rdata))
|
|
||||||
{
|
|
||||||
modified = rdata.userAppearance != null;
|
|
||||||
created = !modified;
|
|
||||||
adata = new AvatarData(rdata.userAppearance);
|
|
||||||
Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
|
||||||
// Rest.UserServices.UpdateUserProfile(rdata.userProfile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
created = true;
|
|
||||||
adata = new AvatarData(rdata.userAppearance);
|
|
||||||
Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
|
||||||
// Rest.UserServices.UpdateUserProfile(rdata.userProfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (created)
|
|
||||||
{
|
|
||||||
newnode = String.Format("{0} {1}", rdata.userProfile.FirstName,
|
|
||||||
rdata.userProfile.SurName);
|
|
||||||
// Must include a location header with a URI that identifies the new resource.
|
|
||||||
|
|
||||||
rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}{3}{4}",
|
|
||||||
rdata.hostname,rdata.port,rdata.path,Rest.UrlPathSeparator, newnode));
|
|
||||||
rdata.Complete(Rest.HttpStatusCodeCreated);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (modified)
|
|
||||||
{
|
|
||||||
rdata.Complete(Rest.HttpStatusCodeOK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rdata.Complete(Rest.HttpStatusCodeNoContent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This updates the user's appearance. not all aspects need to be provided,
|
|
||||||
/// only those supplied will be changed.
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
private void DoUpdate(AppearanceRequestData rdata)
|
|
||||||
{
|
|
||||||
|
|
||||||
// REFACTORING PROBLEM This was commented out. It doesn't work for 0.7
|
|
||||||
|
|
||||||
// bool created = false;
|
// bool created = false;
|
||||||
// bool modified = false;
|
// bool modified = false;
|
||||||
|
// string newnode = String.Empty;
|
||||||
|
//
|
||||||
//rdata.userAppearance = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
|
// Rest.Log.DebugFormat("{0} POST ENTRY", MsgId);
|
||||||
|
//
|
||||||
//// If the user exists then this is considered a modification regardless
|
// //AvatarAppearance old = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
|
||||||
//// of what may, or may not be, specified in the payload.
|
//
|
||||||
|
// rdata.userAppearance = new AvatarAppearance();
|
||||||
//if (rdata.userAppearance != null)
|
//
|
||||||
|
// // Although the following behavior is admitted by HTTP I am becoming
|
||||||
|
// // increasingly doubtful that it is appropriate for REST. If I attempt to
|
||||||
|
// // add a new record, and it already exists, then it seems to me that the
|
||||||
|
// // attempt should fail, rather than update the existing record.
|
||||||
|
// AvatarData adata = null;
|
||||||
|
// if (GetUserAppearance(rdata))
|
||||||
// {
|
// {
|
||||||
// modified = true;
|
// modified = rdata.userAppearance != null;
|
||||||
// Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance);
|
// created = !modified;
|
||||||
// Rest.UserServices.UpdateUserProfile(rdata.userProfile);
|
// adata = new AvatarData(rdata.userAppearance);
|
||||||
|
// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
||||||
|
// // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
|
||||||
// }
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// created = true;
|
||||||
|
// adata = new AvatarData(rdata.userAppearance);
|
||||||
|
// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
||||||
|
// // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
|
||||||
|
// }
|
||||||
|
//
|
||||||
// if (created)
|
// if (created)
|
||||||
// {
|
// {
|
||||||
|
// newnode = String.Format("{0} {1}", rdata.userProfile.FirstName,
|
||||||
|
// rdata.userProfile.SurName);
|
||||||
|
// // Must include a location header with a URI that identifies the new resource.
|
||||||
|
//
|
||||||
|
// rdata.AddHeader(Rest.HttpHeaderLocation,String.Format("http://{0}{1}:{2}{3}{4}",
|
||||||
|
// rdata.hostname,rdata.port,rdata.path,Rest.UrlPathSeparator, newnode));
|
||||||
// rdata.Complete(Rest.HttpStatusCodeCreated);
|
// rdata.Complete(Rest.HttpStatusCodeCreated);
|
||||||
|
//
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
|
@ -427,11 +381,57 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
// {
|
// {
|
||||||
// rdata.Complete(Rest.HttpStatusCodeNoContent);
|
// rdata.Complete(Rest.HttpStatusCodeNoContent);
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
||||||
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
/// <summary>
|
||||||
|
/// This updates the user's appearance. not all aspects need to be provided,
|
||||||
|
/// only those supplied will be changed.
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
}
|
// private void DoUpdate(AppearanceRequestData rdata)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// // REFACTORING PROBLEM This was commented out. It doesn't work for 0.7
|
||||||
|
//
|
||||||
|
// //bool created = false;
|
||||||
|
// //bool modified = false;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //rdata.userAppearance = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID);
|
||||||
|
//
|
||||||
|
// //// If the user exists then this is considered a modification regardless
|
||||||
|
// //// of what may, or may not be, specified in the payload.
|
||||||
|
//
|
||||||
|
// //if (rdata.userAppearance != null)
|
||||||
|
// //{
|
||||||
|
// // modified = true;
|
||||||
|
// // Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance);
|
||||||
|
// // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
|
||||||
|
// //}
|
||||||
|
//
|
||||||
|
// //if (created)
|
||||||
|
// //{
|
||||||
|
// // rdata.Complete(Rest.HttpStatusCodeCreated);
|
||||||
|
// //}
|
||||||
|
// //else
|
||||||
|
// //{
|
||||||
|
// // if (modified)
|
||||||
|
// // {
|
||||||
|
// // rdata.Complete(Rest.HttpStatusCodeOK);
|
||||||
|
// // }
|
||||||
|
// // else
|
||||||
|
// // {
|
||||||
|
// // rdata.Complete(Rest.HttpStatusCodeNoContent);
|
||||||
|
// // }
|
||||||
|
// //}
|
||||||
|
//
|
||||||
|
// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete the specified user's appearance. This actually performs a reset
|
/// Delete the specified user's appearance. This actually performs a reset
|
||||||
|
@ -439,31 +439,29 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||||
/// Existing ownership is preserved. All prior updates are lost and can not
|
/// Existing ownership is preserved. All prior updates are lost and can not
|
||||||
/// be recovered.
|
/// be recovered.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
// private void DoDelete(AppearanceRequestData rdata)
|
||||||
private void DoDelete(AppearanceRequestData rdata)
|
// {
|
||||||
{
|
// AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
|
||||||
AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
|
//
|
||||||
|
// if (adata != null)
|
||||||
if (adata != null)
|
// {
|
||||||
{
|
// AvatarAppearance old = adata.ToAvatarAppearance(rdata.userProfile.ID);
|
||||||
AvatarAppearance old = adata.ToAvatarAppearance(rdata.userProfile.ID);
|
// rdata.userAppearance = new AvatarAppearance();
|
||||||
rdata.userAppearance = new AvatarAppearance();
|
// rdata.userAppearance.Owner = old.Owner;
|
||||||
rdata.userAppearance.Owner = old.Owner;
|
// adata = new AvatarData(rdata.userAppearance);
|
||||||
adata = new AvatarData(rdata.userAppearance);
|
//
|
||||||
|
// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
||||||
Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
//
|
||||||
|
// rdata.Complete();
|
||||||
rdata.Complete();
|
// }
|
||||||
}
|
// else
|
||||||
else
|
// {
|
||||||
{
|
//
|
||||||
|
// rdata.Complete(Rest.HttpStatusCodeNoContent);
|
||||||
rdata.Complete(Rest.HttpStatusCodeNoContent);
|
// }
|
||||||
}
|
//
|
||||||
|
// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
||||||
rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
// }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion method-specific processing
|
#endregion method-specific processing
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue