summaryrefslogtreecommitdiffstats
path: root/catalog-fe/src/main/java/org
diff options
context:
space:
mode:
authorilanap <ilanap@amdocs.com>2019-11-26 11:53:36 +0200
committerilanap <ilanap@amdocs.com>2019-11-27 10:02:46 +0200
commit1367b73c1d1d761939f5893c711f87716a7baad0 (patch)
treeca3e94977db0575e30070d2f852c5184c4a38a06 /catalog-fe/src/main/java/org
parent1d3f7e44c9773db172694e8abe0c1ffea1538e37 (diff)
Add API to retrieve UI configuration
Added configuration file with the menu configuration from catalog-ui. Added to the configuration manager. to chef and to the ui rest APIs. Issue-ID: SDC-2663 Signed-off-by: ilanap <ilanap@amdocs.com> Change-Id: Ia5e014a273238981241821c0d81b0455bd662b28 Signed-off-by: ilanap <ilanap@amdocs.com>
Diffstat (limited to 'catalog-fe/src/main/java/org')
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java
index 138318bb61..08b7c43397 100644
--- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/ConfigServlet.java
@@ -23,6 +23,10 @@ package org.openecomp.sdc.fe.servlets;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.fe.config.FeEcompErrorManager;
import org.openecomp.sdc.fe.impl.PluginStatusBL;
+import org.openecomp.sdc.fe.config.ConfigurationManager;
+import org.openecomp.sdc.fe.config.WorkspaceConfiguration;
+import org.openecomp.sdc.exception.NotFoundException;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,6 +49,37 @@ public class ConfigServlet extends LoggingServlet {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigServlet.class.getName());
+ @GET
+ @Path("/ui/workspace")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getUIWorkspaceConfiguration(@Context final HttpServletRequest request) {
+
+ try {
+ logFeRequest(request);
+
+ ServletContext context = request.getSession().getServletContext();
+
+ ConfigurationManager configurationManager = (ConfigurationManager) context
+ .getAttribute(Constants.CONFIGURATION_MANAGER_ATTR);
+
+ WorkspaceConfiguration configuration = configurationManager.getWorkspaceConfiguration();
+ if (configuration == null) {
+ throw new NotFoundException(WorkspaceConfiguration.class.getSimpleName());
+ }
+ LOGGER.info("The value returned from getConfig is {}", configuration);
+ String result = gson.toJson(configuration);
+ Response response = Response.status(Status.OK).entity(result).build();
+ logFeResponse(request, response);
+
+ return response;
+ } catch (Exception e) {
+ FeEcompErrorManager.getInstance().logFeHttpLoggingError("FE Response");
+ LOGGER.error("Unexpected FE response logging error :", e);
+ return Response.status(Status.INTERNAL_SERVER_ERROR).entity("{}").build();
+ }
+
+ }
+
@GET
@Path("/ui/plugins")