Microsoft Content Management Server - Error in copying Placeholder content

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > July 2007 > Error in copying Placeholder content





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 Error in copying Placeholder content
Arjuna

2007-07-09, 7:16 am

Hi,
I am trying to copy the content off one Posting and past it in another
Posting. Once I do the copying I do a cmsAppContext.CommitAll() in order to
commit the changes. Everything goes fine, however in one of the Postings I
have an HTMLPlaceholder that contains the following content

<P><A
href=\"/NR/exeres/B0844A4F-B579-47CA-B8B2-155367C737F1.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Hotel
History</A> <A
href=\"/EN_FA/Property/MAC/slideshowposting.htm?DisplayType=Popup\"
target=\"_blank\">Slideshow</A></P>\r\n<P><A
href=\"/NR/exeres/1968BDD0-731D-4851-AAF9-A646308E5AA4.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Special
Events</A></P>\r\n<P> </P>\r\n<P>Balamu</P>

Once I copy this content and do a CommitAll I get the following error

Failures occurred during the multi-object commit. One or more objects
modified in this session could not be committed. The session transaction was
rolled-back. Contact the site administrator.

Does anyone know what is going wrong here, it only happens for this content
only.

Thanks
Arjuna.
Stefan Goßner [MSFT]

2007-07-09, 7:16 am

Hi Arjuna,

sounds like a coding problem.
Are you doing this from within a web application?
Then please check your workflow events.
If this is a standalone application, please paste the complete code here.

Cheers,
Stefan

"Arjuna" <Arjuna@discussions.microsoft.com> wrote in message
news:37061CE0-2CEE-40FB-A3A3-F4EB2746D084@microsoft.com...
> Hi,
> I am trying to copy the content off one Posting and past it in another
> Posting. Once I do the copying I do a cmsAppContext.CommitAll() in order
> to
> commit the changes. Everything goes fine, however in one of the Postings
> I
> have an HTMLPlaceholder that contains the following content
>
> <P><A
> href=\"/NR/exeres/B0844A4F-B579-47CA-B8B2-155367C737F1.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Hotel
> History</A> <A
> href=\"/EN_FA/Property/MAC/slideshowposting.htm?DisplayType=Popup\"
> target=\"_blank\">Slideshow</A></P>\r\n<P><A
> href=\"/NR/exeres/1968BDD0-731D-4851-AAF9-A646308E5AA4.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Special
> Events</A></P>\r\n<P> </P>\r\n<P>Balamu</P>
>
> Once I copy this content and do a CommitAll I get the following error
>
> Failures occurred during the multi-object commit. One or more objects
> modified in this session could not be committed. The session transaction
> was
> rolled-back. Contact the site administrator.
>
> Does anyone know what is going wrong here, it only happens for this
> content
> only.
>
> Thanks
> Arjuna.



Arjuna

2007-07-09, 1:22 pm

Hi Stefan,

Yes I am doing this from within a web application.

Given below is the code, I have put a comment in ALL CAPS for the line that
causes the problem.

