Apparently 2 users can edit the same Page!! Bug??
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Apparently 2 users can edit the same Page!! Bug??




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Apparently 2 users can edit the same Page!! Bug??  
DG


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-04 01:53 AM

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.





[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-04 01:53 AM

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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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.







[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
DG


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-04 01:53 AM

Thank you so much Stefan for the clarification. Now I want to make it Exclus
ive 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 d
id
> 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 y
ou
> 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...
a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...nagement+Server
> 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... 
>
>
>





[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
role


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-04 07:47 AM

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...
+Server[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-21-04 12:51 PM

Hi Role,

I'm not aware of ready to use sample code.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"role" <ro@garaio.com> wrote in message
news:eZWWjSvbEHA.2292@TK2MSFTNGP09.phx.gbl...
> 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... 
> Exclusive edit, so as you pointed, I need to acquire the ownership of the
> editing of the page using AcquireOwnership. Will try. 
IE[vbcol=seagreen]
> did 
> http. 
> saving 
caveats[vbcol=seagreen]
> you 
when[vbcol=seagreen]
> a 
> cancel 
> rights. 
>
 
>
[url]http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management
+Server" target="_blank">http://download.microsoft.com/downl...
+Server 
rights.[vbcol=seagreen] 
time.[vbcol=seagreen] 
fine,[vbcol=seagreen] 
As[vbcol=seagreen] 
modified[vbcol=seagreen] 
>
>







[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-29-04 10: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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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...
+Server[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...
+Server[vbcol=seagreen] 
single[vbcol=seagreen] 
For[vbcol=seagreen] 
Or[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
DG


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-30-04 10:49 PM

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@T
K2MSFTNGP11.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...
a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...nagement+Server
> 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 f
or
> 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/...nagement+Server 
>  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/...nagement+Server 
>  single 
>  For 
>  rights. 
>  time. 
>  fine, 
>  Or
>  As 
>  modified 





[ Post a follow-up to this message ]



    Re: Apparently 2 users can edit the same Page!! Bug??  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-30-04 10: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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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...
+Server[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...
+Server[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...egory/4983.aspx[vbcol=seagreen] 
http://www.gotdotnet.com/community/...
+Server[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] 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:04 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register