Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
72:custom_report_tipsandtricks_setting_data [2019/02/07 13:48] – created ext-bkkr | 72:custom_report_tipsandtricks_setting_data [2019/03/08 18:46] – ext-bkkr | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Setting Data Source Login Credentials with XML File ====== | ====== Setting Data Source Login Credentials with XML File ====== | ||
+ | To configure the Stages Data Source credentials like server url, user name and password it is recommended to use the following XML based method. | ||
+ | |||
+ | // | ||
+ | |||
+ | 1. Create an XML file with the name PkitMetrics.xml with the following content: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 2. Change the value of the serverUrl to your Stages server URL. | ||
+ | |||
+ | 3. Save the PkitMetrics.xml in the following directory: .../ | ||
+ | |||
+ | 4. Change username and password | ||
+ | |||
+ | 5. Copy the following Data Source beforeOpen script. | ||
+ | |||
+ | < | ||
+ | importPackage( Packages.javax.xml.parsers); | ||
+ | importPackage( Packages.org.xml.sax); | ||
+ | importPackage( Packages.org.w3c.dom); | ||
+ | importPackage( Packages.java.io); | ||
+ | function load_document(file) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | function getTagValue(document, | ||
+ | nlist = document.getElementsByTagName(tagName); | ||
+ | | ||
+ | } | ||
+ | function find_config() { | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | PkitMetrics.xml", | ||
+ | " | ||
+ | ); | ||
+ | for (var i=0; i< | ||
+ | { | ||
+ | | ||
+ | if (conf.exists()) | ||
+ | { | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | throw " | ||
+ | } | ||
+ | my_conf = find_config(); | ||
+ | doc = load_document(my_conf); | ||
+ | this.setExtensionProperty(" | ||
+ | this.setExtensionProperty(" | ||
+ | this.setExtensionProperty(" | ||
+ | reportContext.setGlobalVariable(" | ||
+ | </ | ||