New Portal property services.widget.protocol controls whether http or https
protocol is used to access the widget microservice endpoints.
Adjust build script to use new name "sdk" when building Docker with Portal apps
(formerly named ecompsdkos).
Change-Id: I25b7f39d40351da04c7a9dc3cc1c75ddad2750ea
Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
14 files changed:
-.idea/workspace.xml
\ No newline at end of file
+/.idea/workspace.xml
+/.project
+/.settings
+/dmaapbc
+/sdk
docker stop ecompdb_portal
docker stop ecompdb_portal
-docker rm ecompdb_portal
\ No newline at end of file
+docker rm ecompdb_portal
+# Builds docker with three webapps: portal app, portal-sdk app, dbc app
# Stop on error; show output
set -e -x
# Stop on error; show output
set -e -x
cp -r ecomp-portal-BE-os $PROJECTDIR/ecomp-portal-BE-os
cp -r ecomp-portal-DB-common $PROJECTDIR/ecomp-portal-DB-common
cp -r ecomp-portal-DB-os $PROJECTDIR/ecomp-portal-DB-os
cp -r ecomp-portal-BE-os $PROJECTDIR/ecomp-portal-BE-os
cp -r ecomp-portal-DB-common $PROJECTDIR/ecomp-portal-DB-common
cp -r ecomp-portal-DB-os $PROJECTDIR/ecomp-portal-DB-os
-cp -r ecompsdkos/ecomp-sdk $PROJECTDIR/ecomp-sdk
+cp -r sdk/ecomp-sdk $PROJECTDIR/ecomp-sdk
cd $PROJECTDIR/ecomp-portal-BE-common
${MVN} install
cd $PROJECTDIR/ecomp-portal-BE-common
${MVN} install
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("FAILURE");
expectedportalRestResponse.setResponse(
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("FAILURE");
expectedportalRestResponse.setResponse(
- "I/O error on GET request for \"https://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
+ "I/O error on GET request for \"" + EcompPortalUtils.widgetMsProtocol() + "://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
PortalRestStatusEnum portalRestStatusEnum = null;
expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
PowerMockito.mockStatic(WidgetServiceHeaders.class);
PortalRestStatusEnum portalRestStatusEnum = null;
expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
PowerMockito.mockStatic(WidgetServiceHeaders.class);
@SuppressWarnings("unchecked")
@Test
public void deleteMicroserviceWhenNoWidgetsAssociatedTest() throws Exception {
@SuppressWarnings("unchecked")
@Test
public void deleteMicroserviceWhenNoWidgetsAssociatedTest() throws Exception {
- String HTTPS = "https://";
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("SUCCESS");
expectedportalRestResponse.setResponse("");
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("SUCCESS");
expectedportalRestResponse.setResponse("");
ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
};
Mockito.when(template.exchange(
ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
};
Mockito.when(template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/service/" + 1,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
+ "/widget/microservices/widgetCatalog/service/" + 1,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.test.framework.MockitoTestSuite;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.test.framework.MockitoTestSuite;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
+import org.openecomp.portalsdk.core.util.SystemProperties;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
{
String whatService = "widgets-service";
PowerMockito.mockStatic(WidgetServiceHeaders.class);
{
String whatService = "widgets-service";
PowerMockito.mockStatic(WidgetServiceHeaders.class);
- Mockito.when(template.getForObject("https://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
+ Mockito.when(template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
WidgetServiceHeaders.getInstance())).thenReturn("Success");
String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
assertTrue(response.equals("Success"));
WidgetServiceHeaders.getInstance())).thenReturn("Success");
String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
assertTrue(response.equals("Success"));
import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.MicroserviceService;
import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.MicroserviceService;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
@EPAuditLog
public class MicroserviceController extends EPRestrictedBaseController {
@EPAuditLog
public class MicroserviceController extends EPRestrictedBaseController {
- private static final String HTTPS = "https://";
-
String whatService = "widgets-service";
RestTemplate template = new RestTemplate();
String whatService = "widgets-service";
RestTemplate template = new RestTemplate();
@Autowired
private MicroserviceService microserviceService;
@Autowired
private MicroserviceService microserviceService;
@RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
@RequestBody MicroserviceData newServiceData) throws Exception {
@RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
@RequestBody MicroserviceData newServiceData) throws Exception {
};
// If this service is assoicated with widgets, cannnot be deleted
ResponseEntity<List<WidgetCatalog>> ans = (ResponseEntity<List<WidgetCatalog>>) template.exchange(
};
// If this service is assoicated with widgets, cannnot be deleted
ResponseEntity<List<WidgetCatalog>> ans = (ResponseEntity<List<WidgetCatalog>>) template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/service/" + serviceId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef);
List<WidgetCatalog> widgets = ans.getBody();
+ "/widget/microservices/widgetCatalog/service/" + serviceId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef);
List<WidgetCatalog> widgets = ans.getBody();
private static final String MACHINE_LEARNING_SERVICE_CTX = "/ml_api";
private static final String REGISTER_ACTION = MACHINE_LEARNING_SERVICE_CTX + "/" + "registerAction";
private static final String CONSUL_ML_SERVICE_ID = "machine-learning";
private static final String MACHINE_LEARNING_SERVICE_CTX = "/ml_api";
private static final String REGISTER_ACTION = MACHINE_LEARNING_SERVICE_CTX + "/" + "registerAction";
private static final String CONSUL_ML_SERVICE_ID = "machine-learning";
- private static final String SERVICE_PROTOCOL = "http";
private static final String APP_KEY = "uebkey";
private static final String APP_KEY = "uebkey";
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebAnalyticsExtAppController.class);
+ private AsyncRestTemplate restTemplate = new AsyncRestTemplate();
+
@Autowired
AuditService auditService;
@Autowired
AuditService auditService;
@Autowired
AppsCacheService appCacheService;
@Autowired
AppsCacheService appCacheService;
- private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebAnalyticsExtAppController.class);
-
- private AsyncRestTemplate restTemplate = new AsyncRestTemplate();
-
SuccessCallback<ResponseEntity<String>> successCallback = new SuccessCallback<ResponseEntity<String>>() {
@Override
public void onSuccess(ResponseEntity<String> arg) {
SuccessCallback<ResponseEntity<String>> successCallback = new SuccessCallback<ResponseEntity<String>>() {
@Override
public void onSuccess(ResponseEntity<String> arg) {
// send it!
ListenableFuture<ResponseEntity<String>> out = restTemplate.exchange(
// send it!
ListenableFuture<ResponseEntity<String>> out = restTemplate.exchange(
- SERVICE_PROTOCOL + "://"
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(CONSUL_ML_SERVICE_ID,
SystemProperties.getProperty("microservices.m-learn.local.port"))
+ REGISTER_ACTION,
+ consulHealthService.getServiceLocation(CONSUL_ML_SERVICE_ID,
SystemProperties.getProperty("microservices.m-learn.local.port"))
+ REGISTER_ACTION,
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.MicroserviceService;
import org.openecomp.portalapp.portal.service.WidgetParameterService;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.MicroserviceService;
import org.openecomp.portalapp.portal.service.WidgetParameterService;
+import org.openecomp.portalapp.portal.utils.CustomLoggingFilter;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
@EPAuditLog
public class WidgetsCatalogController extends EPRestrictedBaseController {
@EPAuditLog
public class WidgetsCatalogController extends EPRestrictedBaseController {
- private static final String HTTPS = "https://";
-
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogController.class);
RestTemplate template = new RestTemplate();
String whatService = "widgets-service";
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogController.class);
RestTemplate template = new RestTemplate();
String whatService = "widgets-service";
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET)
public List<WidgetCatalog> getUserWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
@PathVariable("loginName") String loginName) throws RestClientException, Exception {
List<WidgetCatalog> widgets = new ArrayList<>();
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET)
public List<WidgetCatalog> getUserWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
@PathVariable("loginName") String loginName) throws RestClientException, Exception {
List<WidgetCatalog> widgets = new ArrayList<>();
+ try {CustomLoggingFilter d;
ResponseEntity<ArrayList> ans = template.exchange(
ResponseEntity<ArrayList> ans = template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + loginName,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + loginName,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
public List<WidgetCatalog> getWidgetCatalog(HttpServletRequest request, HttpServletResponse response)
throws RestClientException, Exception {
List<WidgetCatalog> widgets = new ArrayList<>();
public List<WidgetCatalog> getWidgetCatalog(HttpServletRequest request, HttpServletResponse response)
throws RestClientException, Exception {
List<WidgetCatalog> widgets = new ArrayList<>();
+
+ String p = EcompPortalUtils.widgetMsProtocol();
try {
ResponseEntity<ArrayList> ans = template.exchange(
try {
ResponseEntity<ArrayList> ans = template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog",
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog",
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId)
throws RestClientException, Exception {
template.exchange(
@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId)
throws RestClientException, Exception {
template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + widgetId,
HttpMethod.PUT, new HttpEntity(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + widgetId,
HttpMethod.PUT, new HttpEntity(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
public void deleteOnboardingWidget(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
template.exchange(
public void deleteOnboardingWidget(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + widgetId,
HttpMethod.DELETE, new HttpEntity(WidgetServiceHeaders.getInstance()), String.class);
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + widgetId,
HttpMethod.DELETE, new HttpEntity(WidgetServiceHeaders.getInstance()), String.class);
multipartRequest.add("file", new FileSystemResource(tmp_folder + fileName));
multipartRequest.add("widget", request.getParameter("newWidget"));
respond = template.postForObject(
multipartRequest.add("file", new FileSystemResource(tmp_folder + fileName));
multipartRequest.add("widget", request.getParameter("newWidget"));
respond = template.postForObject(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + widgetId,
new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/" + widgetId,
new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
multipartRequest.add("widget", request.getParameter("newWidget"));
respond = template.postForObject(
multipartRequest.add("widget", request.getParameter("newWidget"));
respond = template.postForObject(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog",
new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog",
new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
@RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
public String getWidgetFramework(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
@RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
public String getWidgetFramework(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
- return template.getForObject(HTTPS
+ return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/" + widgetId + "/framework.js", String.class,
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/" + widgetId + "/framework.js", String.class,
@RequestMapping(value = "/portalApi/microservices/{widgetId}/controller.js", method = RequestMethod.GET)
public String getWidgetController(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
@RequestMapping(value = "/portalApi/microservices/{widgetId}/controller.js", method = RequestMethod.GET)
public String getWidgetController(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
- return template.getForObject(HTTPS
+ return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/" + widgetId + "/controller.js", String.class,
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/" + widgetId + "/controller.js", String.class,
@RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET)
public String getWidgetCSS(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
@RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET)
public String getWidgetCSS(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
- return template.getForObject(HTTPS
+ return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/" + widgetId + "/styles.css", String.class,
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/" + widgetId + "/styles.css", String.class,
List<WidgetParameterResult> list = new ArrayList<>();
Long serviceId = template.exchange(
List<WidgetParameterResult> list = new ArrayList<>();
Long serviceId = template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/parameters/" + widgetId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class).getBody();
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/parameters/" + widgetId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class).getBody();
ServletContext context = request.getServletContext();
byte[] byteFile = template.exchange(
ServletContext context = request.getServletContext();
byte[] byteFile = template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService,
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/download/" + widgetId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), byte[].class).getBody();
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/download/" + widgetId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), byte[].class).getBody();
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController {
private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogMarkupController.class);
public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController {
private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogMarkupController.class);
private RestTemplate template = new RestTemplate();
private RestTemplate template = new RestTemplate();
private final String whatService = "widgets-service";
@Autowired
private final String whatService = "widgets-service";
@Autowired
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
return template
.getForObject(
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
return template
.getForObject(
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/markup/" + widgetId,
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/markup/" + widgetId,
import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
import org.openecomp.portalsdk.core.util.SystemProperties;
@SuppressWarnings({ "rawtypes", "unchecked" })
ResponseEntity<Long> ans = (ResponseEntity<Long>) template.exchange(
@SuppressWarnings({ "rawtypes", "unchecked" })
ResponseEntity<Long> ans = (ResponseEntity<Long>) template.exchange(
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/parameters/" + widgetId,
+ consulHealthService.getServiceLocation(whatService,
SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/parameters/" + widgetId,
public static final String AUTH_USER_SERVER = "auth_user_server";
public static final String EXTERNAL_ACCESS_ENABLE = "external_access_enable";
public static final String AUTH_USER_SERVER = "auth_user_server";
public static final String EXTERNAL_ACCESS_ENABLE = "external_access_enable";
+ public static final String WIDGET_MS_PROTOCOL = "microservices.widget.protocol";
}
\ No newline at end of file
}
\ No newline at end of file
+
+ public static String widgetMsProtocol(){
+ final String protocol;
+ try{
+ protocol = SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_PROTOCOL);
+ return (protocol == null || protocol.trim().equals("")) ? "https" : protocol ;
+ }
+ catch(IllegalStateException ese){
+ //looks like SystemProperties.getProperty throws IllegalStateException if it cannot find a property you are looking for
+ //In order to not break the code if a non-required property is missing from system.properties, returning https as default
+ //when this exception is caught.
+ return "https";
+ }
+ }
+Version 1.1.?, July 2017
+- [Portal-30] Failed to communicate with the widget microservice: Fixed
+
Version 1.1.0, July 2017
- [Portal-7] Improvements added as part of the rebasing process
- [Portal-6] Updates to License and Trademark in the PORTAL Source Code
Version 1.1.0, July 2017
- [Portal-7] Improvements added as part of the rebasing process
- [Portal-6] Updates to License and Trademark in the PORTAL Source Code