diff options
author | davsad <david.sadlier@est.tech> | 2021-08-23 05:54:13 +0100 |
---|---|---|
committer | David Sadlier <david.sadlier@est.tech> | 2021-08-23 23:09:40 +0000 |
commit | 38f534f4c7c425f49925dd2d3615729eba703130 (patch) | |
tree | fcf7b3d0430e83d1ebf769fa1d85ddabcc6eb46f /catalog-be/src/main/java | |
parent | e5b8482c4d2ceddf559da26e532fdbb95a593dc1 (diff) |
Filter catalog in UI based on model
Issue-ID: SDC-3679
Signed-off-by: davsad <david.sadlier@est.tech>
Change-Id: Icd0eeb13dbfb1cc27745c7adf6a3212210e00a4a
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java index f79650ddc7..f8028583b3 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java @@ -19,22 +19,12 @@ */ package org.openecomp.sdc.be.servlets; -import com.jcabi.aspects.Loggable; -import fj.data.Either; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.servers.Server; -import io.swagger.v3.oas.annotations.servers.Servers; -import io.swagger.v3.oas.annotations.tags.Tags; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import javax.inject.Inject; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -50,8 +40,10 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; + import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; import org.openecomp.sdc.be.components.impl.ElementBusinessLogic; +import org.openecomp.sdc.be.components.impl.ModelBusinessLogic; import org.openecomp.sdc.be.components.impl.aaf.AafPermission; import org.openecomp.sdc.be.components.impl.aaf.PermissionAllowed; import org.openecomp.sdc.be.components.scheduledtasks.ComponentsCleanBusinessLogic; @@ -83,6 +75,19 @@ import org.openecomp.sdc.common.log.wrappers.Logger; import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.stereotype.Controller; +import com.jcabi.aspects.Loggable; + +import fj.data.Either; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.Servers; +import io.swagger.v3.oas.annotations.tags.Tags; + @Path("/v1/") /** * @@ -101,15 +106,17 @@ public class ElementServlet extends BeGenericServlet { private final ComponentsCleanBusinessLogic componentsCleanBusinessLogic; private final ElementBusinessLogic elementBusinessLogic; private final ArtifactsBusinessLogic artifactsBusinessLogic; + private final ModelBusinessLogic modelBusinessLogic; @Inject public ElementServlet(final UserBusinessLogic userBusinessLogic, final ComponentsUtils componentsUtils, final ComponentsCleanBusinessLogic componentsCleanBusinessLogic, final ElementBusinessLogic elementBusinessLogic, - final ArtifactsBusinessLogic artifactsBusinessLogic) { + final ArtifactsBusinessLogic artifactsBusinessLogic, final ModelBusinessLogic modelBusinessLogic) { super(userBusinessLogic, componentsUtils); this.componentsCleanBusinessLogic = componentsCleanBusinessLogic; this.elementBusinessLogic = elementBusinessLogic; this.artifactsBusinessLogic = artifactsBusinessLogic; + this.modelBusinessLogic = modelBusinessLogic; } /* ****************************************************************************** @@ -652,6 +659,7 @@ public class ElementServlet extends BeGenericServlet { return buildErrorResponse(either.right().value()); } consolidatedObject.put("categories", either.left().value()); + consolidatedObject.put("models", modelBusinessLogic.listModels()); consolidatedObject.put("version", getVersion(servletContext)); } catch (Exception e) { BeEcompErrorManager.getInstance().logBeRestApiGeneralError("getSDCVersion"); |