Microsoft Content Management Server - assigning values to CustomProperties dynamically

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > August 2004 > assigning values to CustomProperties dynamically





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 assigning values to CustomProperties dynamically
Jo Versmissen

2004-08-24, 8:14 am

Hi all,

I have a custom placeholder that renders as a textbox. The text in the
textbox will be copied to a customproperty of the posting.

Now here comes the problem: when I create a new page, it is impossible to
assign a value to a customproperty of the posting, because the save of the
placeholder (and also the assigning of the customproperty) appears to happen
before the creation of the posting.

The following message occurs:

Save Placeholder Failed
----------------------------------------------------------------------------
----
Error Details:
Cannot modify read only object. The target object is read only and it cannot
be modified.

Any ideas?

Greetings,
Jo


Stefan [MSFT]

2004-08-24, 8:14 am

Hi Jo,

I would suggest to use this solution rather than the placeholder approach:
http://blogs.msdn.com/stefan_gossne.../25/119613.aspx

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


"Jo Versmissen" <jve@pss.be> wrote in message
news:#69ah3diEHA.1656@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> I have a custom placeholder that renders as a textbox. The text in the
> textbox will be copied to a customproperty of the posting.
>
> Now here comes the problem: when I create a new page, it is impossible to
> assign a value to a customproperty of the posting, because the save of the
> placeholder (and also the assigning of the customproperty) appears to

happen
> before the creation of the posting.
>
> The following message occurs:
>
> Save Placeholder Failed
> --------------------------------------------------------------------------

--
> ----
> Error Details:
> Cannot modify read only object. The target object is read only and it

cannot
> be modified.
>
> Any ideas?
>
> Greetings,
> Jo
>
>



Jo Versmissen

2004-08-24, 7:00 pm

Hi Stefan,

I have looked at your solution. I have used a very little part of it. In
my custom placeholder in the function SavePlaceholderContent, I used
CmsHttpContext.Current.Posting to get the current posting. Now I use
e.Posting instead, and it works like a charm.

Thanx,
Jo

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eQZsGAeiEHA.3148@TK2MSFTNGP10.phx.gbl...
> Hi Jo,
>
> I would suggest to use this solution rather than the placeholder approach:
> http://blogs.msdn.com/stefan_gossne.../25/119613.aspx
>
> 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
> --------------------------------
>
>
> "Jo Versmissen" <jve@pss.be> wrote in message
> news:#69ah3diEHA.1656@TK2MSFTNGP09.phx.gbl...
to[vbcol=seagreen]
the[vbcol=seagreen]
> happen
>
> --------------------------------------------------------------------------
> --
> cannot
>
>



Stefan [MSFT]

2004-08-24, 7:00 pm

Ah!
Yes that makes sense.
You would have to use the event context and not the http context.

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


"Jo Versmissen" <jve@pss.be> wrote in message
news:uhMJ6XeiEHA.344@TK2MSFTNGP10.phx.gbl...
> Hi Stefan,
>
> I have looked at your solution. I have used a very little part of it. In
> my custom placeholder in the function SavePlaceholderContent, I used
> CmsHttpContext.Current.Posting to get the current posting. Now I use
> e.Posting instead, and it works like a charm.
>
> Thanx,
> Jo
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
> news:eQZsGAeiEHA.3148@TK2MSFTNGP10.phx.gbl...
approach:[vbcol=seagreen]
> rights.
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
>

http://www.gotdotnet.com/community/...t+S
erver

the[vbcol=seagreen]
> to
> the
>
> --------------------------------------------------------------------------
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com