本文整理汇总了Java中org.apache.struts.validator.DynaValidatorForm类的典型用法代码示例。如果您正苦于以下问题:Java DynaValidatorForm类的具体用法?Java DynaValidatorForm怎么用?Java DynaValidatorForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DynaValidatorForm类属于org.apache.struts.validator包,在下文中一共展示了DynaValidatorForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveContact
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward saveContact(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
if(!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_demographic", "w", null)) {
throw new SecurityException("missing required security object (_demographic)");
}
DynaValidatorForm dform = (DynaValidatorForm)form;
Contact contact = (Contact)dform.get("contact");
String id = request.getParameter("contact.id");
if(id != null && id.length()>0) {
Contact savedContact = contactDao.find(Integer.parseInt(id));
if(savedContact != null) {
BeanUtils.copyProperties(contact, savedContact, new String[]{"id"});
contactDao.merge(savedContact);
}
}
else {
contact.setId(null);
contactDao.persist(contact);
}
return mapping.findForward("cForm");
}
示例2: unlock
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward unlock(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
{
DynaValidatorForm myForm = (DynaValidatorForm) form;
String [] userIds = myForm.getString("userId").split(",");
LoginList vec = null;
LoginCheckLogin cl = new LoginCheckLogin();
// unlock
for(int i=0; i<userIds.length; i++)
{
String userName = userIds[i];
if (userName.equals("")) continue;
vec.remove(userName);
cl.unlock(userName);
}
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("Selected Users are successfully unlocked "));
saveMessages(request, messages);
return list(mapping, form, request, response);
}
示例3: buildExtractInformation
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
private void buildExtractInformation(DynaValidatorForm frm, ExtractInformation info, Calendar now) {
info.setRunDate(now);
info.setExtractType((String) frm.get("extractType"));
info.setOrganizationName(frm.getString("orgName"));
info.setContactLastName(frm.getString("contactLName"));
info.setContactFirstName(frm.getString("contactFName"));
info.setContactEmail(frm.getString("contactEmail"));
info.setContactUserName(frm.getString("contactUserName"));
info.setEMRVendorID(frm.getString("vendorId"));
info.setEMRVendorBusinessName(frm.getString("vendorBusinessName"));
info.setEMRVendorCommonName(frm.getString("vendorCommonName"));
info.setEMRSoftwareName(frm.getString("vendorSoftware"));
info.setEMRSoftwareCommonName(frm.getString("vendorSoftwareCommonName"));
info.setEMRSoftwareVersionNumber(frm.getString("vendorSoftwareVer"));
String contactPhoneNumber = Util.onlyNum(frm.getString("contactPhone"));
if (contactPhoneNumber.length()>12) contactPhoneNumber = contactPhoneNumber.substring(0,12);
info.setContactPhoneNumber(contactPhoneNumber);
Date installDate = UtilDateUtilities.StringToDate(frm.getString("installDate"),"yyyy-MM-dd hh:mm aa");
if (installDate==null) installDate = new Date();
Calendar installCalendar = Calendar.getInstance();
installCalendar.setTime(installDate);
info.setEMRSoftwareVersionDate(installCalendar);
}
示例4: buildExtractInformation
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
private void buildExtractInformation(DynaValidatorForm frm, ExtractInformation info, Calendar now) {
info.setRunDate(now);
info.setExtractType((String) frm.get("extractType"));
info.setOrganizationName(frm.getString("orgName"));
info.setContactLastName(frm.getString("contactLName"));
info.setContactFirstName(frm.getString("contactFName"));
info.setContactPhoneNumber(Util.onlyNum(frm.getString("contactPhone")));
info.setContactEmail(frm.getString("contactEmail"));
info.setContactUserName(frm.getString("contactUserName"));
info.setEMRVendorID(frm.getString("vendorId"));
info.setEMRVendorBusinessName(frm.getString("vendorBusinessName"));
info.setEMRVendorCommonName(frm.getString("vendorCommonName"));
info.setEMRSoftwareName(frm.getString("vendorSoftware"));
info.setEMRSoftwareCommonName(frm.getString("vendorSoftwareCommonName"));
info.setEMRSoftwareVersionNumber(frm.getString("vendorSoftwareVer"));
Date installDate = UtilDateUtilities.StringToDate(frm.getString("installDate"),"yyyy-MM-dd hh:mm aa");
if (installDate==null) installDate = new Date();
Calendar installCalendar = Calendar.getInstance();
installCalendar.setTime(installDate);
info.setEMRSoftwareVersionDate(installCalendar);
}
示例5: edit
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
DynaValidatorForm classForm = (DynaValidatorForm) form;
String className = (String) classForm.get("className");
User userView = Authenticate.getUser();
InfoClass infoClassOld = (InfoClass) request.getAttribute(PresentationConstants.CLASS_VIEW);
InfoClass infoClassNew = null;
try {
infoClassNew = (InfoClass) EditarTurma.run(infoClassOld.getExternalId(), className);
} catch (DomainException e) {
throw new ExistingActionException("A SchoolClass", e);
}
request.removeAttribute(PresentationConstants.CLASS_VIEW);
request.setAttribute(PresentationConstants.CLASS_VIEW, infoClassNew);
return prepare(mapping, form, request, response);
}
示例6: create
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
DynaValidatorForm classForm = (DynaValidatorForm) form;
String className = (String) classForm.get("className");
InfoCurricularYear infoCurricularYear = (InfoCurricularYear) request.getAttribute(PresentationConstants.CURRICULAR_YEAR);
InfoExecutionDegree infoExecutionDegree =
(InfoExecutionDegree) request.getAttribute(PresentationConstants.EXECUTION_DEGREE);
AcademicInterval academicInterval =
AcademicInterval.getAcademicIntervalFromResumedString((String) request
.getAttribute(PresentationConstants.ACADEMIC_INTERVAL));
Integer curricularYear = infoCurricularYear.getYear();
try {
CriarTurma.run(className, curricularYear, infoExecutionDegree, academicInterval);
} catch (DomainException e) {
throw new ExistingActionException("A SchoolClass", e);
}
return listClasses(mapping, form, request, response);
}
示例7: prepareReturnAttributes
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
protected DynaActionForm prepareReturnAttributes(ActionForm form, HttpServletRequest request) {
separateLabel(form, request, "executionPeriod", "executionPeriodId", "executionPeriodName");
String executionCoursesNotLinked = RequestUtils.getAndSetStringToRequest(request, "executionCoursesNotLinked");
DynaActionForm executionCourseForm = (DynaValidatorForm) form;
Boolean chooseNotLinked = null;
if (executionCoursesNotLinked == null || executionCoursesNotLinked.equals("null")
|| executionCoursesNotLinked.equals(Boolean.FALSE.toString())) {
separateLabel(form, request, "executionDegree", "executionDegreeId", "executionDegreeName");
separateLabel(form, request, "curYear", "curYearId", "curYearName");
String curYear = (String) request.getAttribute("curYear");
executionCourseForm.set("curYear", curYear);
chooseNotLinked = new Boolean(false);
} else {
chooseNotLinked = new Boolean(executionCoursesNotLinked);
executionCourseForm.set("executionCoursesNotLinked", chooseNotLinked);
}
return executionCourseForm;
}
示例8: saveProContact
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward saveProContact(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DynaValidatorForm dform = (DynaValidatorForm)form;
ProfessionalContact contact = (ProfessionalContact)dform.get("pcontact");
String id = request.getParameter("pcontact.id");
if(id != null && id.length()>0) {
contact.setId(Integer.valueOf(id));
}
if(contact.getId() != null && contact.getId()>0) {
proContactDao.merge(contact);
} else {
ProfessionalContact contactNew = new ProfessionalContact();
BeanUtils.copyProperties(contact, contactNew, new String[]{"id"});
proContactDao.persist(contactNew);
}
return mapping.findForward("pForm");
}
示例9: saveLabTestRequest
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
/**
* Saves Lab request and creates problem
* @param dynaForm
* @param patientId
* @param sessionPatient
* @param conn
* @param username
* @param siteId
* @param labTypeId
* @throws Exception
*/
public static void saveLabTestRequest(DynaValidatorForm dynaForm, Long patientId, SessionPatient sessionPatient, Connection conn, String username, Long siteId, int labTypeId) throws Exception {
Form labTestFormdef = (Form) DynaSiteObjects.getForms().get(Long.valueOf(87));
LabTest labtest = new LabTest();
labtest.setField1844(DateUtils.getNow());
labtest.setField1845(labTypeId);
labtest.setFormId(labTestFormdef.getId());
Date visitDateD = null;
visitDateD = DateUtils.getvisitDate(dynaForm);
labtest.setDateVisit(visitDateD);
labtest.setPatientId(patientId);
labtest.setFlowId(labTestFormdef.getFlowId());
labtest.setPregnancyId(sessionPatient.getCurrentPregnancyId());
Long currentFlowId = sessionPatient.getCurrentFlowId();
FormDAO.create(conn, labtest, username, siteId, labTestFormdef, currentFlowId, null);
EncounterProcessor.processRules(conn, labTestFormdef, labtest, username);
}
示例10: saveRprTestRequest
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
/**
* Saves RPR request and creates problem
* @param dynaForm
* @param patientId
* @param sessionPatient
* @param conn
* @param username
* @param siteId
* @param labTypeId
* @throws Exception
*/
public static void saveRprTestRequest(DynaValidatorForm dynaForm, Long patientId, SessionPatient sessionPatient, Connection conn, String username, Long siteId, int labTypeId) throws Exception {
Form rprTestFormdef = (Form) DynaSiteObjects.getForms().get(Long.valueOf(90));
Rpr labtest = new Rpr();
labtest.setField2006(DateUtils.getNow());
labtest.setFormId(rprTestFormdef.getId());
Date visitDateD = null;
visitDateD = DateUtils.getvisitDate(dynaForm);
labtest.setDateVisit(visitDateD);
labtest.setPatientId(patientId);
labtest.setFlowId(rprTestFormdef.getFlowId());
labtest.setPregnancyId(sessionPatient.getCurrentPregnancyId());
Long currentFlowId = sessionPatient.getCurrentFlowId();
FormDAO.create(conn, labtest, username, siteId, rprTestFormdef, currentFlowId, null);
EncounterProcessor.processRules(conn, rprTestFormdef, labtest, username);
}
示例11: setUp
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public void setUp() throws Exception {
super.setUp();
// set the context directory to /zeprs
// to find the /WEB-INF/web.xml
this.setContextDirectory(new File("webapps/zeprs"));
this.setConfigFile("/WEB-INF/strutstest.xml");
ServletConfigSimulator cfgSim = new ServletConfigSimulator();
Enumeration initParams = cfgSim.getInitParameterNames();
ServletContext cntx = cfgSim.getServletContext();
// set the book into the action form
//bookEditForm = new BookEditForm();
//bookEditForm.setBook(new Book(1, "laliluna", "StrutsTestCases Tutorial", true));
// set the form data in the action form
// ActionForm form
form4 = new DynaValidatorForm();
form4.getDynaClass();
// Construct a FormBeanConfig to be used
beanConfig = new FormBeanConfig();
beanConfig.setName("dynaForm");
beanConfig.setType("org.apache.struts.action.DynaActionForm");
}
示例12: save
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);
DynaValidatorForm f = (DynaValidatorForm)form;
EyeformTestBook data = (EyeformTestBook)f.get("data");
if(data.getId()!=null && data.getId()==0) {
data.setId(null);
}
data.setProvider(loggedInInfo.getLoggedInProviderNo());
dao.save(data);
return mapping.findForward("success");
}
示例13: save
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);
DynaValidatorForm f = (DynaValidatorForm)form;
EyeformProcedureBook data = (EyeformProcedureBook)f.get("data");
if(data.getId()!=null && data.getId()==0) {
data.setId(null);
}
data.setProvider(loggedInInfo.getLoggedInProviderNo());
procedureBookDao.save(data);
return mapping.findForward("success");
}
示例14: save
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DynaValidatorForm f = (DynaValidatorForm)form;
EyeformOcularProcedure procedure = (EyeformOcularProcedure)f.get("proc");
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);
EyeformOcularProcedureDao dao = (EyeformOcularProcedureDao)SpringUtils.getBean("ocularProcDao");
procedure.setProvider(loggedInInfo.getLoggedInProviderNo());
if(request.getParameter("proc.id") != null && request.getParameter("proc.id").length()>0) {
procedure.setId(Integer.parseInt(request.getParameter("proc.id")));
}
if(procedure.getId() != null && procedure.getId() == 0) {
procedure.setId(null);
}
procedure.setUpdateTime(new Date());
if(procedure.getId() == null) {
dao.persist(procedure);
} else {
dao.merge(procedure);
}
if (request.getParameter("json") != null && request.getParameter("json").equalsIgnoreCase("true")) {
HashMap<String, Integer> hashMap = new HashMap<String, Integer>();
hashMap.put("saved", procedure.getId());
JSONObject json = JSONObject.fromObject(hashMap);
response.getOutputStream().write(json.toString().getBytes());
return null;
}
request.setAttribute("parentAjaxId", "ocularprocedure");
return mapping.findForward("success");
}
示例15: save
import org.apache.struts.validator.DynaValidatorForm; //导入依赖的package包/类
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaValidatorForm f = (DynaValidatorForm)form;
EyeformFollowUp data = (EyeformFollowUp)f.get("followup");
if(data.getId()!=null && data.getId()==0) {
data.setId(null);
}
dao.save(data);
return mapping.findForward("success");
}