Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > httpmodule and cms2002
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 25th June 20:00
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default httpmodule and cms2002



Hi,


I have to customized the cms2002 console not to loose specifics
parameters of the http request when execute a console action (switch to edit
mode, save, create new page, ...).

To do that I've been advised to write an httpmodule.

I suppose that for every console action I have to do a little javascript
that put in the http request (cms url) the specifics parameters.

I've been told to overload the RegisterStartupScript in this httpmodule,
but this is a method of the object Page (so how to do this ? (not to touch to
base Page object)).

Best regards.
  Reply With Quote


  sponsored links


2 25th June 20:00
stefan [msft]
External User
 
Posts: 1
Default httpmodule and cms2002



Hi,

you are correct.
It seems not to be possible to override the RegisterStartupScript script
method in a http module.
But what could be done is to register your changed Startup Script before the
console registeres their script.
The first registration wins - so the changes are active.

To achieve this do the following:

public void OnPreRequestHandlerExecute(object sender, EventArgs e)
{
...
if ((CmsHttpContext.Current.Posting != null) &&
((WebAuthorContext.Current.Mode == WebAuthorContextMode.AuthoringNew) |
(WebAuthorContext.Current.Mode ==
WebAuthorContextMode.AuthoringReedit)))
((System.Web.UI.Page)handler).Init += new EventHandler( this.OnInit );
...
}

public void OnInit(object sender, EventArgs eventArgs)
{
System.Web.UI.Page currentPage = sender as System.Web.UI.Page;
currentPage.RegisterStartupScript("startupscriptna me",
overrideStartupScript);
}

Cheers,
Stefan.


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

MCMS FAQ:
http://download.microsoft.com/download/4/2/5/4250f79a-c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossner/archive/2003/12/07/41859.aspx
--------------------------------
  Reply With Quote
3 25th June 20:00
stefan [msft]
External User
 
Posts: 1
Default httpmodule and cms2002


Just to add:

you need to check if the if statement below is correct.
You might have to use a different test to decide whether to register the
OnInit event or not.

Cheers,
Stefan.

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

MCMS FAQ:
http://download.microsoft.com/download/4/2/5/4250f79a-c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossner/archive/2003/12/07/41859.aspx
--------------------------------
  Reply With Quote
4 25th June 20:00
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default httpmodule and cms2002


Hi,

Thanx

Now last questions : which javascript functions to modify by the call
RegisterStartupScript ?

Have I to see all the javascript functions of cms2002 in C:\Program
Files\Microsoft Content Management Server\Server\IIS_CMS\WebAuthor\Client ?

Or more precisely do I have to go in every Cms2002 "mode" (create new page,
exit, save, save and exit, ...) and see in the html source what javascript is
generated at the end of the page ? Then which key to put in the call of
RegisterStartupScript ?

Best regards, I think we're near the end !
  Reply With Quote
5 25th June 20:00
stefan [msft]
External User
 
Posts: 1
Default httpmodule and cms2002


Hi,

I haven't looked into the details, sorry.
Please overload the RegisterStartupScript in one template and debug the
incoming requests to identify this.

Cheers,
Stefan.

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

MCMS FAQ:
http://download.microsoft.com/download/4/2/5/4250f79a-c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossner/archive/2003/12/07/41859.aspx
--------------------------------


touch
  Reply With Quote
6 25th June 20:00
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default httpmodule and cms2002


Hi,

Well it seems to be unmakable, there is a lot of javascript function to
modify (I only see UpdateSiblingFramesScript, __CMS_Page,
OverrideASPXPostBack, ...), and I think it could be easier to directly change
the standard cms2002 javascript functions in IIS_CMS\...\.

The initial solution consisting in overloading the cms2002 console is rather
good but sooner or later the specifics parameters are lost (when a new page
is created after clicking on save the parameters are lost).

If you have another idea ?

Anyway, thank you very much for your help.

Best regards.
  Reply With Quote
7 25th June 20:00
stefan [msft]
External User
 
Posts: 1
Default httpmodule and cms2002


Sure!
The initial one: PropagateParameter.
You are just reinventing the wheel. No wonder that this gets complicated.

Cheers,
Stefan.

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

MCMS FAQ:
http://download.microsoft.com/download/4/2/5/4250f79a-c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossner/archive/2003/12/07/41859.aspx
--------------------------------

to
  Reply With Quote
8 25th June 20:00
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default httpmodule and cms2002


No, PropagateParameter : bad method "durtying" every url of cms even if we
don't use any console action, and the urls are changed for all the session !
As for a lot of pages, parameters are spent in the http request they're all
bugged !

Best regards
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666