use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class ViewUploadedFilesController method uploadNewFile.
@RequestMapping(value = "/uploadNewFile", method = RequestMethod.GET)
public ModelAndView uploadNewFile(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView("uploadNewFile");
UploadedFileFormBean uploadedFileFormBean = new UploadedFileFormBean();
modelAndView.addObject("entityId", request.getParameter("entityId"));
modelAndView.addObject("entityType", request.getParameter("entityType"));
modelAndView.addObject("backPageUrl", request.getParameter("backPageUrl"));
modelAndView.addObject("formBean", uploadedFileFormBean);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project OpenAttestation by OpenAttestation.
the class DemoPortalDataController method getHostsReport.
/**
* Method to Bulk Update trust status for selected host.
*
* @param req (HttpServletRequest Object)
* @param res (HttpServletResponse Object)
* @return
*/
public ModelAndView getHostsReport(HttpServletRequest req, HttpServletResponse res) {
log.info("DemoPortalDataController.getHostsReport >>");
ModelAndView responseView = new ModelAndView(new JSONView());
String[] list = req.getParameterValues("selectedHost");
if (list == null) {
responseView.addObject("message", "No hosts were selected for reports.");
log.info("DemoPortalDataController.getHostsReport<<<");
return responseView;
}
List<String> hosts = Arrays.asList(list);
try {
responseView.addObject("reports", demoPortalServices.getHostTrustReport(hosts, getAttestationService(req, ApiClient.class)));
responseView.addObject("result", true);
} catch (DemoPortalException e) {
log.error(e.getMessage());
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
return responseView;
}
responseView.addObject("message", "");
log.info("DemoPortalDataController.getHostsReport<<<");
return responseView;
}
use of org.springframework.web.servlet.ModelAndView in project OpenAttestation by OpenAttestation.
the class DemoPortalDataController method trustVerificationDetailsXML.
/**
* Method to get Trust Verification Details using SAML.
*
* @param req (HttpServletRequest Object)
* @param res (HttpServletResponse Object)
* @return
*/
public ModelAndView trustVerificationDetailsXML(HttpServletRequest req, HttpServletResponse res) {
log.info("DemoPortalDataController.trustVerificationDetailsXML >>");
ModelAndView responseView = new ModelAndView(new JSONView());
String hostName = req.getParameter("hostName");
try {
responseView.addObject("trustSamlDetails", demoPortalServices.trustVerificationDetails(hostName, getAttestationService(req, AttestationService.class), getTrustedCertificates(req)));
responseView.addObject("hostName", hostName);
responseView.addObject("result", true);
} catch (DemoPortalException e) {
log.error(e.toString());
e.printStackTrace();
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
e.printStackTrace();
return responseView;
}
responseView.addObject("message", "");
responseView.addObject("result", true);
return responseView;
}
use of org.springframework.web.servlet.ModelAndView in project OpenAttestation by OpenAttestation.
the class WLMDataController method addOSData.
/**
* Method to add OS Data into REST Services.
*
* @param req (HttpServletRequest Object)
* @param res (HttpServletResponse Object)
* @return
*/
public ModelAndView addOSData(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.addOSData >>");
ModelAndView responseView = new ModelAndView(new JSONView());
try {
OSDataVO dataVONew = new OSDataVO();
//Getting OS data from request parameter
dataVONew.setOsName(req.getParameter("osName"));
dataVONew.setOsVersion(req.getParameter("osVersion"));
dataVONew.setOsDescription(req.getParameter("osDescription"));
//Calling into Service Layer(OSClientServiceImpl) to add OS Data.
responseView.addObject("result", osClientService.addOSInfo(dataVONew, getWhitelistService(req)));
} catch (WLMPortalException e) {
log.error("Error Wile Adding OS Data. Root cause " + e.getMessage());
responseView.addObject("result", false);
responseView.addObject("message", e.getMessage());
}
log.info("WLMDataController.addOSData <<<");
return responseView;
}
use of org.springframework.web.servlet.ModelAndView in project OpenAttestation by OpenAttestation.
the class WLMDataController method getUploadedMenifestFile.
public ModelAndView getUploadedMenifestFile(HttpServletRequest req, HttpServletResponse res) {
log.info("WLMDataController.getUploadedMenifestFile >>");
ModelAndView responseView = new ModelAndView(new JSONView());
Object manifest = req.getSession().getAttribute("manifestValue");
boolean result = false;
if (manifest != null) {
result = true;
responseView.addObject("manifestValue", manifest);
}
responseView.addObject("result", result);
log.info("WLMDataController.getUploadedMenifestFile <<<");
return responseView;
}
Aggregations