Count postings and Channels
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Count postings and Channels

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Javier Ruiz
Guest





Posted: Tue Jan 11, 2005 11:13 pm    Post subject: Count postings and Channels Reply with quote

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?
Back to top
Stefan [MSFT]
Guest





Posted: Tue Jan 11, 2005 11:26 pm    Post subject: Re: Count postings and Channels Reply with quote

Hi Javier,

you could write a script that does the enumeration.
Something like the following:

using System;
using System.IO;
using Microsoft.ContentManagement.Publishing;

namespace StefanG.Tools
{
/// <summary>
/// Summary description for CmsInfo.
/// </summary>
public class GetSavedPostings
{
int sum_channel = 0;
int sum_posting = 0;

static private void CollectChannel(Channel channel)
{
sum_channel += 1;
sum_posting += channel.Postings.Count;

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


[STAThread]
static void Main(string[] args)
{
// Get the CMS application context
CmsApplicationContext cmsContext = new CmsApplicationContext();
cmsContext.AuthenticateAsCurrentUser(PublishingMode.Unpublished);

CollectChannel(cmsContext.RootChannel);
Console.WriteLine("ChannelCount: "+sum_channel);
Console.WriteLine("PostingCount: "+sum_posting);
}

}
}

Cheers,
Stefan.

"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:5F612969-3B95-488B-B3A6-F82679319C8F@microsoft.com...
Quote:

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?
Back to top
Javier Ruiz
Guest





Posted: Wed Jan 12, 2005 12:35 am    Post subject: Re: Count postings and Channels Reply with quote

This script can run that stan alone script or i have to include in a CMS
project

"Stefan [MSFT]" wrote:

Quote:
Hi Javier,

you could write a script that does the enumeration.
Something like the following:

using System;
using System.IO;
using Microsoft.ContentManagement.Publishing;

namespace StefanG.Tools
{
/// <summary
/// Summary description for CmsInfo.
/// </summary
public class GetSavedPostings
{
int sum_channel = 0;
int sum_posting = 0;

static private void CollectChannel(Channel channel)
{
sum_channel += 1;
sum_posting += channel.Postings.Count;

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


[STAThread]
static void Main(string[] args)
{
// Get the CMS application context
CmsApplicationContext cmsContext = new CmsApplicationContext();
cmsContext.AuthenticateAsCurrentUser(PublishingMode.Unpublished);

CollectChannel(cmsContext.RootChannel);
Console.WriteLine("ChannelCount: "+sum_channel);
Console.WriteLine("PostingCount: "+sum_posting);
}

}
}

Cheers,
Stefan.

"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:5F612969-3B95-488B-B3A6-F82679319C8F@microsoft.com...

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?



Back to top
Stefan [MSFT]
Guest





Posted: Wed Jan 12, 2005 2:06 am    Post subject: Re: Count postings and Channels Reply with quote

Hi Javier,

the script below is a standalone C# Console Application.

Cheers,
Stefan.


"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:67366AB9-6F81-4FC7-A893-1AC9E7B0DD34@microsoft.com...
Quote:
This script can run that stan alone script or i have to include in a CMS
project

"Stefan [MSFT]" wrote:

Hi Javier,

you could write a script that does the enumeration.
Something like the following:

using System;
using System.IO;
using Microsoft.ContentManagement.Publishing;

namespace StefanG.Tools
{
/// <summary
/// Summary description for CmsInfo.
/// </summary
public class GetSavedPostings
{
int sum_channel = 0;
int sum_posting = 0;

static private void CollectChannel(Channel channel)
{
sum_channel += 1;
sum_posting += channel.Postings.Count;

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


[STAThread]
static void Main(string[] args)
{
// Get the CMS application context
CmsApplicationContext cmsContext = new CmsApplicationContext();
cmsContext.AuthenticateAsCurrentUser(PublishingMode.Unpublished);

CollectChannel(cmsContext.RootChannel);
Console.WriteLine("ChannelCount: "+sum_channel);
Console.WriteLine("PostingCount: "+sum_posting);
}

}
}

Cheers,
Stefan.

"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:5F612969-3B95-488B-B3A6-F82679319C8F@microsoft.com...

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?



Back to top
Javier Ruiz
Guest





Posted: Wed Jan 12, 2005 4:31 am    Post subject: Re: Count postings and Channels Reply with quote

do you have this in VB

"Stefan [MSFT]" wrote:

Quote:
Hi Javier,

the script below is a standalone C# Console Application.

Cheers,
Stefan.


"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:67366AB9-6F81-4FC7-A893-1AC9E7B0DD34@microsoft.com...
This script can run that stan alone script or i have to include in a CMS
project

"Stefan [MSFT]" wrote:

Hi Javier,

you could write a script that does the enumeration.
Something like the following:

using System;
using System.IO;
using Microsoft.ContentManagement.Publishing;

namespace StefanG.Tools
{
/// <summary
/// Summary description for CmsInfo.
/// </summary
public class GetSavedPostings
{
int sum_channel = 0;
int sum_posting = 0;

static private void CollectChannel(Channel channel)
{
sum_channel += 1;
sum_posting += channel.Postings.Count;

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


[STAThread]
static void Main(string[] args)
{
// Get the CMS application context
CmsApplicationContext cmsContext = new CmsApplicationContext();
cmsContext.AuthenticateAsCurrentUser(PublishingMode.Unpublished);

CollectChannel(cmsContext.RootChannel);
Console.WriteLine("ChannelCount: "+sum_channel);
Console.WriteLine("PostingCount: "+sum_posting);
}

}
}

Cheers,
Stefan.

"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:5F612969-3B95-488B-B3A6-F82679319C8F@microsoft.com...

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?






Back to top
Stefan [MSFT]
Guest





Posted: Wed Jan 12, 2005 3:36 pm    Post subject: Re: Count postings and Channels Reply with quote

Hi Javier,

no I don't have.
But you could use these tools to convert it:
http://blogs.msdn.com/stefan_gossner/archive/2004/04/06/108512.aspx

Cheers,
Stefan.

"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:29DDF4CD-D6BF-462B-A6CC-E5B35A8CBDB1@microsoft.com...
Quote:
do you have this in VB

"Stefan [MSFT]" wrote:

Hi Javier,

the script below is a standalone C# Console Application.

Cheers,
Stefan.


"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:67366AB9-6F81-4FC7-A893-1AC9E7B0DD34@microsoft.com...
This script can run that stan alone script or i have to include in a
CMS
project

"Stefan [MSFT]" wrote:

Hi Javier,

you could write a script that does the enumeration.
Something like the following:

using System;
using System.IO;
using Microsoft.ContentManagement.Publishing;

namespace StefanG.Tools
{
/// <summary
/// Summary description for CmsInfo.
/// </summary
public class GetSavedPostings
{
int sum_channel = 0;
int sum_posting = 0;

static private void CollectChannel(Channel channel)
{
sum_channel += 1;
sum_posting += channel.Postings.Count;

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


[STAThread]
static void Main(string[] args)
{
// Get the CMS application context
CmsApplicationContext cmsContext = new CmsApplicationContext();
cmsContext.AuthenticateAsCurrentUser(PublishingMode.Unpublished);

CollectChannel(cmsContext.RootChannel);
Console.WriteLine("ChannelCount: "+sum_channel);
Console.WriteLine("PostingCount: "+sum_posting);
}

}
}

Cheers,
Stefan.

"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:5F612969-3B95-488B-B3A6-F82679319C8F@microsoft.com...

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?






Back to top
Angus Logan [MVP]
Guest





Posted: Wed Jan 12, 2005 5:33 pm    Post subject: Re: Count postings and Channels Reply with quote

See if my MCMS Health Check tool helps:-

http://msmvps.com/anguslogan/archive/2004/11/23/20229.aspx

(it links to GotDotNet)

Regards
--
________________________________________

Angus Logan (MCAD/MCDBA/MCP/MVP for MCMS)
Product Specialist
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________
"Javier Ruiz" <javirs@asae.com.mx> wrote in message
news:5F612969-3B95-488B-B3A6-F82679319C8F@microsoft.com...
Quote:

--
Hello Everyone

how can I count overall number of postings and channels in my CMS
2002?
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB