Microsoft Content Management Server - CmsPosting_Approved event - how to differ new from re-approved?

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2006 > CmsPosting_Approved event - how to differ new from re-approved?





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 CmsPosting_Approved event - how to differ new from re-approved?
Søren Andersen

2006-02-17, 10:49 pm

Hello world,

In Global.asax I capture the CmsPosting_Approved in order to send
notifications when postings in certain channels are approved.

However, the notifications should only be sent when it's a new posting
being approved - not when an existing posting is being re-approved
after it's been edited.

How do I make this distinction?

Cheers,
Soren

Adnan Al-Ghourabi

2006-02-17, 10:49 pm

One way is to check StartDate property of the Posting object, which tells you
when the page first became live (assuming that approving a page would publish
it..i.e. you don't have any custom work-flow). Another is to use the
Revisions method. The default method returns all revisions, whether they were
caused by modifying the posting itself, or as a result of a change to a
shared Resource used by the posting. There are overloaded methods that you
can use to exclude Resources and only include revisions caused by approving a
Posting, which should be enough to know whether a Posting was approved before.

You can read more about it here
http://msdn.microsoft.com/library/d...g_Revisions.asp

I hope this helps!

"Søren Andersen" wrote:

> Hello world,
>
> In Global.asax I capture the CmsPosting_Approved in order to send
> notifications when postings in certain channels are approved.
>
> However, the notifications should only be sent when it's a new posting
> being approved - not when an existing posting is being re-approved
> after it's been edited.
>
> How do I make this distinction?
>
> Cheers,
> Soren
>
>

Stefan [MSFT]

2006-02-17, 10:49 pm

Hi Soren,

you could check the Revision collection of the posting object.
If it contains a revision it is an old posting as a new revision is created
during approve.

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
----------------------


"Søren Andersen" <san@mondo.dk> wrote in message
news:1140011599.561245.136250@g44g2000cwa.googlegroups.com...
> Hello world,
>
> In Global.asax I capture the CmsPosting_Approved in order to send
> notifications when postings in certain channels are approved.
>
> However, the notifications should only be sent when it's a new posting
> being approved - not when an existing posting is being re-approved
> after it's been edited.
>
> How do I make this distinction?
>
> Cheers,
> Soren
>



Søren Andersen

2006-02-17, 10:50 pm

Of course. That works a treat. Thank you, Stefan.

Rgds,
S=F8ren

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com