From cc3f94b74397f751a58cbc05c033e715f5a2071a Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Thu, 19 Mar 2020 16:39:11 +0300 Subject: [PATCH 01/12] Remove couchdb configuration from postgres profile configuration --- modules/core/persistence_postgres.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/core/persistence_postgres.xml b/modules/core/persistence_postgres.xml index 1b1c07d..f6e7f34 100644 --- a/modules/core/persistence_postgres.xml +++ b/modules/core/persistence_postgres.xml @@ -50,16 +50,4 @@ value="org.opensrp.repository.postgres.mapper;org.opensrp.repository.postgres.mapper.custom" /> - - - - - - - - - - - - From 62265f91e31242a28d8620ffa5ff843465ce5e9a Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Thu, 19 Mar 2020 18:46:04 +0300 Subject: [PATCH 02/12] Excluse connector beans during org.opensrp component scan --- modules/core/persistence_postgres.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/persistence_postgres.xml b/modules/core/persistence_postgres.xml index f6e7f34..beccbcb 100644 --- a/modules/core/persistence_postgres.xml +++ b/modules/core/persistence_postgres.xml @@ -21,6 +21,8 @@ expression="org.opensrp.service.FormSubmissionDataMigrationService" /> + From a49009da175a6432654f4c6180b6c679d5b8d6f3 Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Thu, 19 Mar 2020 18:54:33 +0300 Subject: [PATCH 03/12] Import connector bean depending on profile --- .../applicationContext-connector.xml | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/modules/connector/applicationContext-connector.xml b/modules/connector/applicationContext-connector.xml index 79e3337..aedf6cf 100644 --- a/modules/connector/applicationContext-connector.xml +++ b/modules/connector/applicationContext-connector.xml @@ -3,9 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> @@ -17,11 +17,34 @@ - + + + + + + - - - - + + + + + + + + + + + + + + + + + + From a48db27ecd7c249ad0f24692503fa255a7b77655 Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 14:51:45 +0300 Subject: [PATCH 04/12] Dont load activemq properties, load latest beans in imported libs --- modules/core/applicationContext-opensrp.xml | 9 ++++----- modules/core/persistence_postgres.xml | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/core/applicationContext-opensrp.xml b/modules/core/applicationContext-opensrp.xml index 6c49ce2..53b9180 100644 --- a/modules/core/applicationContext-opensrp.xml +++ b/modules/core/applicationContext-opensrp.xml @@ -3,14 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xmlns:p="http://www.springframework.org/schema/p" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd - http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.3.xsd"> + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd + http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"> - diff --git a/modules/core/persistence_postgres.xml b/modules/core/persistence_postgres.xml index beccbcb..cfe816f 100644 --- a/modules/core/persistence_postgres.xml +++ b/modules/core/persistence_postgres.xml @@ -2,9 +2,9 @@ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> Date: Fri, 20 Mar 2020 14:57:22 +0300 Subject: [PATCH 05/12] Strip out configs for removed/moved dependencies --- build/maven.properties | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/build/maven.properties b/build/maven.properties index 68d6a6d..1bcf21b 100644 --- a/build/maven.properties +++ b/build/maven.properties @@ -1,17 +1,6 @@ #database configuration that is not likely to change unless massive refactoring couchdb.db.opensrp=opensrp -couchdb.db.form=opensrp-form couchdb.db.atomfeed=atomfeed -couchdb.db.mcts=opensrp-mcts -couchdb.db.motech-scheduletracking=motech-scheduletracking-api -couchdb.db.error=opensrp-errortrace - - -db.quartz=motechquartz -db.reporting=opensrp -db.reporting.report=report -db.reporting.anm=anm_report - #selenium test.driver=htmlunit From 077718307e90629c0c069ac650ce5ee7a833c1aa Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 14:57:58 +0300 Subject: [PATCH 06/12] Strip out couchdb lucene configs --- modules/core/queries/lucene-client-query | 38 ------------------- modules/core/queries/lucene-event-query | 22 ----------- .../core/queries/lucene-formsubmission-query | 38 ------------------- 3 files changed, 98 deletions(-) delete mode 100644 modules/core/queries/lucene-client-query delete mode 100644 modules/core/queries/lucene-event-query delete mode 100644 modules/core/queries/lucene-formsubmission-query diff --git a/modules/core/queries/lucene-client-query b/modules/core/queries/lucene-client-query deleted file mode 100644 index 4069f24..0000000 --- a/modules/core/queries/lucene-client-query +++ /dev/null @@ -1,38 +0,0 @@ -function (doc) { - if(doc.type !== 'Client') return null; - var docl = new Array(); - var len = doc.addresses ? doc.addresses.length : 1; - for(var al = 0; al < len; al++) { - var arr1 = ['firstName', 'middleName', 'lastName', 'gender']; - var arr2 = ['addressType', 'country', 'stateProvince', 'cityVillage', 'countyDistrict', 'subDistrict', 'town', 'subTown']; - var ret = new Document(); - for(var i in arr1) { - ret.add(doc[arr1[i]], {'field' : arr1[i]}); - } - for(var key in doc.attributes) { - ret.add(doc.attributes[key], {'field' : key}); - } - if(doc.addresses) { - var ad = doc.addresses[al]; - if(ad){ - for(var i in arr2) { - ret.add(ad[arr2[i]], {'field' : arr2[i]}); - } - } - - } - var bd = doc.birthdate.substring(0, 19); - ret.add(bd, {'field' : 'birthdate','type' : 'date'}); - - var crd = doc.dateCreated.substring(0, 19); - ret.add(crd, {'field' : 'lastEdited','type' : 'date'}); - - if(doc.dateEdited){ - var led = doc.dateEdited.substring(0, 19); - ret.add(led, {'field' : 'lastEdited','type' : 'date'}); - } - - docl.push(ret); - } - return docl; -} \ No newline at end of file diff --git a/modules/core/queries/lucene-event-query b/modules/core/queries/lucene-event-query deleted file mode 100644 index 54d1138..0000000 --- a/modules/core/queries/lucene-event-query +++ /dev/null @@ -1,22 +0,0 @@ -function(doc) { - if(doc.type !== 'Event') return null; - var arr1 = ['baseEntityId','eventType','entityType','providerId','locationId']; - var ret = new Document(); - for (var i in arr1){ - ret.add(doc[arr1[i]], {'field':arr1[i]}); - } - if(doc.eventDate){ - var bd=doc.eventDate.substring(0,19); - ret.add(bd, {'field':'eventDate','type':'date'}); - } - - var crd = doc.dateCreated.substring(0, 19); - ret.add(crd, {'field' : 'lastEdited','type' : 'date'}); - - if(doc.dateEdited){ - var led = doc.dateEdited.substring(0, 19); - ret.add(led, {'field' : 'lastEdited','type' : 'date'}); - } - - return ret; - } \ No newline at end of file diff --git a/modules/core/queries/lucene-formsubmission-query b/modules/core/queries/lucene-formsubmission-query deleted file mode 100644 index 4069f24..0000000 --- a/modules/core/queries/lucene-formsubmission-query +++ /dev/null @@ -1,38 +0,0 @@ -function (doc) { - if(doc.type !== 'Client') return null; - var docl = new Array(); - var len = doc.addresses ? doc.addresses.length : 1; - for(var al = 0; al < len; al++) { - var arr1 = ['firstName', 'middleName', 'lastName', 'gender']; - var arr2 = ['addressType', 'country', 'stateProvince', 'cityVillage', 'countyDistrict', 'subDistrict', 'town', 'subTown']; - var ret = new Document(); - for(var i in arr1) { - ret.add(doc[arr1[i]], {'field' : arr1[i]}); - } - for(var key in doc.attributes) { - ret.add(doc.attributes[key], {'field' : key}); - } - if(doc.addresses) { - var ad = doc.addresses[al]; - if(ad){ - for(var i in arr2) { - ret.add(ad[arr2[i]], {'field' : arr2[i]}); - } - } - - } - var bd = doc.birthdate.substring(0, 19); - ret.add(bd, {'field' : 'birthdate','type' : 'date'}); - - var crd = doc.dateCreated.substring(0, 19); - ret.add(crd, {'field' : 'lastEdited','type' : 'date'}); - - if(doc.dateEdited){ - var led = doc.dateEdited.substring(0, 19); - ret.add(led, {'field' : 'lastEdited','type' : 'date'}); - } - - docl.push(ret); - } - return docl; -} \ No newline at end of file From 82d834c0d5fa91f05da941c43c6548c796c90fa6 Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 15:00:33 +0300 Subject: [PATCH 07/12] Strip out ziggy js --- modules/core/ziggy/ziggy.min.js | 1085 ------------------------------- 1 file changed, 1085 deletions(-) delete mode 100644 modules/core/ziggy/ziggy.min.js diff --git a/modules/core/ziggy/ziggy.min.js b/modules/core/ziggy/ziggy.min.js deleted file mode 100644 index 59a345e..0000000 --- a/modules/core/ziggy/ziggy.min.js +++ /dev/null @@ -1,1085 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.9 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -var requirejs, require, define; -(function(global) { - function isFunction(e) { - return ostring.call(e) === "[object Function]" - } - - function isArray(e) { - return ostring.call(e) === "[object Array]" - } - - function each(e, t) { - if (e) { - var n; - for (n = 0; n < e.length; n += 1) - if (e[n] && t(e[n], n, e)) break - } - } - - function eachReverse(e, t) { - if (e) { - var n; - for (n = e.length - 1; n > -1; n -= 1) - if (e[n] && t(e[n], n, e)) break - } - } - - function hasProp(e, t) { - return hasOwn.call(e, t) - } - - function getOwn(e, t) { - return hasProp(e, t) && e[t] - } - - function eachProp(e, t) { - var n; - for (n in e) - if (hasProp(e, n) && t(e[n], n)) break - } - - function mixin(e, t, n, r) { - return t && eachProp(t, function(t, i) { - if (n || !hasProp(e, i)) r && typeof t != "string" ? (e[i] || (e[i] = {}), mixin(e[i], t, n, r)) : e[i] = t - }), e - } - - function bind(e, t) { - return function() { - return t.apply(e, arguments) - } - } - - function scripts() { - return document.getElementsByTagName("script") - } - - function defaultOnError(e) { - throw e - } - - function getGlobal(e) { - if (!e) return e; - var t = global; - return each(e.split("."), function(e) { - t = t[e] - }), t - } - - function makeError(e, t, n, r) { - var i = new Error(t + "\nhttp://requirejs.org/docs/errors.html#" + e); - return i.requireType = e, i.requireModules = r, n && (i.originalError = n), i - } - - function newContext(e) { - function v(e) { - var t, n; - for (t = 0; e[t]; t += 1) { - n = e[t]; - if (n === ".") e.splice(t, 1), t -= 1; - else if (n === "..") { - if (t === 1 && (e[2] === ".." || e[0] === "..")) break; - t > 0 && (e.splice(t - 1, 2), t -= 2) - } - } - } - - function m(e, t, n) { - var r, i, s, u, a, f, l, c, h, p, d, m = t && t.split("/"), - g = m, - y = o.map, - b = y && y["*"]; - e && e.charAt(0) === "." && (t ? (getOwn(o.pkgs, t) ? g = m = [t] : g = m.slice(0, m.length - 1), e = g.concat(e.split("/")), v(e), i = getOwn(o.pkgs, r = e[0]), e = e.join("/"), i && e === r + "/" + i.main && (e = r)) : e.indexOf("./") === 0 && (e = e.substring(2))); - if (n && y && (m || b)) { - u = e.split("/"); - for (a = u.length; a > 0; a -= 1) { - l = u.slice(0, a).join("/"); - if (m) - for (f = m.length; f > 0; f -= 1) { - s = getOwn(y, m.slice(0, f).join("/")); - if (s) { - s = getOwn(s, l); - if (s) { - c = s, h = a; - break - } - } - } - if (c) break; - !p && b && getOwn(b, l) && (p = getOwn(b, l), d = a) - }!c && p && (c = p, h = d), c && (u.splice(0, h, c), e = u.join("/")) - } - return e - } - - function g(e) { - isBrowser && each(scripts(), function(t) { - if (t.getAttribute("data-requiremodule") === e && t.getAttribute("data-requirecontext") === r.contextName) return t.parentNode.removeChild(t), !0 - }) - } - - function y(e) { - var t = getOwn(o.paths, e); - if (t && isArray(t) && t.length > 1) return t.shift(), r.require.undef(e), r.require([e]), !0 - } - - function b(e) { - var t, n = e ? e.indexOf("!") : -1; - return n > -1 && (t = e.substring(0, n), e = e.substring(n + 1, e.length)), [t, e] - } - - function w(e, t, n, i) { - var s, o, u, a, f = null, - l = t ? t.name : null, - h = e, - v = !0, - g = ""; - return e || (v = !1, e = "_@r" + (p += 1)), a = b(e), f = a[0], e = a[1], f && (f = m(f, l, i), o = getOwn(c, f)), e && (f ? o && o.normalize ? g = o.normalize(e, function(e) { - return m(e, l, i) - }) : g = m(e, l, i) : (g = m(e, l, i), a = b(g), f = a[0], g = a[1], n = !0, s = r.nameToUrl(g))), u = f && !o && !n ? "_unnormalized" + (d += 1) : "", { - prefix: f, - name: g, - parentMap: t, - unnormalized: !!u, - url: s, - originalName: h, - isDefine: v, - id: (f ? f + "!" + g : g) + u - } - } - - function E(e) { - var t = e.id, - n = getOwn(u, t); - return n || (n = u[t] = new r.Module(e)), n - } - - function S(e, t, n) { - var r = e.id, - i = getOwn(u, r); - hasProp(c, r) && (!i || i.defineEmitComplete) ? t === "defined" && n(c[r]) : (i = E(e), i.error && t === "error" ? n(i.error) : i.on(t, n)) - } - - function x(e, t) { - var n = e.requireModules, - r = !1; - t ? t(e) : (each(n, function(t) { - var n = getOwn(u, t); - n && (n.error = e, n.events.error && (r = !0, n.emit("error", e))) - }), r || req.onError(e)) - } - - function T() { - globalDefQueue.length && (apsp.apply(l, [l.length - 1, 0].concat(globalDefQueue)), globalDefQueue = []) - } - - function N(e) { - delete u[e], delete a[e] - } - - function C(e, t, n) { - var r = e.map.id; - e.error ? e.emit("error", e.error) : (t[r] = !0, each(e.depMaps, function(r, i) { - var s = r.id, - o = getOwn(u, s); - o && !e.depMatched[i] && !n[s] && (getOwn(t, s) ? (e.defineDep(i, c[s]), e.check()) : C(o, t, n)) - }), n[r] = !0) - } - - function k() { - var e, n, i, u, f = o.waitSeconds * 1e3, - l = f && r.startTime + f < (new Date).getTime(), - c = [], - h = [], - p = !1, - d = !0; - if (t) return; - t = !0, eachProp(a, function(t) { - e = t.map, n = e.id; - if (!t.enabled) return; - e.isDefine || h.push(t); - if (!t.error) - if (!t.inited && l) y(n) ? (u = !0, p = !0) : (c.push(n), g(n)); - else if (!t.inited && t.fetched && e.isDefine) { - p = !0; - if (!e.prefix) return d = !1 - } - }); - if (l && c.length) return i = makeError("timeout", "Load timeout for modules: " + c, null, c), i.contextName = r.contextName, x(i); - d && each(h, function(e) { - C(e, {}, {}) - }), (!l || u) && p && (isBrowser || isWebWorker) && !s && (s = setTimeout(function() { - s = 0, k() - }, 50)), t = !1 - } - - function L(e) { - hasProp(c, e[0]) || E(w(e[0], null, !0)).init(e[1], e[2]) - } - - function A(e, t, n, r) { - e.detachEvent && !isOpera ? r && e.detachEvent(r, t) : e.removeEventListener(n, t, !1) - } - - function O(e) { - var t = e.currentTarget || e.srcElement; - return A(t, r.onScriptLoad, "load", "onreadystatechange"), A(t, r.onScriptError, "error"), { - node: t, - id: t && t.getAttribute("data-requiremodule") - } - } - - function M() { - var e; - T(); - while (l.length) { - e = l.shift(); - if (e[0] === null) return x(makeError("mismatch", "Mismatched anonymous define() module: " + e[e.length - 1])); - L(e) - } - } - var t, n, r, i, s, o = { - waitSeconds: 7, - baseUrl: "./", - paths: {}, - pkgs: {}, - shim: {}, - config: {} - }, - u = {}, - a = {}, - f = {}, - l = [], - c = {}, - h = {}, - p = 1, - d = 1; - return i = { - require: function(e) { - return e.require ? e.require : e.require = r.makeRequire(e.map) - }, - exports: function(e) { - e.usingExports = !0; - if (e.map.isDefine) return e.exports ? e.exports : e.exports = c[e.map.id] = {} - }, - module: function(e) { - return e.module ? e.module : e.module = { - id: e.map.id, - uri: e.map.url, - config: function() { - var t, n = getOwn(o.pkgs, e.map.id); - return t = n ? getOwn(o.config, e.map.id + "/" + n.main) : getOwn(o.config, e.map.id), t || {} - }, - exports: c[e.map.id] - } - } - }, n = function(e) { - this.events = getOwn(f, e.id) || {}, this.map = e, this.shim = getOwn(o.shim, e.id), this.depExports = [], this.depMaps = [], this.depMatched = [], this.pluginMaps = {}, this.depCount = 0 - }, n.prototype = { - init: function(e, t, n, r) { - r = r || {}; - if (this.inited) return; - this.factory = t, n ? this.on("error", n) : this.events.error && (n = bind(this, function(e) { - this.emit("error", e) - })), this.depMaps = e && e.slice(0), this.errback = n, this.inited = !0, this.ignore = r.ignore, r.enabled || this.enabled ? this.enable() : this.check() - }, - defineDep: function(e, t) { - this.depMatched[e] || (this.depMatched[e] = !0, this.depCount -= 1, this.depExports[e] = t) - }, - fetch: function() { - if (this.fetched) return; - this.fetched = !0, r.startTime = (new Date).getTime(); - var e = this.map; - if (!this.shim) return e.prefix ? this.callPlugin() : this.load(); - r.makeRequire(this.map, { - enableBuildCallback: !0 - })(this.shim.deps || [], bind(this, function() { - return e.prefix ? this.callPlugin() : this.load() - })) - }, - load: function() { - var e = this.map.url; - h[e] || (h[e] = !0, r.load(this.map.id, e)) - }, - check: function() { - if (!this.enabled || this.enabling) return; - var e, t, n = this.map.id, - i = this.depExports, - s = this.exports, - o = this.factory; - if (!this.inited) this.fetch(); - else if (this.error) this.emit("error", this.error); - else if (!this.defining) { - this.defining = !0; - if (this.depCount < 1 && !this.defined) { - if (isFunction(o)) { - if (this.events.error && this.map.isDefine || req.onError !== defaultOnError) try { - s = r.execCb(n, o, i, s) - } catch (u) { - e = u - } else s = r.execCb(n, o, i, s); - this.map.isDefine && (t = this.module, t && t.exports !== undefined && t.exports !== this.exports ? s = t.exports : s === undefined && this.usingExports && (s = this.exports)); - if (e) return e.requireMap = this.map, e.requireModules = this.map.isDefine ? [this.map.id] : null, e.requireType = this.map.isDefine ? "define" : "require", x(this.error = e) - } else s = o; - this.exports = s, this.map.isDefine && !this.ignore && (c[n] = s, req.onResourceLoad && req.onResourceLoad(r, this.map, this.depMaps)), N(n), this.defined = !0 - } - this.defining = !1, this.defined && !this.defineEmitted && (this.defineEmitted = !0, this.emit("defined", this.exports), this.defineEmitComplete = !0) - } - }, - callPlugin: function() { - var e = this.map, - t = e.id, - n = w(e.prefix); - this.depMaps.push(n), S(n, "defined", bind(this, function(n) { - var i, s, a, f = this.map.name, - l = this.map.parentMap ? this.map.parentMap.name : null, - c = r.makeRequire(e.parentMap, { - enableBuildCallback: !0 - }); - if (this.map.unnormalized) { - n.normalize && (f = n.normalize(f, function(e) { - return m(e, l, !0) - }) || ""), s = w(e.prefix + "!" + f, this.map.parentMap), S(s, "defined", bind(this, function(e) { - this.init([], function() { - return e - }, null, { - enabled: !0, - ignore: !0 - }) - })), a = getOwn(u, s.id), a && (this.depMaps.push(s), this.events.error && a.on("error", bind(this, function(e) { - this.emit("error", e) - })), a.enable()); - return - } - i = bind(this, function(e) { - this.init([], function() { - return e - }, null, { - enabled: !0 - }) - }), i.error = bind(this, function(e) { - this.inited = !0, this.error = e, e.requireModules = [t], eachProp(u, function(e) { - e.map.id.indexOf(t + "_unnormalized") === 0 && N(e.map.id) - }), x(e) - }), i.fromText = bind(this, function(n, s) { - var u = e.name, - a = w(u), - f = useInteractive; - s && (n = s), f && (useInteractive = !1), E(a), hasProp(o.config, t) && (o.config[u] = o.config[t]); - try { - req.exec(n) - } catch (l) { - return x(makeError("fromtexteval", "fromText eval for " + t + " failed: " + l, l, [t])) - } - f && (useInteractive = !0), this.depMaps.push(a), r.completeLoad(u), c([u], i) - }), n.load(e.name, c, i, o) - })), r.enable(n, this), this.pluginMaps[n.id] = n - }, - enable: function() { - a[this.map.id] = this, this.enabled = !0, this.enabling = !0, each(this.depMaps, bind(this, function(e, t) { - var n, s, o; - if (typeof e == "string") { - e = w(e, this.map.isDefine ? this.map : this.map.parentMap, !1, !this.skipMap), this.depMaps[t] = e, o = getOwn(i, e.id); - if (o) { - this.depExports[t] = o(this); - return - } - this.depCount += 1, S(e, "defined", bind(this, function(e) { - this.defineDep(t, e), this.check() - })), this.errback && S(e, "error", bind(this, this.errback)) - } - n = e.id, s = u[n], !hasProp(i, n) && s && !s.enabled && r.enable(e, this) - })), eachProp(this.pluginMaps, bind(this, function(e) { - var t = getOwn(u, e.id); - t && !t.enabled && r.enable(e, this) - })), this.enabling = !1, this.check() - }, - on: function(e, t) { - var n = this.events[e]; - n || (n = this.events[e] = []), n.push(t) - }, - emit: function(e, t) { - each(this.events[e], function(e) { - e(t) - }), e === "error" && delete this.events[e] - } - }, r = { - config: o, - contextName: e, - registry: u, - defined: c, - urlFetched: h, - defQueue: l, - Module: n, - makeModuleMap: w, - nextTick: req.nextTick, - onError: x, - configure: function(e) { - e.baseUrl && e.baseUrl.charAt(e.baseUrl.length - 1) !== "/" && (e.baseUrl += "/"); - var t = o.pkgs, - n = o.shim, - i = { - paths: !0, - config: !0, - map: !0 - }; - eachProp(e, function(e, t) { - i[t] ? t === "map" ? (o.map || (o.map = {}), mixin(o[t], e, !0, !0)) : mixin(o[t], e, !0) : o[t] = e - }), e.shim && (eachProp(e.shim, function(e, t) { - isArray(e) && (e = { - deps: e - }), (e.exports || e.init) && !e.exportsFn && (e.exportsFn = r.makeShimExports(e)), n[t] = e - }), o.shim = n), e.packages && (each(e.packages, function(e) { - var n; - e = typeof e == "string" ? { - name: e - } : e, n = e.location, t[e.name] = { - name: e.name, - location: n || e.name, - main: (e.main || "main").replace(currDirRegExp, "").replace(jsSuffixRegExp, "") - } - }), o.pkgs = t), eachProp(u, function(e, t) { - !e.inited && !e.map.unnormalized && (e.map = w(t)) - }), (e.deps || e.callback) && r.require(e.deps || [], e.callback) - }, - makeShimExports: function(e) { - function t() { - var t; - return e.init && (t = e.init.apply(global, arguments)), t || e.exports && getGlobal(e.exports) - } - return t - }, - makeRequire: function(t, n) { - function s(o, a, f) { - var l, h, p; - return n.enableBuildCallback && a && isFunction(a) && (a.__requireJsBuild = !0), typeof o == "string" ? isFunction(a) ? x(makeError("requireargs", "Invalid require call"), f) : t && hasProp(i, o) ? i[o](u[t.id]) : req.get ? req.get(r, o, t, s) : (h = w(o, t, !1, !0), l = h.id, hasProp(c, l) ? c[l] : x(makeError("notloaded", 'Module name "' + l + '" has not been loaded yet for context: ' + e + (t ? "" : ". Use require([])")))) : (M(), r.nextTick(function() { - M(), p = E(w(null, t)), p.skipMap = n.skipMap, p.init(o, a, f, { - enabled: !0 - }), k() - }), s) - } - return n = n || {}, mixin(s, { - isBrowser: isBrowser, - toUrl: function(e) { - var n, i = e.lastIndexOf("."), - s = e.split("/")[0], - o = s === "." || s === ".."; - return i !== -1 && (!o || i > 1) && (n = e.substring(i, e.length), e = e.substring(0, i)), r.nameToUrl(m(e, t && t.id, !0), n, !0) - }, - defined: function(e) { - return hasProp(c, w(e, t, !1, !0).id) - }, - specified: function(e) { - return e = w(e, t, !1, !0).id, hasProp(c, e) || hasProp(u, e) - } - }), t || (s.undef = function(e) { - T(); - var n = w(e, t, !0), - r = getOwn(u, e); - g(e), delete c[e], delete h[n.url], delete f[e], r && (r.events.defined && (f[e] = r.events), N(e)) - }), s - }, - enable: function(e) { - var t = getOwn(u, e.id); - t && E(e).enable() - }, - completeLoad: function(e) { - var t, n, r, i = getOwn(o.shim, e) || {}, - s = i.exports; - T(); - while (l.length) { - n = l.shift(); - if (n[0] === null) { - n[0] = e; - if (t) break; - t = !0 - } else n[0] === e && (t = !0); - L(n) - } - r = getOwn(u, e); - if (!t && !hasProp(c, e) && r && !r.inited) { - if (o.enforceDefine && (!s || !getGlobal(s))) { - if (y(e)) return; - return x(makeError("nodefine", "No define call for " + e, null, [e])) - } - L([e, i.deps || [], i.exportsFn]) - } - k() - }, - nameToUrl: function(e, t, n) { - var r, i, s, u, a, f, l, c, h; - if (req.jsExtRegExp.test(e)) c = e + (t || ""); - else { - r = o.paths, i = o.pkgs, a = e.split("/"); - for (f = a.length; f > 0; f -= 1) { - l = a.slice(0, f).join("/"), s = getOwn(i, l), h = getOwn(r, l); - if (h) { - isArray(h) && (h = h[0]), a.splice(0, f, h); - break - } - if (s) { - e === s.name ? u = s.location + "/" + s.main : u = s.location, a.splice(0, f, u); - break - } - } - c = a.join("/"), c += t || (/^data\:|\?/.test(c) || n ? "" : ".js"), c = (c.charAt(0) === "/" || c.match(/^[\w\+\.\-]+:/) ? "" : o.baseUrl) + c - } - return o.urlArgs ? c + ((c.indexOf("?") === -1 ? "?" : "&") + o.urlArgs) : c - }, - load: function(e, t) { - req.load(r, e, t) - }, - execCb: function(e, t, n, r) { - return t.apply(r, n) - }, - onScriptLoad: function(e) { - if (e.type === "load" || readyRegExp.test((e.currentTarget || e.srcElement).readyState)) { - interactiveScript = null; - var t = O(e); - r.completeLoad(t.id) - } - }, - onScriptError: function(e) { - var t = O(e); - if (!y(t.id)) return x(makeError("scripterror", "Script error for: " + t.id, e, [t.id])) - } - }, r.require = r.makeRequire(), r - } - - function getInteractiveScript() { - return interactiveScript && interactiveScript.readyState === "interactive" ? interactiveScript : (eachReverse(scripts(), function(e) { - if (e.readyState === "interactive") return interactiveScript = e - }), interactiveScript) - } - var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, version = "2.1.9", - commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, - cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, - jsSuffixRegExp = /\.js$/, - currDirRegExp = /^\.\//, - op = Object.prototype, - ostring = op.toString, - hasOwn = op.hasOwnProperty, - ap = Array.prototype, - apsp = ap.splice, - isBrowser = typeof window != "undefined" && typeof navigator != "undefined" && !!window.document, - isWebWorker = !isBrowser && typeof importScripts != "undefined", - readyRegExp = isBrowser && navigator.platform === "PLAYSTATION 3" ? /^complete$/ : /^(complete|loaded)$/, - defContextName = "_", - isOpera = typeof opera != "undefined" && opera.toString() === "[object Opera]", - contexts = {}, - cfg = {}, - globalDefQueue = [], - useInteractive = !1; - if (typeof define != "undefined") return; - if (typeof requirejs != "undefined") { - if (isFunction(requirejs)) return; - cfg = requirejs, requirejs = undefined - } - typeof require != "undefined" && !isFunction(require) && (cfg = require, require = undefined), req = requirejs = function(e, t, n, r) { - var i, s, o = defContextName; - return !isArray(e) && typeof e != "string" && (s = e, isArray(t) ? (e = t, t = n, n = r) : e = []), s && s.context && (o = s.context), i = getOwn(contexts, o), i || (i = contexts[o] = req.s.newContext(o)), s && i.configure(s), i.require(e, t, n) - }, req.config = function(e) { - return req(e) - }, req.nextTick = typeof setTimeout != "undefined" ? function(e) { - setTimeout(e, 4) - } : function(e) { - e() - }, require || (require = req), req.version = version, req.jsExtRegExp = /^\/|:|\?|\.js$/, req.isBrowser = isBrowser, s = req.s = { - contexts: contexts, - newContext: newContext - }, req({}), each(["toUrl", "undef", "defined", "specified"], function(e) { - req[e] = function() { - var t = contexts[defContextName]; - return t.require[e].apply(t, arguments) - } - }), isBrowser && (head = s.head = document.getElementsByTagName("head")[0], baseElement = document.getElementsByTagName("base")[0], baseElement && (head = s.head = baseElement.parentNode)), req.onError = defaultOnError, req.createNode = function(e, t, n) { - var r = e.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script"); - return r.type = e.scriptType || "text/javascript", r.charset = "utf-8", r.async = !0, r - }, req.load = function(e, t, n) { - var r = e && e.config || {}, - i; - if (isBrowser) return i = req.createNode(r, t, n), i.setAttribute("data-requirecontext", e.contextName), i.setAttribute("data-requiremodule", t), i.attachEvent && !(i.attachEvent.toString && i.attachEvent.toString().indexOf("[native code") < 0) && !isOpera ? (useInteractive = !0, i.attachEvent("onreadystatechange", e.onScriptLoad)) : (i.addEventListener("load", e.onScriptLoad, !1), i.addEventListener("error", e.onScriptError, !1)), i.src = n, currentlyAddingScript = i, baseElement ? head.insertBefore(i, baseElement) : head.appendChild(i), currentlyAddingScript = null, i; - if (isWebWorker) try { - importScripts(n), e.completeLoad(t) - } catch (s) { - e.onError(makeError("importscripts", "importScripts failed for " + t + " at " + n, s, [t])) - } - }, isBrowser && !cfg.skipDataMain && eachReverse(scripts(), function(e) { - head || (head = e.parentNode), dataMain = e.getAttribute("data-main"); - if (dataMain) return mainScript = dataMain, cfg.baseUrl || (src = mainScript.split("/"), mainScript = src.pop(), subPath = src.length ? src.join("/") + "/" : "./", cfg.baseUrl = subPath), mainScript = mainScript.replace(jsSuffixRegExp, ""), req.jsExtRegExp.test(mainScript) && (mainScript = dataMain), cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript], !0 - }), define = function(e, t, n) { - var r, i; - typeof e != "string" && (n = t, t = e, e = null), isArray(t) || (n = t, t = null), !t && isFunction(n) && (t = [], n.length && (n.toString().replace(commentRegExp, "").replace(cjsRequireRegExp, function(e, n) { - t.push(n) - }), t = (n.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(t))), useInteractive && (r = currentlyAddingScript || getInteractiveScript(), r && (e || (e = r.getAttribute("data-requiremodule")), i = contexts[r.getAttribute("data-requirecontext")])), (i ? i.defQueue : globalDefQueue).push([e, t, n]) - }, define.amd = { - jQuery: !0 - }, req.exec = function(text) { - return eval(text) - }, req(cfg) -})(this), define("../../node_modules/requirejs/require.js", function() {}), define("ziggy/EntityRelationshipLoader", [], function() { - return { - load: function() { - return JSON.parse(ziggyFileLoader.loadAppData("entity_relationship.json")) - } - } -}), define("ziggy/FormDefinitionLoader", [], function() { - return { - load: function(e) { - return JSON.parse(ziggyFileLoader.loadAppData(e + "/form_definition.json")) - } - } -}), define("ziggy/FormDataRepository", [], function() { - var e; - return typeof formDataRepositoryContext != "undefined" && (e = formDataRepositoryContext), { - getFormInstanceByFormTypeAndId: function(e, t) { - return null - }, - queryUniqueResult: function(t) { - return e.queryUniqueResult(t) - }, - queryList: function(t) { - return e.queryList(t) - }, - saveFormSubmission: function(t, n, r) { - return e.saveFormSubmission(JSON.stringify(t), JSON.stringify(n), r) - }, - saveEntity: function(t, n) { - return e.saveEntity(t, JSON.stringify(n)) - } - } -}), define("ziggy/RelationKind", [], function() { - var e = { - one_to_one: { - type: "one_to_one" - }, - one_to_many: { - type: "one_to_many" - }, - many_to_one: { - type: "many_to_one" - } - }; - return e.one_to_one.inverse = e.one_to_one, e.one_to_many.inverse = e.many_to_one, e.many_to_one.inverse = e.one_to_many, e -}), define("ziggy/Util", [], function() { - return String.prototype.format || (String.prototype.format = function() { - var e = arguments; - return this.replace(/{(\d+)}/g, function(t, n) { - return typeof e[n] != "undefined" ? e[n] : t - }) - }), { - hasValue: function(e) { - return typeof e != "undefined" && !!e - } - } -}), define("ziggy/SqlQueryBuilder", ["ziggy/FormDataRepository", "ziggy/RelationKind", "ziggy/Util"], function(e, t, n) { - var r = function(e, t, s, o) { - var u = e.findEntityDefinitionByType(o.type), - a = o.from.split(".")[1], - f = "select * from " + o.type + " where " + o.to + " = '" + t[a] + "'", - l = JSON.parse(i(o)(f)); - return n.hasValue(l) ? !n.hasValue(u.relations) || u.relations.length === 0 ? l : (u.relations.forEach(function(t) { - if (t.type !== s) { - var i = r(e, l, u.type, t); - n.hasValue(i) && (l[t.type] = i) - } - }), l) : null - }, - i = function(n) { - return t[n.kind] === t.one_to_many ? e.queryList : e.queryUniqueResult - }; - return { - loadEntityHierarchy: function(t, i, s) { - var o = t.findEntityDefinitionByType(i), - u = "select * from " + i + " where id = '" + s + "'", - a = JSON.parse(e.queryUniqueResult(u)); - if (!n.hasValue(o.relations) || o.relations.length === 0) { - var f = {}; - return f[i] = a, f - } - o.relations.forEach(function(e) { - a[e.type] = r(t, a, i, e) - }); - var l = {}; - return l[i] = a, l - } - } -}), define("ziggy/IdFactoryBridge", [], function() { - var e; - return typeof formDataRepositoryContext != "undefined" && (e = formDataRepositoryContext), { - generateIdFor: function(t) { - return e.generateIdFor(t) - } - } -}), define("ziggy/IdFactory", ["ziggy/IdFactoryBridge"], function(e) { - return { - generateIdFor: function(t) { - return e.generateIdFor(t) - } - } -}), define("ziggy/Entities", ["ziggy/Util"], function(e) { - var t = function() { - var t = this; - t.entities = [], t.add = function(e) { - return t.entities.push(e), t - }, t.addAll = function(e) { - return t.entities = t.entities.concat(e.entities), t - }, t.forEach = function(e) { - return t.entities.forEach(e) - }, t.findEntityByType = function(e) { - for (var n = 0; n < t.entities.length; n++) - if (t.entities[n].type === e) return t.entities[n]; - return null - }, t.findEntityByTypeAndId = function(e) { - for (var n = 0; n < t.entities.length; n++) - if (t.entities[n].type === e.type && t.entities[n].getFieldByPersistenceName("id").value === e.getFieldByPersistenceName("id").value) return t.entities[n]; - return null - }, t.findEntitiesByType = function(e) { - return t.entities.filter(function(t) { - return t.type === e - }) - }, t.contains = function(n) { - return e.hasValue(t.findEntityByTypeAndId(n)) - } - }; - return { - newInstance: function() { - return new t - } - } -}), define("ziggy/FormModelMapper", ["ziggy/FormDataRepository", "ziggy/SqlQueryBuilder", "ziggy/IdFactory", "ziggy/Util", "ziggy/RelationKind", "ziggy/Entities"], function(e, t, n, r, i, s) { - var o = function(e, t, n) { - return r.hasValue(e) && t.contains(e) && !n.contains(e) - }, - u = function(e, t, n, r) { - var i = e.to.split(".")[1], - s = t.findEntityByTypeAndId(r); - s.createField(s.source + "." + i, s.source + "." + i, i, n) - }, - a = function(e, t) { - var n = e.form.fields.filter(function(e) { - return e.source === t.source - })[0]; - r.hasValue(n) ? r.hasValue(n.value) || (n.value = t.value) : e.form.fields.push(t) - }, - f = function(e, t) { - e.forEach(function(e) { - var n = c(e); - a(t, n) - }) - }, - l = function(e, t) { - var n = c(e); - t.id = n.value - }, - c = function(e) { - var t = e.getFieldByPersistenceName("id"); - return r.hasValue(t) ? r.hasValue(t.value) || (t.value = n.generateIdFor(e.type)) : (t = { - name: e.source + ".id", - source: e.source + ".id", - persistenceName: "id", - value: n.generateIdFor(e.type) - }, e.addField(t)), t - }, - h = function(e, t, n, r, i) { - o(e, t, n) && (u(i, t, r, e), p(e, t, n)) - }, - p = function(t, n, r) { - var s = t.findParents(); - s.forEach(function(e) { - var t = n.findEntityByType(e.type); - o(t, n, r) && p(t, n, r) - }); - var u; - if (o(t, n, r)) { - var a = {}; - t.forEachField(function(e) { - a[e.persistenceName] = e.value - }), e.saveEntity(t.type, a), u = t.getFieldByPersistenceName("id").value, r.add(t) - } - var f = t.findChildren(); - f.forEach(function(e) { - if (e.kind === i.one_to_many.type) { - var t = n.findEntitiesByType(e.type); - t.forEach(function(t) { - h(t, n, r, u, e) - }) - } else { - var s = n.findEntityByType(e.type); - h(s, n, r, u, e) - } - }) - }, - d = function(e, t) { - var n = e; - for (var i = 0; i < t.length; i++) { - var s = t[i]; - if (!r.hasValue(n[s])) { - n = undefined; - break - } - n = n[s] - } - return n - }, - v = function(e, t) { - return e.filter(function(e) { - if (e.name === t) return e - })[0] - }, - m = function(e, t) { - e.form.fields.forEach(function(e) { - if (e.shouldLoadValue) { - var n = e.source.split("."), - i = d(t, n); - r.hasValue(i) && (e.value = i) - } - }) - }, - g = function(e, t, n) { - r.hasValue(e.form.sub_forms) && e.form.sub_forms.forEach(function(i) { - var s = t.findPathToBaseEntityFromSubEntity(e.form.bind_type, i.bind_type), - o = d(n, s); - o.forEach(function(e) { - var t = null; - i.fields.forEach(function(n) { - if (n.shouldLoadValue) { - var i = d(e, n.source.split(".").slice(-1)); - r.hasValue(i) && (t = t || {}, t[n.name] = i) - } - }), r.hasValue(t) && i.instances.push(t) - }) - }) - }, - y = function(e, t) { - if (!r.hasValue(t)) return; - var n = decodeURIComponent(decodeURIComponent(t)), - i = JSON.parse(n); - for (var s in i) - if (i.hasOwnProperty(s)) { - var o = v(e.form.fields, s); - r.hasValue(o) && (o.value = i[s]) - } - }, - b = function(e, t) { - e.forEach(function(e) { - r.hasValue(e.source) || (e.source = t + "." + e.name) - }) - }, - w = function(e) { - r.hasValue(e.form.sub_forms) && e.form.sub_forms.forEach(function(e) { - b(e.fields, e.bind_type), e.instances = [] - }) - }; - return { - mapToFormModel: function(n, i, s) { - var o = e.getFormInstanceByFormTypeAndId(s.id, s.formName); - if (r.hasValue(o)) { - var u = JSON.parse(o); - if (r.hasValue(u)) return u - } - if (!r.hasValue(n)) return i; - b(i.form.fields, i.form.bind_type), w(i); - if (!r.hasValue(s.entityId)) return i; - var a = t.loadEntityHierarchy(n, i.form.bind_type, s.entityId); - return m(i, a), y(i, s.fieldOverrides), g(i, n, a), i - }, - mapToEntityAndSave: function(e, t) { - var n = s.newInstance(); - t.form.fields.forEach(function(t) { - var i = t.source.split("."), - s = i[i.length - 2], - o = n.findEntityByType(s); - r.hasValue(o) || (o = e.findEntityDefinitionByType(s).createInstance(), o.source = t.source.substring(0, t.source.lastIndexOf(".")), n.add(o)), o.createField(t.name, t.source, i[i.length - 1], t.value) - }); - var i = s.newInstance(); - r.hasValue(t.form.sub_forms) && t.form.sub_forms.forEach(function(t) { - t.instances.forEach(function(n) { - var r = e.findEntityDefinitionByType(t.bind_type).createInstance(); - t.fields.forEach(function(e) { - var t = e.source.split("."); - r.createField(e.name, e.source, t[t.length - 1], n[e.name]) - }), r.source = t.bind_type, l(r, n), i.add(r) - }) - }), f(n, t), n.addAll(i); - var o = s.newInstance(), - u = n.findEntityByType(t.form.bind_type); - p(u, n, o) - } - } -}), define("ziggy/FormSubmissionRouter", [], function() { - var e; - return typeof formSubmissionRouter != "undefined" && (e = formSubmissionRouter), { - route: function(t) { - return e.route(t) - } - } -}), define("ziggy/Entity", [], function() { - var e = function(e) { - var t = this, - n = function(e) { - return t.relations.filter(function(t) { - return t.as === e - }) - }; - t.type = e, t.relations = [], t.fields = [], t.addField = function(e) { - return t.fields.push(e), t - }, t.createField = function(e, n, r, i) { - return t.fields.push({ - name: e, - source: n, - persistenceName: r, - value: i - }), t - }, t.findParents = function() { - return n("child") - }, t.findChildren = function() { - return n("parent") - }, t.getFieldByPersistenceName = function(e) { - return t.fields.filter(function(t) { - return t.persistenceName === e - })[0] - }, t.forEachField = function(e) { - return t.fields.forEach(e) - } - }; - return { - newInstance: function(t) { - return new e(t) - } - } -}), define("ziggy/EntityDef", ["ziggy/Entity"], function(e) { - var t = function(t) { - var n = this; - n.type = t, n.relations = [], n.fields = [], n.addRelation = function(e) { - return n.relations.push(e), n - }, n.removeAllRelations = function() { - n.relations = [] - }, n.createInstance = function() { - var t = e.newInstance(n.type); - return n.relations.forEach(function(e) { - t.relations.push(e.createInstance()) - }), t - }, n.findRelationByType = function(e) { - return n.relations.filter(function(t) { - return t.type === e - })[0] - } - }; - return { - newInstance: function(e) { - return new t(e) - } - } -}), define("ziggy/EntityDefinitions", ["ziggy/Util"], function(e) { - var t = function() { - var t = this; - t.entityDefinitions = [], t.add = function(e) { - return t.entityDefinitions.push(e), t - }, t.findEntityDefinitionByType = function(e) { - for (var n = 0; n < t.entityDefinitions.length; n++) - if (t.entityDefinitions[n].type === e) return t.entityDefinitions[n]; - return null - }, t.hasEntityDefinitions = function() { - return t.entityDefinitions.length !== 0 - }, t.findPathToBaseEntityFromSubEntity = function(n, r) { - var i = t.findEntityDefinitionByType(r), - s = i.findRelationByType(n); - if (e.hasValue(s)) return [s.type, r]; - for (var o = 0; o < i.relations.length; o++) { - var u = t.findPathToBaseEntityFromSubEntity(n, i.relations[o].type); - if (e.hasValue(u)) return u.push(r), u - } - return null - } - }; - return { - newInstance: function() { - return new t - } - } -}), define("ziggy/Relation", [], function() { - var e = function(e, t, n, r, i) { - var s = this; - s.type = e, s.kind = t, s.as = n, s.from = r, s.to = i - }; - return { - newInstance: function(t, n, r, i, s) { - return new e(t, n, r, i, s) - } - } -}), define("ziggy/RelationDef", ["ziggy/Relation"], function(e) { - var t = function(t, n, r, i, s) { - var o = this; - o.type = t, o.kind = n, o.as = r, o.from = i, o.to = s, o.createInstance = function() { - return e.newInstance(o.type, o.kind, o.as, o.from, o.to) - } - }; - return { - newInstance: function(e, n, r, i, s) { - return new t(e, n, r, i, s) - } - } -}), define("ziggy/EntityRelationships", ["ziggy/EntityDef", "ziggy/EntityDefinitions", "ziggy/RelationDef", "ziggy/RelationKind", "ziggy/Util"], function(e, t, n, r, i) { - var s = function(n, r) { - var s = t.newInstance(); - return i.hasValue(n) && n.forEach(function(t) { - var n = s.findEntityDefinitionByType(t.parent); - i.hasValue(n) || s.add(e.newInstance(t.parent)), n = s.findEntityDefinitionByType(t.child), i.hasValue(n) || s.add(e.newInstance(t.child)) - }), i.hasValue(r.form.bind_type) && !i.hasValue(s.findEntityDefinitionByType(r.form.bind_type)) && s.add(e.newInstance(r.form.bind_type)), s - }; - return { - determineEntitiesAndRelations: function(e, t) { - var o = s(e, t); - return i.hasValue(e) ? (e.forEach(function(e) { - var t = o.findEntityDefinitionByType(e.parent); - i.hasValue(t.relations) || t.removeAllRelations(), t.addRelation(n.newInstance(e.child, e.kind, "parent", e.from, e.to)); - var s = o.findEntityDefinitionByType(e.child); - i.hasValue(s.relations) || s.removeAllRelations(), s.addRelation(n.newInstance(e.parent, r[e.kind].inverse.type, "child", e.to, e.from)) - }), o) : o - } - } -}), define("FormDataController", ["ziggy/EntityRelationshipLoader", "ziggy/FormDefinitionLoader", "ziggy/FormModelMapper", "ziggy/FormDataRepository", "ziggy/FormSubmissionRouter", "ziggy/EntityRelationships", "ziggy/Util"], function(e, t, n, r, i, s, o) { - var u = "1", - a, f, l, c = function(n) { - o.hasValue(a) || (a = e.load()), o.hasValue(f) || (f = t.load(n.formName)), o.hasValue(l) || (l = s.determineEntitiesAndRelations(a, f)) - }, - h = function(e, t) { - c(e); - if (l.hasEntityDefinitions()) { - n.mapToEntityAndSave(l, t); - var r = t.form.fields.filter(function(e) { - return e.source === t.form.bind_type + ".id" - })[0]; - e.entityId = r.value - } - return e - }; - return { - get: function(e) { - return c(e), n.mapToFormModel(l, f, e) - }, - save: function(e, t) { - typeof e != "object" && (e = JSON.parse(e)), typeof t != "object" && (t = JSON.parse(t)), e = h(e, t); - var n = r.saveFormSubmission(e, t, t.form_data_definition_version || u); - o.hasValue(n) && i.route(e.instanceId) - }, - createOrUpdateEntity: function(e, t) { - typeof e != "object" && (e = JSON.parse(e)), typeof t != "object" && (t = JSON.parse(t)), e = h(e, t), i.route(e.instanceId) - }, - deleteFormSubmission: function(e) { - c(e) - } - } -}), requirejs.config({ - paths: { - ziggy: "." - } -}), require(["FormDataController"], function(e) { - controller = e -}), define("../../main", function() {}); \ No newline at end of file From dfd19944b6141267b8b8641016dec279eda2a3e7 Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 15:02:02 +0300 Subject: [PATCH 08/12] Strip out quartz/mysql tables configs --- build/sql/tables_opensrp.sql | 55 -------- build/sql/tables_quartz_MYSQL.sql | 148 --------------------- build/sql/tables_quartz_postgres.sql | 186 --------------------------- 3 files changed, 389 deletions(-) delete mode 100644 build/sql/tables_opensrp.sql delete mode 100644 build/sql/tables_quartz_MYSQL.sql delete mode 100644 build/sql/tables_quartz_postgres.sql diff --git a/build/sql/tables_opensrp.sql b/build/sql/tables_opensrp.sql deleted file mode 100644 index 7f971c8..0000000 --- a/build/sql/tables_opensrp.sql +++ /dev/null @@ -1,55 +0,0 @@ --- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64) --- --- Host: localhost Database: opensrp --- ------------------------------------------------------ --- Server version 5.7.17-0ubuntu0.16.04.1 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `unique_ids` --- - -DROP TABLE IF EXISTS `unique_ids`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `unique_ids` ( - `_id` bigint(20) NOT NULL AUTO_INCREMENT, - `created_at` datetime DEFAULT NULL, - `location` varchar(255) DEFAULT NULL, - `openmrs_id` varchar(255) DEFAULT NULL, - `status` varchar(255) DEFAULT NULL, - `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `used_by` varchar(255) DEFAULT NULL, - PRIMARY KEY (`_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `unique_ids` --- - -LOCK TABLES `unique_ids` WRITE; -/*!40000 ALTER TABLE `unique_ids` DISABLE KEYS */; -/*!40000 ALTER TABLE `unique_ids` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2017-05-31 12:12:10 diff --git a/build/sql/tables_quartz_MYSQL.sql b/build/sql/tables_quartz_MYSQL.sql deleted file mode 100644 index 95d2f29..0000000 --- a/build/sql/tables_quartz_MYSQL.sql +++ /dev/null @@ -1,148 +0,0 @@ --- Thanks to Patrick Lightbody for submitting this... --- --- In your Quartz properties file, you'll need to set --- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate - -CREATE TABLE QRTZ_JOB_DETAILS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - JOB_NAME VARCHAR(200) NOT NULL, - JOB_GROUP VARCHAR(200) NOT NULL, - DESCRIPTION VARCHAR(250) NULL, - JOB_CLASS_NAME VARCHAR(250) NOT NULL, - IS_DURABLE TINYINT(1) NOT NULL, - IS_NONCONCURRENT TINYINT(1) NOT NULL, - IS_UPDATE_DATA TINYINT(1) NOT NULL, - REQUESTS_RECOVERY TINYINT(1) NOT NULL, - JOB_DATA BLOB NULL, - PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -) ; - -CREATE TABLE QRTZ_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - JOB_NAME VARCHAR(200) NOT NULL, - JOB_GROUP VARCHAR(200) NOT NULL, - DESCRIPTION VARCHAR(250) NULL, - NEXT_FIRE_TIME BIGINT NULL, - PREV_FIRE_TIME BIGINT NULL, - PRIORITY INT NULL, - TRIGGER_STATE VARCHAR(16) NOT NULL, - TRIGGER_TYPE VARCHAR(8) NOT NULL, - START_TIME BIGINT NOT NULL, - END_TIME BIGINT NULL, - CALENDAR_NAME VARCHAR(200) NULL, - MISFIRE_INSTR SMALLINT NULL, - JOB_DATA BLOB NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) - REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) -) ; - -CREATE TABLE QRTZ_SIMPLE_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - REPEAT_COUNT BIGINT NOT NULL, - REPEAT_INTERVAL BIGINT NOT NULL, - TIMES_TRIGGERED BIGINT NOT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -) ; - -CREATE TABLE QRTZ_CRON_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - CRON_EXPRESSION VARCHAR(120) NOT NULL, - TIME_ZONE_ID VARCHAR(80), - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -) ; - -CREATE TABLE QRTZ_SIMPROP_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - STR_PROP_1 VARCHAR(512) NULL, - STR_PROP_2 VARCHAR(512) NULL, - STR_PROP_3 VARCHAR(512) NULL, - INT_PROP_1 INT NULL, - INT_PROP_2 INT NULL, - LONG_PROP_1 BIGINT NULL, - LONG_PROP_2 BIGINT NULL, - DEC_PROP_1 NUMERIC(13,4) NULL, - DEC_PROP_2 NUMERIC(13,4) NULL, - BOOL_PROP_1 TINYINT(1) NULL, - BOOL_PROP_2 TINYINT(1) NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -) ; - -CREATE TABLE QRTZ_BLOB_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - BLOB_DATA BLOB NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -) ; - -CREATE TABLE QRTZ_CALENDAR - ( - SCHED_NAME VARCHAR(120) NOT NULL, - CALENDAR_NAME VARCHAR(200) NOT NULL, - CALENDAR BLOB NOT NULL, - PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) -) ; - -CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) -) ; - -CREATE TABLE QRTZ_FIRED_TRIGGERS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - ENTRY_ID VARCHAR(95) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - INSTANCE_NAME VARCHAR(200) NOT NULL, - FIRED_TIME BIGINT NOT NULL, - PRIORITY INT NOT NULL, - STATE VARCHAR(16) NOT NULL, - JOB_NAME VARCHAR(200) NULL, - JOB_GROUP VARCHAR(200) NULL, - IS_NONCONCURRENT TINYINT(1) NULL, - REQUESTS_RECOVERY TINYINT(1) NULL, - PRIMARY KEY (SCHED_NAME,ENTRY_ID) -) ; - -CREATE TABLE QRTZ_SCHEDULER_STATE - ( - SCHED_NAME VARCHAR(120) NOT NULL, - INSTANCE_NAME VARCHAR(200) NOT NULL, - LAST_CHECKIN_TIME BIGINT NOT NULL, - CHECKIN_INTERVAL BIGINT NOT NULL, - PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) -) ; - -CREATE TABLE QRTZ_LOCKS - ( - SCHED_NAME VARCHAR(120) NOT NULL, - LOCK_NAME VARCHAR(40) NOT NULL, - PRIMARY KEY (SCHED_NAME,LOCK_NAME) -) ; - diff --git a/build/sql/tables_quartz_postgres.sql b/build/sql/tables_quartz_postgres.sql deleted file mode 100644 index 22f254c..0000000 --- a/build/sql/tables_quartz_postgres.sql +++ /dev/null @@ -1,186 +0,0 @@ --- Thanks to Patrick Lightbody for submitting this... --- --- In your Quartz properties file, you'll need to set --- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate - -drop table if exists qrtz_fired_triggers; -drop table if exists QRTZ_PAUSED_TRIGGER_GRPS; -drop table if exists QRTZ_SCHEDULER_STATE; -drop table if exists QRTZ_LOCKS; -drop table if exists qrtz_simple_triggers; -drop table if exists qrtz_cron_triggers; -drop table if exists qrtz_simprop_triggers; -drop table if exists QRTZ_BLOB_TRIGGERS; -drop table if exists qrtz_triggers; -drop table if exists qrtz_job_details; -drop table if exists qrtz_calendars; - -CREATE TABLE qrtz_job_details - ( - SCHED_NAME VARCHAR(120) NOT NULL, - JOB_NAME VARCHAR(200) NOT NULL, - JOB_GROUP VARCHAR(200) NOT NULL, - DESCRIPTION VARCHAR(250) NULL, - JOB_CLASS_NAME VARCHAR(250) NOT NULL, - IS_DURABLE BOOL NOT NULL, - IS_NONCONCURRENT BOOL NOT NULL, - IS_UPDATE_DATA BOOL NOT NULL, - REQUESTS_RECOVERY BOOL NOT NULL, - JOB_DATA BYTEA NULL, - PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -); - -CREATE TABLE qrtz_triggers - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - JOB_NAME VARCHAR(200) NOT NULL, - JOB_GROUP VARCHAR(200) NOT NULL, - DESCRIPTION VARCHAR(250) NULL, - NEXT_FIRE_TIME BIGINT NULL, - PREV_FIRE_TIME BIGINT NULL, - PRIORITY INTEGER NULL, - TRIGGER_STATE VARCHAR(16) NOT NULL, - TRIGGER_TYPE VARCHAR(8) NOT NULL, - START_TIME BIGINT NOT NULL, - END_TIME BIGINT NULL, - CALENDAR_NAME VARCHAR(200) NULL, - MISFIRE_INSTR SMALLINT NULL, - JOB_DATA BYTEA NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) - REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) -); - -CREATE TABLE qrtz_simple_triggers - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - REPEAT_COUNT BIGINT NOT NULL, - REPEAT_INTERVAL BIGINT NOT NULL, - TIMES_TRIGGERED BIGINT NOT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - -CREATE TABLE qrtz_cron_triggers - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - CRON_EXPRESSION VARCHAR(120) NOT NULL, - TIME_ZONE_ID VARCHAR(80), - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - -CREATE TABLE qrtz_simprop_triggers - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - STR_PROP_1 VARCHAR(512) NULL, - STR_PROP_2 VARCHAR(512) NULL, - STR_PROP_3 VARCHAR(512) NULL, - INT_PROP_1 INT NULL, - INT_PROP_2 INT NULL, - LONG_PROP_1 BIGINT NULL, - LONG_PROP_2 BIGINT NULL, - DEC_PROP_1 NUMERIC(13,4) NULL, - DEC_PROP_2 NUMERIC(13,4) NULL, - BOOL_PROP_1 BOOL NULL, - BOOL_PROP_2 BOOL NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - -CREATE TABLE qrtz_blob_triggers - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - BLOB_DATA BYTEA NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - -CREATE TABLE qrtz_calendars - ( - SCHED_NAME VARCHAR(120) NOT NULL, - CALENDAR_NAME VARCHAR(200) NOT NULL, - CALENDAR BYTEA NOT NULL, - PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) -); - - -CREATE TABLE qrtz_paused_trigger_grps - ( - SCHED_NAME VARCHAR(120) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) -); - -CREATE TABLE qrtz_fired_triggers - ( - SCHED_NAME VARCHAR(120) NOT NULL, - ENTRY_ID VARCHAR(95) NOT NULL, - TRIGGER_NAME VARCHAR(200) NOT NULL, - TRIGGER_GROUP VARCHAR(200) NOT NULL, - INSTANCE_NAME VARCHAR(200) NOT NULL, - FIRED_TIME BIGINT NOT NULL, - PRIORITY INTEGER NOT NULL, - STATE VARCHAR(16) NOT NULL, - JOB_NAME VARCHAR(200) NULL, - JOB_GROUP VARCHAR(200) NULL, - IS_NONCONCURRENT BOOL NULL, - REQUESTS_RECOVERY BOOL NULL, - PRIMARY KEY (SCHED_NAME,ENTRY_ID) -); - -CREATE TABLE qrtz_scheduler_state - ( - SCHED_NAME VARCHAR(120) NOT NULL, - INSTANCE_NAME VARCHAR(200) NOT NULL, - LAST_CHECKIN_TIME BIGINT NOT NULL, - CHECKIN_INTERVAL BIGINT NOT NULL, - PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) -); - -CREATE TABLE qrtz_locks - ( - SCHED_NAME VARCHAR(120) NOT NULL, - LOCK_NAME VARCHAR(40) NOT NULL, - PRIMARY KEY (SCHED_NAME,LOCK_NAME) -); - -create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY); -create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP); - -create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); -create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP); -create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME); -create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP); -create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE); -create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); -create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); -create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME); -create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); -create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); -create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); -create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); - -create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME); -create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); -create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); -create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP); -create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); -create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP); - - -commit; From 86dc3e978c9d66b7f97240a41e861d20c0960b6a Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 15:07:54 +0300 Subject: [PATCH 09/12] Remove unused configs --- assets/config/activemq.properties | 6 ------ assets/config/osgi.properties | 0 assets/config/schedule_tracking.properties | 2 -- 3 files changed, 8 deletions(-) delete mode 100644 assets/config/activemq.properties delete mode 100644 assets/config/osgi.properties delete mode 100644 assets/config/schedule_tracking.properties diff --git a/assets/config/activemq.properties b/assets/config/activemq.properties deleted file mode 100644 index f9c4c16..0000000 --- a/assets/config/activemq.properties +++ /dev/null @@ -1,6 +0,0 @@ -queue.for.events=QueueForEventsDrishti -queue.for.scheduler=QueueForSchedulerDrishti -broker.url=tcp://localhost:61616 -maximumRedeliveries=0 -redeliveryDelayInMillis=2000 -acknowledge.mode=transacted \ No newline at end of file diff --git a/assets/config/osgi.properties b/assets/config/osgi.properties deleted file mode 100644 index e69de29..0000000 diff --git a/assets/config/schedule_tracking.properties b/assets/config/schedule_tracking.properties deleted file mode 100644 index 8526c88..0000000 --- a/assets/config/schedule_tracking.properties +++ /dev/null @@ -1,2 +0,0 @@ -#this file is used by motech -schedule.definitions.directory=/schedules \ No newline at end of file From a8ad57724d5c4963ff71158a514eab70f97f3ee9 Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 15:22:20 +0300 Subject: [PATCH 10/12] Load couchdb repositories if dhis2, rapidpro or atomfeed is activated --- modules/connector/applicationContext-connector.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/connector/applicationContext-connector.xml b/modules/connector/applicationContext-connector.xml index aedf6cf..da12371 100644 --- a/modules/connector/applicationContext-connector.xml +++ b/modules/connector/applicationContext-connector.xml @@ -37,14 +37,17 @@ + + + From d0f3c1162382a85e5cbb3fd53f8bc11893db65a2 Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 15:28:26 +0300 Subject: [PATCH 11/12] Remove loading of activemq properties --- modules/connector/applicationContext-connector.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/connector/applicationContext-connector.xml b/modules/connector/applicationContext-connector.xml index da12371..2208045 100644 --- a/modules/connector/applicationContext-connector.xml +++ b/modules/connector/applicationContext-connector.xml @@ -8,7 +8,6 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> - From dcb1dde66c3e5d543a64219d8001e3da5bbb3e3f Mon Sep 17 00:00:00 2001 From: Samuel Githengi Date: Fri, 20 Mar 2020 15:46:16 +0300 Subject: [PATCH 12/12] Strip out used configs --- assets/config/opensrp.properties | 48 -------------------------------- 1 file changed, 48 deletions(-) diff --git a/assets/config/opensrp.properties b/assets/config/opensrp.properties index de172c2..35cf8b0 100644 --- a/assets/config/opensrp.properties +++ b/assets/config/opensrp.properties @@ -1,23 +1,7 @@ sms.can.be.sent=false number.of.audit.messages=1000 -form.poll.time.interval=2 -mcts.phone.number=8762963816 -js.directory.name=/ziggy -form.directory.name=/form multimedia.directory.name=/opt/multimedia -form.download.files=form.xml, model.xml, form_definition.json -qrcodes.directory.name=/home/opensrp/qr-codes/ - -schedule.config.path=/schedules/schedule-config.xls -schedule.config.json.path=/schedules/schedule-config.json -schedules.config.files.dir=/schedules/schedule-configs - -report-fields-definition-path=/report-fields-definition.json -report-definition-path=/report-definition.json -mcts-report-definition-path=/mcts-report-definition.json -mcts-report-delay-in-days=10 -mcts.poll.time.interval.in.minutes=10 # OpenMRS configuration openmrs.url=http://localhost:8080/openmrs/ @@ -48,38 +32,6 @@ couchdb.password=adminpass couchdb.atomfeed-db.revision-limit=2 -# properties for postgres db in opensrp-web and opensrp-reporting modules -jdbc.backend=MYSQL -jdbc.driverClassName=com.mysql.jdbc.Driver -jdbc.username=root -jdbc.password=VA1913wm -jdbc.url=jdbc:mysql://localhost:3306/opensrp?createDatabaseIfNotExist=true - -##jdbc url with server and port but without database -jdbc.url-wo-db=jdbc:mysql://localhost:3306 - -# Hibernate properties for Reporting DB -hibernate.dialect=org.hibernate.dialect.MySQLDialect -# hibernate.hbm2ddl.auto=update -hibernate.show_sql=true -hibernate.format_sql=false -hibernate.auto_commit=false - -hibernate.c3p0.max_size=15 -hibernate.c3p0.min_size=3 -hibernate.c3p0.timeout=60000 -hibernate.c3p0.max_statements=20 -hibernate.c3p0.idle_test_period=300 -hibernate.c3p0.acquire_increment=3 - -preferred.time=7 -aggregator.dataset.url=http://bamboo.io/datasets/55a9e822cf46480eb1f24970741ceb15 -aggregated.dataset.url=http://bamboo.io/datasets/5d0734ccf76c4153a9db750b86ca49b9 -number.of.reports.sent.in.a.batch=100 -batch.update.time.interval=5 -drishti.site.url=http://localhost:9000 -application.context=org.springframework.web.context.WebApplicationContext:/opensrp - #RapidPro settings rapidpro.url=https://rapidpro.ona.io rapidpro.token=YOUR_AUTH_TOKEN