MicroStrategy SDK - Web Features



What is Web Feature?


Other information on Web Feature:

<page ... name="welcome">
    <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"/>

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:displayBean bean="pathBean" styleName="PathStyle"/>    
        <div class="mstrPathText">
            <span class="mstrPathLast"><web:descriptor key="mstrWeb.1142" desc="About"/></span>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License