use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method getViewMleForPageNo.
@SuppressWarnings("unchecked")
public ModelAndView getViewMleForPageNo(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.getViewMleForPageNo >>");
ModelAndView responseView = new ModelAndView(new JSONView());
try {
HttpSession session = req.getSession();
Map<Integer, List<MLEDataVO>> map = (Map<Integer, List<MLEDataVO>>) session.getAttribute("MleList");
responseView.addObject("MLEDataVo", map.get(Integer.parseInt(req.getParameter("pageNo"))));
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
responseView.addObject("MLEDataVo", "");
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
return responseView;
}
responseView.addObject("result", true);
responseView.addObject("message", "");
log.info("WLMDataController.getViewMleForPageNo <<");
return responseView;
}
use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method getAllOSList.
/*Methods to get data for pagination for OS Component */
public ModelAndView getAllOSList(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.getAllOSList >>");
ModelAndView responseView = new ModelAndView(new JSONView());
try {
Map<Integer, List<OSDataVO>> map = getPartitionListOfAllOS(req);
responseView.addObject("OSDataVo", map.get(1));
responseView.addObject("noOfPages", map.size());
} catch (WLMPortalException e) {
log.error(e.toString());
e.printStackTrace();
responseView.addObject("OSDataVo", "");
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
return responseView;
}
responseView.addObject("result", true);
responseView.addObject("message", "");
log.info("WLMDataController.getAllOSList <<");
return responseView;
}
use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class WLMDataController method viewSingleMLEData.
public ModelAndView viewSingleMLEData(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.viewSingleMLEData>>");
ModelAndView responseView = new ModelAndView(new JSONView());
MLEDataVO dataVO = new MLEDataVO();
MLEDataVO detailMLEVO = null;
try {
dataVO.setMleName(req.getParameter("mleName"));
dataVO.setMleVersion(req.getParameter("mleVersion"));
dataVO.setAttestation_Type(req.getParameter("attestation_Type"));
String mleType = req.getParameter("mleType");
if (mleType != null && mleType.equalsIgnoreCase("VMM")) {
dataVO.setOsName(req.getParameter("osName"));
dataVO.setOsVersion(req.getParameter("osVersion"));
} else {
dataVO.setOemName(req.getParameter("oemName"));
}
} catch (Exception e) {
log.error("Error While in request parameters Data. " + e.getMessage());
responseView.addObject("result", false);
responseView.addObject("message", "Error While request parameters are Null. Please check.");
}
try {
// TODO: Had to temporarily store the detailed MLE object so that it can be reused to retrieve the mleSource details.
// The MleData object expects the MLE_Type detail to be present to get the OS/OEM details. Need to fix this
detailMLEVO = mleClientService.getSingleMleData(dataVO, getWhitelistService(req));
responseView.addObject("dataVo", detailMLEVO);
responseView.addObject("result", true);
} catch (WLMPortalException e) {
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
log.error(e.toString());
}
// was used for white listing this MLE.
try {
responseView.addObject("mleSource", mleClientService.getMleSourceHost(detailMLEVO, getWhitelistService(req)));
} catch (WLMPortalException e) {
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
log.error(e.toString());
}
log.info("WLMDataController.viewSingleMLEData <<<");
return responseView;
}
use of com.intel.mountwilson.util.JSONView in project OpenAttestation by OpenAttestation.
the class RegisterUserController method handleRequestInternal.
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse res) throws Exception {
logger.info("RegisterUserController >>");
ModelAndView view = new ModelAndView(new JSONView());
view.addObject("result", false);
view.addObject("message", "Register user functionality not supported.");
return view;
}
Aggregations