MicroStrategy SDK - Web Features

microstrategy-sdk

https://lw.microstrategy.com/msdz/MSDL/_CurrentGARelease/docs/projects/WebSDK/default.htm#topics/objbeans/Understanding_Web_Features.htm?Highlight=report
https://lw.microstrategy.com/msdz/MSDL/_CurrentGARelease/docs/projects/WebSDK/default.htm#topics/objbeans/Web_Feature_Examples.htm?Highlight=report
https://lw.microstrategy.com/msdz/MSDL/_CurrentGARelease/docs/projects/WebSDK/default.htm#topics/bestpract/BP_Use_privileges_and_Web_features.htm?Highlight=report

What is Web Feature?

I NEED TO COMPLETE THIS.

Other information on Web Feature:

<page ... name="welcome">
...
  <javascripts>
    <javascript event="customWelcomePageOutput" javascript-code="alert('Welcome, Administrator');" feature-id="administrator" name="WelcomeMessage"/>
    <javascript event="customWelcomePageOutput" javascript-code="alert('Remember to check alerts');" feature-id="administrator" name="AlertReminder"/>
    <javascript event="onload" javascript-code="alert('You have returned to the Welcome page');" feature-id="administrator" name="onload"/>
    <javascript event="onunload" javascript-code="alert('You are now leaving the Welcome page');" feature-id="administrator" name="onUnload"/>
  </javascripts>
  ...
</page>

In the code sample above, the JavaScript is executed only if the user has administrative privileges—indicated by the feature-id attribute being set to "administrator". In this example, the check is made on the "welcome" page, which means that the user has already logged in. The feature-id check works correctly in this case because, once a user has logged in, MicroStrategy Web has knowledge of user privileges. However, if this feature-id check were made on a page that did not require login AND the user was not already logged in, the check would not necessarily work as expected. Without knowledge of user privileges (because the user is not logged in), MicroStrategy Web would not be able to confirm the feature-id attribute and would return the default value of "true". As a result, the JavaScript would be executed for any user—regardless of whether (s)he has administrative privileges. In order to test for this case and have the JavaScript be executed only for an administrative-level user, you would need to add the following code (in the appropriate template or page-section file) around the <web:javascript> tag(s).

See the microstrategy-sdk-javascript page and search for feature-id.

How can we check for web feature inside a JSP file?

<web:ifFeature name="!mobile-server">
    <web:then>
        <web:displayBean bean="pathBean" styleName="PathStyle"/>    
    </web:then>
    <web:else>   
        <div class="mstrPathText">
            <span class="mstrPathLast"><web:descriptor key="mstrWeb.1142" desc="About"/></span>
        </div>
    </web:else>
</web:ifFeature>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License