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

KB13827: Which preferences should be set on the session object when session is created in an external application or via getWebIServerSession method of External Security Module (ESM) in MicroStrategy SDK 9.x?


Community Admin

• Strategy


A MicroStrategy Intelligence Server session can be created via Web APIs, either embedded into portal application or through an External Security Module (ESM) plug-in to MicroStrategy Web or Web Universal. Every time the session is created explicitly, specific user and project level preferences have to be set directly on the new session object as session flags or through public methods. These preferences will not be read from User or Project level preferences.

A Strategy Intelligence Server session can be created via Web APIs, either embedded into portal application or through an External Security Module (ESM) plug-in to Strategy Web or Web Universal. Every time the session is created explicitly, specific user and project level preferences have to be set directly on the new session object as session flags or through public methods. These preferences will not be read from User or Project level preferences.
 
NOTE: An External Security Module session is created explicitly when getWebIServerSession method is implemented.
 
Assume that the session is created using the following calls:
 
WebObjectsFactory factory=WebObjectsFactory.getInstance();
WebIServerSession serverSession=factory.getIServerSession();
The following preferences need to be set on serverSession. Otherwise, the default values will be applied as explained in javadocs for IDSSXMLServerSession in the Strategy Developer Library.
 

  • User Language and Number and Date Format locales. Use:
    serverSession.setDisplayLocale(LocaleInfo.getInstance(localeID).getLocale());
    serverSession.setLocale(LocaleInfo.getInstance(localeID).getLocale());
  • where localeID is an integer representation of user locale.
     
ka04W000000Oey0QAC_0EM440000002H0W.jpeg
  •  
    Locale ID can be determined from the browser header 'Accept-Language' or from the user's preferences. In order to read locale from the user's preferences, additional logic has to be implemented in getWebIServerSession method. In order to read user preferences, the session has to be already established. In order to set all preferences listed in this technical note on active session, the session has to be reconnected for new settings to take effect. If the user's locale preferences are set to Default, then the locale has to be obtained from the browser's 'Accept-Language' header. The header value needs to be parsed to returned valid locale.
     
  • Report/document working set in Project Defaults -> History List. Use:
    serverSession.setRegularWorkingSetSize(newSize);
  • where newSize is an integer desired by the user.
     
ka04W000000Oey0QAC_0EM440000002H0V.jpeg
  • Search working set in Project Defaults -> General. Use:
    serverSession.setSearchWorkingSetSize(newSize);
  • where newSize is an integer desired by the user.
     
ka04W000000Oey0QAC_0EM440000002H0Y.jpeg
  • Security logout options. These have to be set as a bitwise OR (|) or bitwise AND (&) of EnumDSSXMLSessionFlags. For instance, in order to set 'Cancel this session's pending requests on close' and 'Delete Read Messages from History List on close' to 'No' use:
    int sessionFlags = serverSession.getSessionFlags();
    serverSession.setSessionFlags(sessionFlags & ~(EnumDSSXMLSessionFlags.DssXmlSessionDeleteReadMsgsOnClose | EnumDSSXMLSessionFlags.DssXmlSessionCancelActiveJobsOnClose) );
ka04W000000Oey0QAC_0EM440000002H0T.jpeg
  •  
    The security logout options should not be visible to the user because changes to their values made in the Strategy Web interface will never be applied. The values set on the session object always take precedence.
     
ka04W000000Oey0QAC_0EM440000002H0U.jpeg

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 23, 2017

Last Updated:

June 23, 2017