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

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

book

Article ID: 57272

calendar_today

Updated On:

Products

Spectrum

Issue/Introduction

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' 

Environment

Release: Any
Component:

Resolution

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://<hostName>?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

Please reference the "OneClick Customization" section of the documentation for more information.