Modifies and removes properties for this item.
Value field is ignored. Specifying the removal of a property that does not exist is not an error.
In your UpdateProperties implementation you will create, modify and delete item properties. If any property failed to update than you should not modify any properties and rollback the entire operation. To inform WebDAV client which properties failed to update you must return MultipropResponse class instance. Each item of MultipropResponse is the instance of PropResponse class and provides information about individual property update operation.
public WebDAVResponse UpdateProperties(Property[] setProps, Property[] delProps)
{
if(!ClientHasToken) // required by class 2 server only
return new LockedResponse();
MultipropResponse resp = new MultipropResponse();
SqlConnection conn = new SqlConnection(connStr);
SqlTransaction trans = null;
try
{
conn.Open();
trans = conn.BeginTransaction();
if(setProps != null)
foreach(Property p in setProps)
{
SetProperty(p, trans); // create or update property
resp.AddResponses(new PropResponse(p, new OkResponse()));
}
if(delProps != null)
foreach(Property p in delProps)
{
RemoveProperty(p.Name, p.Namespace, trans);
resp.AddResponses(new PropResponse(p, new OkResponse()));
}
UpdateModified(trans);
trans.Commit();
}
catch
{
if(trans != null) trans.Rollback();
return new ServerErrorResponse();
}
finally
{
conn.Close();
}
return resp;
}
IHierarchyItem Interface | ITHit.WebDAV.Server Namespace