|
|
|
date: Mon, 14 Apr 2008 17:08:40 +0800,
group: microsoft.public.cmserver.general
back
Problem with content assignment to HTML placeholder in MCMS
I have some MCMS application code that will replicate the content of
placeholders from one posting to another. There were some system performance
issues, notably the NodeResource table becoming locked. I did some anaylsis
and found that the assignment of HTML from an HTML placeholder on the source
page to a corresponding placeholder on the target page was causing this for
pages that had a large number of local attachments (PDF, docs, xls, etc.) in
their content.
The line of code that does the assignment is simple, and is executed on the
save event of the posting (specifically a custom implementation of the
AuthoringReeditSaveAndExitAction.HandleAction event):
TargetPlaceholder.Html = SourcePlaceholder.Html
The issue arose when the source placeholder had local attachments. The HTML
for a local attachment in a placeholder is:
/NR/rdonlyres/<guid of the page>/<unique id>/<resource name>
What I found is that when the save event occurs and the changes are
committed to the MCMS database, MCMS reworks the contents of the
NodeResource table for the target page's new version even if the attachments
are already on that page. This can be seen because the NodeResource.Id
column increases in value for the target page's new content version, whereas
the source page's version keeps its current values in this column. The
previous entries for the target page are still in the NodeResource table,
they are associated with the previous content version.
To verify this was an issue, I made the following code change:
NewHtml = SourcePlaceholder.Html
NewHtml.Replace(SourcePosting.Guid, TargetPosting.Guid)
TargetPlaceholder.Html = NewHtml
This stopped the contents of the NodeResource table being reworked for the
target page's versions, however it is not a solution because if a new local
attachment is added to the source placeholder it doesn't work for the target
placeholder.
In addition there seemed to be a problem with attachments that had names of
50 characters or more. When the reworking of the NodeResource table occurred,
attachments with less than 50 characters in their filenames had new entries
added and the original ones removed for that specific version of the page
content. With a file that has a name of 50 characters or more, the original
entries were carried over to the new version of the page.
Any help on this would be appreciated. The 50 character filename problem is
relatively simple to resolve, we will alter the HTML of the MCMS dialog to
not allow filenames of greater than 45 characters (just to be safe). But the
first issue to do with HTML assignment seems nasty.
url:http://www.ureader.com/gp/1253-1.aspx
date: Mon, 14 Apr 2008 17:08:40 +0800
author: Adam Flint
Re: Problem with content assignment to HTML placeholder in MCMS
Hi Adam,
a similar issue has been reported before and a problem in MCMS code has been
identified.
A hotfix for this issue has been requested.
Please open a support case to get your specific flavor of the issue
investigaged as well.
Cheers,
Stefan
"Adam Flint" wrote in message
news:265c949c0888473493aea7dcc0f63f08@newspe.com...
>I have some MCMS application code that will replicate the content of
> placeholders from one posting to another. There were some system
> performance
> issues, notably the NodeResource table becoming locked. I did some
> anaylsis
> and found that the assignment of HTML from an HTML placeholder on the
> source
> page to a corresponding placeholder on the target page was causing this
> for
> pages that had a large number of local attachments (PDF, docs, xls, etc.)
> in
> their content.
>
> The line of code that does the assignment is simple, and is executed on
> the
> save event of the posting (specifically a custom implementation of the
> AuthoringReeditSaveAndExitAction.HandleAction event):
>
> TargetPlaceholder.Html = SourcePlaceholder.Html
>
> The issue arose when the source placeholder had local attachments. The
> HTML
> for a local attachment in a placeholder is:
>
> /NR/rdonlyres/<guid of the page>/<unique id>/<resource name>
>
> What I found is that when the save event occurs and the changes are
> committed to the MCMS database, MCMS reworks the contents of the
> NodeResource table for the target page's new version even if the
> attachments
> are already on that page. This can be seen because the NodeResource.Id
> column increases in value for the target page's new content version,
> whereas
> the source page's version keeps its current values in this column. The
> previous entries for the target page are still in the NodeResource table,
> they are associated with the previous content version.
>
> To verify this was an issue, I made the following code change:
>
> NewHtml = SourcePlaceholder.Html
> NewHtml.Replace(SourcePosting.Guid, TargetPosting.Guid)
> TargetPlaceholder.Html = NewHtml
>
> This stopped the contents of the NodeResource table being reworked for the
> target page's versions, however it is not a solution because if a new
> local
> attachment is added to the source placeholder it doesn't work for the
> target
> placeholder.
>
> In addition there seemed to be a problem with attachments that had names
> of
> 50 characters or more. When the reworking of the NodeResource table
> occurred,
> attachments with less than 50 characters in their filenames had new
> entries
> added and the original ones removed for that specific version of the page
> content. With a file that has a name of 50 characters or more, the
> original
> entries were carried over to the new version of the page.
>
> Any help on this would be appreciated. The 50 character filename problem
> is
> relatively simple to resolve, we will alter the HTML of the MCMS dialog to
> not allow filenames of greater than 45 characters (just to be safe). But
> the
> first issue to do with HTML assignment seems nasty.
>
> url:http://www.ureader.com/gp/1253-1.aspx
date: Mon, 14 Apr 2008 16:47:10 +0200
author: Stefan Go?ner [MSFT]
|
|