summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-core/src
diff options
context:
space:
mode:
authorst782s <statta@research.att.com>2017-08-14 11:41:04 -0400
committerst782s <statta@research.att.com>2017-08-15 14:07:15 -0400
commita2f5a35c06a526b05e4efd9fe275d6639bf22cd3 (patch)
tree75e423e367598929f54345359b3851e48ae9cd68 /ecomp-sdk/epsdk-core/src
parent3159458ff8563771a5460839fd75bdc25159ea87 (diff)
DDL updates and cleanup
- remove unused javascript libraries - remove contentious icons and images - Remove constraints to support Role Centralization Issue: PORTAL-21, Portal-17 Change-Id: I347accb04343d1c866c075ee716c46fea9e0d036 Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core/src')
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuService.java2
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuServiceImpl.java22
2 files changed, 18 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuService.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuService.java
index 2face03a..913c9de1 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuService.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuService.java
@@ -42,7 +42,7 @@ public interface FnMenuService {
List<Long> getParentId(String label);
@SuppressWarnings("rawtypes")
List<List> getParentList();
- List<RoleFunction> getFunctionCDList(HttpServletRequest request);
+ List<RoleFunction> getFunctionCDList(HttpServletRequest request) throws Exception;
void removeMenuItem(Menu domainFnMenu);
Map<String, List<MenuData>> setMenuDataStructure(List<List<MenuData>> childItemList, List<MenuData> parentList, Set<MenuData> menuResult) throws Exception;
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuServiceImpl.java
index 9b16aabb..22bc9675 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuServiceImpl.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/FnMenuServiceImpl.java
@@ -31,12 +31,16 @@ import javax.servlet.http.HttpServletRequest;
import org.openecomp.portalsdk.core.domain.Menu;
import org.openecomp.portalsdk.core.domain.MenuData;
import org.openecomp.portalsdk.core.domain.RoleFunction;
+import org.openecomp.portalsdk.core.domain.User;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.web.support.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+
/**
* Description: this java class is an implementation of services for Admin to add/edit/delete menu items from FN_MENU
*/
@@ -51,7 +55,7 @@ public class FnMenuServiceImpl implements FnMenuService{
private DataAccessService dataAccessService;
@Autowired
- private RoleService roleService;
+ private RestApiRequestBuilder restApiRequestBuilder;
@SuppressWarnings("unchecked")
public List<MenuData> getFnMenuItems() {
@@ -104,10 +108,18 @@ public class FnMenuServiceImpl implements FnMenuService{
@SuppressWarnings("unchecked")
@Override
- public List<RoleFunction> getFunctionCDList(HttpServletRequest request) {
- Set roleFunctionList = new HashSet<>();
- roleFunctionList = UserUtils.getRoleFunctions(request);
- List roleFunctionFinalList = new ArrayList<>(roleFunctionList);
+ public List<RoleFunction> getFunctionCDList(HttpServletRequest request) throws Exception {
+ User user = UserUtils.getUserSession(request);
+ ObjectMapper mapper = new ObjectMapper();
+ List roleFunctionFinalList = new ArrayList<>();
+ try {
+ String menuList = restApiRequestBuilder.getViaREST("/menuFunctions", true, user.getOrgUserId());
+ roleFunctionFinalList = mapper.readValue(menuList,
+ TypeFactory.defaultInstance().constructCollectionType(List.class, String.class));
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "saveRole Failed", e);
+ throw new Exception(e.getMessage());
+ }
return roleFunctionFinalList;
}