List of usage examples for com.liferay.portal.kernel.util JavaConstants JAVAX_PORTLET_CONFIG
String JAVAX_PORTLET_CONFIG
To view the source code for com.liferay.portal.kernel.util JavaConstants JAVAX_PORTLET_CONFIG.
Click Source Link
From source file:org.oep.cmon.admin.portlet.action.AdminActionPortlet.java
License:Apache License
/** * This is function add role own civil servants * Version: 1.0//w w w. ja va2 s .c o m * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param actionRequest * @param actionResponse * @throws Exception */ public void addRoleCongChucRieng(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { new CongChucAction().addRoleCongChucRieng(actionRequest, actionResponse); PortletConfig portletConfig = (PortletConfig) actionRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(actionRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.admin.portlet.action.AdminActionPortlet.java
License:Apache License
/** * This is function add public service//w ww . ja va 2s . c o m * Version: 1.0 * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param actionRequest * @param actionResponse * @throws Exception */ public void addDichVuCong(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { new DichVuCongAction().addDichVuCong(actionRequest, actionResponse); PortletConfig portletConfig = (PortletConfig) actionRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(actionRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.admin.portlet.action.AdminActionPortlet.java
License:Apache License
/** * This is function add only public service * Version: 1.0/*from w w w . j a v a2 s .com*/ * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param actionRequest * @param actionResponse * @throws Exception */ public void addDichVuCongOnly(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { new DichVuCongAction().addDichVuCongOnly(actionRequest, actionResponse); PortletConfig portletConfig = (PortletConfig) actionRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(actionRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.admin.portlet.util.SetParamUtil.java
License:Apache License
/** * This is function setParameter// w w w . j a v a2s . com * Version: 1.0 * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param actionRequest * @param actionResponse * @param value */ public static void setParameter(ActionRequest actionRequest, ActionResponse actionResponse, String value) { if (value != null) { actionResponse.setRenderParameter("searchKeyWord", value); } // Hidden default error message PortletConfig portletConfig = (PortletConfig) actionRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(actionRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.czprofile.portlet.action.CitizenProfileActionPortlet.java
License:Apache License
/** * This is function update detail// w ww .jav a2s. c om * Version: 1.0 * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param actionRequest * @param actionResponse * @throws Exception */ public void updateDetail(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { Map<String, String> userRequest = (Map<String, String>) actionRequest.getPortletSession() .getAttribute("USER_REQUEST_OBJECT"); // Get all parameters from request String id = ParamUtil.getString(actionRequest, "id").trim(); if (Validator.isNotNull(id)) { userRequest.put("id", id); } /*String ngayCapCmnd = ParamUtil.getString(actionRequest, "ngayCapCmnd").trim(); userRequest.put("NGAYCAPCMND", ngayCapCmnd);*/ String noiCapCmnd = ParamUtil.getString(actionRequest, "noiCapCmnd").trim(); if (Validator.isNotNull(noiCapCmnd)) { userRequest.put("IDNOICAPCMND", noiCapCmnd); } /*String ghiChuCmnd = ParamUtil.getString(actionRequest, "ghiChuCmnd").trim(); userRequest.put("GHICHUCMND", ghiChuCmnd);*/ String ngayHetHanHoChieuStr = ParamUtil.getString(actionRequest, "ngayHetHanHoChieu"); userRequest.put("NGAYHETHANHOCHIEU", ngayHetHanHoChieuStr); /* String ghiChuHoChieu = ParamUtil.getString(actionRequest, "ghiChuHoChieu").trim(); userRequest.put("GHICHUHOCHIEU", ghiChuHoChieu); */ String gioiTinh = ParamUtil.getString(actionRequest, "gioiTinh"); if (Validator.isNotNull(gioiTinh)) { userRequest.put("IDGIOITINH", gioiTinh); } String trinhDoHocVan = ParamUtil.getString(actionRequest, "trinhDoHocVan"); if (Validator.isNotNull(trinhDoHocVan)) { userRequest.put("IDTRINHDOHOCVAN", trinhDoHocVan); } String soBhyt = ParamUtil.getString(actionRequest, "soBhyt").trim(); userRequest.put("SOBAOHIEMYTE", soBhyt); String tinhTrangHonNhan = ParamUtil.getString(actionRequest, "tinhTrangHonNhan"); if (Validator.isNotNull(tinhTrangHonNhan)) { userRequest.put("IDTINHTRANGHONNHAN", tinhTrangHonNhan); } String motaDiachiHienTai = ParamUtil.getString(actionRequest, "motaDiachiHienTai").trim(); userRequest.put("MOTADIACHIHIENTAI", motaDiachiHienTai); // Set the data back to session actionRequest.getPortletSession().setAttribute("USER_REQUEST_OBJECT", userRequest); PortletConfig portletConfig = (PortletConfig) actionRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(actionRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); // validate data // Check noi cap cmnd if (Validator.isNull(noiCapCmnd)) { SessionErrors.add(actionRequest, "vn.dtt.cmon.userreg.form.input.err.noiCapCmnd"); } // Check gioi tinh if (Validator.isNull(gioiTinh)) { SessionErrors.add(actionRequest, "vn.dtt.cmon.userreg.form.input.err.gioiTinh"); } // Check tinh trang hon nhan if (Validator.isNull(tinhTrangHonNhan)) { SessionErrors.add(actionRequest, "vn.dtt.cmon.userreg.form.input.err.tinhTrangHonNhan"); } // Check mo ta dia chi hien tai // if (Validator.isNull(motaDiachiHienTai)) { // SessionErrors.add(actionRequest, "vn.dtt.cmon.userreg.form.input.err.motaDiachiHienTai"); // } // Validate ngayHetHanHoChieu Date ngayHetHanHoChieu = null; if (ngayHetHanHoChieuStr != null && !"".equals(ngayHetHanHoChieuStr)) { DateFormat df = new SimpleDateFormat(DATE_FORMAT); df.setLenient(false); try { ngayHetHanHoChieu = df.parse(ngayHetHanHoChieuStr); } catch (Exception e) { SessionErrors.add(actionRequest, "vn.dtt.cmon.userreg.form.input.err.ngayHetHanHoChieu.notValid"); } } // In case there's error String redirectUrl = ParamUtil.getString(actionRequest, "redirectUrl"); if (!SessionErrors.isEmpty(actionRequest)) { actionResponse.sendRedirect(redirectUrl); return; } User currentUser = PortalUtil.getUser(actionRequest); if (currentUser == null) { SessionErrors.add(actionRequest, "vn.dtt.cmon.czprofile.form.input.err.notLogin"); actionResponse.sendRedirect(redirectUrl); return; } CongDan citizen = CongDanLocalServiceUtil.fetchCongDan(Long.parseLong(id)); if (citizen == null) { SessionErrors.add(actionRequest, "vn.dtt.cmon.czprofile.form.input.err.notExist"); actionResponse.sendRedirect(redirectUrl); return; } // Update citizen citizen.setTrinhDoHocVanId(Long.parseLong(trinhDoHocVan)); citizen.setTinhTrangHonNhanId(Long.parseLong(tinhTrangHonNhan)); citizen.setNoiCapCmndId(Long.parseLong(noiCapCmnd)); citizen.setGioiTinh(Integer.parseInt(gioiTinh)); citizen.setDiaChiHienNay(motaDiachiHienTai); citizen.setNgayHetHanHoChieu(ngayHetHanHoChieu); citizen.setSoBaoHiemYTe(soBhyt); CongDanLocalServiceUtil.updateCongDan(citizen); // Remove attribute actionRequest.getPortletSession().removeAttribute("USER_REQUEST_OBJECT"); // Redirect SessionMessages.add(actionRequest, "success"); actionResponse.sendRedirect(redirectUrl); }
From source file:org.oep.cmon.czprofile.portlet.action.CitizenProfileActionPortlet.java
License:Apache License
/** * This is function update CongChuc detail * Version: 1.0//from ww w . jav a 2 s .co m * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param actionRequest * @param actionResponse * @throws Exception */ public void updateCongChucDetail(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { Map<String, String> userRequest = (Map<String, String>) actionRequest.getPortletSession() .getAttribute("USER_REQUEST_OBJECT"); // Get all parameters from request String id = ParamUtil.getString(actionRequest, "id").trim(); _log.info("======= cong dan Id = " + String.valueOf(id)); if (Validator.isNotNull(id)) { userRequest.put("id", id); } String tenDaydu = ParamUtil.getString(actionRequest, "tenDaydu").trim(); _log.info("======= tenDaydu = " + tenDaydu); if (Validator.isNotNull(tenDaydu)) { userRequest.put("tenDaydu", tenDaydu); } String ngaySinh = ParamUtil.getString(actionRequest, "ngaySinh"); _log.info("======= ngaySinh = " + ngaySinh); userRequest.put("ngaySinh", ngaySinh); String gioiTinh = ParamUtil.getString(actionRequest, "gioiTinh"); _log.info("======= gioiTinh = " + String.valueOf(gioiTinh)); if (Validator.isNotNull(gioiTinh)) { userRequest.put("gioiTinh", gioiTinh); } String soCmnd = ParamUtil.getString(actionRequest, "soCmnd").trim(); _log.info("======= soCmnd = " + soCmnd); if (Validator.isNotNull(tenDaydu)) { userRequest.put("soCmnd", soCmnd); } String ngayCapCmnd = ParamUtil.getString(actionRequest, "ngayCapCmnd"); _log.info("======= ngayCapCmnd = " + String.valueOf(ngayCapCmnd)); userRequest.put("ngayCapCmnd", ngayCapCmnd); String noiCapCmnd = ParamUtil.getString(actionRequest, "noiCapCmnd").trim(); _log.info("======= noiCapCmnd = " + String.valueOf(noiCapCmnd)); if (Validator.isNotNull(noiCapCmnd)) { userRequest.put("noiCapCmnd", noiCapCmnd); } // Set the data back to session actionRequest.getPortletSession().setAttribute("USER_REQUEST_OBJECT", userRequest); PortletConfig portletConfig = (PortletConfig) actionRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(actionRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); boolean isValid = validationInput(tenDaydu, ngaySinh, soCmnd, ngayCapCmnd, noiCapCmnd, actionRequest); // In case there's error String redirectUrl = ParamUtil.getString(actionRequest, "redirectUrl"); if (!isValid && !SessionErrors.isEmpty(actionRequest)) { actionResponse.sendRedirect(redirectUrl); return; } User currentUser = PortalUtil.getUser(actionRequest); if (currentUser == null) { SessionErrors.add(actionRequest, "vn.dtt.cmon.czprofile.form.input.err.notLogin"); actionResponse.sendRedirect(redirectUrl); return; } CongChuc congChuc = CongChucLocalServiceUtil.getCongChuc(Long.parseLong(id)); _log.info("======= congChuc info = " + congChuc); if (congChuc == null) { SessionErrors.add(actionRequest, "vn.dtt.cmon.czprofile.form.input.err.notExist"); actionResponse.sendRedirect(redirectUrl); return; } // Update cong chuc; congChuc.setHoVaTen(tenDaydu); //congChuc.setNoiCapCmndId(Long.parseLong(noiCapCmnd)); congChuc.setNgaySinh(ConvertUtil.parseStringToDate(ngaySinh)); congChuc.setGioiTinhId(Integer.parseInt(gioiTinh)); congChuc.setSoCmnd(soCmnd); congChuc.setNgayCapCmnd(ConvertUtil.parseStringToDate(ngayCapCmnd)); congChuc.setNoiCapCmnd(noiCapCmnd); _log.info("======= congChuc info update: = " + congChuc); CongChucLocalServiceUtil.updateCongChuc(congChuc); // Remove attribute actionRequest.getPortletSession().removeAttribute("USER_REQUEST_OBJECT"); // Redirect SessionMessages.add(actionRequest, "success"); actionResponse.sendRedirect(redirectUrl); }
From source file:org.oep.cmon.portlet.document.action.YKienTraoDoiAction.java
License:Apache License
/** * This is function saveTraoDoi/* w w w .java 2 s . c o m*/ * Version: 1.0 * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param resourceRequest * @param httpReq * @throws Exception */ public void saveTraoDoi(ActionRequest resourceRequest, ActionResponse httpReq) throws NumberFormatException, Exception { // hoso - String long idHoSo = FormatUtil.convertToLong(ParamUtil.getString(resourceRequest, "yKienTraoDoiId")); String tieuDe = ParamUtil.getString(resourceRequest, "tieuDe").trim(); String noiDung = ParamUtil.getString(resourceRequest, "noiDung").trim(); String back_Current_Url = ParamUtil .getString(resourceRequest, "/html/portlet/ykientraodoi/danh_sach_y_kien.jsp").trim(); if (validatorsYKienTraoDoi(resourceRequest)) { saveYKienTraoDoiToDB(resourceRequest, httpReq, ""); // String emailNguoiGui= ConfigurationManager.getStrProp("vn.dtt.moh.mail.default.system", "noreply1@dtt.vn"); // LogFactoryMOC.getLog().debug("doanhNghiep.getEmailDoanhNghiep()doanhNghiep.getEmailDoanhNghiep()===" + doanhNghiep.getEmailDoanhNghiep()); // LogFactoryMOC.getLog().debug("congChuc.getHoVaTen()congChuc.getHoVaTen()===" + congChuc.getHoVaTen()); // try { // BusinessUtils.sendEmail(doanhNghiep.getEmailDoanhNghiep(), emailNguoiGui, congChuc.getHoVaTen(), tieuDe, noiDung); // } catch (Exception e) { // LogFactoryMOC.getLog().error(e.toString()); // } // if (listMail != null && listMail.length() > 0) { // String[] list = listMail.split(";"); // for (String item : list) { // BusinessUtils.sendEmail(item,emailNguoiGui, congChuc.getHoVaTen(), tieuDe, noiDung); // } // } // String BUOC_XU_LY = ConfigurationManager.getStrProp("vn.dtt.moh.sentemail.content.buocxuly", ""); // DocumentUtils.addHistory(BusinessUtils.createLichSuHoSoObject(BUOC_XU_LY, // congChuc.getHoVaTen(), idHoSo, noiDung, 0)); httpReq.setRenderParameter("jspPage", "/html/portlet/ykientraodoi/congdan_traodoi_canbo_form.jsp"); httpReq.setRenderParameter("sent_success", "true"); } else { httpReq.setRenderParameter("jspPage", "/html/portlet/ykientraodoi/congdan_traodoi_canbo_form.jsp"); } httpReq.setRenderParameter("tieuDe", tieuDe); httpReq.setRenderParameter("noiDung", noiDung); httpReq.setRenderParameter("back_Current_Url", back_Current_Url); httpReq.setRenderParameter("hoSoTTHCCongId", String.valueOf(idHoSo)); PortletConfig portletConfig = (PortletConfig) resourceRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(resourceRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.portlet.ipmslist.action.IPMSListPortlet.java
License:Apache License
/** * This is function uploadLoadFileKetQua * Version: 1.0/* w w w . java2 s. c om*/ * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param resourceRequest * @param httpReq * @throws NumberFormatException * @throws Exception */ public void uploadLoadFileKetQua(ActionRequest resourceRequest, ActionResponse httpReq) throws NumberFormatException, Exception { FormOfflineBusiness formOfflineBusiness = new FormOfflineBusiness(); formOfflineBusiness.uploadLoadFileKetQua(resourceRequest, httpReq); PortletConfig portletConfig = (PortletConfig) resourceRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(resourceRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.portlet.ipmslist.action.IPMSListPortlet.java
License:Apache License
/** * This is function uploadLoadFileKetQuaDoanhNghiep * Version: 1.0/*from w w w . ja va2 s. co m*/ * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param resourceRequest * @param httpReq * @throws NumberFormatException * @throws Exception */ public void uploadLoadFileKetQuaDoanhNghiep(ActionRequest resourceRequest, ActionResponse httpReq) throws NumberFormatException, Exception { FormOfflineBusiness formOfflineBusiness = new FormOfflineBusiness(); formOfflineBusiness.uploadLoadFileKetQuaDoanhNghiep(resourceRequest, httpReq); PortletConfig portletConfig = (PortletConfig) resourceRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(resourceRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }
From source file:org.oep.cmon.portlet.ipmslist.action.IPMSListPortlet.java
License:Apache License
/** * This is function doiChieuHoSoRequest/* www. j ava 2s.c om*/ * Version: 1.0 * * History: * DATE AUTHOR DESCRIPTION * ------------------------------------------------- * 3-March-2013 Nam Dinh Create new * @param resourceRequest * @param httpReq * @throws NumberFormatException * @throws Exception */ public void doiChieuHoSoRequest(ActionRequest resourceRequest, ActionResponse httpReq) throws NumberFormatException, Exception { FormOfflineBusiness formOfflineBusiness = new FormOfflineBusiness(); formOfflineBusiness.doiChieuHoSoRequest(resourceRequest, httpReq); PortletConfig portletConfig = (PortletConfig) resourceRequest .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); SessionMessages.add(resourceRequest, portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE); }