IsHiddenModePublished // Cannot modify read only object
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 > IsHiddenModePublished // Cannot modify read only object




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

    IsHiddenModePublished // Cannot modify read only object  
hanne_bal@hotmail.com


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


 
01-24-07 06:15 PM

Hi,

A while ago I created a template with the following event:


private void Posting_Created(object sender, WebAuthorPostingEventArgs
e)
{
CmsHttpContext.Current.Posting.IsHiddenModePublished = true;
}

When users created a new posting, this posting was hidden after
creation.

Now I've installed MCMS 2002 SP2 and I get the following error:

Cannot modify read only object. The target object is read only and it
cannot be modified.

Does anybody know how to undo this error?






[ Post a follow-up to this message ]



    Re: IsHiddenModePublished // Cannot modify read only object  
Stefan Goßner [MSFT]


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


 
01-24-07 06:15 PM

Hi Hanne,

it is not allowed to use CmsHttpContext in a workflow event.
You need to use e.Context instead.

Cheers,
Stefan


<hanne_bal@hotmail.com> wrote in message
news:1169647392.063840.254430@l53g2000cwa.googlegroups.com...
> Hi,
>
> A while ago I created a template with the following event:
>
>
> private void Posting_Created(object sender, WebAuthorPostingEventArgs
> e)
> {
>   CmsHttpContext.Current.Posting.IsHiddenModePublished = true;
> }
>
> When users created a new posting, this posting was hidden after
> creation.
>
> Now I've installed MCMS 2002 SP2 and I get the following error:
>
> Cannot modify read only object. The target object is read only and it
> cannot be modified.
>
> Does anybody know how to undo this error?
>







[ Post a follow-up to this message ]



    Re: IsHiddenModePublished // Cannot modify read only object  
hanne_bal@hotmail.com


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


 
01-25-07 12:16 PM

Hi Stefan,

Thanks for your reply...

Now I use the following statement, but I still get the same error...

private void Posting_Created(object sender, WebAuthorPostingEventArgs e
)
{
e.Posting.IsHiddenModePublished =3D true;
}

In WebAuthorPostingEventArgs there's no Context property...

Regards,
Max

On 24 jan, 15:57, "Stefan Go=DFner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi Hanne,
>
> it is not allowed to use CmsHttpContext in a workflow event.
> You need to use e.Context instead.
>
> Cheers,
> Stefan
>
> <hanne_...@hotmail.com> wrote in messagenews:1169647392.063840.254430@l53=
g2000cwa.googlegroups.com...[vbcol=seagreen]
>
>
> 
> 
> 
> 
> 
> 
> 
icht niet weergeven -- Tekst uit oorspronkelijk bericht weergeven -






[ Post a follow-up to this message ]



    Re: IsHiddenModePublished // Cannot modify read only object  
Stefan Goßner [MSFT]


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


 
01-25-07 12:16 PM

Hi Hanne,

what kind of event is this?
I thought you were talking about workflow events.
The created event for workflow looks like this:

public void CmsPosting_Created( Object sender, CreatedEventArgs e ) {}

CreatedEventArgs has a Context method.

Cheers,
Stefan


<hanne_bal@hotmail.com> wrote in message
news:1169714600.881907.186140@a75g2000cwd.googlegroups.com...
Hi Stefan,

Thanks for your reply...

Now I use the following statement, but I still get the same error...

private void Posting_Created(object sender, WebAuthorPostingEventArgs e
)
{
e.Posting.IsHiddenModePublished = true;
}

In WebAuthorPostingEventArgs there's no Context property...

Regards,
Max

On 24 jan, 15:57, "Stefan Goßner [MSFT]"
<stef...@online.microsoft.com> wrote:[vbcol=seagreen]
> Hi Hanne,
>
> it is not allowed to use CmsHttpContext in a workflow event.
> You need to use e.Context instead.
>
> Cheers,
> Stefan
>
> <hanne_...@hotmail.com> wrote in
> messagenews:1169647392.063840.254430@l53g2000cwa.googlegroups.com...
>
>
> 
> 
> 
> 
> 
> 
> 







