Microsoft Content Management Server - approval date and time

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > September 2004 > approval date and time





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 approval date and time
bill tie

2004-09-24, 8:48 pm


Is there a way to detect the date and time a posting has been approved for
publishing?

Angus Logan

2004-09-25, 2:48 am

Hi Bill,

This data is not exposed via the API.

The best practice is to create a custom property on your template and then
set the value in the CmsPosting_Approved event.

See
http://groups.google.com/groups?hl=...6d784457&rnum=3
for more information.

Regards
--
________________________________________


Angus Logan (MCAD/MCDBA/MCP)
Lead Software Developer
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________


"bill tie" <billtie@discussions.microsoft.com> wrote in message
news:F1823D9C-2DA1-4999-825D-EEF07514E1F1@microsoft.com...
>
> Is there a way to detect the date and time a posting has been approved for
> publishing?
>



bill tie

2004-09-25, 7:46 am


Thank you for the pointer, Angus.

Where else would you suggest the value could be kept?

What I'm thinking of doing is this:

When a new posting enters the published state I'd like to create a subchannel.

For example, today's date is September 24, 2004. The author writes in
Channel A.

The URL should look like so

www.foo.com/channelA/2004/09/24/MyFunkyStory.htm

www.foo.com/channelA/2004/09/24/AnotherFunkyStory.htm

Angus Logan

2004-09-25, 7:46 am

Hi Bill,

You should define a Custom Property on your template ; but what you are
talking about is another story.

I think what you would need to do is write your own custom console action
for "Create new Story"

Here's some pseudo code:

If a channel called Current Year does not exist create the year channel;
If a channel called Current Month does not exist under the current ear
channel the month channel (under the year channel);
IF a channel called Current Day does not exist under the current month
channel (under the current month year) create the current day channel;

Then you would want to redirect the user to be creating a new posting using
a specified template under the current channel.

Similar to what blogs do?

May I ask what you are going to use this functionality for as there may be a
cleaner way to do it.

Regards
--
________________________________________


Angus Logan (MCAD/MCDBA/MCP)
Lead Software Developer
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________


"bill tie" <billtie@discussions.microsoft.com> wrote in message
news:D35EB510-AB67-46DC-A02D-52F50B8ACAE4@microsoft.com...
>
> Thank you for the pointer, Angus.
>
> Where else would you suggest the value could be kept?
>
> What I'm thinking of doing is this:
>
> When a new posting enters the published state I'd like to create a

subchannel.
>
> For example, today's date is September 24, 2004. The author writes in
> Channel A.
>
> The URL should look like so
>
> www.foo.com/channelA/2004/09/24/MyFunkyStory.htm
>
> www.foo.com/channelA/2004/09/24/AnotherFunkyStory.htm
>



bill tie

2004-09-25, 7:46 am


> I think what you would need to do is write your own custom
> console action for "Create new Story"


Please, spare me. The wild combination of VBscript, JavaScript and what not
gives me goosebumps.

> redirect the user to be creating a new posting using
> a specified template under the current channel.


Not quite. The subchannels should not be created at the time a posting is
being created. Here's why:

Sep. 30 -- MyFunkyStory is created.
Oct. 01 -- MyFunkyStory is approved and published.

> Similar to what blogs do?
>
> May I ask what you are going to use this functionality for


Yes, blogs were an inspiration. To boot, I hear and read MCMS is capable of
handling efficiently only 300 postings per channel.

Let me hear what the cleaner way is.

Angus Logan

2004-09-25, 7:46 am

Hi Bill,

So are you going to be looking at a channel structure like:

/News
/Stories not yet approved
- A story not yet published
/2004
/09
/24
- Funky Story 1
- Funky Story 2

So the authors will create the articles in /News/Stories not yet approved
and then in the CmsPosting_Approved event you will need to move the posting.
and re submit/approve etc.

Clean enough?

But then you will need to define the business requirements of when an
article is reauthored or modified does it get moved again into the next
month etc.

Cheers
--
________________________________________


Angus Logan (MCAD/MCDBA/MCP)
Lead Software Developer
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________


"bill tie" <billtie@discussions.microsoft.com> wrote in message
news:E2C81AAC-F9B3-49AD-A0B2-14B846CC49E5@microsoft.com...
>
>
> Please, spare me. The wild combination of VBscript, JavaScript and what

not
> gives me goosebumps.
>
>
> Not quite. The subchannels should not be created at the time a posting is
> being created. Here's why:
>
> Sep. 30 -- MyFunkyStory is created.
> Oct. 01 -- MyFunkyStory is approved and published.
>
>
> Yes, blogs were an inspiration. To boot, I hear and read MCMS is capable

of
> handling efficiently only 300 postings per channel.
>
> Let me hear what the cleaner way is.
>



bill tie

2004-09-25, 5:53 pm


Angus,

Thank you for your note.

Before I start programming, let me go over a few points.

> /News
> /Stories not yet approved
> - A story not yet published
> /2004
> /09
> /24
> - Funky Story 1
> - Funky Story 2


I thought I'd keep unpublished stories in the root like so:

/News
- StoryNotYetPublished
/2004
/09
/24
- FunkyStory1
- FunkyStory2

I hope it makes no difference. From my point of view, I'll be doing less(?)
traversal.

> in the CmsPosting_Approved event you will need to move the
> posting. and re submit/approve etc.


(a) What's better? Move the posting? Or copy the posting to a new channel,
delete the posting in the old channel?

(b) If the posting is approved in the old channel, will it have to be
approved in the new channel again?

