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

Document ID : KB000057272
Last Modified Date : 10/12/2018
Show Technical Document Details
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' 

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:
Please reference the "OneClick Customization" section of the documentation for more information.

https://docops.ca.com/ca-spectrum/10-2-3/en/customizing/oneclick-customization