Mombu the Microsoft Forum sponsored links

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

sponsored links


Reply
 
1 25th June 19:59
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default overload the cms2002 console



Hi everybody,


To ease the use (for users) of cms2002, I have overloaded every action of
the console of cms2002 not to loose the applicatives parameters of the http
request.

To do that I have overloaded every UrlPostback or UrlNewWindow or others
resulting urls of console actions.

It works well, except when we save / exit a new posting
(AuthoringSaveNewAction), the applicatives parameter of the http request are
lost.

Do you know what to do, which application's method to overload ?

Best regards.
  Reply With Quote


  sponsored links


2 25th June 19:59
stefan [msft]
External User
 
Posts: 1
Default overload the cms2002 console



Hi Fguigui,

please explain in more detail.
Not sure what you mean with applicatives parameters.

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 19:59
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default overload the cms2002 console


Hi Stefan !

How are you ?

I mean by "the applicatives parameters" : parameters that are put in the
http request by classes of the application (such as
http://....?nochannel=7&noposting=2&...).

Such parameters are lost when we do (for instance) a "Switch to edit site"
or others actions in the cms console.

So the purpose of the "overload" of the console is to save them when a
console's action is done.

It's done by overloading (customizing) the actions of the console : parsing
the http request, getting the parameters that are not cms parameters ones and
putting them in resulting url used by cms (urlpostback, UrlPostbackForExit,
....).

Am I clear ?

Best regards
  Reply With Quote
4 25th June 19:59
stefan [msft]
External User
 
Posts: 1
Default overload the cms2002 console


Hi,

have you tried using CmsContext.PropagateParameters?
This might do what you are looking for without any modification to the
console actions.

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
5 25th June 19:59
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default overload the cms2002 console


We have tried this method but it's "durtying" all the urls of cms of the
session (even if we don't do cms actions !) and then it's completely bugging
the web site ! (parameters in the http request are, really, not trustworthy !

So I've opted for this solution that is rather fastidious but save
parameters only for the current page (that's what i want).

Best regards.
  Reply With Quote
6 25th June 19:59
stefan [msft]
External User
 
Posts: 1
Default overload the cms2002 console


Hi,

then I think there is no solution for this but to completly rewrite the
console action.
The standard action seems to generate the redirection URL manually and does
not take into account additional parameters added.

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
7 25th June 19:59
fguiguiàº(.‰Ø¬rë,Љìš+¢ÊµÊ&
External User
 
Posts: 1
Default overload the cms2002 console


that's what i have done, in the following class :

#region CARTOUCHE

/*
///<cartouche>
/// <copyright>(c) 2004 - PSA Peugeot Citroen </copyright>
/// <project>French Site & Web Services - Psa.Cw3.ContentManagement</project>
/// <class>CustomSwitchToEdit.cs
/// <summary>
/// Custom Cms Mode switching classes
/// Keeps html parameters when switching
/// </summary>
/// </class>
/// <author>
/// <name>Stéphane Palluet</name>
/// <company>Microsoft</company>
/// <ID>E204965</ID>
/// </author>
/// <author>
/// <name>Vincent GUERCI</name>
/// <company>CapGemini</company>
/// <ID>E219330</ID>
/// </author>
/// <author>
/// <name>Frédéric GUIGUI</name>
/// <company>CapGemini</company>
/// <ID>E209219</ID>
/// </author>
/// <version information>
/// <version number="1.0" date="03/09/2004" author="SPA">
/// <summary>Base version</summary>
/// </version>
/// <version number="1.1" date="06/09/2004" author="VGU">
/// <summary>Front office integration</summary>
/// </version>
/// <version number="1.1" date="08/10/2004" author="fGU">
/// <summary>Front office integration, fixing bug</summary>
/// </version>
/// </version information>
///</cartouche>
*/

#endregion

#region Usings

using System;
using System.Collections.Specialized;
using System.Web.UI;
using Microsoft.ContentManagement.WebControls.ConsoleCon trols;
using Microsoft.ContentManagement.Publishing;
using Microsoft.ContentManagement.WebControls.ConsoleCon trols;

#endregion


namespace Psa.Cw3.ContentManagement.WebAuthor
{
/// <summary>
/// Summary description for CustomConsoleAction.
/// </summary>
public class CustomConsoleAction
{
public static string privateUrl;
public CustomConsoleAction()
{
//
// TODO: Add constructor logic here
//
}
}


public class CustomSwitchToEdit : SwitchToPresentationUnpublishedAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}

}

public class CustomSwitchToLive : SwitchToPresentationPublishedAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}


public class CustomSwitchToAuthoringReeditAction :
SwitchToAuthoringReeditAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomPresentationPreviewAction : PresentationPreviewAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomAuthoringPreviewAction : AuthoringPreviewAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomAuthoringSaveNewAction : AuthoringSaveNewAction
{
private string refParametersList;
private string parametersList
{
get
{
if (refParametersList == null)
{
Parser p = new Parser();
refParametersList = p.BuildParametersList(Page.Request.QueryString);
}
return refParametersList;
}
}
/* public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
*/
public override string UrlSaveNewPageWindow
{
get
{
string url = base.UrlSaveNewPageWindow+ parametersList;
return url;
}
set
{
base.UrlSaveNewPageWindow = value;
}
}

public override string UrlPostback
{
get
{
string url = base.UrlPostback+ parametersList;
return url;
}
set
{
base.UrlPostback = value;
}
}

}

public class CustomAuthoringReeditSaveAction : AuthoringReeditSaveAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomAuthoringReeditSaveAndExitAction :
AuthoringReeditSaveAndExitAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
public override string UrlPostbackForExit
{
get
{
Parser p = new Parser();
string url = base.UrlPostbackForExit +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostbackForExit = value;
}
}

}

public class CustomAuthoringExitAction : AuthoringExitAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}


public class CustomApproveAction : ApproveAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomSubmitAction : SubmitAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomProductionManagerAction : ProductionManagerAction
{
/* public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
*/
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomApprovalAssistantAction : ApprovalAssistantAction
{
/* public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
*/
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}

}

public class CustomResourceManagerAction : ResourceManagerAction
{
/* public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
*/
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomGoToConnectedAction : GoToConnectedAction
{
/* public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
*/
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomCreateNewPageAction : CreateNewPageAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomCreateConnectedPageAction : CreateConnectedPageAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomDeleteAction : DeleteAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomCopyAction : CopyAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomMoveAction : MoveAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomDeclineAction : DeclineAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomPagePropertiesAction : PagePropertiesAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomRevisionHistoryAction : RevisionHistoryAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomViewRevisionByDateAction : ViewRevisionByDateAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomChannelPropertiesAction : ChannelPropertiesAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

/* public class CustomPostingStatus : PostingStatus
{
public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}

}

public class CustomPostingVersionInfo : PostingVersionInfo
{
public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
}

public class CustomPostingLockingInfo : PostingLockingInfo
{
public override string ActionJavascript
{
get
{
Parser p = new Parser();
return p.BuildCustomizedUrl(base.ActionJavascript,
Page.Request.QueryString);
}
}
}
*/
public class CustomBackToAuthoringAction : BackToAuthoringAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomExitErrorAction : ExitErrorAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomSaveRegardlessOverlapAction : SaveRegardlessOverlapAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomViewLatestAfterOverlapSaveAction :
ViewLatestAfterOverlapSaveAction
{
public override string UrlNewWindow
{
get
{
Parser p = new Parser();
string url = base.UrlNewWindow +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlNewWindow = value;
}
}
}

public class CustomReattemptSaveAction : ReattemptSaveAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}

public override string UrlPostbackForExit
{
get
{
Parser p = new Parser();
string url = base.UrlPostbackForExit +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostbackForExit = value;
}
}

}

public class CustomReattemptSubmitAction : ReattemptSubmitAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomReattemptApproveAction : ReattemptApproveAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomReattemptDeclineAction : ReattemptDeclineAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CustomReattemptDeleteAction : ReattemptDeleteAction
{
public override string UrlPostback
{
get
{
Parser p = new Parser();
string url = base.UrlPostback +
p.BuildParametersList(Page.Request.QueryString);
return url;
}
set
{
base.UrlPostback = value;
}
}
}

public class CmsUrlParameters
{
public static StringCollection LoadCmsUrlParameters()
{
StringCollection scCmsParameters = new StringCollection();
scCmsParameters.Add("NRMODE");
scCmsParameters.Add("NRCHANNELGUID");
scCmsParameters.Add("NRORIGINALURL");
scCmsParameters.Add("FRAMELESS");
scCmsParameters.Add("NRNODEGUID");
scCmsParameters.Add("NRCACHEHINT");
scCmsParameters.Add("WBCMODE");
scCmsParameters.Add("wbc_purpose");

scCmsParameters.Add("NRTEMPLATEVERSION");
scCmsParameters.Add("wbc_phname");
scCmsParameters.Add("wbc_phtype");
scCmsParameters.Add("wbc_deskres");
scCmsParameters.Add("wbc_attachicon");
scCmsParameters.Add("wbc_video");
scCmsParameters.Add("nr_emit");
scCmsParameters.Add("FreshTree");
return scCmsParameters;
}
}

public class Parser
{
public Parser()
{

}

public string BuildCustomizedUrl(string standardCMSUrl,
NameValueCollection QuerystringCollection)
{
StringCollection scCmsParameters;
string[] arr1;
string myPostBackString = "";
string myPostBackStringFollowing = "";

scCmsParameters = CmsUrlParameters.LoadCmsUrlParameters();

// Get names of all keys into a string array.
arr1 = QuerystringCollection.AllKeys;

string workStr = standardCMSUrl;
int pos = workStr.IndexOf("')");

if (pos > -1)
{
myPostBackStringFollowing = workStr.Substring(pos + 2, workStr.Length -
pos - 2);
myPostBackString = workStr.Substring(0, pos);
for (int loop1 = 0; loop1 < arr1.Length; loop1++)
{
if (!scCmsParameters.Contains(arr1[loop1]))
{
myPostBackString += "&" + QuerystringCollection.GetKey(loop1)+ "="+
QuerystringCollection.GetValues(loop1)[0];
}
}
myPostBackString += "')" + myPostBackStringFollowing;
}
else
{
myPostBackString = standardCMSUrl;
}
return myPostBackString;
}
public string BuildParametersList(NameValueCollection QuerystringCollection)
{
StringCollection scCmsParameters = CmsUrlParameters.LoadCmsUrlParameters();
string[] arr1 = QuerystringCollection.AllKeys;
string workStr = "";

for (int loop1 = 0; loop1 < arr1.Length; loop1++)
{
if (!scCmsParameters.Contains(arr1[loop1]))
{
workStr += "&" + QuerystringCollection.GetKey(loop1)+ "="+
QuerystringCollection.GetValues(loop1)[0];
}
}

return workStr;

}

}
}


But it's not working in every case !

If you have any idea !

Thank you for your help.

Best regards
  Reply With Quote
8 25th June 19:59
stefan [msft]
External User
 
Posts: 1
Default overload the cms2002 console


Hi,

no you are not writing a new console action.
You derived from the AuthoringSaveNewAction which means that the original
code will still be executed.
And this code registers a startup script which does the redirect to a Url
not under your control.

What you could do is to override the RegisterStartupScript method and modify
the content of the routine before it gets registered.

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
--------------------------------


Psa.Cw3.ContentManagement</project>

http

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


Hi,

Actually RegisterStartupScript is a method of the object Page ?
It means that templatefiles (of cms2002 templates) that are derived from
this Page must have this method RegisterStartupScript overloaded ?

In the overload we have to save the parameters of the http request, and take
them in the customized actions of the console ?

Isn't it ?

Thanx
  Reply With Quote
10 25th June 20:00
stefan [msft]
External User
 
Posts: 1
Default overload the cms2002 console


Hi,

I personally would implement an HttpModule which does this automatically for
all pages.
So no modification to the templates would be required.

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
--------------------------------

posting

the
  Reply With Quote
Reply


Thread Tools
Display Modes




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