private Posting CopyContent(Posting sourcePosting, Posting targetPosting)
{
foreach (Microsoft.ContentManagement.Publishing.Placeholder plc
in sourcePosting.Placeholders)
{

if (plc is
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.ImagePlaceholder)
{

ImagePlaceholder sourcePlc = plc as ImagePlaceholder;
ImagePlaceholder targetPlc =
targetPosting.Placeholders[sourcePlc.Name] as ImagePlaceholder;
targetPlc.Alt = sourcePlc.Alt;
targetPlc.Href = sourcePlc.Href;
targetPlc.Src = sourcePlc.Src;
}

else if (plc is
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.HtmlPlaceholder)
{

HtmlPlaceholder sourcePlc = plc as HtmlPlaceholder;
HtmlPlaceholder targetPlc =
targetPosting.Placeholders[sourcePlc.Name] as HtmlPlaceholder;
string sourceHtml = sourcePlc.Html;
//FOR ONE OF THE PLACEHOLDERS THE LINE BELOW CAUSES THE //PROBLEM THE REST
WORKS
targetPlc.Html = sourceHtml;
}
else if (plc is
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.AttachmentPlaceholder)
{
AttachmentPlaceholder sourcePlc = plc as
AttachmentPlaceholder;
AttachmentPlaceholder targetPlc =
targetPosting.Placeholders[sourcePlc.Name] as AttachmentPlaceholder;
targetPlc.AttachmentText = sourcePlc.AttachmentText;
targetPlc.IconUrl = sourcePlc.IconUrl;
targetPlc.Url = sourcePlc.Url;
}

else if (plc is
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.XmlPlaceholder)
{
XmlPlaceholder sourcePlc = plc as XmlPlaceholder;
XmlPlaceholder targetPlc =
targetPosting.Placeholders[sourcePlc.Name] as XmlPlaceholder;
if (sourcePlc.XmlAsString.Trim() != string.Empty)
{
targetPlc.XmlAsString = sourcePlc.XmlAsString;
}
}

}
foreach (Microsoft.ContentManagement.Publishing.CustomProperty
customProperty in sourcePosting.CustomProperties)
{
targetPosting.CustomProperties[customProperty.Name].Value =
customProperty.Value;
}

targetPosting.DisplayName = sourcePosting.DisplayName;
targetPosting.Description = sourcePosting.Description;
targetPosting.StartDate = sourcePosting.StartDate;
targetPosting.ExpiryDate = sourcePosting.ExpiryDate;
targetPosting.IsImportant = sourcePosting.IsImportant;
targetPosting.IsHiddenModePublished =
sourcePosting.IsHiddenModePublished;
targetPosting.IsRobotIndexable = sourcePosting.IsRobotIndexable;
targetPosting.IsRobotFollowable = sourcePosting.IsRobotFollowable;

return targetPosting;
}

I belive the problem is with the following content in one of the Placeholders


<P><A
href=\"/NR/exeres/B0844A4F-B579-47CA-B8B2-155367C737F1.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Hotel
History</A> <A
href=\"/EN_FA/Property/MAC/slideshowposting.htm?DisplayType=Popup\"
target=\"_blank\">Slideshow</A></P>\r\n<P><A
href=\"/NR/exeres/1968BDD0-731D-4851-AAF9-A646308E5AA4.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Special
Events</A></P>\r\n<P> </P>\r\n<P>Balamu</P>


If I put a different content into the same Placeholder then it seems to work
fine. And if I put this same (above content) into a different Placeholder
that worked before then it crashes at that point.

Can you please tell me what is going wrong.

Thanks
Arjuna.


"Stefan Goßner [MSFT]" wrote:

> Hi Arjuna,
>
> sounds like a coding problem.
> Are you doing this from within a web application?
> Then please check your workflow events.
> If this is a standalone application, please paste the complete code here.
>
> Cheers,
> Stefan
>
> "Arjuna" <Arjuna@discussions.microsoft.com> wrote in message
> news:37061CE0-2CEE-40FB-A3A3-F4EB2746D084@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2007-07-09, 1:22 pm

Hi Arjuna,

then I would suggest to open a support case to get this analyzed.

Cheers,
Stefan


