How to pass the Spectrum OneClick User name as a script variable for a custom menu pick

Document ID : KB000057272
Last Modified Date : 14/02/2018
Show Technical Document Details

SUMMARY:  How to pass the Spectrum OneClick User name as a script variable for a custom menu pick

I am working with creating some custom menu items in the 'custom-menu-config.xml' and trying to find a way to pass the current users' full name attribute as a script variable using 'launch-web-server-script' 

 

INSTRUCTIONS:  You can pass the current user’s OneClick username to an application, web browser, or executable requiring a username. Use the following expression to specify the logged-in user’s username:

 

<param>

<expression>

com.aprisma.spectrum.app.util.context.DefaultApplicationContext.getGlobalParameter(com.aprisma.spectrum.app.util.context.ApplicationContext.USER_PARAMETER_NAME)

</expression>

</param>

 

Example: Pass Username to Browser

The following example launches a browser to a specified URL and passes the username to the browser.

 

<launch-browser>

<url> http://acme.com?user={0}</url>

<param>

<expression>

com.aprisma.spectrum.app.util.context.DefaultApplicationContext.getGlobalParameter(com.aprisma.spectrum.app.util.context.ApplicationContext.USER_PARAMETER_NAME)

</expression>

</param>

</launch-browser>

 

ADDITIONAL INFORMATION:  For more information on OneClick custom menus, please reference the "OneClick Customization Guide" for Spectrum 9.4 and below and the "OneClick Customization" section in the Spectrum 10 documentation.