EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB46812: How to Add a Logout Button to the Left Dock Bar Using the MicroStrategy Web SDK


Community Admin

• Strategy


How to Add a Logout Button to the Left Dock Bar Using the MicroStrategy Web SDK.

Users may want a Logout link on the left dock bar in Strategy Web 9.4.x.  The following are steps to add a Logout shortcut to the left dock bar.
 

ka04W00000148eeQAA_0EM440000002GW5.png

 
The following steps will guide developers in creating a logout link on the left dock menu using the Strategy SDK 9.4.x.
 
Using the Web Customization Editor to create a plug-in
Strategy SDK provides a Web Customization Editor that can be used to create a customization plug-in. The following steps show how to create the plug-in and deploy.
 
PART I: Adding the shortcut to the left dock bar

  • Launch the Web Customization Editor.
  • Create a new plug-in and give it a meaningful name. (For step by step instructions on creating a new plug-in, please navigate to Home > Web SDK > Customizing Strategy Web > Web Customization Editor > Features and Customizable)
  • On the Application Settings tab, navigate to Strategy Web Configuration > Pages
  • Double click on the -1(Default Page)
  • On the Template Properties tab, scroll down and click on the Edit Shortcuts button
  • The Template Shortcuts Wizard will appear.  Select the Add New Shortcut, click Next
  • Enter the following into the template:
    Name: customLogout
    Descriptor: Logout
    Descriptior ID: click the Modify button and select mstrWeb.8
     
ka04W00000148eeQAA_0EM440000002GWB.png
  • Click the Add Event button
  • Click the Browse button to select the event enumeration class: EnumServletEvents
  • For the dropdown Event to trigger when menu element is selected, choose WebEventLogout
     
ka04W00000148eeQAA_0EM440000002GWD.png
  • Click OK, click Next, click Finish
  • Save changes to the -1(Default Page)
  • Restart the Web Server. Notice that the Logout link will appear on the left dock toolbar as follows:
     
ka04W00000148eeQAA_0EM440000002GWH.png

 
PART II: Adding an image for the custom shortcut (normal view and collapsed view) - to add and format an icon for the custom shortcut, refer to KB44003 "Adding an Image for a New Shortcut to the Dropdown Menu through the WCE in MicroStrategy Web SDK 9.3.x Does not Add the Image Properly" 
 
PART III: Removing the custom logout from the Startburst/Logo dropdown list

  • When users click on the Starburst/Logo icon, the custom logout shortcut will appear as part of the list:
     
ka04W00000148eeQAA_0EM440000002GW6.png
  •  
    However, there is already a stock logout link for this drop down. The following steps will help remove the custom logout shortcut:
  • Navigate to CSS > Customized Web Styles > style
  • Right click on global.css > New Selector
  • Set selector to .mstrShortcutsListPopup a.customLogout
  • Keep All Pages radio button selected
  • Click OK
  • Navigate to CSS > Customized Web Styles > style > global.css
  • Right click on .mstrShortcutsListPopup a.customLogout > New Property
  • Set property to display
  • Set value to none !important
  • Keep All Pages radio button selected
  • Click OK

PART IV: Rearranging the list to have the Logout link as the last option

  • Notice that Preferences appears after the custom Logout link:
     
ka04W00000148eeQAA_0EM440000002GW8.png
  •  
    To rearrange the list to have Logout as the last option, follow these steps:
  • Minimize Eclipse
  • Navigate to the Strategy Web directory ..\MicroStrategy\plugins\_Interface\jsp
  • Copy Menu_DocLeft.jsp and save it to ..\MicroStrategy\plugins\plugin_name\style\jsp
  • Maximize or re-open Eclipse
  • On the Application Settings tab, navigate to Strategy Web Configuration > Pages
  • Double click on desktop(Desktop), the editor will open
  • On the template properties tab, for the Default page template, right click on the dockleft > Choose a new file
     
