org.apache.struts.action.ActionMapping Java Examples
The following examples show how to use
org.apache.struts.action.ActionMapping.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ScientificCouncilManageThesisDA.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward approveThesis(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { Thesis thesis = getThesis(request); if (thesis != null) { try { ApproveThesisDiscussion.runApproveThesisDiscussion(thesis); addActionMessage("mail", request, "thesis.evaluated.mail.sent"); final ThesisPresentationState thesisPresentationState = ThesisPresentationState.getThesisPresentationState(thesis); request.setAttribute("thesisPresentationState", thesisPresentationState); } catch (DomainException e) { addActionMessage("error", request, e.getKey(), e.getArgs()); return reviewThesis(mapping, actionForm, request, response); } } // return listThesis(mapping, actionForm, request, response); return viewThesis(mapping, actionForm, request, response); }
Example #2
Source File: RequisitionAction.java From kfs with GNU Affero General Public License v3.0 | 6 votes |
/** * save the document without any validations..... * @see org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase#save(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //call the super save to save the document without validations... ActionForward actionForward = super.save(mapping, form, request, response); //we need to make "calculated" to false so that the "below lines" //can be edited until calculated button is clicked. KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form; PurchasingFormBase baseForm = (PurchasingFormBase) form; PurchasingAccountsPayableDocument purapDocument = (PurchasingAccountsPayableDocument) kualiDocumentFormBase.getDocument(); baseForm.setCalculated(false); purapDocument.setCalculated(false); return mapping.findForward(RiceConstants.MAPPING_BASIC); }
Example #3
Source File: UnpublishedErrataAction.java From uyuni with GNU General Public License v2.0 | 6 votes |
/** {@inheritDoc} */ public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ListRhnSetHelper helper = new ListRhnSetHelper(this, request, RhnSetDecl.ERRATA_TO_DELETE); helper.execute(); if (helper.isDispatched()) { // Nothing to do when dispatched, there is a confirmation page displayed next // that will do the actual work return actionMapping.findForward("continue"); } return actionMapping.findForward(RhnHelper.DEFAULT_FORWARD); }
Example #4
Source File: ProjectSubmissionDispatchAction.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward prepareProjectSubmission(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixActionException, FenixServiceException { Attends attends = getAttends(request); Project project = getProject(request); StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends); request.setAttribute("attends", attends); request.setAttribute("project", getProject(request)); request.setAttribute("studentGroup", studentGroup); request.setAttribute("person", getUserView(request).getPerson()); request.setAttribute("projectSubmission", new CreateProjectSubmissionBean()); RenderUtils.invalidateViewState("createProjectSubmission"); return mapping.findForward("submitProject"); }
Example #5
Source File: PurchasingActionBase.java From kfs with GNU Affero General Public License v3.0 | 6 votes |
@Override public ActionForward calculate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PurchasingAccountsPayableFormBase purchasingForm = (PurchasingAccountsPayableFormBase) form; PurchasingDocument purDoc = (PurchasingDocument) purchasingForm.getDocument(); boolean defaultUseTaxIndicatorValue = SpringContext.getBean(PurchasingService.class).getDefaultUseTaxIndicatorValue(purDoc); SpringContext.getBean(PurapService.class).updateUseTaxIndicator(purDoc, defaultUseTaxIndicatorValue); SpringContext.getBean(PurapService.class).calculateTax(purDoc); // call prorateDiscountTradeIn SpringContext.getBean(PurapService.class).prorateForTradeInAndFullOrderDiscount(purDoc); // recalculate the amounts and percents on the accounting line. SpringContext.getBean(PurapAccountingService.class).updateAccountAmounts(purDoc); customCalculate(purDoc); PurchasingFormBase formBase = (PurchasingFormBase) form; formBase.setInitialZipCode(purDoc.getDeliveryPostalCode()); formBase.setCalculated(true); purDoc.setCalculated(true); KNSGlobalVariables.getMessageList().clear(); return super.calculate(mapping, form, request, response); }
Example #6
Source File: TestService.java From iaf with Apache License 2.0 | 6 votes |
public ActionForward executeSub( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Initialize action initAction(request); DynaActionForm serviceTestForm = getPersistentForm(mapping, form, request); Iterator it=ServiceDispatcher.getInstance().getRegisteredListenerNames(); List services=new ArrayList(); services.add("----- select a service -----"); while (it.hasNext()) { services.add((String)it.next()); } serviceTestForm.set("services", services); // Forward control to the specified success URI log.debug("forward to success"); return (mapping.findForward("success")); }
Example #7
Source File: SecondCycleIndividualCandidacyProcessDA.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward removeSelectedDegree(ActionMapping mapping, ActionForm ActionForm, HttpServletRequest request, HttpServletResponse response) { SecondCycleIndividualCandidacyProcessBean bean = getIndividualCandidacyProcessBean(); Degree selectedDegree = getDomainObject(request, "removeDegreeExternalId"); bean.removeSelectedDegree(selectedDegree); request.setAttribute(getIndividualCandidacyProcessBeanName(), bean); if (getFromRequest(request, "userAction").equals("createCandidacy")) { return mapping.findForward("fill-candidacy-information"); } else if (getFromRequest(request, "userAction").equals("editCandidacyQualifications")) { return mapping.findForward("edit-candidacy-information"); } return null; }
Example #8
Source File: TecentUserCallAction.java From jivejdon with Apache License 2.0 | 6 votes |
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String forwdUrl = mapping.findForward("success").getPath(); String domainUrl = CallUtil.getCleanDomainUrl(request, forwdUrl); TecentWeiboSubmitter weiboSubmitter = (TecentWeiboSubmitter) WebAppUtil.getComponentInstance("tecentWeiboSubmitter", request); String authUrl = weiboSubmitter.request(domainUrl); if (authUrl != null) { HttpSession session = request.getSession(); Map<String, String> params = CallUtil.getParameters(request); params.put("tecentbackurl", domainUrl); session.setAttribute("subscriptionParameters", params); response.sendRedirect(authUrl); } else { request.setAttribute("errors", "tecent weibo server error"); } return mapping.findForward("failure"); }
Example #9
Source File: AuthorizationExceptionAction.java From rice with Educational Community License v2.0 | 6 votes |
/** * Dispatches action to be taken during an AuthorizationException. * * @see org.apache.struts.action.Action#execute( * org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, * javax.servlet.http.HttpServletResponse) */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(String.format("ENTRY %s%n%s", form.getClass().getSimpleName(), request.getRequestURI())); } ActionForward forward = null; Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_KEY); if (t == null) { forward = mapping.findForward(KRADConstants.MAPPING_CLOSE); } else { forward = processException(mapping, form, request, t); } if (LOG.isDebugEnabled()) { LOG.debug(String.format("EXIT %s", (forward == null) ? "null" : forward.getPath())); } return forward; }
Example #10
Source File: CrossListsModifyForm.java From unitime with Apache License 2.0 | 6 votes |
/** * Method validate * @param mapping * @param request * @return ActionErrors */ public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (op.equals(MSG.actionAddCourseToCrossList())) { // Check Added Course if (this.addCourseOfferingId==null || this.addCourseOfferingId.intValue()<=0) { errors.add("addCourseOfferingId", new ActionMessage("errors.generic", MSG.errorRequiredCourseOffering())); } } if (op.equals(MSG.actionUpdateCrossLists())) { // Check controlling course if (this.ctrlCrsOfferingId==null || this.ctrlCrsOfferingId.intValue()<=0) { errors.add("ctrlCrsOfferingId", new ActionMessage("errors.generic", MSG.errorRequiredControllingCourse())); } } return errors; }
Example #11
Source File: PhdThesisProcessDA.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward editPhdThesisProcessInformation(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { final PhdThesisProcessBean bean = getRenderedObject("phdThesisProcessBean"); request.setAttribute("phdThesisProcessBean", bean); try { ExecuteProcessActivity.run(getProcess(request), EditPhdThesisProcessInformation.class.getSimpleName(), bean); addSuccessMessage(request, "message.phdThesisProcessInformation.edit.success"); return viewIndividualProgramProcess(request, getProcess(request)); } catch (DomainException e) { addErrorMessage(request, e.getKey(), e.getArgs()); return mapping.findForward("editPhdThesisProcessInformation"); } }
Example #12
Source File: MarkSheetRectifyDispatchAction.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward showRectificationHistoric(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { DynaActionForm form = (DynaActionForm) actionForm; EnrolmentEvaluation enrolmentEvaluation = getDomainObject(form, "evaluationID"); Enrolment enrolment = enrolmentEvaluation.getEnrolment(); List<EnrolmentEvaluation> rectifiedAndRectificationEvaluations = enrolment.getConfirmedEvaluations(enrolmentEvaluation.getMarkSheet().getEvaluationSeason()); if (!rectifiedAndRectificationEvaluations.isEmpty()) { request.setAttribute("enrolmentEvaluation", rectifiedAndRectificationEvaluations.remove(0)); request.setAttribute("rectificationEvaluations", rectifiedAndRectificationEvaluations); } return mapping.findForward("showRectificationHistoric"); }
Example #13
Source File: PublicInstitutionPhdProgramsCandidacyProcessDA.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward removeReferee(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { final PhdProgramCandidacyProcess process = getProcess(request); final PhdCandidacyReferee referee = getDomainObject(request, "candidacyRefereeId"); try { ExecuteProcessActivity.run(process.getIndividualProgramProcess(), RemoveCandidacyReferee.class, referee); addSuccessMessage(request, "message.referee.information.remove.success"); } catch (final DomainException e) { addErrorMessage(request, e.getKey(), e.getArgs()); return editRefereesInvalid(mapping, form, request, response); } RenderUtils.invalidateViewState(); return prepareEditReferees(mapping, form, request, response); }
Example #14
Source File: DegreeCandidacyForGraduatedPersonIndividualProcessRefactoredDA.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
public ActionForward editCandidacyProcess(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { DegreeCandidacyForGraduatedPersonIndividualProcessBean bean = (DegreeCandidacyForGraduatedPersonIndividualProcessBean) getIndividualCandidacyProcessBean(); try { ActionForward actionForwardError = verifySubmissionPreconditions(mapping); if (actionForwardError != null) { return actionForwardError; } if (!isApplicationSubmissionPeriodValid()) { return beginCandidacyProcessIntro(mapping, form, request, response); } executeActivity(bean.getIndividualCandidacyProcess(), "EditPublicCandidacyPersonalInformation", getIndividualCandidacyProcessBean()); } catch (final DomainException e) { addActionMessage(request, e.getMessage(), e.getArgs()); request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean()); return mapping.findForward("edit-candidacy"); } request.setAttribute("individualCandidacyProcess", bean.getIndividualCandidacyProcess()); return backToViewCandidacyInternal(mapping, form, request, response); }
Example #15
Source File: UserLocalePrefAction.java From spacewalk with GNU General Public License v2.0 | 6 votes |
private ActionForward save(ActionMapping mapping, RequestContext ctx, User currentUser, DynaActionForm form) { String preferredLocale = form.getString("preferredLocale"); if (preferredLocale != null && preferredLocale.equals("none")) { preferredLocale = null; } currentUser.setTimeZone(UserManager.getTimeZone( ((Integer) form.get("timezone")).intValue())); currentUser.setPreferredLocale(preferredLocale); UserManager.storeUser(currentUser); ActionMessages msgs = new ActionMessages(); msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.preferencesModified")); getStrutsDelegate().saveMessages(ctx.getRequest(), msgs); if (ctx.getRequest().getParameter("uid") != null) { ActionForward display = mapping.findForward("display"); ActionForward fwd = new ActionForward(); fwd.setPath(display.getPath() + "?uid=" + currentUser.getId()); fwd.setRedirect(true); return fwd; } return mapping.findForward("display"); }
Example #16
Source File: RankChannels.java From spacewalk with GNU General Public License v2.0 | 6 votes |
/** * Updates the set and then moves the user to the confirm page. * @param mapping struts ActionMapping * @param formIn struts ActionForm * @param request HttpServletRequest * @param response HttpServletResponse * @return ActionForward to the confirm page. */ public ActionForward apply(ActionMapping mapping, ActionForm formIn, HttpServletRequest request, HttpServletResponse response) { RequestContext context = new RequestContext(request); // if its not javascript enabled, can't do much report error if (!context.isJavaScriptEnabled()) { return handleNoScript(mapping, formIn, request, response); } String position = ((DynaActionForm)formIn).getString(PRIORITY); User user = context.getCurrentUser(); DynaActionForm form = (DynaActionForm) formIn; RhnSet set = getRhnSet(user); //update the set and go to confirm. updateSet(form, set); return getStrutsDelegate().forwardParam( mapping.findForward(RhnHelper.CONFIRM_FORWARD), "position", position); }
Example #17
Source File: AjaxDeleteSprintTaskAction.java From ezScrum with GNU General Public License v2.0 | 6 votes |
@Override public StringBuilder getResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { // get session info ProjectObject project = (ProjectObject) SessionManager.getProjectObject(request); // get parameter info long sprintId = Long.parseLong(request.getParameter("sprintID")); // delete task 單選的 task ID long taskId = Long.parseLong(request.getParameter("issueID")); SprintBacklogMapper backlog = new SprintBacklogLogic(project, sprintId).getSprintBacklogMapper(); backlog.deleteTask(taskId); String result = "<DeleteTask><Result>true</Result><Task><Id>" + taskId + "</Id></Task></DeleteTask>"; return new StringBuilder(result); }
Example #18
Source File: WrittenEvaluationsSearchByDegreeAndYear.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 6 votes |
@EntryPoint public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { VariantBean bean = getRenderedObject(); if (bean == null) { bean = new VariantBean(); bean.setObject(AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.SEMESTER)); } RenderUtils.invalidateViewState(); AcademicInterval academicInterval = (AcademicInterval) bean.getObject(); request.setAttribute("bean", bean); final List<LabelValueBean> executionDegreeLabelValueBeans = new ArrayList<LabelValueBean>(); for (final ExecutionDegree executionDegree : ExecutionDegree.filterByAcademicInterval(academicInterval)) { String part = addAnotherInfoToLabel(executionDegree, academicInterval) ? " - " + executionDegree.getDegreeCurricularPlan().getName() : ""; executionDegreeLabelValueBeans.add(new LabelValueBean(executionDegree.getDegree().getPresentationName() + part, executionDegree.getExternalId().toString())); } Collections.sort(executionDegreeLabelValueBeans, Comparator.comparing(LabelValueBean::getLabel)); request.setAttribute("executionDegreeLabelValueBeans", executionDegreeLabelValueBeans); return mapping.findForward("showForm"); }
Example #19
Source File: JournalVoucherAction.java From kfs with GNU Affero General Public License v3.0 | 6 votes |
/** * Overrides to call super, and then to repopulate the credit/debit amounts b/c the credit/debit code might change during a JV * error correction. * * @see org.kuali.kfs.fp.document.web.struts.VoucherAction#correct(org.apache.struts.action.ActionMapping, * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward correct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionForward actionForward = super.correct(mapping, form, request, response); JournalVoucherDocument jvDoc = (JournalVoucherDocument) ((JournalVoucherForm) form).getDocument(); jvDoc.refreshReferenceObject(KFSPropertyConstants.BALANCE_TYPE); // only repopulate if this is a JV that was entered in debit/credit mode if (jvDoc.getBalanceType().isFinancialOffsetGenerationIndicator()) { // now make sure to repopulate credit/debit amounts populateAllVoucherAccountingLineHelpers((JournalVoucherForm) form); } return actionForward; }
Example #20
Source File: BudgetConstructionAction.java From kfs with GNU Affero General Public License v3.0 | 6 votes |
/** * @see org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase#save(org.apache.struts.action.ActionMapping, * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { BudgetConstructionForm budgetConstructionForm = (BudgetConstructionForm) form; BudgetConstructionDocument bcDocument = (BudgetConstructionDocument) budgetConstructionForm.getDocument(); // DocumentService documentService = SpringContext.getBean(DocumentService.class); BudgetDocumentService budgetDocumentService = SpringContext.getBean(BudgetDocumentService.class); // force tighter checks when saving in cleanup mode if (!bcDocument.isBudgetableDocument()) { bcDocument.setCleanupModeActionForceCheck(Boolean.TRUE); } budgetDocumentService.saveDocument(bcDocument); budgetConstructionForm.initializePersistedRequestAmounts(); budgetDocumentService.calculateBenefitsIfNeeded(bcDocument); KNSGlobalVariables.getMessageList().add(KFSKeyConstants.MESSAGE_SAVED); budgetConstructionForm.setAnnotation(""); // redisplay the document along with document saved message return mapping.findForward(KFSConstants.MAPPING_BASIC); }
Example #21
Source File: PurchasingActionBase.java From kfs with GNU Affero General Public License v3.0 | 6 votes |
/** * Overrides the superclass method so that it will also do proration for trade in and full order discount when the user clicks * on the submit button. * * @see org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase#route(org.apache.struts.action.ActionMapping, * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public ActionForward route(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PurchasingFormBase purchasingForm = (PurchasingFormBase) form; PurchasingDocument purDoc = (PurchasingDocument) purchasingForm.getDocument(); // if form is not yet calculated, return and prompt user to calculate if (requiresCalculate(purchasingForm)) { GlobalVariables.getMessageMap().putError(KFSConstants.DOCUMENT_ERRORS, PurapKeyConstants.ERROR_PURCHASING_REQUIRES_CALCULATE); return mapping.findForward(KFSConstants.MAPPING_BASIC); } // call prorateDiscountTradeIn SpringContext.getBean(PurapService.class).prorateForTradeInAndFullOrderDiscount(purDoc); return super.route(mapping, form, request, response); }
Example #22
Source File: PurchaseOrderAction.java From kfs with GNU Affero General Public License v3.0 | 6 votes |
public ActionForward printPoQuoteList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String poDocId = ((PurchaseOrderForm) form).getDocId(); KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form; PurchaseOrderDocument po = (PurchaseOrderDocument) kualiDocumentFormBase.getDocument(); SpringContext.getBean(PurapService.class).saveDocumentNoValidation(po); String basePath = getApplicationBaseUrl(); String methodToCallPrintPurchaseOrderPDF = "printPoQuoteListOnly"; String methodToCallDocHandler = "docHandler"; String printPOQuoteListPDFUrl = getUrlForPrintPO(basePath, poDocId, methodToCallPrintPurchaseOrderPDF); String displayPOTabbedPageUrl = getUrlForPrintPO(basePath, poDocId, methodToCallDocHandler); request.setAttribute("printPOQuoteListPDFUrl", printPOQuoteListPDFUrl); request.setAttribute("displayPOTabbedPageUrl", displayPOTabbedPageUrl); String label = SpringContext.getBean(DataDictionaryService.class).getDocumentLabelByTypeName(KFSConstants.FinancialDocumentTypeCodes.PURCHASE_ORDER); request.setAttribute("purchaseOrderLabel", label); return mapping.findForward("printPOQuoteListPDF"); }
Example #23
Source File: KualiForm.java From rice with Educational Community License v2.0 | 5 votes |
/** * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest) */ @Override public void reset(ActionMapping mapping, HttpServletRequest request) { super.reset(mapping, request); if (extraButtons != null) { extraButtons.clear(); } //fieldNameToFocusOnAfterSubmit = ""; clearDisplayedMessages(); }
Example #24
Source File: PhdIndividualProgramProcessDA.java From fenixedu-academic with GNU Lesser General Public License v3.0 | 5 votes |
public ActionForward uploadGuidanceAcceptanceLetter(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { PhdIndividualProgramProcess process = getDomainObject(request, "processId"); PhdParticipantBean guidingBean = getRenderedObject("guidingBean"); ExecuteProcessActivity.run(process, UploadGuidanceAcceptanceLetter.class, guidingBean); return prepareManageGuidingInformation(mapping, form, request, response); }
Example #25
Source File: QuickSalarySettingAction.java From kfs with GNU Affero General Public License v3.0 | 5 votes |
/** * Forwards to budget incumbent lookup passing parameters for new funding line. */ public ActionForward addIncumbent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { QuickSalarySettingForm salarySettingForm = (QuickSalarySettingForm) form; if (!salarySettingForm.isViewOnlyEntry()) { boolean isSaved = this.save(form); if (!isSaved) { return mapping.findForward(KFSConstants.MAPPING_BASIC); } } Map<String, String> parameters = new HashMap<String, String>(); parameters.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, salarySettingForm.getChartOfAccountsCode()); parameters.put(KFSPropertyConstants.ACCOUNT_NUMBER, salarySettingForm.getAccountNumber()); parameters.put(KFSPropertyConstants.SUB_ACCOUNT_NUMBER, salarySettingForm.getSubAccountNumber()); parameters.put(KFSPropertyConstants.FINANCIAL_OBJECT_CODE, salarySettingForm.getFinancialObjectCode()); parameters.put(KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE, salarySettingForm.getFinancialSubObjectCode()); parameters.put(BCConstants.SHOW_SALARY_BY_INCUMBENT_ACTION, Boolean.TRUE.toString()); parameters.put(BCPropertyConstants.BUDGET_BY_ACCOUNT_MODE, Boolean.TRUE.toString()); parameters.put(BCPropertyConstants.ADD_LINE, Boolean.TRUE.toString()); parameters.put(BCPropertyConstants.MAIN_WINDOW, (salarySettingForm.isMainWindow() ? "true" : "false")); // anchor, if it exists if (form instanceof KualiForm && StringUtils.isNotEmpty(salarySettingForm.getAnchor())) { parameters.put(BCConstants.RETURN_ANCHOR, salarySettingForm.getAnchor()); } // the form object is retrieved and removed upon return by KualiRequestProcessor.processActionForm() parameters.put(BCConstants.RETURN_FORM_KEY, GlobalVariables.getUserSession().addObjectWithGeneratedKey(form, BCConstants.FORMKEY_PREFIX)); String lookupUrl = BudgetUrlUtil.buildTempListLookupUrl(mapping, salarySettingForm, BCConstants.TempListLookupMode.INTENDED_INCUMBENT, BudgetConstructionIntendedIncumbent.class.getName(), parameters); this.cleanupAnySessionForm(mapping, request); return new ActionForward(lookupUrl, true); }
Example #26
Source File: FormatAction.java From kfs with GNU Affero General Public License v3.0 | 5 votes |
/** * This method prepares the data for the format process * * @param mapping * @param form * @param request * @param response * @return * @throws Exception */ public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormatForm formatForm = (FormatForm) form; Person kualiUser = GlobalVariables.getUserSession().getPerson(); FormatSelection formatSelection = formatService.getDataForFormat(kualiUser); DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class); formatForm.setCampus(kualiUser.getCampusCode()); // no data for format because another format process is already running if (formatSelection.getStartDate() != null) { GlobalVariables.getMessageMap().putError(KFSConstants.GLOBAL_ERRORS, PdpKeyConstants.Format.ERROR_PDP_FORMAT_PROCESS_ALREADY_RUNNING, dateTimeService.toDateTimeString(formatSelection.getStartDate())); } else { List<CustomerProfile> customers = formatSelection.getCustomerList(); for (CustomerProfile element : customers) { if (formatSelection.getCampus().equals(element.getDefaultPhysicalCampusProcessingCode())) { element.setSelectedForFormat(Boolean.TRUE); } else { element.setSelectedForFormat(Boolean.FALSE); } } formatForm.setPaymentDate(dateTimeService.toDateString(dateTimeService.getCurrentTimestamp())); formatForm.setPaymentTypes(PdpConstants.PaymentTypes.ALL); formatForm.setCustomers(customers); formatForm.setRanges(formatSelection.getRangeList()); } return mapping.findForward(PdpConstants.MAPPING_SELECTION); }
Example #27
Source File: ViewLogDetailsAction.java From uyuni with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { // Load the operation details for display long oid = Long.parseLong(request.getParameter(PARAM_OPERATION_ID)); RequestContext context = new RequestContext(request); User user = context.getCurrentUser(); OperationDetailsDto operationData = SsmOperationManager. findOperationById(user, oid); request.setAttribute("operationData", operationData); // List stuff for the server list ListHelper helper = new ListHelper(this, request); helper.setDataSetName(RequestContext.PAGE_LIST); Map<String, String> helperParams = new HashMap<String, String>(1); helperParams.put("oid", request.getParameter("oid")); helper.setParamMap(helperParams); helper.execute(); return actionMapping.findForward(RhnHelper.DEFAULT_FORWARD); }
Example #28
Source File: BudgetConstructionSelectionAction.java From kfs with GNU Affero General Public License v3.0 | 5 votes |
/** * This method sets up to forward to the BC Organization Selection screen using a specific operating mode. The various operating * modes include PULLUP, PUSHDOWN, REPORTS, SALSET, ACCOUNT. * * @param opMode * @param mapping * @param form * @param request * @param response * @return * @throws Exception */ public ActionForward performOrgSelectionTree(OrgSelOpMode opMode, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { BudgetConstructionSelectionForm budgetConstructionSelectionForm = (BudgetConstructionSelectionForm) form; this.flagBCInProgress(); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, BCConstants.ORG_SEL_TREE_METHOD); parameters.put("operatingMode", opMode.toString()); parameters.put("universityFiscalYear", budgetConstructionSelectionForm.getUniversityFiscalYear().toString()); String lookupUrl = BudgetUrlUtil.buildBudgetUrl(mapping, budgetConstructionSelectionForm, BCConstants.ORG_SEL_TREE_ACTION, parameters); return new ActionForward(lookupUrl, true); }
Example #29
Source File: ActionListAction.java From rice with Educational Community License v2.0 | 5 votes |
public ActionForward takeMassActions(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionListForm actionListForm = (ActionListForm) form; List<? extends ActionItemBase> actionList = (List<? extends ActionItemBase>) request.getSession().getAttribute(ACTION_LIST_KEY); if (actionList == null) { return start(mapping, new ActionListForm(), request, response); } ActionMessages messages = new ActionMessages(); List<ActionInvocation> invocations = new ArrayList<ActionInvocation>(); int index = 0; for (Object element : actionListForm.getActionsToTake()) { ActionToTake actionToTake = (ActionToTake) element; if (actionToTake != null && actionToTake.getActionTakenCd() != null && !"".equals(actionToTake.getActionTakenCd()) && !"NONE".equalsIgnoreCase(actionToTake.getActionTakenCd()) && actionToTake.getActionItemId() != null) { ActionItemBase actionItem = getActionItemFromActionList(actionList, actionToTake.getActionItemId()); if (actionItem == null) { LOG.warn("Could not locate the ActionItem to take mass action against in the action list: " + actionToTake.getActionItemId()); continue; } invocations.add(ActionInvocation.create(ActionType.fromCode(actionToTake.getActionTakenCd()), actionItem.getId())); } index++; } KEWServiceLocator.getWorkflowDocumentService().takeMassActions(getUserSession().getPrincipalId(), invocations); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("general.routing.processed")); saveMessages(request, messages); ActionListForm cleanForm = new ActionListForm(); request.setAttribute(mapping.getName(), cleanForm); request.getSession().setAttribute(KewApiConstants.REQUERY_ACTION_LIST_KEY, "true"); return start(mapping, cleanForm, request, response); }
Example #30
Source File: ListRemoveGroupsAction.java From spacewalk with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public ActionForward handleDispatch( ListSessionSetHelper helper, ActionMapping mapping, ActionForm formIn, HttpServletRequest request, HttpServletResponse response) { RequestContext context = new RequestContext(request); User user = context.getCurrentUser(); Server server = context.lookupAndBindServer(); ServerGroupManager manager = ServerGroupManager.getInstance(); List <Server> servers = new LinkedList<Server>(); servers.add(server); Set <String> set = helper.getSet(); for (String id : set) { Long sgid = Long.valueOf(id); ServerGroup group = manager.lookup(sgid, user); manager.removeServers(group, servers, user); } helper.destroy(); getStrutsDelegate().saveMessage( "systems.groups.jsp.removed", new String [] {String.valueOf(set.size())}, request); Map<String, Object> params = new HashMap<String, Object>(); params.put(RequestContext.SID, server.getId().toString()); StrutsDelegate strutsDelegate = getStrutsDelegate(); return strutsDelegate.forwardParams (mapping.findForward("success"), params); }