Microsoft Content Management Server - Searches.NewPostings()

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > January 2007 > Searches.NewPostings()





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 Searches.NewPostings()
sc

2007-01-19, 7:19 am

I have my Searches.NewPostings() working.

However I need to show all new Postings below a certain channel and in
the subchannels.
I am using this in an if statement:

if(.......&& posting.Path.ToLower().StartsWith("/channels/channelname")

it is only searching channelname for new postings and not going into
any subchannel.

How do I get around this? txs

Stefan Goßner [MSFT]

2007-01-19, 7:19 am

Hi Sonya,

not sure what you mean.
Does the collection you are iterating through contains postings of the
subchannel?

Cheers,
Stefan


"sc" <sonyacooley@vodafone.ie> wrote in message
news:1169206918.048274.222910@51g2000cwl.googlegroups.com...
>I have my Searches.NewPostings() working.
>
> However I need to show all new Postings below a certain channel and in
> the subchannels.
> I am using this in an if statement:
>
> if(.......&& posting.Path.ToLower().StartsWith("/channels/channelname")
>
> it is only searching channelname for new postings and not going into
> any subchannel.
>
> How do I get around this? txs
>



sc

2007-01-19, 7:19 am

Hi Stefan

This line searches the entire MCMS repository for new Postings.
PostingCollection groupofPostings = cmsContext.Searches.NewPostings(1);

But I have channel below the root channel as a seperate website:[vbcol=seagreen]

I need to return the new Postings from ONLY SubChannelA AND ALL
channels below SubChannelA

I have an if statement that says:
if(posting.StartDate >= DateTime.Now.Subtract(subtractDays)&&
NumberOfLinks > intCounter &&
posting.Path.StartsWith("/Channels/SubChannelA"))

but this is only returning new Postings in the root of SubChannelA and
not any of its subchannels.

Stefan Goßner [MSFT]

2007-01-19, 1:16 pm

Hi SC,

then something seems to be wrong in your string operation.
Sorry but this is not a MCMS related question.

Cheers,
Stefan

"sc" <sonyacooley@vodafone.ie> wrote in message
news:1169209973.191907.301250@s34g2000cwa.googlegroups.com...
> Hi Stefan
>
> This line searches the entire MCMS repository for new Postings.
> PostingCollection groupofPostings = cmsContext.Searches.NewPostings(1);
>
> But I have channel below the root channel as a seperate website:
>
> I need to return the new Postings from ONLY SubChannelA AND ALL
> channels below SubChannelA
>
> I have an if statement that says:
> if(posting.StartDate >= DateTime.Now.Subtract(subtractDays)&&
> NumberOfLinks > intCounter &&
> posting.Path.StartsWith("/Channels/SubChannelA"))
>
> but this is only returning new Postings in the root of SubChannelA and
> not any of its subchannels.
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com