MicroStrategy ONE

Modifying the Page Template

The template page is a placeholder for all the page sections defined for pages within the Web application. It determines the final layout for a given application page. Refer to MicroStrategy Web page structure for more information. As described in the MicroStrategy Web Page Structure, there are several page sections such as header, footer, links, content, etc. that comprise a MicroStrategy Web page. These page sections as well as the page template for any MicroStrategy Web page can be viewed by accessing the Pages setting in the Web Customization Editor. The content for the page sections is provided by jsp/ascx files.

Sometimes a customization requires you to add or remove custom content (text or images) to a MicroStrategy Web page. This is achieved by modifying (adding or removing) content in the page sections (that is, in the jsp/ascx files). To modify page sections, you can use either option: modify the existing jsp/ascx file (that provides content to the page section) or create a new jsp/ascx file to be used by a page section. Note that in both these options, you are modifying the default page sections that are provided by MicroStrategy Web. For a huge majority of customizations, these two options help accomplish the desired objective.

MicroStrategy's best practices recommend reusing existing page sections to add or modify content rather than creating new page sections. For example, if you want to add content to the footer of a MicroStrategy Web page, reuse the page section called footerused by that page or the default page rather than create a new page section called custom footer.

However, you might have a customization requirement to add a custom page section to a page template file. This custom page section will be in addition to the page sections defined for a page template. The following steps describe the process of adding a custom page section called "custom footer" to a new page template for the About page in MicroStrategy Web.

It is recommended you create a new page template that has your custom page section rather than adding the custom page section to an existing page template such as mstrWeb.jsp/aspx.

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

  3. Exit the Web Customization Editor. 

  4. Make a copy of mstrWeb.jsp/aspx (located in the jsp or asp folder) and save it in your customization plug-in folder. For example: /plugins/AddingCustomPageSection/jsp or /plugins/AddingCustomPageSection/asp.:

  5. Make the following changes as shown below in a J2EE environment:

    Open the copied mstrWeb.jsp from your customization plug-in folder and search for the code for the default footer section included in the <div> tag. Copy the entire <div> tag, paste it directly below it and make the changes shown as shown below.:

    ...

    ...

    <div class="mstrFooter" id="mstrWeb_footer" name="mstrWeb_footer" iframe="true">

    <%--

     Display the "footer" section of the template as specified in pageConfig.xml (i.e. Copyright_Footer.jsp)

     <jsp:include page="[a page section]" />

    --%>

    <web:ifFeature name = "page-full-screen-mode">

    <web:then>

    </web:then>

    <web:else>

    <web:ifFeature type="browserSetting" name="hsect" value="contains:footer"><web:else>

    <jsp:include page='<%=mstrPage.getTemplateInfo().getSection("footer")%>' flush="true" />

    </web:else></web:ifFeature>

    </web:else>

    </web:ifFeature>

    </div>

     

    <div class="" id="" name="" iframe="true">

    <%--

     Display the "custom footer" section of the template as specified in pageConfig.xml (i.e. Custom_Footer.jsp)

     <jsp:include page="[a page section]" />

    --%>

    <web:ifFeature name = "page-full-screen-mode">

    <web:then>

    </web:then>

    <web:else>

    <web:ifFeature type="browserSetting" name="hsect" value="contains:footer"><web:else>

    <jsp:include page='<%=mstrPage.getTemplateInfo().getSection("custom_footer")%>' flush="true" />

    </web:else></web:ifFeature>

    </web:else>

    </web:ifFeature>

    </div>

    ...

    ...

  6. Save your changes. 

  7. Create a new file Custom_Footer.jsp/ascx and use this file to provide content to the Custom Footer page section.

  8. Save this new file Custom_Footer.jsp/ascx inside the jsp or asp subfolder of your customization plug-in. For example: /plugins/AddingCustomPageSection/jsp or /plugins/AddingCustomPageSection/asp

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

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

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

  12. Double-click the page which will use the new page template with the custom page section (custom footer). For this scenario, we will use the About page. This launches the Basic Properties editor for the page. 

  13. Click the Template Properties tab at the bottom in the right frame to see the page template information such as the jsp/ascx file used for the page template, default page sections and the jsp/ascx files that provide content to the page sections.:

    The display for the page template is based on the layout of the defaultmstrWeb.jsp/aspx. Information about a custom page section is not displayed through the Web Customization Editor. Thus, you need to add this information by manually editing the Page Configuration file as shown later.

  14. Click ... next to the text field for Template File to specify a file for the Default page template. 

  15. Navigate to the new page template file mstrWeb.jsp/aspx inside the customization plug-in folder (for example: /plugins/AddingCustomPageSection/jsp or /plugins/AddingCustomPageSection/asp), and click Open

  16. Save your changes. 

  17. Exit the Web Customization Editor. 

  18. In a J2EE environment, edit the Page Configuration file, pageConfig.xml, inside the customization plug-in folder (for example: /plugins/AddingCustomPageSection/WEB-INF/xml), and add a <page-section node> as shown below. This code change specifies the jsp/ascx file that will be used by the custom footer section.

    <framework>

      <pages>

        <page name="about">

          <templates>

            <template file-name="/plugins/AddingCustomPageSection/jsp/mstrWeb.jsp">

              <page-sections>

                <page-section file-name="@AddingCustomPageSection:/jsp/Custom_Footer.jsp" name="custom_footer"/>

              </page-sections>

            </template>

          </templates>

        </page>

      </pages>

    </framework>

  19. Save your changes. 

  20. Launch MicroStrategy Web to view your customization.

For specific settings that affect whether customization changes are applied automatically or require a restart of the Web server, see Applying customization changes to the application.

See also