private void CleanOutCollection(Id collId, AppService appSvc)
 {
   if (collId == null) return;
   LogProgress("Cleaning out old entries and categories in collection with id={0}", collId);
   //just clean out existing entries
   AtomPubService.DeleteCollection(collId, false);
   var coll = appSvc.GetCollection(collId);
   coll.Categories = null;
 }
 private void ResetTrackbacks(Id collId, AppService appSvc)
 {
   if (collId == null) return;
   var bcoll = new BlogAppCollection(appSvc.GetCollection(collId));
   //get old value
   bool? on = bcoll.GetBooleanProperty(Atom.SvcNs + "tracbacksWereOn");
   bcoll.TrackbacksOn = on.HasValue ? on.Value : true;
   bcoll.SetBooleanProperty(Atom.SvcNs + "tracbacksWereOn", null);
 }
    private void ChangeCollectionId(AppService appSvc, Id oldId, Id newId)
    {
      if (newId == null) return;

      //update old id's in service.config
      //update include ids
      foreach (XElement xid in appSvc.Xml.Descendants(Atom.SvcNs + "id"))
      {
        if (xid.Value.StartsWith(oldId.ToString()))
        {
          string id = newId.ToString() + xid.Value.Substring(oldId.ToString().Length);
          LogProgress("Changing old include id from {0} to {1}", xid, id);
          xid.SetValue(id);
        }
      }
      LogProgress("Changing old collection id from {0} to {1}", oldId, newId);
      appSvc.GetCollection(oldId).Id = newId;
    }
 private void TurnOffTrackbacks(Id collId, AppService appSvc)
 {
   if (collId == null) return;
   var bcoll = new BlogAppCollection(appSvc.GetCollection(collId));
   //store old value
   bcoll.SetBooleanProperty(Atom.SvcNs + "tracbacksWereOn", bcoll.TrackbacksOn);
   bcoll.TrackbacksOn = false;
 }