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


Java DynaActionForm.get方法代码示例

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


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

示例1: openGateForSingleUser

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
/**
    * Allows a single learner to pass the gate.
    *
    * @param mapping
    *            An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send
    *            the end-user.
    * @param form
    *            he ActionForm class that will contain any data submitted by the end-user via a form.
    * @param request
    *            A standard Servlet HttpServletRequest class.
    * @param response
    *            A standard Servlet HttpServletRequest class.
    * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go
    *         next.
    * @throws IOException
    * @throws ServletException
    */
   public ActionForward openGateForSingleUser(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException {
monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext());

DynaActionForm gateForm = (DynaActionForm) form;
Long gateIdLong = (Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD);
String userId = (String) gateForm.get(GateAction.USER_ID);
String[] userIdsString = userId.split(",");
List<Integer> userIds = new LinkedList<Integer>();
for (String userIdString : userIdsString) {
    if (StringUtils.isNotBlank(userIdString)) {
	userIds.add(Integer.valueOf(userIdString));
    }
}
GateActivity gate = monitoringService.openGateForSingleUser(gateIdLong, userIds.toArray(new Integer[] {}));
return findViewByGateType(mapping, gateForm, gate);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:35,代码来源:GateAction.java

示例2: processNewEntry

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

// initialize service object
ICoreNotebookService notebookService = getNotebookService();

DynaActionForm notebookForm = (DynaActionForm) actionForm;
Long id = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID);
String title = (String) notebookForm.get("title");
String entry = (String) notebookForm.get("entry");
String signature = (String) notebookForm.get("signature");
Integer userID = LearningWebUtil.getUserId();

notebookService.createNotebookEntry(id, CoreNotebookConstants.SCRATCH_PAD, signature, userID, title, entry);

boolean skipViewAll = WebUtil.readBooleanParam(request, "skipViewAll", false);
return skipViewAll ? null : viewAll(mapping, actionForm, request, response);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:NotebookAction.java

