Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Get user's list of documents awaiting approval via API? View modes: 
User avatar
Member
Member
laurence-ecentricarts - 12/7/2011 3:41:23 PM
   
Get user's list of documents awaiting approval via API?
For a given user, I would like to get a list or DataSet of documents awaiting her approval -- the same as seen in CMS Desk > My desk > Waiting for my approval.

The purpose is so that I can aggregate all of the user's workflow notifications into one notification. Rather than have notification emails sent (one email for each approval required), I have turned off email notification, and want to provide a single message once per day, or maybe RSS feed the user can follow.

What API class would allow me to do this? The documented samples are all document-oriented rather than user-oriented; it would be slow to crawl the CMS Tree looking for all the documents awaiting one user's approval.

-- Laurence

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/8/2011 2:38:30 AM
   
RE:Get user's list of documents awaiting approval via API?
Hi,

You can take the inspiration how the unigrid in CMS Desk -> My Desk -> Waiting for my apploval section is being filled by checking the file. When using FireFox right click into the main frame -> This frame -> View frame info and there you can see the path to the aspx file which is displaying the information here. In this case it it \CMSDesk\MyDesk\WaitingForApproval\WaitingForApproval.aspx.cs.

Best regards,
Juraj Ondrus

User avatar
Member
Member
laurence-ecentricarts - 12/8/2011 9:44:01 AM
   
RE:Get user's list of documents awaiting approval via API?
Ah, so simple... I need to stop thinking of Kentico as a "closed box" system! I'll repeat what I found for my future self / other searchers.

The heart of it, from WaitingForApproval_List.xml which is fed to the UniGrid in WaitingForApproval.aspx, is

<query name="cms.document.selectWaitingForApproval" ... />

and that query is found in the CMS_Query table, taking @UserID as a parameter.

Thanks for the answer, Juraj.