Error in copying Placeholder content
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Error in copying Placeholder content




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Error in copying Placeholder content  
Arjuna


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-09-07 12:16 PM

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=Unpublishe
d&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=Unpublishe
d&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 wa
s
rolled-back. Contact the site administrator.

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

Thanks
Arjuna.





[ Post a follow-up to this message ]



    Re: Error in copying Placeholder content  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-09-07 12:16 PM

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=Unpublis
hed&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=Unpublis
hed&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.







[ Post a follow-up to this message ]



    Re: Error in copying Placeholder content  
Arjuna


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-09-07 06: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.ImagePlacehol
der)
{

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.HtmlPlacehold
er)
{

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.AttachmentPla
ceholder)
{
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.XmlPlaceholde
r)
{
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 Placeholder
s


<P><A
href=\"/NR/exeres/B0844A4F-B579-47CA-B8B2-155367C737F1.htm?NRMODE=Unpublishe
d&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=Unpublishe
d&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... 
>
>
>





[ Post a follow-up to this message ]



    Re: Error in copying Placeholder content  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-09-07 06: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.ImagePlaceh
older)
>                {
>
>                    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.HtmlPlaceho
lder)
>                {
>
>                    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.AttachmentP
laceholder)
>                {
>                    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.XmlPlacehol
der)
>                {
>                    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].Val
ue =
> 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=Unpublis
hed&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=Unpublis
hed&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:
> 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:53 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register