当前位置: 首页>>代码示例>>Java>>正文


Java DynaActionForm.set方法代码示例

本文整理汇总了Java中org.apache.struts.action.DynaActionForm.set方法的典型用法代码示例。如果您正苦于以下问题:Java DynaActionForm.set方法的具体用法?Java DynaActionForm.set怎么用?Java DynaActionForm.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.struts.action.DynaActionForm的用法示例。


在下文中一共展示了DynaActionForm.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: viewScheduleGate

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
/**
    * Set up the form attributes specific to the schedule gate and navigate to the schedule gate view.
    *
    * @param mapping
    *            An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send
    *            the end-user.
    * @param gateForm
    *            The ActionForm class that will contain any data submitted by the end-user via a form.
    * @param permissionGate
    *            the gate acitivty object
    * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go
    *         next.
    */
   private ActionForward viewScheduleGate(ActionMapping mapping, DynaActionForm gateForm,
    ScheduleGateActivity scheduleGate) {
if (Boolean.TRUE.equals(scheduleGate.getGateActivityCompletionBased())) {
    gateForm.set("activityCompletionBased", true);
} else {
    gateForm.set("activityCompletionBased", false);
    learnerService = MonitoringServiceProxy.getLearnerService(getServlet().getServletContext());
    Lesson lesson = learnerService.getLessonByActivity(scheduleGate);
    Calendar startingTime = new GregorianCalendar(TimeZone.getDefault());
    startingTime.setTime(lesson.getStartDateTime());
    startingTime.add(Calendar.MINUTE, scheduleGate.getGateStartTimeOffset().intValue());
    gateForm.set("startingTime", startingTime.getTime());
}

return mapping.findForward(GateAction.VIEW_SCHEDULE_GATE);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:GateAction.java

示例2: create

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {
OrganisationAction.service = AdminServiceProxy.getService(getServlet().getServletContext());
initLocalesAndStatus();
DynaActionForm orgForm = (DynaActionForm) form;

if (!(request.isUserInRole(Role.SYSADMIN) || OrganisationAction.service.isUserGlobalGroupAdmin())) {
    // only sysadmins and global group admins can create groups
    if (((orgForm.get("typeId") != null) && orgForm.get("typeId").equals(OrganisationType.COURSE_TYPE))
	    || (orgForm.get("typeId") == null)) {
	return error(mapping, request);
    }
}

// creating new organisation
orgForm.set("orgId", null);
Integer parentId = WebUtil.readIntParam(request, "parentId", true);
if (parentId != null) {
    Organisation parentOrg = (Organisation) OrganisationAction.service.findById(Organisation.class, parentId);
    orgForm.set("parentName", parentOrg.getName());
}
request.getSession().setAttribute("locales", OrganisationAction.locales);
request.getSession().setAttribute("status", OrganisationAction.status);
return mapping.findForward("organisation");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:OrganisationAction.java

示例3: edit

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	DynaActionForm providerForm = (DynaActionForm)form;
	String id = request.getParameter("id");

	if(this.isCancelled(request)) {
		return list(mapping,form,request,response);
	}

	if(id != null) {
		Provider provider = providerManager.getProvider(id);

           if(provider == null) {
           	ActionMessages messages = new ActionMessages();
   			messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("provider.missing"));
   			saveMessages(request,messages);

               return list(mapping,form,request,response);
           }
           providerForm.set("provider",provider);
           setEditAttributes(request,provider);
	}

	return mapping.findForward("edit");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:25,代码来源:StaffManagerAction.java

示例4: assign_role

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward assign_role(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	DynaActionForm providerForm = (DynaActionForm)form;
	Provider provider = (Provider)providerForm.get("provider");
	ProgramProvider pp = (ProgramProvider)providerForm.get("program_provider");
	ProgramProvider existingPP = null;

	if( (existingPP = programManager.getProgramProvider(provider.getProviderNo(),String.valueOf(pp.getProgramId())) ) != null) {
		if(pp.getRoleId().longValue() == 0) {
			programManager.deleteProgramProvider(String.valueOf(existingPP.getId()));
		} else {
			existingPP.setRoleId(pp.getRoleId());
			programManager.saveProgramProvider(existingPP);
		}
	} else {
		pp.setProviderNo(provider.getProviderNo());
		programManager.saveProgramProvider(pp);
	}

	setEditAttributes(request,providerManager.getProvider(provider.getProviderNo()));
	providerForm.set("program_provider",new ProgramProvider());
	return mapping.findForward("edit");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:23,代码来源:StaffManagerAction.java

示例5: delete_access

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward delete_access(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	DynaActionForm programForm = (DynaActionForm) form;
	Program program = (Program) programForm.get("program");
	ProgramAccess access = (ProgramAccess) programForm.get("access");

	programManager.deleteProgramAccess(String.valueOf(access.getId()));

	ActionMessages messages = new ActionMessages();
	messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("program.saved", program.getName()));
	saveMessages(request, messages);

	LogAction.log("write", "edit program - delete access", String.valueOf(program.getId()), request);

	this.setEditAttributes(request, String.valueOf(program.getId()));
	programForm.set("access", new ProgramAccess());

	ProgramAccessCache.setAccessMap(program.getId());
	return edit(mapping, form, request, response);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:20,代码来源:ProgramManagerAction.java

示例6: execute

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
@Override
   public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

DynaActionForm loginMaintainForm = (DynaActionForm) form;
loginMaintainForm.set("news", loadNews());
return mapping.findForward("loginmaintain");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:LoginMaintainAction.java

示例7: edit

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

Integer soid = WebUtil.readIntParam(request, "soid", false);

if (soid != null && soid > 0) {
    SignupOrganisation signup = (SignupOrganisation) userManagementService.findById(SignupOrganisation.class,
	    soid);
    if (signup != null) {
	DynaActionForm signupForm = (DynaActionForm) form;
	signupForm.set("signupOrganisationId", signup.getSignupOrganisationId());
	signupForm.set("organisationId", signup.getOrganisation().getOrganisationId());
	signupForm.set("addToLessons", signup.getAddToLessons());
	signupForm.set("addAsStaff", signup.getAddAsStaff());
	signupForm.set("addWithAuthor", signup.getAddWithAuthor());
	signupForm.set("addWithMonitor", signup.getAddWithMonitor());
	signupForm.set("courseKey", signup.getCourseKey());
	signupForm.set("blurb", signup.getBlurb());
	signupForm.set("disabled", signup.getDisabled());
	signupForm.set("loginTabActive", signup.getLoginTabActive());
	signupForm.set("context", signup.getContext());
	request.setAttribute("signupForm", signupForm);

	List organisations = signupService.getOrganisationCandidates();
	request.setAttribute("organisations", organisations);

	return mapping.findForward("addSignupPage");
    }
}
return null;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:SignupManagementAction.java

示例8: execute

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
@Override
   public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

service = AdminServiceProxy.getService(getServlet().getServletContext());
messageService = AdminServiceProxy.getMessageService(getServlet().getServletContext());

//ActionMessages errors = new ActionMessages();
Integer orgId = WebUtil.readIntParam(request, "orgId", true);
log.debug("orgId: " + orgId);
// get org name
Organisation organisation = (Organisation) service.findById(Organisation.class, orgId);

if ((orgId == null) || (orgId <= 0) || organisation == null) {
    request.setAttribute("errorName", "UserOrgAction");
    request.setAttribute("errorMessage", messageService.getMessage("error.org.invalid"));
    return mapping.findForward("error");
}

String orgName = organisation.getName();
log.debug("orgName: " + orgName);
Organisation parentOrg = organisation.getParentOrganisation();
if (parentOrg != null && !parentOrg.equals(service.getRootOrganisation())) {
    request.setAttribute("pOrgId", parentOrg.getOrganisationId());
    request.setAttribute("pOrgName", parentOrg.getName());
}
Integer orgType = organisation.getOrganisationType().getOrganisationTypeId();
request.setAttribute("orgType", orgType);

// create form object
DynaActionForm userOrgForm = (DynaActionForm) form;
userOrgForm.set("orgId", orgId);
userOrgForm.set("orgName", orgName);

String[] args = { "0" };
request.setAttribute("numExistUsers", messageService.getMessage("label.number.of.users", args));
request.setAttribute("numPotentialUsers", messageService.getMessage("label.number.of.potential.users", args));

return mapping.findForward("userorg");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:41,代码来源:UserOrgAction.java

示例9: refresh

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward refresh(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

// display temp files info
File oldFiles[] = FileUtil.getOldTempFiles(0);
long zipTotal = 0;
long tmpTotal = 0;
if (oldFiles != null) {
    for (int i = 0; i < oldFiles.length; i++) {
	if (oldFiles[i].getName().startsWith(TempDirectoryFilter.zip_prefix)) {
	    zipTotal += FileUtil.calculateFileSize(oldFiles[i]);
	} else if (oldFiles[i].getName().startsWith(TempDirectoryFilter.tmp_prefix)) {
	    tmpTotal += FileUtil.calculateFileSize(oldFiles[i]);
	}
    }
}
request.setAttribute("zipTotal", zipTotal / 1024);
request.setAttribute("tmpTotal", tmpTotal / 1024);

// set default numDays
DynaActionForm dynaForm = (DynaActionForm) form;
Integer numDays = (Integer) dynaForm.get("numDays");
if (numDays == null) {
    dynaForm.set("numDays", new Integer(1));
}

return mapping.findForward("cleanup");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:CleanupTempFilesAction.java

示例10: viewMyDrugrefId

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward viewMyDrugrefId(ActionMapping actionmapping,
                             ActionForm actionform,
                             HttpServletRequest request,
                             HttpServletResponse response) {

       DynaActionForm frm = (DynaActionForm)actionform;
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);
String providerNo=loggedInInfo.getLoggedInProviderNo();

       UserProperty prop = this.userPropertyDAO.getProp(providerNo, UserProperty.MYDRUGREF_ID);
       

       if (prop == null){
           prop = new UserProperty();
       }

       request.setAttribute("dateProperty",prop);


       request.setAttribute("providertitle","provider.setmyDrugrefId.title"); //=Set myDrugref ID
       request.setAttribute("providermsgPrefs","provider.setmyDrugrefId.msgPrefs"); //=Preferences"); //
       request.setAttribute("providermsgProvider","provider.setmyDrugrefId.msgProvider"); //=myDrugref ID
       request.setAttribute("providermsgEdit","provider.setmyDrugrefId.msgEdit"); //=Enter your desired login for myDrugref
       request.setAttribute("providerbtnSubmit","provider.setmyDrugrefId.btnSubmit"); //=Save
       request.setAttribute("providermsgSuccess","provider.setmyDrugrefId.msgSuccess"); //=myDrugref Id saved
       request.setAttribute("method","saveMyDrugrefId");

       frm.set("dateProperty", prop);
       return actionmapping.findForward("gen");
   }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:31,代码来源:ProviderPropertyAction.java

示例11: reassign

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward reassign(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	log.debug("reassign");
	LoggedInInfo loggedInInfo = LoggedInInfo.getLoggedInInfoFromSession(request);

	String id = request.getParameter("id");
	String reassignee = request.getParameter("tickler.taskAssignedTo");
	log.debug("reassign by" + id);

	ticklerManager.reassign(loggedInInfo, Integer.parseInt(id), getProviderNo(request), reassignee);

	DynaActionForm ticklerForm = (DynaActionForm) form;
	ticklerForm.set("tickler", new Tickler());

	return view(mapping, form, request, response);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:16,代码来源:TicklerAction.java

示例12: edit

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward edit(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	DynaActionForm facilityMessageForm = (DynaActionForm)form;
	String messageId = request.getParameter("id");
	
	//List facilities = programProviderDAO.getFacilitiesInProgramDomain(providerNo);
	List<Facility> facilities = new ArrayList<Facility>();
	facilities.add((Facility)request.getSession().getAttribute("currentFacility"));
	
	request.getSession().setAttribute("facilities", facilities);
	
	List<Program> programs = programManager.getPrograms(((Facility)request.getSession().getAttribute("currentFacility")).getId());
	
	request.setAttribute("programs", programs);
	
	
	if(messageId != null) {
		FacilityMessage msg = mgr.getMessage(messageId);
		
		if(msg == null) {
			ActionMessages webMessage = new ActionMessages();
			webMessage.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("system_message.missing"));
			saveErrors(request,webMessage);
			return list(mapping,form,request,response);
		}
		facilityMessageForm.set("facility_message",msg);
	}
	
	
	return mapping.findForward("edit");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:31,代码来源:FacilityMessageAction.java

示例13: viewConsultationRequestCuffOffDate

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward viewConsultationRequestCuffOffDate(ActionMapping actionmapping,
                             ActionForm actionform,
                             HttpServletRequest request,
                             HttpServletResponse response) {

LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);
String providerNo=loggedInInfo.getLoggedInProviderNo();

DynaActionForm frm = (DynaActionForm)actionform;
       UserProperty prop = this.userPropertyDAO.getProp(providerNo, UserProperty.CONSULTATION_TIME_PERIOD_WARNING);

       if (prop == null){
           prop = new UserProperty();
       }

       request.setAttribute("dateProperty",prop);

       request.setAttribute("providertitle","provider.setConsultationCutOffDate.title"); //=Set myDrugref ID
       request.setAttribute("providermsgPrefs","provider.setConsultationCutOffDate.msgPrefs"); //=Preferences"); //
       request.setAttribute("providermsgProvider","provider.setConsultationCutOffDate.msgProvider"); //=myDrugref ID
       request.setAttribute("providermsgEdit","provider.setConsultationCutOffDate.msgEdit"); //=Enter your desired login for myDrugref
       request.setAttribute("providerbtnSubmit","provider.setConsultationCutOffDate.btnSubmit"); //=Save
       request.setAttribute("providermsgSuccess","provider.setConsultationCutOffDate.msgSuccess"); //=myDrugref Id saved
       request.setAttribute("method","saveConsultationRequestCuffOffDate");

       frm.set("dateProperty", prop);
       return actionmapping.findForward("gen");
   }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:29,代码来源:ProviderPropertyAction.java

示例14: edit

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
    if (log.isDebugEnabled()) {
        log.debug("entering 'edit' method...");
    }
    
    if(!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_admin", "w", null)) {
    	throw new SecurityException("missing required security object (_admin)");
    }

    DynaActionForm issueAdminForm = (DynaActionForm) form;
    String issueAdminId = request.getParameter("id");
    // null issueAdminId indicates an add
    if (issueAdminId != null) {
        Issue issueAdmin = mgr.getIssueAdmin(issueAdminId);
        if (issueAdmin == null) {
            ActionMessages errors = new ActionMessages();
            errors.add(ActionMessages.GLOBAL_MESSAGE,
                       new ActionMessage("issueAdmin.missing"));
            saveErrors(request, errors);
            return mapping.findForward("list");
        }
        request.setAttribute("issueRole", issueAdmin.getRole());
        issueAdminForm.set("issueAdmin", issueAdmin);
    }
    
    request.setAttribute("caisiRoles", secRoleDao.findAll());
    return mapping.findForward("edit");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:29,代码来源:IssueAdminAction.java

示例15: viewDisplayDocumentAs

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward viewDisplayDocumentAs(ActionMapping actionmapping,
                             ActionForm actionform,
                             HttpServletRequest request,
                             HttpServletResponse response) {

       DynaActionForm frm = (DynaActionForm)actionform;
LoggedInInfo loggedInInfo=LoggedInInfo.getLoggedInInfoFromSession(request);
String providerNo=loggedInInfo.getLoggedInProviderNo();
       UserProperty prop = this.userPropertyDAO.getProp(providerNo, UserProperty.DISPLAY_DOCUMENT_AS);

       if (prop == null){
           prop = new UserProperty();
       }

       ArrayList<LabelValueBean> serviceList = new ArrayList<LabelValueBean>();
       serviceList.add(new LabelValueBean(UserProperty.PDF, UserProperty.PDF));
       serviceList.add(new LabelValueBean(UserProperty.IMAGE, UserProperty.IMAGE));

       request.setAttribute("dropOpts",serviceList);

       request.setAttribute("displayDocumentAsProperty",prop);

       request.setAttribute("providertitle","provider.displayDocumentAs.title");
       request.setAttribute("providermsgPrefs","provider.displayDocumentAs.msgPrefs");
       request.setAttribute("providermsgProvider","provider.displayDocumentAs.msgProvider");
       request.setAttribute("providermsgEdit","provider.displayDocumentAs.msgEdit");
       request.setAttribute("providerbtnSubmit","provider.displayDocumentAs.btnSubmit");
       request.setAttribute("providermsgSuccess","provider.displayDocumentAs.msgSuccess");
       request.setAttribute("method","saveDisplayDocumentAs");

       frm.set("displayDocumentAsProperty", prop);
       return actionmapping.findForward("genDisplayDocumentAs");
   }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:34,代码来源:ProviderPropertyAction.java


注:本文中的org.apache.struts.action.DynaActionForm.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。