(c) If the posting has to be approved in the new channel, we should do it
programmatically.

Is it safe to assume during this process CmsHttpContext.Current.User is
logically the user who can create a new channel and approve the posting in
the channel?

> when an article is reauthored or modified does it get moved
> again into the next month etc.


No, it should remain in the channel in which it was published.

(a) I suppose a posting could have a custom property "Approved".
At the time of creation, set "Approved" to false.

When approving, check whether approved. If not approved, set "Approved" to
true and create a new channel.

Will this do?

(b) Early this month, there was a discussion about last modified date, in
which you partook. We want to publish the date of the most recent
modification. There seem to be problems with the last modified date and I'm
not sure about revision date. Isn't the "ChangeDate" property more reliable
for this purpose?

Angus Logan

2004-09-25, 8:48 pm

> (a) What's better? Move the posting? Or copy the posting to a new
channel,
> delete the posting in the old channel?
[vbcol=seagreen]
> (b) If the posting is approved in the old channel, will it have to be
> approved in the new channel again?
[vbcol=seagreen]
> (c) If the posting has to be approved in the new channel, we should do it
> programmatically.
more rights.
[vbcol=seagreen]
> Is it safe to assume during this process CmsHttpContext.Current.User is
> logically the user who can create a new channel and approve the posting in
> the channel?
[vbcol=seagreen]
>
> No, it should remain in the channel in which it was published.
[vbcol=seagreen]
> (a) I suppose a posting could have a custom property "Approved".
> At the time of creation, set "Approved" to false.
>
> When approving, check whether approved. If not approved, set "Approved"

to
> true and create a new channel.
don't move it; or see if it is in the root; if it isn't leave it.
[vbcol=seagreen]
> Will this do?
>
> (b) Early this month, there was a discussion about last modified date, in
> which you partook. We want to publish the date of the most recent
> modification. There seem to be problems with the last modified date and

I'm
> not sure about revision date. Isn't the "ChangeDate" property more

reliable[vbcol=seagreen]
> for this purpose?
my previous suggestion and put the AppovedDate into a custom property on the
posting.

Cheers


bill tie

2004-09-26, 5:52 pm


Angus,

Thank you for you reply.

This thread is getting pretty long and if you're patient, it may get a
little longer. I'll get back to you on the finer points later.

Right now, while coding this approval piece, I've run into a couple of
issues. I wonder whether you can clarify them.

1. According to MCMS documentation custom properties are "get" properties.
So they can't be modified programmatically. Am I right or wrong?

2. When I create "year" subchannels, I set the "SortOrdinal" to the current
year.

Channel childChannel = parentChannel.CreateChannel();
childChannel.SortOrdinal = intCurrentYear;

Next time I retrieve the collection of child channels,

ChannelCollection cltnChannels = parentChannel.Channels;

I'm guaranteed the most recent-year child channel is the first, i.e.
zero-th, item in the collection.

Why doesn't the following work:

Channel fooChannel = cltnChannels.Item[0];

Angus Logan

2004-09-26, 5:52 pm

> 1. According to MCMS documentation custom properties are "get" properties.
> So they can't be modified programmatically. Am I right or wrong?


= Date.Now.ToString();[vbcol=seagreen]
[vbcol=seagreen]
> 2. When I create "year" subchannels, I set the "SortOrdinal" to the

current
> year.


> Channel childChannel = parentChannel.CreateChannel();
> childChannel.SortOrdinal = intCurrentYear;
>
> Next time I retrieve the collection of child channels,
>
> ChannelCollection cltnChannels = parentChannel.Channels;
>
> I'm guaranteed the most recent-year child channel is the first, i.e.
> zero-th, item in the collection.
>
> Why doesn't the following work:
>
> Channel fooChannel = cltnChannels.Item[0];
>

[vbcol=seagreen]
channel from the news channel;[vbcol=seagreen]
CmsHttpcontext.current.channel.channels[Date.Now.Year.ToString].Channels[Dat
e.Now.Month.ToString.PadLeft(0,2)][vbcol=seagreen]
coming to Outlook Express???


bill tie

2004-09-26, 5:52 pm


Angus,

I'm awed.

Reading the documentation, I would never know that if I had a child channel
"MyFunkyChannel" I could access it from the parent the way you do:

Channel childChannel =
CmsHttpContext.Current.Channel.Channels["MyFunkyChannel"];

Why is my Revision Date January 1, 3000?


Angus Logan

2004-09-26, 5:52 pm

Hi Bill,

Like most technologies (especially MS ones) you really only pickup the finer
points by actually building solutions and not trawling documentation.

As for the 1/1/3000 revision date issue: this is to do with if the posting
is not a historical revision.

Stefan (or anyone else) if you are listening - are you able to give an
overview of the cmsPosting.RevisionDate property's behaviour specificially
the 1/1/3000 value?

Cheers
--
________________________________________


Angus Logan (MCAD/MCDBA/MCP)
Lead Software Developer
Microsoft Application Solutions
Data#3 Limited
E angus_logan@data3.com.au
BLOG www.anguslogan.com
________________________________________


"bill tie" <billtie@discussions.microsoft.com> wrote in message
news:56B4E3F9-3CD7-40C8-BDBD-F2D82FCCB87A@microsoft.com...
>
> Angus,
>
> I'm awed.
>
> Reading the documentation, I would never know that if I had a child

channel
> "MyFunkyChannel" I could access it from the parent the way you do:
>
> Channel childChannel =
> CmsHttpContext.Current.Channel.Channels["MyFunkyChannel"];
>
> Why is my Revision Date January 1, 3000?
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com