Microsoft Content Management Server - Retrieve all postings from root channel and subchannel

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > June 2007 > Retrieve all postings from root channel and subchannel





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 Retrieve all postings from root channel and subchannel
Mun

2007-06-15, 1:18 am

Could anyone show me how to retrieve all postings from the root channel as
well as postings from subchannels. Thank you very much.
Stefan Goßner [MSFT]

2007-06-15, 7:22 am

Hi,

you would need to iterate through all channel recursivly and then look at
the postings collection of each channel.

Cheers,
Stefan


"Mun" <Mun@discussions.microsoft.com> wrote in message
news:A7D6E762-1592-4125-8E00-15E80D434BC0@microsoft.com...
> Could anyone show me how to retrieve all postings from the root channel as
> well as postings from subchannels. Thank you very much.



Mun

2007-06-15, 7:22 am

Hello,

I am quite new to this. Do you have a sample code for that? Thank you.

Cheers

M

"Stefan Goßner [MSFT]" wrote:

> Hi,
>
> you would need to iterate through all channel recursivly and then look at
> the postings collection of each channel.
>
> Cheers,
> Stefan
>
>
> "Mun" <Mun@discussions.microsoft.com> wrote in message
> news:A7D6E762-1592-4125-8E00-15E80D434BC0@microsoft.com...
>
>
>

Stefan Goßner [MSFT]

2007-06-15, 7:22 am

Hi M,

something like this:

Channel c = cmsContext.RootChannel;
CollectChannel(channel);

static private void CollectChannel(Channel channel)
{
PostingCollection pc = channel.Postings;
// do something with the postings

foreach (Channel ch in channel.Channels)
{
CollectChannel(ch);
}

}

Be aware that you should not use such code in your website as it will impact
your site performance badly.

Cheers,
Stefan

"Mun" <Mun@discussions.microsoft.com> wrote in message
news:3A11121B-ADF0-4B5C-A31C-A18E52DDC30E@microsoft.com...[vbcol=seagreen]
> Hello,
>
> I am quite new to this. Do you have a sample code for that? Thank you.
>
> Cheers
>
> M
>
> "Stefan Goßner [MSFT]" wrote:
>


Mun

2007-06-15, 7:22 am

Thank you, Stefan.

Cheers

Mun

"Stefan Goßner [MSFT]" wrote:

> Hi M,
>
> something like this:
>
> Channel c = cmsContext.RootChannel;
> CollectChannel(channel);
>
> static private void CollectChannel(Channel channel)
> {
> PostingCollection pc = channel.Postings;
> // do something with the postings
>
> foreach (Channel ch in channel.Channels)
> {
> CollectChannel(ch);
> }
>
> }
>
> Be aware that you should not use such code in your website as it will impact
> your site performance badly.
>
> Cheers,
> Stefan
>
> "Mun" <Mun@discussions.microsoft.com> wrote in message
> news:3A11121B-ADF0-4B5C-A31C-A18E52DDC30E@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com