06-26-04 03:49 PM
Hi --
The CMS help for ReleaseOwnership states "Releasing ownership on a Posting
will not change its State value. This allows a user to release ownership on
a Posting without taking it out of publication." However, I am finding that
it DOES appear to change the state.
I am trying to make a simple console action to Release Ownership (see code
below). Unfortunately, when the ReleaseOwnership method is called, the State
changes to Saved.
Example:
1) User cmsauthor edits a posting and Submits. Lock is owned by cmsauthor,
and State is WaitingForEditorApproval.
2) cmsauthor clicks the Release Ownership console action.
3) When the ReleaseOwnership method is called, the lock is correctly
released, but the State reverts to Saved (the same is true if a different
user clicks Release Ownership).
I'm running CMS 2002 SP1 (not SP1a). Any thoughts as to what I'm doing
wrong?
Thanks! --Erik
public class ReleaseOwnershipAction : BasePostbackAction
{
private Microsoft.ContentManagement.Publishing.Posting
currentPosting = null;
public ReleaseOwnershipAction()
{
this.Text = "Release Ownership";
currentPosting = CmsHttpContext.Current.Posting;
}
public override bool Available
{
get
{
if (currentPosting != null )
{
return ( !currentPosting.OwnedBy.IsEverybody &&
currentPosting.CanSetProperties);
}
else
{
return false;
}
}
}
public override string ActionJavascript
{
get
{
if (this.Available)
{
return "if (confirm('Release ownership of this
posting?')) { " + base.ActionJavascript + "}";
}
else
{
return "";
}
}
}
protected override void PerformActionBehavior()
{
CmsHttpContext.Current.Posting.ReleaseOwnership(true);
CmsHttpContext.Current.CommitAll();
}
}
[ Post a follow-up to this message ]
|