diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/ApplicationConfigurationService.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/ApplicationConfigurationService.java index c5ba2c462..b26a02e82 100644 --- a/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/ApplicationConfigurationService.java +++ b/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/ApplicationConfigurationService.java @@ -2,8 +2,7 @@ package org.mifosng.configuration; public interface ApplicationConfigurationService { - OAuthProviderDetails retrieveOAuthProviderDetails(); - - void update(OAuthProviderDetails newDetails); + void update(String platformApiUrl); + String retrievePlatformApiUrl(); } diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/InMemoryApplicationConfigurationService.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/InMemoryApplicationConfigurationService.java index 4306e554e..8d3d2b060 100644 --- a/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/InMemoryApplicationConfigurationService.java +++ b/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/InMemoryApplicationConfigurationService.java @@ -6,46 +6,24 @@ import org.springframework.stereotype.Service; * When application goes down or rebooted, configuration values return to defaults provided here. */ @Service -public class InMemoryApplicationConfigurationService implements - ApplicationConfigurationService { - - private String oauthProviderUrl = "http://localhost:8080/mifosng-provider/"; - private String requestTokenURL = "oauth/request_token"; - private String userAuthorizationURL = "oauth/confirm_access"; - private String accessTokenURL = "oauth/access_token"; - - private String individualLendingResourceConsumerkey = "mifosng-ui-consumer-key"; - private String individualLendingConsumerSharedSecret = "testmifosng"; +public class InMemoryApplicationConfigurationService implements ApplicationConfigurationService { + private String platformApiUrl = "http://localhost:8080/mifosng-provider/api/v1/"; + public InMemoryApplicationConfigurationService() { // } @Override - public OAuthProviderDetails retrieveOAuthProviderDetails() { - - String requestTokenFullUrl = this.oauthProviderUrl - .concat(this.requestTokenURL); - String userAuthorizationFullURL = this.oauthProviderUrl - .concat(this.userAuthorizationURL); - String accessTokenFullURL = this.oauthProviderUrl - .concat(this.accessTokenURL); - - return new OAuthProviderDetails(this.oauthProviderUrl, requestTokenFullUrl, - userAuthorizationFullURL, accessTokenFullURL, - this.individualLendingResourceConsumerkey, - this.individualLendingConsumerSharedSecret); + public void update(final String platformApiUrl) { + this.platformApiUrl = platformApiUrl; + if (!this.platformApiUrl.endsWith("/")) { + this.platformApiUrl = this.platformApiUrl.concat("/"); + } } @Override - public void update(OAuthProviderDetails newDetails) { - this.oauthProviderUrl = newDetails.getProviderBaseUrl(); - if (!this.oauthProviderUrl.endsWith("/")) { - this.oauthProviderUrl = this.oauthProviderUrl.concat("/"); - } - - this.individualLendingResourceConsumerkey = newDetails.getConsumerkey(); - this.individualLendingConsumerSharedSecret = newDetails.getSharedSecret(); + public String retrievePlatformApiUrl() { + return this.platformApiUrl; } - } \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/OAuthProviderDetails.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/OAuthProviderDetails.java deleted file mode 100644 index 9363a324d..000000000 --- a/mifosng-individual-lending-app/src/main/java/org/mifosng/configuration/OAuthProviderDetails.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.mifosng.configuration; - -public class OAuthProviderDetails { - - private final String requestTokenUrl; - private final String userAuthorizationUrl; - private final String accessTokenUrl; - private final String sharedSecret; - private final String consumerkey; - private final String providerBaseUrl; - - public OAuthProviderDetails(String providerBaseUrl, String requestTokenUrl, - String userAuthorizationUrl, String accessTokenUrl, - String consumerkey, String sharedSecret) { - this.providerBaseUrl = providerBaseUrl; - this.requestTokenUrl = requestTokenUrl; - this.userAuthorizationUrl = userAuthorizationUrl; - this.accessTokenUrl = accessTokenUrl; - this.consumerkey = consumerkey; - this.sharedSecret = sharedSecret; - } - - public OAuthProviderDetails(String oauthProviderUrl, String consumerkey, - String sharedSecret) { - this.providerBaseUrl = oauthProviderUrl; - this.consumerkey = consumerkey; - this.sharedSecret = sharedSecret; - this.accessTokenUrl = ""; - this.userAuthorizationUrl = ""; - this.requestTokenUrl = ""; - } - - public String getRequestTokenUrl() { - return requestTokenUrl; - } - - public String getUserAuthorizationUrl() { - return userAuthorizationUrl; - } - - public String getAccessTokenUrl() { - return accessTokenUrl; - } - - public String getSharedSecret() { - return sharedSecret; - } - - public String getConsumerkey() { - return consumerkey; - } - - public String getProviderBaseUrl() { - return providerBaseUrl; - } -} \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/ApplicationPagesRoutesController.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/ApplicationPagesRoutesController.java index 8303a03ad..c908b0f60 100644 --- a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/ApplicationPagesRoutesController.java +++ b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/ApplicationPagesRoutesController.java @@ -1,9 +1,6 @@ package org.mifosng.ui; -import org.mifosng.configuration.ApplicationConfigurationService; -import org.mifosng.configuration.OAuthProviderDetails; import org.mifosng.ui.infrastructure.BasicAuthUserDetails; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Controller; @@ -21,13 +18,6 @@ import org.springframework.web.servlet.ModelAndView; @Controller public class ApplicationPagesRoutesController { - private final ApplicationConfigurationService applicationConfigurationService; - - @Autowired - public ApplicationPagesRoutesController(ApplicationConfigurationService applicationConfigurationService) { - this.applicationConfigurationService = applicationConfigurationService; - } - @ExceptionHandler(AccessDeniedException.class) public String accessDeniedException() { return "unAuthorizedAction"; @@ -106,14 +96,10 @@ public class ApplicationPagesRoutesController { @RequestMapping(value = "/reporting/flexireport", method = RequestMethod.GET) public String viewFlexibleReportingPage(final Model model, final Authentication authentication) { - OAuthProviderDetails oauthDetails = this.applicationConfigurationService.retrieveOAuthProviderDetails(); - BasicAuthUserDetails userDetails = (BasicAuthUserDetails) authentication.getPrincipal(); model.addAttribute("basicAuthKey", userDetails.getBasicAuthenticationKey()); model.addAttribute("baseApiUrl", userDetails.getFullApiUrl()); - model.addAttribute("baseUrl", oauthDetails.getProviderBaseUrl()); - return "reports/flexireport"; } } \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java index 0c217e439..0428f26a1 100644 --- a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java +++ b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java @@ -5,7 +5,6 @@ import java.util.ArrayList; import java.util.Collection; import org.mifosng.configuration.ApplicationConfigurationService; -import org.mifosng.configuration.OAuthProviderDetails; import org.mifosng.data.AuthenticatedUserData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; @@ -46,10 +45,9 @@ public class ApiDelegatingAuthenticationProvider extends AbstractUserDetailsAuth String password = (String) authentication.getCredentials(); - OAuthProviderDetails oauthDetails = this.applicationConfigurationService.retrieveOAuthProviderDetails(); - String apiVersion = "api/v1/"; + String platformApiUrl = this.applicationConfigurationService.retrievePlatformApiUrl(); String authUrlExtension = "authentication?username=" + username + "&password=" + password; - StringBuilder authenticationApiUrl = new StringBuilder(oauthDetails.getProviderBaseUrl()).append(apiVersion).append(authUrlExtension); + StringBuilder authenticationApiUrl = new StringBuilder(platformApiUrl).append(authUrlExtension); URI restUri = URI.create(authenticationApiUrl.toString()); ResponseEntity s = this.restTemplate.postForEntity(restUri, authRequest(), AuthenticatedUserData.class); @@ -63,7 +61,7 @@ public class ApiDelegatingAuthenticationProvider extends AbstractUserDetailsAuth authorities.add(new SimpleGrantedAuthority(permission)); } User user = new User(authenticatedUserData.getUsername(), "[not needed]", authorities); - userDetails = new BasicAuthUserDetails(user, authenticatedUserData.getBase64EncodedAuthenticationKey(), oauthDetails.getProviderBaseUrl(), apiVersion); + userDetails = new BasicAuthUserDetails(user, authenticatedUserData.getBase64EncodedAuthenticationKey(), platformApiUrl); } return userDetails; diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/BasicAuthUserDetails.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/BasicAuthUserDetails.java index efda943a3..9a716a168 100644 --- a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/BasicAuthUserDetails.java +++ b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/BasicAuthUserDetails.java @@ -10,14 +10,12 @@ public class BasicAuthUserDetails implements UserDetails { private final User user; private final String basicAuthenticationKey; - private final String apiBaseUrl; - private final String apiVersion; + private final String fullApiUrl; - public BasicAuthUserDetails(User user, String basicAuthenticationKey, String apiBaseUrl, String apiVersion) { + public BasicAuthUserDetails(User user, String basicAuthenticationKey, String fullApiUrl) { this.user = user; this.basicAuthenticationKey = basicAuthenticationKey; - this.apiBaseUrl = apiBaseUrl; - this.apiVersion = apiVersion; + this.fullApiUrl = fullApiUrl; } @Override @@ -59,15 +57,7 @@ public class BasicAuthUserDetails implements UserDetails { return basicAuthenticationKey; } - public String getApiBaseUrl() { - return apiBaseUrl; - } - - public String getApiVersion() { - return apiVersion; - } - public String getFullApiUrl() { - return this.apiBaseUrl + apiVersion; + return this.fullApiUrl; } } \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/stretchyreporting/stretchyreporting-0.985.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/stretchyreporting/stretchyreporting-0.987.js similarity index 98% rename from mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/stretchyreporting/stretchyreporting-0.985.js rename to mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/stretchyreporting/stretchyreporting-0.987.js index d104ff404..6d29983c8 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/stretchyreporting/stretchyreporting-0.985.js +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/stretchyreporting/stretchyreporting-0.987.js @@ -3,8 +3,6 @@ $.stretchyReporting = {}; $.stretchyReporting.initialise = function(params) { - username="mifos"; - password="password"; initialiseReporting(params) }; @@ -81,6 +79,9 @@ function initialiseReporting(params) { if (params.RESTUrl) RESTUrl = params.RESTUrl else RESTUrl = ""; + + if (params.basicAuthKey) basicAuthKey = params.basicAuthKey + else basicAuthKey = ""; if (params.pentahoUrl) pentahoUrl = params.pentahoUrl else pentahoUrl = ""; @@ -984,21 +985,21 @@ return for (var i in inParams ) inQueryParameters["R_" + i] = inParams[i]; if (rptDB > "") inQueryParameters["R_rptDB"] = rptDB; - OAuthSimple().reset(); - var OAuthProcess = (new OAuthSimple()).sign({ - path : RESTUrl, - parameters : inQueryParameters, - signatures : { - 'consumer_key' : apiKey, - 'shared_secret' : sharedSecret, - 'access_token' : accessToken, - 'access_secret' : tokenSecret - } - }); +// OAuthSimple().reset(); +// var OAuthProcess = (new OAuthSimple()).sign({ +// path : RESTUrl, +// parameters : inQueryParameters, +// signatures : { +// 'consumer_key' : apiKey, +// 'shared_secret' : sharedSecret, +// 'access_token' : accessToken, +// 'access_secret' : tokenSecret +// } +// }); showMsgE("getReportData IS Auth: " + inQueryParameters); $.ajax({ - url: OAuthProcess.signed_url, + url: RESTUrl, type:'GET', dataType: 'json', contentType: "application/json; charset=utf-8", @@ -1006,6 +1007,8 @@ return cache: false, beforeSend: function( xhr ) { xhr.setRequestHeader("Accept", "application/json"); + console.log("base64: " + basicAuthKey); + xhr.setRequestHeader("Authorization", "Basic " + basicAuthKey); }, success: successFunction, error:function(jqXHR, textStatus, errorThrown){ @@ -1058,9 +1061,8 @@ function getReportDataNoAuth(rptName, inParams, successFunction, isParameterType cache: false, beforeSend : function(xhr) { xhr.setRequestHeader("Accept", "application/json"); - var base64 = $.base64Encode(username + ":" + password); - console.log("base64: " + base64); - xhr.setRequestHeader("Authorization", "Basic " + base64); + console.log("base64: " + basicAuthKey); + xhr.setRequestHeader("Authorization", "Basic " + basicAuthKey); }, success: successFunction, error:function(jqXHR, textStatus, errorThrown){ diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/accountsettings.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/accountsettings.jsp index a9a778f32..ffff7516c 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/accountsettings.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/accountsettings.jsp @@ -22,6 +22,7 @@ $(document).ready(function() { // basic auth details var base64 = "${basicAuthKey}"; + var baseApiUrl = "${baseApiUrl}"; // these helpers are registered for the jsViews and jsRender functionality to fix bug with display zero! $.views.registerHelpers({ @@ -312,8 +313,8 @@ $(document).ready(function() { $("#settings").html(tableHtml); $('#changepassword').click(function(e) { - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/useraccounts/current/password/template'; - var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/useraccounts/current/password'; + var getUrl = baseApiUrl + 'useraccounts/current/password/template'; + var putUrl = baseApiUrl + 'useraccounts/current/password'; var templateSelector = "#changePasswordFormTemplate"; var width = 600; var height = 350; @@ -329,7 +330,7 @@ $(document).ready(function() { }); $('#changedetails').click(function(e) { - var getAndPutUrl = 'http://localhost:8080/mifosng-provider/api/v1/useraccounts/current'; + var getAndPutUrl = baseApiUrl + 'useraccounts/current'; var templateSelector = "#userSettingsFormTemplate"; var width = 600; var height = 350; @@ -361,7 +362,7 @@ $(document).ready(function() {
    -
  • +
diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/orghome.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/orghome.jsp index 2561ad430..b2069dd47 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/orghome.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/orghome.jsp @@ -17,7 +17,8 @@ // basic auth details var base64 = "${basicAuthKey}"; - + var baseApiUrl = "${baseApiUrl}"; + // these helpers are registered for the jsViews and jsRender functionality to fix bug with display zero! $.views.registerHelpers({ @@ -298,8 +299,8 @@ }); $('#addloanproduct').click(function(e) { - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts/template'; - var postUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts'; + var getUrl = baseApiUrl + 'loanproducts/template'; + var postUrl = baseApiUrl + 'loanproducts'; var templateSelector = "#productFormTemplate"; var width = 800; var height = 550; @@ -315,7 +316,7 @@ function refreshLoanProductsView() { var jqxhr = $.ajax({ - url: 'http://localhost:8080/mifosng-provider/api/v1/loanproducts', //'${allLoanProductsUrl}', + url: baseApiUrl + 'loanproducts', type: 'GET', contentType: 'application/json', dataType: 'json', @@ -335,8 +336,8 @@ $("a.editproduct").click( function(e) { var linkId = this.id; var productId = linkId.replace("editproduct", ""); - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts/' + productId; - var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/loanproducts/' + productId; + var getUrl = baseApiUrl + 'loanproducts/' + productId; + var putUrl = baseApiUrl + 'loanproducts/' + productId; var templateSelector = "#productFormTemplate"; var width = 800; @@ -394,8 +395,8 @@ }); $('#addoffice').click(function(e) { - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices/template'; - var postUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices'; + var getUrl = baseApiUrl + 'offices/template'; + var postUrl = baseApiUrl + 'offices'; var templateSelector = "#officeFormTemplate"; var width = 600; var height = 400; @@ -411,7 +412,7 @@ function refreshOfficesView() { var jqxhr = $.ajax({ - url: 'http://localhost:8080/mifosng-provider/api/v1/offices', // '${allOfficesUrl}', + url: baseApiUrl + 'offices', type: 'GET', contentType: 'application/json', dataType: 'json', @@ -435,8 +436,8 @@ $("a.edit").click( function(e) { var linkId = this.id; var entityId = linkId.replace("edit", ""); - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices/' + entityId; - var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/offices/' + entityId; + var getUrl = baseApiUrl + 'offices/' + entityId; + var putUrl = baseApiUrl + 'offices/' + entityId; var templateSelector = "#officeFormTemplate"; var width = 600; @@ -482,8 +483,8 @@ // currency configuration $('#editconfiguration').click(function(e) { - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/configurations/currency'; - var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/configurations/currency'; + var getUrl = baseApiUrl + 'configurations/currency'; + var putUrl = baseApiUrl + 'configurations/currency'; var templateSelector = "#configurationFormTemplate"; var width = 900; var height = 400; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/userhome.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/userhome.jsp index 4b217ba5f..ea6b79b81 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/userhome.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/admin/userhome.jsp @@ -19,6 +19,7 @@ $(document).ready(function() { // basic auth details var base64 = "${basicAuthKey}"; + var baseApiUrl = "${baseApiUrl}"; // $.views.registerHelpers({ @@ -346,14 +347,14 @@ $(document).ready(function() { } $('#listusers').click(function(e) { - var listUrl = "http://localhost:8080/mifosng-provider/api/v1/users"; + var listUrl = baseApiUrl + "users"; refreshUsersView(); e.preventDefault(); }); $('#adduser').click(function(e) { - var url = 'http://localhost:8080/mifosng-provider/api/v1/users/template'; - var postUrl = "http://localhost:8080/mifosng-provider/api/v1/users"; + var url = baseApiUrl + 'template'; + var postUrl = baseApiUrl + "users"; var templateSelector = "#userFormTemplate"; var width = 1000; var height = 550; @@ -368,14 +369,14 @@ $(document).ready(function() { }); $('#listroles').click(function(e) { - var listUrl = "http://localhost:8080/mifosng-provider/api/v1/roles"; + var listUrl = baseApiUrl + "roles"; refreshRolesView(); e.preventDefault(); }); $('#addrole').click(function(e) { - var url = 'http://localhost:8080/mifosng-provider/api/v1/roles/template'; - var postUrl = "http://localhost:8080/mifosng-provider/api/v1/roles"; + var url = baseApiUrl +'template'; + var postUrl = baseApiUrl + "roles"; var templateSelector = "#roleFormTemplate"; var width = 1000; var height = 550; @@ -397,7 +398,7 @@ $(document).ready(function() { function refreshUsersView() { - var listUrl = 'http://localhost:8080/mifosng-provider/api/v1/users'; + var listUrl = baseApiUrl + 'users'; var templateSelector = "#usersListTemplate"; var displayAreaDivSelector = "#contentplaceholder"; @@ -419,8 +420,8 @@ $(document).ready(function() { $("a.edit").click( function(e) { var linkId = this.id; var entityId = linkId.replace("edit", ""); - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/users/' + entityId; - var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/users/' + entityId; + var getUrl = baseApiUrl + 'users/' + entityId; + var putUrl = baseApiUrl + 'users/' + entityId; var templateSelector = "#userFormTemplate"; var width = 1000; @@ -438,7 +439,7 @@ $(document).ready(function() { $("a.delete").click( function(e) { var linkId = this.id; var entityId = linkId.replace("delete", ""); - var url = 'http://localhost:8080/mifosng-provider/api/v1/users/' + entityId; + var url = baseApiUrl + 'users/' + entityId; showNotAvailableDialog('dialog.title.functionality.not.available'); e.preventDefault(); @@ -464,7 +465,7 @@ $(document).ready(function() { } function refreshRolesView() { - var listUrl = 'http://localhost:8080/mifosng-provider/api/v1/roles'; + var listUrl = baseApiUrl + 'roles'; var templateSelector = "#roleListTemplate"; var displayAreaDivSelector = "#contentplaceholder"; @@ -486,8 +487,8 @@ $(document).ready(function() { $("a.edit").click( function(e) { var linkId = this.id; var entityId = linkId.replace("edit", ""); - var getUrl = 'http://localhost:8080/mifosng-provider/api/v1/roles/' + entityId; - var putUrl = 'http://localhost:8080/mifosng-provider/api/v1/roles/' + entityId; + var getUrl = baseApiUrl + 'roles/' + entityId; + var putUrl = baseApiUrl + 'roles/' + entityId; var templateSelector = "#roleFormTemplate"; var width = 1000; @@ -505,7 +506,7 @@ $(document).ready(function() { $("a.delete").click( function(e) { var linkId = this.id; var entityId = linkId.replace("delete", ""); - var url = 'http://localhost:8080/mifosng-provider/api/v1/roles/' + entityId; + var url = baseApiUrl + 'roles/' + entityId; showNotAvailableDialog('dialog.title.functionality.not.available'); e.preventDefault(); @@ -531,7 +532,7 @@ $(document).ready(function() { } function refreshPermissionsView() { - var listUrl = 'http://localhost:8080/mifosng-provider/api/v1/permissions'; + var listUrl = baseApiUrl + 'permissions'; var templateSelector = "#permissionListTemplate"; var displayAreaDivSelector = "#contentplaceholder"; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp index 5dddaae5a..a63e14cb4 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp @@ -840,7 +840,7 @@ $(document).ready(function() {
diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head-stretchyreporting.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head-stretchyreporting.jsp index 6a797be2b..c163d5d30 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head-stretchyreporting.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head-stretchyreporting.jsp @@ -15,6 +15,6 @@ - + diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp index 1e2e3c499..2521f2978 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp @@ -343,7 +343,7 @@ $(document).ready(function() {
    -
  • +
diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/newloanapplication.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/newloanapplication.jsp index f51786244..8ab0642f7 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/newloanapplication.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/newloanapplication.jsp @@ -15,6 +15,7 @@ $(document).ready(function() { // basic auth details var base64 = "${basicAuthKey}"; + var baseApiUrl = "${baseApiUrl}"; $.views.registerHelpers({ @@ -197,7 +198,7 @@ $(document).ready(function() { function repopulateFullForm(clientId, productId) { - var url = 'http://localhost:8080/mifosng-provider/api/v1/loans/template?clientId=' + clientId + '&productId=' + productId; + var url = baseApiUrl + 'loans/template?clientId=' + clientId + '&productId=' + productId; var jqxhr = $.ajax({ url: url, @@ -298,7 +299,7 @@ $(document).ready(function() { } function calculateLoanSchedule() { - var calculateLoanScheduleurl = 'http://localhost:8080/mifosng-provider/api/v1/loans?command=calculateLoanSchedule'; + var calculateLoanScheduleurl = baseApiUrl + 'loans?command=calculateLoanSchedule'; var newFormData = JSON.stringify($('#entityform').serializeObject()); console.log(newFormData); @@ -328,7 +329,7 @@ $(document).ready(function() { } function submitLoanApplication() { - var submitLoanApplicationUrl = 'http://localhost:8080/mifosng-provider/api/v1/loans'; + var submitLoanApplicationUrl = baseApiUrl + 'loans'; var newFormData = JSON.stringify($('#entityform').serializeObject()); console.log(newFormData); @@ -361,7 +362,7 @@ $(document).ready(function() { // on page load var jqxhr = $.ajax({ - url: 'http://localhost:8080/mifosng-provider/api/v1/loans/template?clientId=${clientId}', + url: baseApiUrl + 'loans/template?clientId=${clientId}', type: 'GET', contentType: 'application/json', dataType: 'json', diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/reports/flexireport.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/reports/flexireport.jsp index c5d335ee9..573cbd996 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/reports/flexireport.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/reports/flexireport.jsp @@ -64,7 +64,7 @@
-