Commit 92b21fd3 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '37-api-v1' into 'master'

Resolve "API v1"

Closes #37

See merge request !31
parents 8d9d3a91 689191dc
...@@ -85,7 +85,6 @@ public class DwcaBuilder extends AbstractModelObject { ...@@ -85,7 +85,6 @@ public class DwcaBuilder extends AbstractModelObject {
JSONObject oauthSettings = new JSONObject(); JSONObject oauthSettings = new JSONObject();
oauthSettings.put("accessToken", sourceSettings.getOauthSettings().getAccessToken()); oauthSettings.put("accessToken", sourceSettings.getOauthSettings().getAccessToken());
oauthSettings.put("apiUrl", sourceSettings.getOauthSettings().getApiUrl());
oauthSettings.put("authorizationEndpoint", sourceSettings.getOauthSettings().getAuthorizationEndpoint()); oauthSettings.put("authorizationEndpoint", sourceSettings.getOauthSettings().getAuthorizationEndpoint());
oauthSettings.put("clientKey", sourceSettings.getOauthSettings().getClientKey()); oauthSettings.put("clientKey", sourceSettings.getOauthSettings().getClientKey());
oauthSettings.put("clientSecret", sourceSettings.getOauthSettings().getClientSecret()); oauthSettings.put("clientSecret", sourceSettings.getOauthSettings().getClientSecret());
...@@ -317,7 +316,6 @@ public class DwcaBuilder extends AbstractModelObject { ...@@ -317,7 +316,6 @@ public class DwcaBuilder extends AbstractModelObject {
OAuthSettings oAuthSettings = new OAuthSettings(); OAuthSettings oAuthSettings = new OAuthSettings();
oAuthSettings.setAccessToken(jsonOauthSettings.getString("accessToken")); oAuthSettings.setAccessToken(jsonOauthSettings.getString("accessToken"));
oAuthSettings.setApiUrl(jsonOauthSettings.getString("apiUrl"));
oAuthSettings.setAuthorizationEndpoint(jsonOauthSettings.getString("authorizationEndpoint")); oAuthSettings.setAuthorizationEndpoint(jsonOauthSettings.getString("authorizationEndpoint"));
oAuthSettings.setClientKey(jsonOauthSettings.getString("clientKey")); oAuthSettings.setClientKey(jsonOauthSettings.getString("clientKey"));
oAuthSettings.setClientSecret(jsonOauthSettings.getString("clientSecret")); oAuthSettings.setClientSecret(jsonOauthSettings.getString("clientSecret"));
......
...@@ -87,7 +87,6 @@ public class SettingsDialog extends Dialog { ...@@ -87,7 +87,6 @@ public class SettingsDialog extends Dialog {
private Text txtGenesysURL; private Text txtGenesysURL;
private Text txtAuthorizationEndpoint; private Text txtAuthorizationEndpoint;
private Text txtTokenEndpoint; private Text txtTokenEndpoint;
private Text txtApiUrl;
private Text txtAccessToken; private Text txtAccessToken;
private Text txtRefreshToken; private Text txtRefreshToken;
private Text txtClientKey; private Text txtClientKey;
...@@ -447,14 +446,6 @@ public class SettingsDialog extends Dialog { ...@@ -447,14 +446,6 @@ public class SettingsDialog extends Dialog {
txtTokenEndpoint = new Text(grpGenesysApiConfiguration, SWT.BORDER); txtTokenEndpoint = new Text(grpGenesysApiConfiguration, SWT.BORDER);
txtTokenEndpoint.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtTokenEndpoint.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Label lblGenesysApiUrl = new Label(grpGenesysApiConfiguration, SWT.NONE);
lblGenesysApiUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
lblGenesysApiUrl.setAlignment(SWT.RIGHT);
lblGenesysApiUrl.setText("Genesys API URL");
txtApiUrl = new Text(grpGenesysApiConfiguration, SWT.BORDER);
txtApiUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Label lblClientApiKey = new Label(grpGenesysApiConfiguration, SWT.NONE); Label lblClientApiKey = new Label(grpGenesysApiConfiguration, SWT.NONE);
lblClientApiKey.setAlignment(SWT.RIGHT); lblClientApiKey.setAlignment(SWT.RIGHT);
lblClientApiKey.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblClientApiKey.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
...@@ -592,10 +583,6 @@ public class SettingsDialog extends Dialog { ...@@ -592,10 +583,6 @@ public class SettingsDialog extends Dialog {
IObservableValue oauthSettingstokenEndpointSettingsObserveValue = BeanProperties.value("oauthSettings.tokenEndpoint").observe(settings); IObservableValue oauthSettingstokenEndpointSettingsObserveValue = BeanProperties.value("oauthSettings.tokenEndpoint").observe(settings);
bindingContext.bindValue(observeTextTxtTokenEndpointObserveWidget, oauthSettingstokenEndpointSettingsObserveValue, null, null); bindingContext.bindValue(observeTextTxtTokenEndpointObserveWidget, oauthSettingstokenEndpointSettingsObserveValue, null, null);
// //
IObservableValue observeTextTxtApiUrlObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtApiUrl);
IObservableValue oauthSettingsapiUrlSettingsObserveValue = BeanProperties.value("oauthSettings.apiUrl").observe(settings);
bindingContext.bindValue(observeTextTxtApiUrlObserveWidget, oauthSettingsapiUrlSettingsObserveValue, null, null);
//
IObservableValue observeTextTxtAccessTokenObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtAccessToken); IObservableValue observeTextTxtAccessTokenObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtAccessToken);
IObservableValue oauthSettingsaccessTokenSettingsObserveValue = BeanProperties.value("oauthSettings.accessToken").observe(settings); IObservableValue oauthSettingsaccessTokenSettingsObserveValue = BeanProperties.value("oauthSettings.accessToken").observe(settings);
bindingContext.bindValue(observeTextTxtAccessTokenObserveWidget, oauthSettingsaccessTokenSettingsObserveValue, null, null); bindingContext.bindValue(observeTextTxtAccessTokenObserveWidget, oauthSettingsaccessTokenSettingsObserveValue, null, null);
......
...@@ -22,7 +22,6 @@ public class OAuthSettings extends AbstractModelObject { ...@@ -22,7 +22,6 @@ public class OAuthSettings extends AbstractModelObject {
private String serverUrl = SettingsDialog.CUSTOM_SERVER_URL; private String serverUrl = SettingsDialog.CUSTOM_SERVER_URL;
private String authorizationEndpoint = SettingsDialog.CUSTOM_SERVER_URL + "/oauth/authorize"; private String authorizationEndpoint = SettingsDialog.CUSTOM_SERVER_URL + "/oauth/authorize";
private String tokenEndpoint = SettingsDialog.CUSTOM_SERVER_URL + "/oauth/token"; private String tokenEndpoint = SettingsDialog.CUSTOM_SERVER_URL + "/oauth/token";
private String apiUrl = SettingsDialog.CUSTOM_SERVER_URL + "/api/v0";
private String accessToken = ""; private String accessToken = "";
private String refreshToken = ""; private String refreshToken = "";
private String clientKey = ""; private String clientKey = "";
...@@ -37,7 +36,6 @@ public class OAuthSettings extends AbstractModelObject { ...@@ -37,7 +36,6 @@ public class OAuthSettings extends AbstractModelObject {
this.serverUrl = serverUrl; this.serverUrl = serverUrl;
setAuthorizationEndpoint(this.serverUrl + "/oauth/authorize"); setAuthorizationEndpoint(this.serverUrl + "/oauth/authorize");
setTokenEndpoint(this.serverUrl + "/oauth/token"); setTokenEndpoint(this.serverUrl + "/oauth/token");
setApiUrl(this.serverUrl + "/api/v0");
firePropertyChange("serverUrl", null, this.serverUrl); firePropertyChange("serverUrl", null, this.serverUrl);
} }
...@@ -59,15 +57,6 @@ public class OAuthSettings extends AbstractModelObject { ...@@ -59,15 +57,6 @@ public class OAuthSettings extends AbstractModelObject {
firePropertyChange("tokenEndpoint", null, this.tokenEndpoint); firePropertyChange("tokenEndpoint", null, this.tokenEndpoint);
} }
public String getApiUrl() {
return apiUrl;
}
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
firePropertyChange("apiUrl", null, this.apiUrl);
}
public String getAccessToken() { public String getAccessToken() {
return accessToken; return accessToken;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment