public override void Save(int revisingUserId)
{
IDbConnection newConnection = DataProvider.Instance().GetConnection();
IDbTransaction trans = newConnection.BeginTransaction();
try
{
this.SaveInfo(trans, revisingUserId);
UpdateItem(trans, this.ItemId, this.ModuleId);
this.UpdateApprovalStatus(trans);
// update article version now
// replace <br> with <br />
AddArticleVersion(
trans,
this.ItemVersionId,
this.ItemId,
this.VersionNumber,
this.VersionDescription,
this.ArticleText.Replace("<br>", "<br />"),
this.ReferenceNumber);
// Save the Relationships
this.SaveRelationships(trans);
// Save the ItemVersionSettings
// SaveItemVersionSettings(trans);
trans.Commit();
}
catch
{
trans.Rollback();
// Rolling back to the original version, exception thrown.
this.ItemVersionId = this.OriginalItemVersionId;
throw;
}
finally
{
// clean up connection stuff
newConnection.Close();
}
this.SaveItemVersionSettings();
Utility.ClearPublishCache(this.PortalId);
if (HostController.Instance.GetBoolean(Utility.PublishEnableTags + this.PortalId.ToString(CultureInfo.InvariantCulture), false))
{
// Save Tags
this.SaveTags();
}
try
{
if (Utility.IsPingEnabledForPortal(this.PortalId))
{
if (this.ApprovalStatusId == ApprovalStatus.Approved.GetId())
{
string surl = HostController.Instance.GetString(
Utility.PublishPingChangedUrl + this.PortalId.ToString(CultureInfo.InvariantCulture));
string changedUrl = Engage.Utility.HasValue(surl) ? surl : Globals.NavigateURL(this.DisplayTabId);
PortalSettings ps = Utility.GetPortalSettings(this.PortalId);
// ping
Ping.SendPing(ps.PortalName, ps.PortalAlias.ToString(), changedUrl, this.PortalId);
}
}
}
catch (Exception exc)
{
// WHAT IS THIS? Why try/catch and gooble up errors???
// this was added because some exceptions occur for ping servers that we don't need to let the users know about.
// catch the ping exception but let everything else proceed.
// TODO: localize this error
Exceptions.LogException(exc);
// Exceptions.ProcessModuleLoadException(Localize.GetString("PingError", LocalResourceFile), exc);
}
}