McDewey

Multi-vendor documentation library · semantic search · MCP endpoint at /mcp

Page 402

↗ View in doc context
page
402
source
finesse/v12.5/developer-guide/developer-guide.md
chunk_id
finesse::v12.5::developer-guide::developer-guide::386

</Content> </Module> Note that for each User Preference, “hangman variables” can be substituted into supported gadget specification fields. Hangman variables are of the form <TYPE>_<ID>, and are replaced with string values. For each provided User Pref with key foo and value bar, hangman expansion UP_foo = bar. Hence, in the above code user preference scheme is available as UP_scheme. Similarly, for other User Preferences the hangman variables are dynamically substituted. Also, as the datatype value is specified as hidden, the user preferences pop up for the agent to enter their own data does not show up on the gadget. User preferences are accessed from your gadget using the user preferences JavaScript API, for example: <script type="text/javascript"> var prefs = new gadgets.Prefs(); var someStringPref = prefs.getString("StringPrefName"); var someIntPref = prefs.getInt("IntPrefName"); var someBoolPref = prefs.getBool("BoolPrefName"); </script> Gadget JavaScript Contains the business logic for the gadget. It can be written inside the gadget XML under the content section or an external JavaScript file can be created which can then be referred to using the src attribute in the <script> tag. Gadget CSS Contains the complete styling of the gadget. Similar to the JavaScript, CSS can also be referred to as an external file using href attribute in <link> tag. Gadget Behavior Rendering a gadget at the page level removes the title bar from the gadget layout. Components Components are simple scripts that are loaded into the desktop directly at predefined positions as directed by the layout, without an enclosing frame and its document. Components have been introduced in the desktop to overcome a few rendering limitations and performance considerations inherent to gadgets. Components are listed in the desktop layout using the <component> tag. Currently, the layout validations prevent custom components from being created. Hence, only default components are allowed in the desktop layouts. The default desktop functionalities are currently registered as components to provide flexibility and to reduce the load on the server. Simple Example Gadget Do the following to create and deploy a gadget: • Use any text editor to write your gadget specification. • Host the gadget on any web server. See Enable or Reset 3rdpartygadget Account, on page 409. • Add the gadget to the Finesse Container which can run gadgets. See Upload Third-Party Gadgets, on page 410. Cisco Finesse Web Services Developer and JavaScript Guide, Release 12.5(1) 386 Finesse Desktop Gadget Development Simple Example Gadget