ka04W00000148eeQAA_0EM440000002GWI.png
  • Select the Menu_DocLeft.jsp from ..\MicroStrategy\plugins\plugin_name\style\jsp
  • Save the changes to the desktop(Desktop) page
  • Right click on dockleft > Edit current file, the Menu_DocLeft.jsp will open in Eclipse
  • Look for the following lines of code:
    
    <web:shortcutOptions type="toolbar" shortcutClass="mstrMenuItem" shortcutSelectedClass="mstrMenuItemSelected">
    	<web:shortcutElement />
    </web:shortcutOptions>
    
    <web:ifFeature name="preferences"><web:then>
    	<web:shortcutOptions type="tools" shortcutClass="mstrMenuItem" shortcutSelectedClass="mstrMenuItem">
    		<web:shortcutElement />
    	</web:shortcutOptions>
    </web:then></web:ifFeature>

     
  • Rearrange the lines of code to now look as follows:


    
    <web:ifFeature name="preferences"><web:then>
    	<web:shortcutOptions type="tools" shortcutClass="mstrMenuItem" shortcutSelectedClass="mstrMenuItem">
    		<web:shortcutElement />
    	</web:shortcutOptions>
    
    </web:then></web:ifFeature>
    
    <web:shortcutOptions type="toolbar" shortcutClass="mstrMenuItem" shortcutSelectedClass="mstrMenuItemSelected">
    	<web:shortcutElement />
    </web:shortcutOptions>

     


  • Save the changes
  • Restart the Web Server.  The shortcut list will now appear as follows:
     
ka04W00000148eeQAA_0EM440000002GWF.png
  •  
    Note: Applying the above changes to the -1(Default Page) will result in the shortcuts to NOT rearrange properly.  Do not make the changes in above on the -1(Default Page).
     
  • Steps 1 – 15 will only apply to the Desktop page.  For the rearranged shortcuts to appear on all pages, be sure to apply ONLY steps 6-10 to these pages:
    • shared(Shared Reports)
    • my(My Reports)
    • historyList(History List)
    • mySubs(My Subscriptions)
    • search(Search Page)
  • Restart the Web Server 

 
The example provided in this document is provided “as-is” to the user and assumes that the user:

  • Can program, compile (e.g. javac, jikes, etc.), and execute Java programs
  • Can configure environment variables (e.g. JAR files, property files, etc.)
  • Have all the necessary tools to create Java applications (JDK, IDE, etc.)
  • Has access to the Strategy SDK documentation.
  • Has read the customization warning at the bottom of this document

 
PREREQUISITES: 
For the sample to work, the Strategy Web JAR files must be accessible by the Java Runtime
Environment. The Strategy Web JAR files can be found under:

  • Strategy Web Universal (JSP): {web_root}/WEB-INF/lib directory.
  • Strategy Web (.NET): Program Files\Common Files\Strategy directory.

Note:
More elaborate programs will require additional library files and are out of the scope of this document.
 
ADDITIONAL INFORMATION:
The Strategy SDK allows you to customize the standard Strategy Web interface, and extend and integrate the Strategy business intelligence functionality into other applications. However, before changing the way Strategy Web products look or behave, it is helpful to understand how the application is built. For more information regarding the Strategy Web architecture or the process of customizing Strategy Web, please refer to Strategy Developer Zone (https://community.strategy.com/topic/0TO44000000FliLGAS/sdk).
 
To access the Strategy Developer Zone, you must have access to the Strategy Knowledge Base, you must have purchased the Strategy SDK, and you must be current on your Strategy maintenance agreement. If you are a US-based business and believe that you satisfy all three of these conditions but you do not have access to the Strategy Developer Zone, please contact Strategy Technical Support at support@microstrategy.com or at (703) 848-8700. If you are an international business, please contact Strategy Technical Support at the appropriate email address or phone number found at https://www.microstrategy.com/en/support/contact-support.
 
CUSTOMIZATION WARNING:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.


Comment

0 comments

Details

Knowledge Article

Published:

June 12, 2017

Last Updated:

January 4, 2018