Microsoft Content Management Server - recursion in workflow

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > January 2006 > recursion in workflow





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 recursion in workflow
Ismail Mayat

2006-01-29, 9:09 pm

Hello,

I am attempting to put into workflow some code which will for a posting loop
through all html placeholders and clean up the html so that it meets
accessibility requirements. I have dll that uses tidy and xsl to clean up.

The situation that I am trying to address is that authors are creating
content in word and pasting into the placeholder.

1. Which event should I put the code in ie CmsPosting_Submitted or
CmsPosting_Approved i am assuming approved would be best becuase this implies
content is ready for publishing

2.How do i prevent recursion? After clean up i will assign cleaned html to
html property of the placeholder then do CommitAll() this will no doubt
trigger submitted event and cause recursion my code looks a bit like

if(e.Target is Posting)
{
Posting cmsPost = (Posting)e.Target;
CmsHttpContext context =(CmsHttpContext)e.Context;

if(!CleanUpPlaceHoldersInPosting(cmsPost
,context))
{
//log it somewhere or send email
}
else{
context.CommitAll();
}
}


Thanks in advance

Regards

Ismail
Stefan [MSFT]

2006-01-31, 7:59 am

Hi Ismail,

1) I would suggest to put this code into the CmsPosting_Submitting or
_Approving handler.
Placing it into the CmsPosting_Submitted or _Approved handler will cause the
submit to be reverted back.

2) changing the placeholder content will not fire a Submitted or Submitting
event. So recursion will not happen here.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Ismail Mayat" <IsmailMayat@discussions.microsoft.com> wrote in message
news:EBB5A853-FFBF-403E-B120-CD212AFC09A0@microsoft.com...
> Hello,
>
> I am attempting to put into workflow some code which will for a posting
> loop
> through all html placeholders and clean up the html so that it meets
> accessibility requirements. I have dll that uses tidy and xsl to clean up.
>
> The situation that I am trying to address is that authors are creating
> content in word and pasting into the placeholder.
>
> 1. Which event should I put the code in ie CmsPosting_Submitted or
> CmsPosting_Approved i am assuming approved would be best becuase this
> implies
> content is ready for publishing
>
> 2.How do i prevent recursion? After clean up i will assign cleaned html to
> html property of the placeholder then do CommitAll() this will no doubt
> trigger submitted event and cause recursion my code looks a bit like
>
> if(e.Target is Posting)
> {
> Posting cmsPost = (Posting)e.Target;
> CmsHttpContext context =(CmsHttpContext)e.Context;
>
> if(!CleanUpPlaceHoldersInPosting(cmsPost
,context))
> {
> //log it somewhere or send email
> }
> else{
> context.CommitAll();
> }
> }
>
>
> Thanks in advance
>
> Regards
>
> Ismail



Ismail Mayat

2006-01-31, 7:59 am

Stefan,

Many thanks for the reply. I put in submitted and because i change the
content do a commit all the recursion does not happen. I though i had to
after change do submit approve etc in api. It all works a treat.

Regards

Ismail
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com