示例3: save

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
/**
    * Makes selected timezones default ones.
    *
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return
    * @throws Exception
    */
   public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws Exception {

if (isCancelled(request)) {
    return mapping.findForward(FORWARD_BACK);
}

DynaActionForm timezoneForm = (DynaActionForm) form;
String[] selectedTimezoneIds = (String[]) timezoneForm.get("selected");

List<Timezone> selectedTimezones = new ArrayList<Timezone>();
for (String selectedTimezoneId : selectedTimezoneIds) {
    selectedTimezones.add(new Timezone(selectedTimezoneId));
}
timezoneService.updateTimezones(selectedTimezones);

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

示例4: 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

示例5: discharge_select_program

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward discharge_select_program(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	String id = request.getParameter("id");
	String admissionId = request.getParameter("admission.id");
	
	DynaActionForm clientForm = (DynaActionForm) form;
	Program program = (Program) clientForm.get("program");
	request.setAttribute("programId", String.valueOf(program.getId()));
	setEditAttributes(form, request, id);

	request.setAttribute("do_discharge", new Boolean(true));
	
	if(admissionId != null) {
		Admission admission = admissionDao.find(Integer.parseInt(admissionId));
		if(admission != null) {
			request.setAttribute("admissionDate",admission.getAdmissionDate("yyyy-MM-dd"));
		}
	}
	
	return mapping.findForward("edit");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:21,代码来源:ClientManagerAction.java

示例6: 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

示例7: add_closing

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward add_closing(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
	if(!surveyUserManager.isAdmin(request)) {
   		postMessage(request,"survey.auth");
   		return mapping.findForward("auth");
   	}
	
	DynaActionForm surveyForm = (DynaActionForm)form;
	SurveyManagerFormBean formBean = (SurveyManagerFormBean)surveyForm.get("web");
	SurveyDocument model = (SurveyDocument)surveyForm.get("model");
	SurveyDocument.Survey surveyModel = model.getSurvey();
	
	if(surveyModel.getClosing() == null) {
		surveyModel.setClosing(surveyModel.addNewClosing());
		surveyModel.getClosing().setIncludeOnLastPage(true);
	}
	
	formBean.setPage("Closing");
	return form(mapping,form,request,response);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:20,代码来源:SurveyManagerAction.java

示例8: edit_function

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

	ProgramFunctionalUser pfu = programManager.getFunctionalUser(String.valueOf(function.getId()));

	if (pfu == null) {
		ActionMessages messages = new ActionMessages();
		messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("program_function.missing"));
		saveMessages(request, messages);
		setEditAttributes(request, String.valueOf(program.getId()));
		return edit(mapping, form, request, response);
	}
	programForm.set("function", pfu);
	request.setAttribute("providerName", pfu.getProvider().getFormattedName());

	setEditAttributes(request, String.valueOf(program.getId()));

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

示例9: scheduleGate

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
public ActionForward scheduleGate(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException, ParseException {
monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext());

DynaActionForm gateForm = (DynaActionForm) form;
Long gateId = (Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD);
String dateAsString = (String) gateForm.get(GateAction.SCHEDULE_DATE);
GateActivity gate = null;
if (dateAsString != null && dateAsString.trim().length() > 0) {
    gate = monitoringService.scheduleGate(gateId, SCHEDULING_DATETIME_FORMAT.parse(dateAsString), getUserId());
} else {
    gate = (GateActivity) monitoringService.getActivityById(gateId);
}
return findViewByGateType(mapping, gateForm, gate);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:GateAction.java

示例10: viewAll

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
/**
    * View all notebook entries
    */
   public ActionForward viewAll(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException {

// initialize service object
ICoreNotebookService notebookService = getNotebookService();

DynaActionForm notebookForm = (DynaActionForm) actionForm;

// getting requested object according to coming parameters
Integer learnerID = LearningWebUtil.getUserId();

// lessonID
Long lessonID = (Long) notebookForm.get("currentLessonID");
if (lessonID == null || lessonID == 0) {
    lessonID = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID);
}

// get all notebook entries for the learner

TreeMap<Long, List<NotebookEntry>> entries = notebookService.getEntryByLesson(learnerID,
	CoreNotebookConstants.SCRATCH_PAD);

request.getSession().setAttribute("entries", entries.values());
request.setAttribute("lessonID", lessonID);

return mapping.findForward(NotebookAction.VIEW_ALL);

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:NotebookAction.java

示例11: viewAllJournals

import org.apache.struts.action.DynaActionForm; //导入方法依赖的package包/类
/**
    * View all journals entries from a lesson call
    */
   public ActionForward viewAllJournals(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException {


DynaActionForm notebookForm = (DynaActionForm) actionForm;

// getting requested object according to coming parameters
Integer userID = LearningWebUtil.getUserId();
User user = (User) LearnerServiceProxy.getUserManagementService(getServlet().getServletContext())
	.findById(User.class, userID);

// lesson service
ICoreLearnerService learnerService = LearnerServiceProxy.getLearnerService(getServlet().getServletContext());
Long lessonID = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID);
Lesson lesson = learnerService.getLesson(lessonID);

if ( ! hasStaffAccessToJournals(user, lesson) ) {
    throw new UserAccessDeniedException(
	    "User " + userID + " may not retrieve journal entries for lesson " + lessonID);
}

// List of Journal entries
List<NotebookEntry> journals = getJournals(lesson.getLessonId());
request.getSession().setAttribute("journals", journals);
request.setAttribute(AttributeNames.PARAM_LESSON_ID, lessonID);

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

示例12: updateEntry

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

// initialize service object
ICoreNotebookService notebookService = getNotebookService();

// get form data
DynaActionForm notebookForm = (DynaActionForm) actionForm;
Long uid = (Long) notebookForm.get("uid");
String title = (String) notebookForm.get("title");
String entry = (String) notebookForm.get("entry");
String signature = (String) notebookForm.get("signature");

// get existing entry to edit
NotebookEntry entryObj = notebookService.getEntry(uid);

// check entry is being edited by it's owner
Integer userID = LearningWebUtil.getUserId();
if (userID != entryObj.getUser().getUserId()) {
    // throw exception
}

// update entry
entryObj.setTitle(title);
entryObj.setEntry(entry);
entryObj.setExternalSignature(signature);

notebookService.updateEntry(entryObj);

return viewAll(mapping, actionForm, request, response);

   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:36,代码来源:NotebookAction.java

示例13: 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

示例14: execute

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

if (SignupAction.signupService == null) {
    WebApplicationContext wac = WebApplicationContextUtils
	    .getRequiredWebApplicationContext(getServlet().getServletContext());
    SignupAction.signupService = (ISignupService) wac.getBean("signupService");
}

DynaActionForm signupForm = (DynaActionForm) form;
String method = WebUtil.readStrParam(request, "method", true);
String context = WebUtil.readStrParam(request, "context", true);
SignupOrganisation signupOrganisation = null;
if (StringUtils.isNotBlank(context)) {
    signupOrganisation = SignupAction.signupService.getSignupOrganisation(context);
    request.setAttribute("signupOrganisation", signupOrganisation);
}
if ((signupForm.get("submitted") == null) || !((Boolean) signupForm.get("submitted"))) {
    if (signupOrganisation == null) {
	request.setAttribute("messageKey", "no.such.signup.page.exist");
	return mapping.findForward("message");
    }

    // no context and unsubmitted form means it's the initial request
    return mapping.findForward("signup");
} else if (StringUtils.equals(method, "register")) {
    return signUp(mapping, form, request, response);
} else {
    return signIn(mapping, form, request, response);
}
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:33,代码来源:SignupAction.java

示例15: my_tickler_filter

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

	LoggedInInfo loggedInInfo = LoggedInInfo.getLoggedInInfoFromSession(request);

	DynaActionForm ticklerForm = (DynaActionForm) form;
	CustomFilter filter = (CustomFilter) ticklerForm.get("filter");
	filter.setStartDate(null);
	filter.setEndDate(new Date(System.currentTimeMillis()));
	filter.setProvider(null);
	filter.setStatus("A");
	filter.setPriority(null);
	filter.setClient(null);
	filter.setAssignee((String) request.getSession().getAttribute("user"));
	filter.setDemographic_webName(null);
	filter.setProgramId(null);
	String providerId = (String) request.getSession().getAttribute("user");
	String programId = "";
	List<Tickler> ticklers = ticklerManager.getTicklers(loggedInInfo, filter, providerId, programId);
	request.getSession().setAttribute("ticklers", ticklers);
	request.setAttribute("providers", providerMgr.getProviders());
	if (OscarProperties.getInstance().getBooleanProperty("clientdropbox", "on")) {
		request.setAttribute("demographics", demographicMgr.getDemographics());
	}

	request.setAttribute("programs", programMgr.getProgramDomainInCurrentFacilityForCurrentProvider(loggedInInfo, true));

	request.setAttribute("customFilters", ticklerManager.getCustomFilters(this.getProviderNo(request)));
	request.setAttribute("from", getFrom(request));
	return mapping.findForward("list");
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:32,代码来源:TicklerAction.java


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