Monday, May 7, 2007

Adding a new content query report

Many of my customers are experiencing problems during the creation process of their publishing portals in MOSS 2007 WCM enabled sites.
The two main issues I found are not having an easy way to check-in and publish/approve all pages we developed at once (very much needed when building a new site) and the ability to view all checked out documents in my site collection – just so we could know where we stand in our publishing process.
For the first problem I had to write a nice utility (I will try to publish it for free soon… promise! When finished it will be available here: http://www.kwizcom.com/ – look for the free stuff), but for the second issue I found a simple solution that asked for no more than few seconds of "hard labor" to solve.
(by that I mean some googling was needed)
Well, you might of noticed content editing enabled sites have some reports in their site settings menu:



Clicking one of these menu items will bring you to the manage content and structure page, where a search will be performed on all items according to the report you wanted.



Now, adding a new report to this list turned out to be really easy. All I had to do is click the "content and structure reports" list under the root site and there I found all queries there with their CAML code!


So – to add a new search that will show all items that are checked out to any user simply add a new item there and set this as the CAML for the item:
<where><isnotnull><fieldref lookupid="TRUE" name="CheckoutUser"></isnotnull></where>
Now, this is not perfect yet, you could limit this query to lists/libraries etc… but hey – I have to leave something for you guys to write about, no?
Hope this helps some of you guys, don’t forget to vote!







Shai Ben Shooshan
shai@kwizcom.com
KWizCom Canada

No comments: