|
Home > Archive > Microsoft Content Management Server > August 2004 > ReleaseOwnership changing State to Saved?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ReleaseOwnership changing State to Saved?
|
|
| Erik Bailey 2004-06-26, 10:49 am |
| 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();
}
}
| |
| Stefan [MSFT] 2004-06-26, 10:49 am |
| Hi Erik,
I have seen the same issue before.
I think to get this fixed you will have to open a support case to request a
hotfix.
Cheers
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Erik Bailey" <ebaileyREVERSEDOMAINS@org.ihi> wrote in message
news:u7hqr1GWEHA.1152@TK2MSFTNGP09.phx.gbl...
> 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();
> }
> }
>
>
| |
| Erik Bailey 2004-08-17, 7:52 am |
| All --
I'm following up to the newsgroup to let folks know where this stands, in
case other people have the same issue and come across this thread in a
search.
This has been confirmed by Microsoft as a bug in CMS 2002 (it does not
affect CMS 2001). Per Microsoft, "Hotfix was rejected due to the risk to the
entire product in changing this code."
They will be publishing a knowledgebase article on this (the ID will be
873126, although as I write this it has not yet been published).
--Erik Bailey
"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:Ol%23uaUKWEHA.2816@TK2MSFTNGP11.phx.gbl...
> Hi Erik,
>
> I have seen the same issue before.
> I think to get this fixed you will have to open a support case to request
a
> hotfix.
>
> Cheers
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> MCMS FAQ:
>
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
>
http://www.gotdotnet.com/community/...t+S
erver
> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Erik Bailey" <ebaileyREVERSEDOMAINS@org.ihi> wrote in message
> news:u7hqr1GWEHA.1152@TK2MSFTNGP09.phx.gbl...
Posting[vbcol=seagreen]
> on
> that
code[vbcol=seagreen]
> State
cmsauthor,[vbcol=seagreen]
different[vbcol=seagreen]
>
>
| |
|
|
|
|
|