From aad26dd1b9a1f63deb2923fb2b6d0576e458fd36 Mon Sep 17 00:00:00 2001
From: anthomba-tibco <73111464+anthomba-tibco@users.noreply.github.com>
Date: Wed, 21 Oct 2020 15:30:56 +0530
Subject: [PATCH 01/60] Create mainJS.js
---
mainJS/mainJS.js | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 mainJS/mainJS.js
diff --git a/mainJS/mainJS.js b/mainJS/mainJS.js
new file mode 100644
index 0000000..2037f03
--- /dev/null
+++ b/mainJS/mainJS.js
@@ -0,0 +1,63 @@
+
+var initializeVisualize = function(initialize, authentication, configPath) {
+//load the config
+ var path = configPath ? configPath : '../../../../config/config.json';
+ jQuery.getJSON(path)
+ .done(function(jrsConfig) {
+ //console.log(data);
+ options = {
+ dataType: "script",
+ cache: jrsConfig.cacheVisualizeJS || false,
+ url: jrsConfig.visualizeJS
+ };
+
+ // load visualize.js
+ jQuery.ajax( options ).done( function() {
+ // themeHref is a global variable created by loading visualize from a JRS instance
+ // initially, it is something like: http://localhost:8080/jasperserver-pro/_themes/19BF127D
+ if (themeHref.indexOf("/") === 0) {
+ themeHref = jrsConfig.jrsTheme + themeHref;
+ }
+ if (typeof themeHref !== 'undefined') {
+ if (themeHref.indexOf("http") == 0) {
+ if (jrsConfig.jrsHostname.indexOf("/") == 0) {
+ // assumes that visualize javascript was loaded via a relative jrsUrl like example above,
+ // not a full URL like http://host:port/jasperserver-pro
+ // let's make it relative!!!!
+ var posOfRelative = themeHref.indexOf(jrsConfig.jrsHostname);
+ if (posOfRelative > 0) {
+ themeHref = themeHref.substring(posOfRelative);
+ }
+ } else if (jrsConfig.jrsHostname.indexOf("https:") == 0 && themeHref.indexOf("http:") == 0 ) {
+ // JRS is reached via a full URL
+ // we have to switch the protocols, since visualize generated the wrong theme URL
+ themeHref = "https:" + themeHref.substring( "http:".length );
+ }
+ }
+ } else {
+ // visualize.js script not loaded from a JRS instance
+ // point to theme installed in web app
+ themeHref = "theme";
+ }
+
+ visualize({
+ server: jrsConfig.jrsHostname,
+ // assume if a theme is not set in the config,
+ // set it up based on the above process
+ theme: {
+ href: themeHref || jrsConfig.theme
+ },
+ auth: authentication || jrsConfig.jrsAuth
+ }, function(v) {
+ initialize(jrsConfig, v);
+ }, function(err) {
+ console.log(err);
+ alert(err.message);
+ });
+ });
+ })
+ .fail( function (jqxhr, textStatus, error ) {
+ var err = textStatus + ", " + error;
+ console.log( "config.json Request Failed: " + err );
+ });
+}
From 820555166809ee0872295c6915d662fe41a431c7 Mon Sep 17 00:00:00 2001
From: anthomba-tibco <73111464+anthomba-tibco@users.noreply.github.com>
Date: Wed, 21 Oct 2020 15:31:58 +0530
Subject: [PATCH 02/60] Create config.json
---
config/config.json | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 config/config.json
diff --git a/config/config.json b/config/config.json
new file mode 100644
index 0000000..f77e466
--- /dev/null
+++ b/config/config.json
@@ -0,0 +1,13 @@
+{
+ "visualizeJS": "https://infra-platforms-phase2-11723-rsarda.pfa.jaspersoft.com/jasperserver-pro/client/visualize.js",
+ "cacheVisualizeJS": true,
+ "visualizeJSFromServer": "https://infra-platforms-phase2-11723-rsarda.pfa.jaspersoft.com/jasperserver-pro/client/visualize.js",
+ "jrsHostname": "https://infra-platforms-phase2-11723-rsarda.pfa.jaspersoft.com/jasperserver-pro",
+ "jrsTheme": "https://infra-platforms-phase2-11723-rsarda.pfa.jaspersoft.com",
+ "jrsAuth": {
+ "name": "jasperadmin",
+ "password": "jasperadmin",
+ "organization": "organization_1"
+ },
+ "theme": "theme"
+}
From ec7b076dce80a500bb8fca73f7654d756ab4ab4c Mon Sep 17 00:00:00 2001
From: anthomba-tibco <73111464+anthomba-tibco@users.noreply.github.com>
Date: Wed, 21 Oct 2020 15:33:41 +0530
Subject: [PATCH 03/60] Update main.html
---
UrbanRoast-tutorial/modules/module1/1-1/main.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/UrbanRoast-tutorial/modules/module1/1-1/main.html b/UrbanRoast-tutorial/modules/module1/1-1/main.html
index 2debf35..cda510c 100644
--- a/UrbanRoast-tutorial/modules/module1/1-1/main.html
+++ b/UrbanRoast-tutorial/modules/module1/1-1/main.html
@@ -46,8 +46,8 @@
crossorigin="">
-
+