summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-common/src
diff options
context:
space:
mode:
authorChristopher Lott (cl778h) <clott@research.att.com>2017-06-13 14:33:51 -0400
committerChristopher Lott (cl778h) <clott@research.att.com>2017-06-13 15:09:24 -0400
commita91868b4d461d903c2e0ef78a75afe89385bc7e9 (patch)
tree22ee5f9f096e0e650cf2804c6281233c63df5ab9 /ecomp-sdk/epsdk-app-common/src
parent0b2b3270d23bc1bec003f7bda3e6b4babd41ba38 (diff)
[PORTAL-15] RAPTOR reporting fixes
Also repairs a bug in the user-management overlay screen. Ticket number all caps this time. Restore epsdk-app-os pom -SNAPSHOT suffix Change-Id: I7ef620c4ebc52259bcf474908bc4810dfd7e41e7 Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-common/src')
-rw-r--r--ecomp-sdk/epsdk-app-common/src/main/java/org/openecomp/portalapp/controller/core/ProfileSearchController.java29
1 files changed, 12 insertions, 17 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/openecomp/portalapp/controller/core/ProfileSearchController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/openecomp/portalapp/controller/core/ProfileSearchController.java
index c5614f80..e44aef8b 100644
--- a/ecomp-sdk/epsdk-app-common/src/main/java/org/openecomp/portalapp/controller/core/ProfileSearchController.java
+++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/openecomp/portalapp/controller/core/ProfileSearchController.java
@@ -55,13 +55,13 @@ public class ProfileSearchController extends RestrictedBaseController {
private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ProfileSearchController.class);
@Autowired
- UserProfileService service;
+ private UserProfileService service;
@Autowired
- FnMenuService fnMenuService;
+ private FnMenuService fnMenuService;
@RequestMapping(value = { "/profile_search" }, method = RequestMethod.GET)
- public ModelAndView ProfileSearch(HttpServletRequest request) {
+ public ModelAndView profileSearch(HttpServletRequest request) {
Map<String, Object> model = new HashMap<String, Object>();
ObjectMapper mapper = new ObjectMapper();
List<User> profileList = null;
@@ -71,14 +71,13 @@ public class ProfileSearchController extends RestrictedBaseController {
model.putAll(setDashboardData(request));
model.put("profileList", mapper.writeValueAsString(profileList));
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.applicationLogger,
- "error while profile_search process in ProfileSearchController" + e.getMessage());
+ logger.error(EELFLoggerDelegate.applicationLogger, "profileSearch failed", e);
}
return new ModelAndView(getViewName(), "model", model);
}
@RequestMapping(value = { "/get_user" }, method = RequestMethod.GET)
- public void GetUser(HttpServletRequest request, HttpServletResponse response) {
+ public void getUser(HttpServletRequest request, HttpServletResponse response) {
logger.info(EELFLoggerDelegate.applicationLogger, "Initiating get_user in ProfileSearchController");
ObjectMapper mapper = new ObjectMapper();
List<User> profileList = null;
@@ -86,11 +85,10 @@ public class ProfileSearchController extends RestrictedBaseController {
profileList = service.findAll();
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(profileList));
JSONObject j = new JSONObject(msg);
+ response.setContentType("application/json");
response.getWriter().write(j.toString());
-
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.applicationLogger,
- "error while get_user process in ProfileSearchController" + e.getMessage());
+ logger.error(EELFLoggerDelegate.applicationLogger, "getUser failed", e);
}
}
@@ -111,16 +109,15 @@ public class ProfileSearchController extends RestrictedBaseController {
model.put("profileList", mapper.writeValueAsString(profileList));
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
JSONObject j = new JSONObject(msg);
+ response.setContentType("application/json");
response.getWriter().write(j.toString());
-
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.applicationLogger,
- "error while get_user_pagination process in ProfileSearchController" + e.getMessage());
+ logger.error(EELFLoggerDelegate.applicationLogger, "getUserPagination failed", e);
}
}
@SuppressWarnings("unchecked")
- public Map<String, Object> setDashboardData(HttpServletRequest request) throws Exception {
+ private Map<String, Object> setDashboardData(HttpServletRequest request) throws Exception {
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> model = new HashMap<String, Object>();
List<List<MenuData>> childItemList = new ArrayList<List<MenuData>>();
@@ -132,8 +129,7 @@ public class ProfileSearchController extends RestrictedBaseController {
.getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
fnMenuService.setMenuDataStructure(childItemList, parentList, menuResult);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.applicationLogger,
- "error while setDashboardData process in ProfileSearchController" + e.getMessage());
+ logger.error(EELFLoggerDelegate.applicationLogger, "setDashboardData failed", e);
}
model.put("childItemList", mapper.writeValueAsString(childItemList));
model.put("parentList", mapper.writeValueAsString(parentList));
@@ -156,8 +152,7 @@ public class ProfileSearchController extends RestrictedBaseController {
PrintWriter out = response.getWriter();
out.write(mapper.writeValueAsString(user.getActive()));
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.applicationLogger,
- "error while toggleProfileActive process in ProfileSearchController" + e.getMessage());
+ logger.error(EELFLoggerDelegate.applicationLogger, "toggleProfileActive failed", e);
}
}
}