"Arjuna" <Arjuna@discussions.microsoft.com> wrote in message
news:161F941C-8809-4D4E-993A-6DE527450D6C@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> Yes I am doing this from within a web application.
>
> Given below is the code, I have put a comment in ALL CAPS for the line
> that
> causes the problem.
>
> private Posting CopyContent(Posting sourcePosting, Posting targetPosting)
> {
> foreach (Microsoft.ContentManagement.Publishing.Placeholder plc
> in sourcePosting.Placeholders)
> {
>
> if (plc is
> Microsoft.ContentManagement.Publishing.Extensions.Placeholders.ImagePlaceholder)
> {
>
> ImagePlaceholder sourcePlc = plc as ImagePlaceholder;
> ImagePlaceholder targetPlc =
> targetPosting.Placeholders[sourcePlc.Name] as ImagePlaceholder;
> targetPlc.Alt = sourcePlc.Alt;
> targetPlc.Href = sourcePlc.Href;
> targetPlc.Src = sourcePlc.Src;
> }
>
> else if (plc is
> Microsoft.ContentManagement.Publishing.Extensions.Placeholders.HtmlPlaceholder)
> {
>
> HtmlPlaceholder sourcePlc = plc as HtmlPlaceholder;
> HtmlPlaceholder targetPlc =
> targetPosting.Placeholders[sourcePlc.Name] as HtmlPlaceholder;
> string sourceHtml = sourcePlc.Html;
> //FOR ONE OF THE PLACEHOLDERS THE LINE BELOW CAUSES THE //PROBLEM THE REST
> WORKS
> targetPlc.Html = sourceHtml;
> }
> else if (plc is
> Microsoft.ContentManagement.Publishing.Extensions.Placeholders.AttachmentPlaceholder)
> {
> AttachmentPlaceholder sourcePlc = plc as
> AttachmentPlaceholder;
> AttachmentPlaceholder targetPlc =
> targetPosting.Placeholders[sourcePlc.Name] as AttachmentPlaceholder;
> targetPlc.AttachmentText = sourcePlc.AttachmentText;
> targetPlc.IconUrl = sourcePlc.IconUrl;
> targetPlc.Url = sourcePlc.Url;
> }
>
> else if (plc is
> Microsoft.ContentManagement.Publishing.Extensions.Placeholders.XmlPlaceholder)
> {
> XmlPlaceholder sourcePlc = plc as XmlPlaceholder;
> XmlPlaceholder targetPlc =
> targetPosting.Placeholders[sourcePlc.Name] as XmlPlaceholder;
> if (sourcePlc.XmlAsString.Trim() != string.Empty)
> {
> targetPlc.XmlAsString = sourcePlc.XmlAsString;
> }
> }
>
> }
> foreach (Microsoft.ContentManagement.Publishing.CustomProperty
> customProperty in sourcePosting.CustomProperties)
> {
> targetPosting.CustomProperties[customProperty.Name].Value =
> customProperty.Value;
> }
>
> targetPosting.DisplayName = sourcePosting.DisplayName;
> targetPosting.Description = sourcePosting.Description;
> targetPosting.StartDate = sourcePosting.StartDate;
> targetPosting.ExpiryDate = sourcePosting.ExpiryDate;
> targetPosting.IsImportant = sourcePosting.IsImportant;
> targetPosting.IsHiddenModePublished =
> sourcePosting.IsHiddenModePublished;
> targetPosting.IsRobotIndexable =
> sourcePosting.IsRobotIndexable;
> targetPosting.IsRobotFollowable =
> sourcePosting.IsRobotFollowable;
>
> return targetPosting;
> }
>
> I belive the problem is with the following content in one of the
> Placeholders
>
>
> <P><A
> href=\"/NR/exeres/B0844A4F-B579-47CA-B8B2-155367C737F1.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Hotel
> History</A> <A
> href=\"/EN_FA/Property/MAC/slideshowposting.htm?DisplayType=Popup\"
> target=\"_blank\">Slideshow</A></P>\r\n<P><A
> href=\"/NR/exeres/1968BDD0-731D-4851-AAF9-A646308E5AA4.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished\">Special
> Events</A></P>\r\n<P> </P>\r\n<P>Balamu</P>
>
>
> If I put a different content into the same Placeholder then it seems to
> work
> fine. And if I put this same (above content) into a different Placeholder
> that worked before then it crashes at that point.
>
> Can you please tell me what is going wrong.
>
> Thanks
> Arjuna.
>
>
> "Stefan Goßner [MSFT]" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com