[ Post a follow-up to this message ]



    Re: IsHiddenModePublished // Cannot modify read only object  
hanne_bal@hotmail.com


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


 
01-25-07 12:16 PM


Hi Stefan,

I'm not even sure what I try to accomplish is possible.
I want to make each posting of this template hidden when it is created
by code.

I created now a CmsPosting_Created workflow event:

public void CmsPosting_Created( Object sender, CreatedEventArgs e )
{
}

.=2E.but I don't see how I can access the IsHiddenModePublished property
because there is no Posting property in e.Context.

Thanks for your help.
Regards,
Max

On 25 jan, 10:17, "Stefan Go=DFner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi Hanne,
>
> what kind of event is this?
> I thought you were talking about workflow events.
> The created event for workflow looks like this:
>
> public void CmsPosting_Created( Object sender, CreatedEventArgs e ) {
}
>
> CreatedEventArgs has a Context method.
>
> Cheers,
> Stefan
>
> <hanne_...@hotmail.com> wrote in messagenews:1169714600.881907.186140@a75=
g2000cwd.googlegroups.com...[vbcol=seagreen]
> Hi Stefan,
>
> Thanks for your reply...
>
> Now I use the following statement, but I still get the same error...
>
> private void Posting_Created(object sender, WebAuthorPostingEventArgs e
> )
> {
>    e.Posting.IsHiddenModePublished =3D true;
>
> }In WebAuthorPostingEventArgs there's no Context property...
>
> Regards,
> Max
>
> On 24 jan, 15:57, "Stefan Go=DFner [MSFT]"
>
>
>
> <stef...@online.microsoft.com> wrote: 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
-- Tekst uit oorspronkelijk bericht niet weergeven -- Tekst uit oorspronkel=
ijk bericht weergeven -






[ Post a follow-up to this message ]



    Re: IsHiddenModePublished // Cannot modify read only object  
Stefan Goßner [MSFT]


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


 
01-25-07 12:16 PM

Hi Hanne,

this is possible.
you need to do it in a workflow event.

Something like this:

public void CmsPosting_Created( Object sender, CreatedEventArgs e )
{
Posting p = e.Target as Posting;
if (p.Template.Path == "...path to your template")
{
p.IsHiddenModePublished = true;
}
}

Cheers,
Stefan

<hanne_bal@hotmail.com> wrote in message
news:1169721245.342615.132140@q2g2000cwa.googlegroups.com...

Hi Stefan,

I'm not even sure what I try to accomplish is possible.
I want to make each posting of this template hidden when it is created
by code.

I created now a CmsPosting_Created workflow event:

public void CmsPosting_Created( Object sender, CreatedEventArgs e )
{
}

...but I don't see how I can access the IsHiddenModePublished property
because there is no Posting property in e.Context.

Thanks for your help.
Regards,
Max

On 25 jan, 10:17, "Stefan Goßner [MSFT]"
<stef...@online.microsoft.com> wrote:[vbcol=seagreen]
> Hi Hanne,
>
> what kind of event is this?
> I thought you were talking about workflow events.
> The created event for workflow looks like this:
>
> public void CmsPosting_Created( Object sender, CreatedEventArgs e ) {
}
>
> CreatedEventArgs has a Context method.
>
> Cheers,
> Stefan
>
> <hanne_...@hotmail.com> wrote in
> messagenews:1169714600.881907.186140@a75g2000cwd.googlegroups.com...
> Hi Stefan,
>
> Thanks for your reply...
>
> Now I use the following statement, but I still get the same error...
>
> private void Posting_Created(object sender, WebAuthorPostingEventArgs e
> )
> {
>    e.Posting.IsHiddenModePublished = true;
>
> }In WebAuthorPostingEventArgs there's no Context property...
>
> Regards,
> Max
>
> On 24 jan, 15:57, "Stefan Goßner [MSFT]"
>
>
>
> <stef...@online.microsoft.com> wrote: 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:20 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