Microsoft Content Management Server - auto approve with save page

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > May 2006 > auto approve with save page





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 auto approve with save page
anabhra

2006-05-12, 1:16 am

Hi All,

I wish to do the following with a CMS page;

From the edit mode when a user hits Save and Exit the page should be saved
and approved. The user is a channel manager and I default the page name for
the pop-up window.

What happens now is that the user has to hit Submit button to put the page
in published state. Also, when I save, I am setting the page attribute of
important posting using code. (I am using the placeholderpropertychanged
event to do all this.)

How to auto approve is the question?

--
anabhra
Stefan [MSFT]

2006-05-12, 7:14 am

Hi Anabhra,

this can be done using a custom console action that replaces the save&exit
action and adds the submit functionality to this new action.

See here on how to create custom console actions:
http://msdn.microsoft.com/library/d....asp?frame=true

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"anabhra" <sonia@rotaryintl.org> wrote in message
news:EE455CB3-D984-422D-8505-018DEE539D99@microsoft.com...
> Hi All,
>
> I wish to do the following with a CMS page;
>
> From the edit mode when a user hits Save and Exit the page should be saved
> and approved. The user is a channel manager and I default the page name
> for
> the pop-up window.
>
> What happens now is that the user has to hit Submit button to put the page
> in published state. Also, when I save, I am setting the page attribute of
> important posting using code. (I am using the placeholderpropertychanged
> event to do all this.)
>
> How to auto approve is the question?
>
> --
> anabhra



anabhra

2006-05-12, 1:14 pm

Thanks Stefan.

I did that. I call the posting.submit method.

That still keeps the page in saved state. is it because I am setting the
important flag in the same routine?



--
anabhra


"Stefan [MSFT]" wrote:

> Hi Anabhra,
>
> this can be done using a custom console action that replaces the save&exit
> action and adds the submit functionality to this new action.
>
> See here on how to create custom console actions:
> http://msdn.microsoft.com/library/d....asp?frame=true
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "anabhra" <sonia@rotaryintl.org> wrote in message
> news:EE455CB3-D984-422D-8505-018DEE539D99@microsoft.com...
>
>
>

Stefan [MSFT]

2006-05-15, 7:13 am

Hi,

you need to ensure that the Submit method is the last method called.
If you are setting the important property after you did the submit you will
go back to saved mode.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"anabhra" <sonia@rotaryintl.org> wrote in message
news:AA9AB46D-B631-4726-88B2-C8F57CA029DD@microsoft.com...[vbcol=seagreen]
> Thanks Stefan.
>
> I did that. I call the posting.submit method.
>
> That still keeps the page in saved state. is it because I am setting the
> important flag in the same routine?
>
>
>
> --
> anabhra
>
>
> "Stefan [MSFT]" wrote:
>


anabhra

2006-05-15, 1:14 pm

Stefan,

What I do is as follows:
1. Extended the savenewaction so that the pop-up to save the posting is
populated using code (I pass the posting name into it) and call the
save_click routine.

2.Trap the PlaceholderPropertyChanged event in my global.asax. Here, when
the last placeholder property change fires, I call a routine which does a
"submit".

3. In this routine, I first set the important attribute and then move the
posting to the appropriate channel if necessary. (Channel structure is based
on claendar year and the posting has a date associated. So this happens only
once or twice as most postings are created in the current year.)

Also, this is the code that I call in the routine after setting the
important attribute and creating the channel if necessary:

cmsContext.CommitAll()
objPosting.MoveTo(chTmp1) 'move posting to correct channel
objPosting.Submit() ' submit the posting
cmsContext.CommitAll() 'commit all

What could be flawed here?

Thanks.
--
anabhra


"Stefan [MSFT]" wrote:

> Hi,
>
> you need to ensure that the Submit method is the last method called.
> If you are setting the important property after you did the submit you will
> go back to saved mode.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "anabhra" <sonia@rotaryintl.org> wrote in message
> news:AA9AB46D-B631-4726-88B2-C8F57CA029DD@microsoft.com...
>
>
>

Stefan [MSFT]

2006-05-15, 1:14 pm

Hi Anabhra,

I assume that an additional workflow event is fired due to the modifications
you are doing in your routine and that this workflow event does some actions
which cause the posting to go to saved mode again after going to published.
Please debug the code below and check objPosting.State after the last commit
all.
It should be published.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"anabhra" <sonia@rotaryintl.org> wrote in message
news:F40877FF-105D-4A37-BE1D-C4842AEE5FB0@microsoft.com...[vbcol=seagreen]
> Stefan,
>
> What I do is as follows:
> 1. Extended the savenewaction so that the pop-up to save the posting is
> populated using code (I pass the posting name into it) and call the
> save_click routine.
>
> 2.Trap the PlaceholderPropertyChanged event in my global.asax. Here, when
> the last placeholder property change fires, I call a routine which does a
> "submit".
>
> 3. In this routine, I first set the important attribute and then move the
> posting to the appropriate channel if necessary. (Channel structure is
> based
> on claendar year and the posting has a date associated. So this happens
> only
> once or twice as most postings are created in the current year.)
>
> Also, this is the code that I call in the routine after setting the
> important attribute and creating the channel if necessary:
>
> cmsContext.CommitAll()
> objPosting.MoveTo(chTmp1) 'move posting to correct channel
> objPosting.Submit() ' submit the posting
> cmsContext.CommitAll() 'commit all
>
> What could be flawed here?
>
> Thanks.
> --
> anabhra
>
>
> "Stefan [MSFT]" wrote:
>


