Skip to content

Commit 8cc1266

Browse files
authored
Merge pull request #135 from watson-developer-cloud/devExp-590-configEditor
Dev exp 590 config editor
2 parents ab9b3ba + ea88c1a commit 8cc1266

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

Config.json.enc

144 Bytes
Binary file not shown.

Scripts/Editor/ConfigEditor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ private class ServiceSetup
6666
URL ="https://console.ng.bluemix.net/catalog/services/tradeoff-analytics/", ServiceID="TradeoffAnalyticsV1" },
6767
new ServiceSetup() { ServiceName = "Personality Insights", ServiceAPI = "personality-insights/api",
6868
URL ="https://console.ng.bluemix.net/catalog/services/personality-insights/", ServiceID="PersonalityInsightsV2" },
69-
//new ServiceSetup() { ServiceName = "Conversation (Experimental)", ServiceAPI = "conversation-experimental/api",
70-
// URL ="https://console.ng.bluemix.net/catalog/services/conversation/", ServiceID="ConversationExperimentalV1" },
7169
new ServiceSetup() { ServiceName = "Conversation", ServiceAPI = "conversation/api",
7270
URL ="https://console.ng.bluemix.net/catalog/services/conversation/", ServiceID="ConversationV1" },
7371
new ServiceSetup() { ServiceName = "RetrieveAndRank", ServiceAPI = "retrieve-and-rank/api",

Scripts/Utilities/Config.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,25 @@ public bool ParseJSON(string json)
111111
}
112112
catch (Exception e)
113113
{
114-
Log.Error("Config", "Caught Exception: {0}", e.ToString());
114+
try
115+
{
116+
IDictionary iParse = Json.Deserialize(json) as IDictionary;
117+
m_URL = (string)iParse["url"];
118+
m_User = (string)iParse["username"];
119+
m_Password = (string)iParse["password"];
120+
m_Note = (string)iParse["note"];
121+
if (!string.IsNullOrEmpty((string)iParse["apikey"]))
122+
m_Apikey = (string)iParse["apikey"];
123+
if (!string.IsNullOrEmpty((string)iParse["api_key"]))
124+
m_Apikey = (string)iParse["api_key"];
125+
126+
return true;
127+
}
128+
catch
129+
{
130+
Log.Error("Config", "Caught Exception: {0}", e.ToString());
131+
}
132+
Log.Error("Config", "Caught Exception: {0}", e.ToString());
115133
}
116134

117135
return false;

0 commit comments

Comments
 (0)