From d970d5c7b0b7c99350031398c0cd5a0b8ce61c7f Mon Sep 17 00:00:00 2001 From: Daniel Cunnington Date: Fri, 15 Apr 2016 14:29:01 +0100 Subject: [PATCH 1/3] service creds test --- services/concept_insights/v2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/concept_insights/v2.js b/services/concept_insights/v2.js index c67a1487..1864ad0c 100644 --- a/services/concept_insights/v2.js +++ b/services/concept_insights/v2.js @@ -20,7 +20,7 @@ module.exports = function (RED) { var username, password; var service = cfenv.getAppEnv().getServiceCreds(/concept insights/i); - + console.log(cfenv).getAppEnv().getServices(); if (service) { username = service.username; password = service.password; From 28f7ead043e89f0e4f2e7da915c54525f559494c Mon Sep 17 00:00:00 2001 From: Daniel Cunnington Date: Fri, 15 Apr 2016 14:58:14 +0100 Subject: [PATCH 2/3] fix bug with upload document --- services/concept_insights/v2.html | 8 ++++---- services/concept_insights/v2.js | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/services/concept_insights/v2.html b/services/concept_insights/v2.html index 41373019..d2d8e80c 100644 --- a/services/concept_insights/v2.html +++ b/services/concept_insights/v2.html @@ -139,7 +139,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 0, - icon: "ConceptInsights.png", + icon: "concept_insights.png", paletteLabel: "concept insights upload document", label: function() { return this.name || "concept insights upload document"; @@ -259,7 +259,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 1, - icon: "ConceptInsights.png", + icon: "concept_insights.png", paletteLabel: "concept insights search", label: function() { return this.name || "concept insights search"; @@ -342,7 +342,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 1, - icon: "ConceptInsights.png", + icon: "concept_insights.png", paletteLabel: "concept insights search concepts", label: function() { return this.name || "concept insights search concepts"; @@ -402,7 +402,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 1, - icon: "ConceptInsights.png", + icon: "concept_insights.png", paletteLabel: "concept insights related concepts", label: function() { return this.name || "concept insights related concepts"; diff --git a/services/concept_insights/v2.js b/services/concept_insights/v2.js index 1864ad0c..91e19b3a 100644 --- a/services/concept_insights/v2.js +++ b/services/concept_insights/v2.js @@ -20,7 +20,7 @@ module.exports = function (RED) { var username, password; var service = cfenv.getAppEnv().getServiceCreds(/concept insights/i); - console.log(cfenv).getAppEnv().getServices(); + if (service) { username = service.username; password = service.password; @@ -259,7 +259,8 @@ module.exports = function (RED) { var corpus_name = this.corpus.cname; var access = this.corpus.access; - if (this.corpus.publiccorpus) { + //Private corpus takes precedence, but change to public if there is one. + if (this.corpus.publiccorpus && !this.corpus.cname) { corpus_name = this.corpus.publiccorpus; account_id = 'public'; } @@ -394,13 +395,14 @@ module.exports = function (RED) { version: 'v2' }); + node.status({fill:"blue",shape:"ring",text:"Getting account information"}); concept_insights.accounts.getAccountsInfo({},function(err,res) { - node.status({fill:"blue",shape:"ring",text:"Getting account information"}); + node.status({}); if (err) { + console.log(err); var message = err.error; return node.error(message, msg); } else { - node.status({}); var account_id = res.accounts[0].account_id; if (callback) callback(concept_insights,account_id); } From 73f9e1dadd1abebe4829d93dbd48ae9d746be98d Mon Sep 17 00:00:00 2001 From: Daniel Cunnington Date: Fri, 15 Apr 2016 15:00:28 +0100 Subject: [PATCH 3/3] correct ci icons --- services/concept_insights/v2.html | 8 ++++---- services/concept_insights/v2.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/services/concept_insights/v2.html b/services/concept_insights/v2.html index d2d8e80c..41373019 100644 --- a/services/concept_insights/v2.html +++ b/services/concept_insights/v2.html @@ -139,7 +139,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 0, - icon: "concept_insights.png", + icon: "ConceptInsights.png", paletteLabel: "concept insights upload document", label: function() { return this.name || "concept insights upload document"; @@ -259,7 +259,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 1, - icon: "concept_insights.png", + icon: "ConceptInsights.png", paletteLabel: "concept insights search", label: function() { return this.name || "concept insights search"; @@ -342,7 +342,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 1, - icon: "concept_insights.png", + icon: "ConceptInsights.png", paletteLabel: "concept insights search concepts", label: function() { return this.name || "concept insights search concepts"; @@ -402,7 +402,7 @@ color: "rgb(85, 150, 230)", inputs: 1, outputs: 1, - icon: "concept_insights.png", + icon: "ConceptInsights.png", paletteLabel: "concept insights related concepts", label: function() { return this.name || "concept insights related concepts"; diff --git a/services/concept_insights/v2.js b/services/concept_insights/v2.js index 91e19b3a..f5b62ff5 100644 --- a/services/concept_insights/v2.js +++ b/services/concept_insights/v2.js @@ -399,7 +399,6 @@ module.exports = function (RED) { concept_insights.accounts.getAccountsInfo({},function(err,res) { node.status({}); if (err) { - console.log(err); var message = err.error; return node.error(message, msg); } else {