|
Home > Archive > Microsoft Content Management Server > July 2004 > Apparently 2 users can edit the same Page!! Bug??
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 |
Apparently 2 users can edit the same Page!! Bug??
|
|
|
| Hello!
Greetings!
My question is :
"Does not MCMS 2002 only allow exclusive edit of a page by a single
user?"
In our MCMS application when one user is trying to edit a page,
another person can still go to the edit mode of the same page. For
example say user1 has MCMS author rights user2 has MCMS Editor rights.
But user1,user2; both of them can edit the same page at the same time.
When they try to save the page, the first saving say by user1 is fine,
the next saving by user2 says "Overlapped saving". Is it a Bug? Or As
we have modified the basic MCMS workflow so somewhere in the modified
code it got corrupted.
Any help is really appreciated.
Regards.
| |
| Stefan [MSFT] 2004-07-20, 8:53 pm |
| Hi DG,
this is by design.
There is no way for MCMS to see if the user who opened the posting in IE did
close IE or if he is still editing due to the stateless behaviour of http.
To prevent endless locks of items the item will only be locked when saving
the posting.
If you would like to change this and would like to live with the caveats you
would have to modify the console actions and call AcquireOwnership when a
browser switches to edit mode.
But as indicated: if the user closes the IE window without pressing cancel
or without save the item will stay locked.
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
--------------------------------
"DG" <mabhin@yahoo.com> wrote in message
news:59ad8b52.0407201105.6e66afd9@posting.google.com...
> Hello!
>
> Greetings!
> My question is :
> "Does not MCMS 2002 only allow exclusive edit of a page by a single
> user?"
>
> In our MCMS application when one user is trying to edit a page,
> another person can still go to the edit mode of the same page. For
> example say user1 has MCMS author rights user2 has MCMS Editor rights.
> But user1,user2; both of them can edit the same page at the same time.
> When they try to save the page, the first saving say by user1 is fine,
> the next saving by user2 says "Overlapped saving". Is it a Bug? Or As
> we have modified the basic MCMS workflow so somewhere in the modified
> code it got corrupted.
>
> Any help is really appreciated.
>
> Regards.
| |
|
| Thank you so much Stefan for the clarification. Now I want to make it Exclusive edit, so as you pointed, I need to acquire the ownership of the editing of the page using AcquireOwnership. Will try.
Thanks again.
"Stefan [MSFT]" wrote:
> Hi DG,
>
> this is by design.
> There is no way for MCMS to see if the user who opened the posting in IE did
> close IE or if he is still editing due to the stateless behaviour of http.
> To prevent endless locks of items the item will only be locked when saving
> the posting.
> If you would like to change this and would like to live with the caveats you
> would have to modify the console actions and call AcquireOwnership when a
> browser switches to edit mode.
> But as indicated: if the user closes the IE window without pressing cancel
> or without save the item will stay locked.
>
> 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
> --------------------------------
>
>
> "DG" <mabhin@yahoo.com> wrote in message
> news:59ad8b52.0407201105.6e66afd9@posting.google.com...
>
>
>
| |
|
| Hi Folks,
has anybody sample code for such a modification in the
SwitchToAuthoringReeditAction Class?
Best regards,
Role
"DG" <DG@discussions.microsoft.com> wrote in message
news:1F13E21E-A5E5-4E61-9324-A692A4425FAF@microsoft.com...
> Thank you so much Stefan for the clarification. Now I want to make it
Exclusive edit, so as you pointed, I need to acquire the ownership of the
editing of the page using AcquireOwnership. Will try.[vbcol=seagreen]
> Thanks again.
>
>
> "Stefan [MSFT]" wrote:
>
did[vbcol=seagreen]
http.[vbcol=seagreen]
saving[vbcol=seagreen]
you[vbcol=seagreen]
a[vbcol=seagreen]
cancel[vbcol=seagreen]
rights.[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
| |
|
|
| Stefan [MSFT] 2004-07-29, 5:51 pm |
| Hi DG,
check cmsContext.Mode to see if you are in Update mode.
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
--------------------------------
"DG" <DG@discussions.microsoft.com> wrote in message
news:2115B747-BA3F-4FF8-8B0C-52CDD784A98D@microsoft.com...
> Greetings!
> I have tried to acquire the posting ownership for "Edit " command by
deriving a class from SwitchToAuthoringReeditAction like following:
>
> public class ReeditandAcquireOwnership : SwitchToAuthoringReeditAction
> {
> public ReeditandAcquireOwnership()
> {
> base.Text = "Edit with Lock";
> }
> protected override void PerformActionBehavior()
> {
> base.PerformActionBehavior();
> CmsHttpContext.Current.Posting.AcquireOwnership();
> }
> }
>
> Releasing the ownership at saveandnewaction, saveandexitaction and
saveaction using Stefan's classes in gotdotnet. Thanks a bunch to Stefan for
those classes. Now how to check that the posting is in update mode or to
check whether is locked by another user before invoking Acquire ownership
method? As the code works fine for the first edit by an user and throwing
exception for others until the ownership is realesed; as expected :-(
>
> The error message:
> Invalid mode for update. The requested action modifies the state of an
object and can only be performed when the session is in the 'Update' mode.
> Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
>
> Exception Details: System.Runtime.InteropServices.COMException: Invalid
mode for update. The requested action modifies the state of an object and
can only be performed when the session is in the 'Update' mode.[vbcol=seagreen]
>
> Source Error:
>
>
> Line 22: {
> Line 23: base.PerformActionBehavior();
> Line 24: CmsHttpContext.Current.Posting.AcquireOwnership();
> Line 25: }
> Line 26:
>
>
> any help is really appreciated.
>
>
> "Stefan [MSFT]" wrote:
>
rights.[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
it[vbcol=seagreen]
the[vbcol=seagreen]
in[vbcol=seagreen]
of[vbcol=seagreen]
when[vbcol=seagreen]
pressing[vbcol=seagreen]
no[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
single[vbcol=seagreen]
For[vbcol=seagreen]
Or[vbcol=seagreen]
| |
|
| Hi Stefan!
I have tried the following:
protected override void PerformActionBehavior()
{
base.PerformActionBehavior();
Posting pst = CmsHttpContext.Current.Posting;
switch (CmsHttpContext.Current.Mode)
{
case PublishingMode.Update:
{
pst.AcquireOwnership();
CmsHttpContext.Current.CommitAll();
break;
}
case PublishingMode.Published:
case PublishingMode.Staging:
case PublishingMode.Unpublished:
default:
break;
}
}
But whenever I am trying to edit the posting, the PublishingMode is
always other than "update" PublishingMode, so the AcquireOwnership is
never been invoked and the exclusive edit is not happening. But when
the ReleaseOwnership is invoked without ownership acquired by a user
it dooes not throw any exception. So it seems I do not have to check
for Release Ownership whether need to release at all.
Now my question is do I have to set the mode programmatically to
Update at the beginning of PerformActionBehavior say
CmsApplicationContext AppContext = new CmsApplicationContext();
AppContext.AuthenticateAsCurrentUser (PublishingMode.Update);
But I got exception when I tried to set the PublishingMode inside
PerformActionBehavior. Can you please help me to understand this. I
need to make the edit exclusive for a user, once s/he starts editing
no one can use edit command unless that page is saved and submitted.
Thank you.
"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message news:<Oi6LNqXdEHA.3308@TK2MSFTNGP11.phx.gbl>...[vbcol=seagreen]
> Hi DG,
>
> check cmsContext.Mode to see if you are in Update mode.
>
> 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
> --------------------------------
>
>
> "DG" <DG@discussions.microsoft.com> wrote in message
> news:2115B747-BA3F-4FF8-8B0C-52CDD784A98D@microsoft.com...
> deriving a class from SwitchToAuthoringReeditAction like following:
> saveaction using Stefan's classes in gotdotnet. Thanks a bunch to Stefan for
> those classes. Now how to check that the posting is in update mode or to
> check whether is locked by another user before invoking Acquire ownership
> method? As the code works fine for the first edit by an user and throwing
> exception for others until the ownership is realesed; as expected :-(
> object and can only be performed when the session is in the 'Update' mode.
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
> mode for update. The requested action modifies the state of an object and
> can only be performed when the session is in the 'Update' mode.
> rights.
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> http://www.gotdotnet.com/community/...t+S
erver
> it
> the
> in
> IE
> did
> of
> http.
> when
> saving
> caveats
> you
> when
> a
> pressing
> cancel
> no
> rights.
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> http://www.gotdotnet.com/community/...t+S
erver
> single
> For
> rights.
> time.
> fine,
> Or
> As
> modified
| |
| Stefan [MSFT] 2004-07-30, 5:49 pm |
| Hi DG,
that is correct.
That is what I indicated: The Publishing Mode is only switching to update
while you hit the save key. That's the reason for the two postbacks you are
seeing:
- first postback switches to update mode to allow the save
- second postback switches back to unpublished mode.
You would have to implement a similar techique here: when you click on this
button you need to check if the current user already has ownership.
If not, check if you are in update mode. If not do a redirect to Update
mode, aquire ownership and do a redirect back to the original URL.
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
--------------------------------
"DG" <mabhin@yahoo.com> wrote in message
news:59ad8b52.0407300614.44c0194e@posting.google.com...
> Hi Stefan!
>
> I have tried the following:
> protected override void PerformActionBehavior()
> {
> base.PerformActionBehavior();
> Posting pst = CmsHttpContext.Current.Posting;
> switch (CmsHttpContext.Current.Mode)
> {
> case PublishingMode.Update:
> {
> pst.AcquireOwnership();
> CmsHttpContext.Current.CommitAll();
> break;
> }
> case PublishingMode.Published:
> case PublishingMode.Staging:
> case PublishingMode.Unpublished:
> default:
> break;
> }
> }
>
> But whenever I am trying to edit the posting, the PublishingMode is
> always other than "update" PublishingMode, so the AcquireOwnership is
> never been invoked and the exclusive edit is not happening. But when
> the ReleaseOwnership is invoked without ownership acquired by a user
> it dooes not throw any exception. So it seems I do not have to check
> for Release Ownership whether need to release at all.
> Now my question is do I have to set the mode programmatically to
> Update at the beginning of PerformActionBehavior say
>
> CmsApplicationContext AppContext = new CmsApplicationContext();
> AppContext.AuthenticateAsCurrentUser (PublishingMode.Update);
>
> But I got exception when I tried to set the PublishingMode inside
> PerformActionBehavior. Can you please help me to understand this. I
> need to make the edit exclusive for a user, once s/he starts editing
> no one can use edit command unless that page is saved and submitted.
>
> Thank you.
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:<Oi6LNqXdEHA.3308@TK2MSFTNGP11.phx.gbl>...[vbcol=seagreen]
rights.[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
for[vbcol=seagreen]
ownership[vbcol=seagreen]
throwing[vbcol=seagreen]
mode.[vbcol=seagreen]
the[vbcol=seagreen]
Invalid[vbcol=seagreen]
and[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
make[vbcol=seagreen]
of[vbcol=seagreen]
posting[vbcol=seagreen]
behaviour[vbcol=seagreen]
the[vbcol=seagreen]
AcquireOwnership[vbcol=seagreen]
confers[vbcol=seagreen]
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm[vbcol=seagreen]
http://blogs.msdn.com/stefan_gossner/category/4983.aspx[vbcol=seagreen]
http://www.gotdotnet.com/community/...t+S
erver[vbcol=seagreen]
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx[vbcol=seagreen]
page,[vbcol=seagreen]
page.[vbcol=seagreen]
Editor[vbcol=seagreen]
same[vbcol=seagreen]
user1 is[vbcol=seagreen]
Bug?[vbcol=seagreen]
|
|
|
|
|