| Author |
Writing to Placeholders on NEW postings
|
|
| Charly 2006-02-17, 10:50 pm |
| Why is it that when using API to modify placeholder content on a NEW
posting (one that is being created) the API throws a
CmsInvalidObjectStateException
("Cannot modify read only object. The target object is read only and
it cannot be modified") ??
This error occurs even whenI have executed an MCMS
ApplicationContext.CommitAll() prior to attempting to change the
placeholder value. It occurs both for HtmlPlaceholders (when
attempting to set HtmlPlaceholder.Html property) as well as for
XmlPlaceholders (when attemtping to set XmlPlaceholder.XmlAsString)
Once the posting object has been saved, and I load the template again
in edit update mode, this same process works fine.
| |
| Mei Ying [MVP] 2006-02-20, 2:47 am |
| Hi
How's the code being called?
--
regards
Mei Ying
---
Blog: http://meiyinglim.blogspot.com
Book: http://www.packtpub.com/book/mcms
Contact: meiyinglim@hotmail.com
---
"Charly" wrote:
> Why is it that when using API to modify placeholder content on a NEW
> posting (one that is being created) the API throws a
> CmsInvalidObjectStateException
> ("Cannot modify read only object. The target object is read only and
> it cannot be modified") ??
>
> This error occurs even whenI have executed an MCMS
> ApplicationContext.CommitAll() prior to attempting to change the
> placeholder value. It occurs both for HtmlPlaceholders (when
> attempting to set HtmlPlaceholder.Html property) as well as for
> XmlPlaceholders (when attemtping to set XmlPlaceholder.XmlAsString)
>
> Once the posting object has been saved, and I load the template again
> in edit update mode, this same process works fine.
>
>
| |
| Charly 2006-02-21, 5:52 pm |
| I'm not sure exactly what you're asking, but the code is called from
within the server side code behind of the template aspx page. The
template aspx page is being called using the following url... so the
NRMODE and WBCMODE, are 'Update' and 'AuthoringNew' , respectively.
http://localhost:/NR/exeres/35CF470...rpose=Authoring
| |
|
| Hi Charly
Did you ever get this resolved ?
I have the same problem
Any help anyone ??
"Charly" wrote:
> I'm not sure exactly what you're asking, but the code is called from
> within the server side code behind of the template aspx page. The
> template aspx page is being called using the following url... so the
> NRMODE and WBCMODE, are 'Update' and 'AuthoringNew' , respectively.
>
> http://localhost:/NR/exeres/35CF470...rpose=Authoring
>
>
| |
|
| Don't worry
I worked it out
Quote from a post somewhere else
"one wrong thing is that you are using CmsHttpContext in the workflow event.
That is not allowed.
You need to use e.Context instead."
Gee its easy once you know how
"Luke" wrote:
[vbcol=seagreen]
> Hi Charly
>
> Did you ever get this resolved ?
>
> I have the same problem
>
> Any help anyone ??
>
> "Charly" wrote:
>
|
|
|
|