MicroStrategy ONE

Creating a Custom Default Page-Section That Can be Inherited by All Pages

MicroStrategy Web pages are composed of page-sections. The content for each page-section is supplied by an individual page-section file— either a JSP file in a J2EE environment or an ASP.NET file in a .NET environment. Page-section files can be explicitly defined for a particular page or they can be inherited from the page-section files defined for the default page.

You can customize any page in the application by adding or removing page-sections from that page, including the default page. When you customize the MicroStrategy Web default page, those customizations are available to any other page. For example, if you want a custom footer to be displayed on all MicroStrategy Web pages, you can create a custom file for the "footer" page-section of the default page and have all MicroStrategy Web pages inherit this custom "footer" page section. If, on the other hand, you want only a specific page to have a custom footer, you would create a custom file for the "footer" page-section of only that page.

In this customization scenario, you will create a custom footer that is used by all MicroStrategy Web pages that inherit the default "footer" page-section and do not override that page-section with a different file.

The Login and Logout pages are the only MicroStrategy Web pages that do not inherit default page-sections, although pages such as the Welcome page override the default footer page-section file.

Before customization:

After customization:

This customization can be accomplished using either of the following methods:

Deploying the plug-in provided with MicroStrategy SDK

MicroStrategy SDK provides a plug-in (ZIP file) that can simply be extracted to thepluginsfolder to view the customization in MicroStrategy Web. The following steps guide you in locating the plug-in and deploying it. 

  1. Access the plug-in: JSP version or ASP .NET version

  2. Extract the plug-in to the plugins subfolder inside the MicroStrategy Web installation folder.   

  3. Launch MicroStrategy Web to view the customization.

Using the Web Customization Editor to create a plug-in

MicroStrategy SDK provides a Web Customization Editor that can be used to create a customization plug-in. The following steps guide you in creating the plug-in and deploying it. 

  1. Launch the Web Customization Editor

  2. Create a new plug-in and give it a meaningful name. For example: CreatingCustomPageSectionAllPages

  3. Create Custom_Footer file as shown below. Note the presence of the <div class="mstrFooter> and </div> tags in the JSP as well as the ASP .NET code. Any content that you wish to display should always be enclosed within these two tags.::

    J2EE environment:

    <%

     /****

      * Custom_Footer.jsp

      * This page displays a simple line of text "This is a custom footer applied to all pages that inherit from the Default Page".

      *

      * Copyright 2009 MicroStrategy Incorporated. All rights reserved.

      * version: 1.2

      * xhtml: true

      ****/

    %><%@ page errorPage="JSP_Error.jsp"

    %><%@ page contentType="text/html; charset=UTF-8"

    %><%@ taglib uri="/webUtilTL.tld" prefix="web"%>

     

    <div class="mstrFooter">

    <span class="copyright"> This is a custom footer applied to all pages that inherit from the Default Page. </span>

    </div>

    .NET environment:

    <%@ Control Language="vb" AutoEventWireUp="false" CodeFile="Custom_Footer.ascx.vb" Inherits="MicroStrategy.Custom_Footer"%>

    <%@ Register TagPrefix="web" Namespace="MicroStrategy.Tags"%>

     

    <%--

     /****

      * Custom_Footer.ascx

      * This file displays a simple line of text in the footer: 'This is a custom footer.'

      *

      * You can substitute the text you want to display in the custom footer.

      ****/

    --%>

     

    <div class="mstrFooter">

    <span class="copyright">This is a custom footer.</span>

    </div>

    In an ASP .NET environment, you must also create the code-behind file, Custom_Footer.ascx.vb. Use the code sample below to create the code-behind file for the custom footer page-section file.

    .NET environment:

    Namespace MicroStrategy

        Partial Class Custom_Footer

             Inherits MSTRControls.MSTRUserControl

             Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

                Dim ex As System.Exception

                Try

                    Me.errorPageName = "JSP_Error.ascx"

                Catch ex

                    Me.setError(Me, ex)

                End Try

            End Sub

        End Class

    End Namespace

  4. Copy Custom_Footer.jsp/ascx (and the code-behind file if using ASP .NET) file to plugins\CreatingCustomPageSectionAllPages\jsp or plugins\CreatingCustomPageSectionAllPages\asp as appropriate. 

  5. If the Web Customization Editor is closed, launch it again and access your plug-in

  6. Click on MicroStrategy Web Configuration inside the Application Settings view to expand the hierarchical tree. The expanded list comprises the different settings that can be modified to perform customizations. 

  7. Click on Pages to expand the list of pages used in MicroStrategy Web. 

  8. Double-click on -1 (Default Page) to view it in the editor. 

  9. Click the Template Properties tab at the bottom. 

  10. Click the footer and select Custom_Footer.jsp/ascx file you saved in your plug-in. 

  11. Save your changes. 

  12. Click OK in the Refresh Application window. 

  13. Launch MicroStrategy Web to view the customization.

See Also