anabhra

2006-05-15, 1:14 pm

Thanks Stefan.

I must be going nuts here. It is working and the state is published.

something was messed up and after cleaning up the .net instance things are
behaving as expected.

Again, many thanks.
--
anabhra


"Stefan [MSFT]" wrote:

> Hi Anabhra,
>
> I assume that an additional workflow event is fired due to the modifications
> you are doing in your routine and that this workflow event does some actions
> which cause the posting to go to saved mode again after going to published.
> Please debug the code below and check objPosting.State after the last commit
> all.
> It should be published.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "anabhra" <sonia@rotaryintl.org> wrote in message
> news:F40877FF-105D-4A37-BE1D-C4842AEE5FB0@microsoft.com...
>
>
>

anabhra

2006-05-19, 7:14 pm

Stefan,

I am at a complete loss. one template goes thru auto approve without any
issues but another one stays in saved state. After submit I do see the state
as published.

I did notice that one placeholder save event fires afterwards. Do not know
why...It is an extended checkbox placeholder...

Any ideas why this may be happening?
--
anabhra


"anabhra" wrote:
[vbcol=seagreen]
> Thanks Stefan.
>
> I must be going nuts here. It is working and the state is published.
>
> something was messed up and after cleaning up the .net instance things are
> behaving as expected.
>
> Again, many thanks.
> --
> anabhra
>
>
> "Stefan [MSFT]" wrote:
>
Stefan [MSFT]

2006-05-21, 1:13 pm

Hi Anabhra,

no idea.
Please open a support case to get this analyzed.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"anabhra" <sonia@rotaryintl.org> wrote in message
news:5A893DA4-F0C2-4794-B99F-FAF28C344B86@microsoft.com...[vbcol=seagreen]
> Stefan,
>
> I am at a complete loss. one template goes thru auto approve without any
> issues but another one stays in saved state. After submit I do see the
> state
> as published.
>
> I did notice that one placeholder save event fires afterwards. Do not know
> why...It is an extended checkbox placeholder...
>
> Any ideas why this may be happening?
> --
> anabhra
>
>
> "anabhra" wrote:
>


anabhra

2006-05-24, 7:15 pm

Hey Stefan,

I figured out what was going on and that prompts me to ask the next question:

Is there a way for me to know when the CmsPosting_PlaceholderPropertyChanged
event fires for the last placeholder on the template?

What was happening was that the submit method was being called before all
the placeholders had saved the data and hence the posting was still saved and
not published.

Thanks,

--
anabhra


"Stefan [MSFT]" wrote:

> Hi Anabhra,
>
> no idea.
> Please open a support case to get this analyzed.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "anabhra" <sonia@rotaryintl.org> wrote in message
> news:5A893DA4-F0C2-4794-B99F-FAF28C344B86@microsoft.com...
>
>
>

Stefan [MSFT]

2006-05-24, 7:15 pm

Hi Anabhra,

no there is no way to get this working.
I would suggest to do the approve not in a workflow event but in a custom
console action.
Here you are able to control that the approve / submit is done after the
save is completed.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"anabhra" <sonia@rotaryintl.org> wrote in message
news:206159FC-DCD8-43DB-917D-184980B46E3B@microsoft.com...[vbcol=seagreen]
> Hey Stefan,
>
> I figured out what was going on and that prompts me to ask the next
> question:
>
> Is there a way for me to know when the
> CmsPosting_PlaceholderPropertyChanged
> event fires for the last placeholder on the template?
>
> What was happening was that the submit method was being called before all
> the placeholders had saved the data and hence the posting was still saved
> and
> not published.
>
> Thanks,
>
> --
> anabhra
>
>
> "Stefan [MSFT]" wrote:
>


anabhra

2006-05-25, 1:19 am

Should have listened to you in the begining.

Hmmm... custom action that would mimic create channel and or moe my posting
and then submit.

I need to work on this...

Thanks Stefan.

--
anabhra


"Stefan [MSFT]" wrote:

> Hi Anabhra,
>
> no there is no way to get this working.
> I would suggest to do the approve not in a workflow event but in a custom
> console action.
> Here you are able to control that the approve / submit is done after the
> save is completed.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> Check out the new book as well: Advanced MCMS development:
> http://tinyurl.com/8ugwj
> ----------------------
>
>
> "anabhra" <sonia@rotaryintl.org> wrote in message
> news:206159FC-DCD8-43DB-917D-184980B46E3B@microsoft.com...
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com