Customizing the ASP Web Author

As mentioned at the beginning of this chapter, CMS 2002 ships with two versions of the Web Author. This section quickly discusses how you can make changes to the ASP version. Based on this example, you should get an idea of where to start if you want to make changes to the ASP Web Author.

Adding an Option to the Web Author

This example shows how you can create a new action for the ASP version of the Web Author. Just like the .NET Web Author, the ASP version was designed to allow users to modify the console. The example adds a new link to the Web Author console. This new link opens a window that represents the new action page. The example shows that this new window could also be a CMS posting.

The first thing you will need to do is add a call to the new function in ConsoleUI.inc (the default location is C:\Program Files\Microsoft Content Management Server\Server\IIS_NR\System\WBC\Customizable\SiteEmbeddedWBCLinks\ConsoleUI.inc). Keep in mind that there are different versions of the console. Choose which console you are using. The default console is the one located at C:\Program Files\Microsoft Content Management Server\Server\IIS_NR\System\WBC\Customizable\SiteEmbeddedWBCLinks\WBCConsole\FlatHTMLConsole.

Add this code to the console file (line 210):

[View full width]

' -- 8) ASP Example link If AutoSession.ThisChannel.CanSetProperties Then Response.Write("<br>" & vbCr & vbCr ) Dim urlASPExample, strChannelModeUpdate urlASPExample = Autosession.Searches.GetByPath("/Channels/Samples/ASPExample") graphics/ccc.gif.URLModeUnpublished strChannelModeUpdate = Autosession.ThisChannel.QuerystringModeUpdate %> <script language="Javascript"> <! function openWindow() { //Open the window for the ASP Example (in update mode) window.open("<%=urlASPExample%>?<%=strChannelModeUpdate%>&PostingGUID=<%=Autosession graphics/ccc.gif.ThisPosting.GUID%>", "WorkflowProperties", "height=610,width=650"); } --> </script> <% Call WriteHrTagAndReset(bWriteHrTag) Call ShowASPExampleLink() End If

This code opens a new window and displays another CMS posting. You do not have to do it this way. In fact, the Web Author uses stand-alone ASP pages to open the action windows. But you can see from this example that either method is possible.

The next choice is which Web Author mode you would like to use to show the new action. For example, if you want to add the action during the regular Edit site mode, you should add your new call to EditSite Ops.inc (the default install location is C:\Program Files\Microsoft Content Management Server\Server\IIS_NR\System\WBC\Customizable\SiteEmbeddedWBCLinks\WBCConsole\EditSiteOps.inc).

This code adds the link to the Web Author application (line 32):

 ' ---- [Public] This subroutine generates the html to show the "ASP Example" link Sub ShowASPExampleLink() %><a href="#" onclick="JavaScript:openWindow();return false">ASP Example</a><% End Sub '--/ASPExample---' 

You can see that you get the posting object by its path. This method is easier to maintain than a GUID. However, a GUID search would be faster. The posting returned is the object that represents the UI for the command. For better encapsulation, you could put this code into an include file.

This example should help you add or remove options from the ASP version of the Web Author console. Unlike the .NET version of the Web Author, the ASP code is not compiled, so keep in mind that the complete code for the ASP Web Author is there for your viewing pleasure. Just be sure to check the legal statements about what changes are supported by Microsoft PSS.



Microsoft Content Management Server 2002. A Complete Guide
Microsoft Content Management Server 2002: A Complete Guide
ISBN: 0321194446
EAN: 2147483647
Year: 2003
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net