Microsoft Content Management Server - IsHiddenModePublished // Cannot modify read only object

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > January 2007 > IsHiddenModePublished // Cannot modify read only object





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 IsHiddenModePublished // Cannot modify read only object
hanne_bal@hotmail.com

2007-01-24, 1: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?

Stefan Goßner [MSFT]

2007-01-24, 1: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?
>



hanne_bal@hotmail.com

2007-01-25, 7:16 am

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 -

Stefan Goßner [MSFT]

2007-01-25, 7:16 am

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...
>
>
>
>
>
>
>
>
>


hanne_bal@hotmail.com

2007-01-25, 7:16 am


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 -

Stefan Goßner [MSFT]

2007-01-25, 7:16 am

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:
>
>
>
>
>
>
>
>
>
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com