Java Code Examples for org.apache.struts.action.ActionMapping

The following examples show how to use org.apache.struts.action.ActionMapping. These examples are extracted from open source projects. 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
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 2
@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 3
/**
 * 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 4
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 5
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 6
/** {@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 7
Source Project: kfs   Source File: RequisitionAction.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * 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 8
/**
 * 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 9
/**
 * 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 10
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 11
@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 12
Source Project: iaf   Source File: TestService.java    License: Apache License 2.0 6 votes vote down vote up
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 13
Source Project: jivejdon   Source File: TecentUserCallAction.java    License: Apache License 2.0 6 votes vote down vote up
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 14
Source Project: unitime   Source File: CrossListsModifyForm.java    License: Apache License 2.0 6 votes vote down vote up
/** 
 * 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 15
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 16
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 17
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 18
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 19
/**
 * @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 20
@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 21
Source Project: spacewalk   Source File: RankChannels.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 22
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 23
Source Project: rice   Source File: KualiForm.java    License: Educational Community License v2.0 5 votes vote down vote up
/**
 * @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
/**
 * This overridden method ...
 *
 * @see org.kuali.rice.krad.web.struts.action.KualiAction#getReturnLocation(javax.servlet.http.HttpServletRequest, org.apache.struts.action.ActionMapping)
 */
@Override
protected String getReturnLocation(HttpServletRequest request,
                                   ActionMapping mapping)
{
    String mappingPath = mapping.getPath();
    String basePath = getApplicationBaseUrl();
    return basePath + KewApiConstants.WEBAPP_DIRECTORY + mappingPath + ".do";
}
 
Example 25
@EntryPoint
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws FenixActionException, FenixServiceException {

    List<Registration> registrations = getUserView(request).getPerson().getStudent().getActiveRegistrationStream().collect(Collectors.toList());
    if (registrations.size() == 1) {
        return forwardToShowTimeTable(registrations.get(0), mapping, request, ExecutionSemester.readActualExecutionSemester());
    } else {
        request.setAttribute("registrations", registrations);
        return mapping.findForward("chooseRegistration");
    }
}
 
Example 26
/**
 * This method confirms and sets the immediate flag.
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return an ActionForward
 * @throws Exception
 */
public ActionForward confirmAndSetImmediate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

    PdpPaymentDetailQuestionCallback callback = new PdpPaymentDetailQuestionCallback() {
        public boolean doPostQuestion(int paymentDetailId, String changeText, Person user) {
            return performSetImmediate(paymentDetailId, changeText, user);

        }
    };
    return askQuestionWithInput(mapping, form, request, response, PdpKeyConstants.PaymentDetail.Confirmation.CHANGE_IMMEDIATE_PAYMENT_QUESTION, PdpKeyConstants.PaymentDetail.Confirmation.CHANGE_IMMEDIATE_PAYMENT_MESSAGE, PdpKeyConstants.PaymentDetail.Messages.PAYMENT_SUCCESSFULLY_SET_AS_IMMEDIATE, "confirmAndSetImmediate", callback);
}
 
Example 27
/**
 * 1. This method passes the control from Dunning Letter Distribution lookup to the Dunning Letter Distribution
 * Summary page. 2. Retrieves the list of selected awards by agency for sending Dunning Letters
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
public ActionForward viewSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

    GenerateDunningLettersSummaryForm dunningLetterDistributionSummaryForm = (GenerateDunningLettersSummaryForm) form;
    String lookupResultsSequenceNumber = dunningLetterDistributionSummaryForm.getLookupResultsSequenceNumber();
    if (StringUtils.isNotBlank(lookupResultsSequenceNumber)) {
        String personId = GlobalVariables.getUserSession().getPerson().getPrincipalId();
        Collection<GenerateDunningLettersLookupResult> generateDunningLettersLookupResults = getDunningLetterDistributionLookupResultsFromLookupResultsSequenceNumber(lookupResultsSequenceNumber, personId);

        dunningLetterDistributionSummaryForm.setGenerateDunningLettersLookupResults(generateDunningLettersLookupResults);
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
Example 28
/**
     * This method will insert the new ad hoc person from the from into the list of ad hoc person recipients, put a new new record
     * in place and return like normal.
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return ActionForward
     * @throws Exception
     */
    public ActionForward insertAdHocRoutePerson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form;
        Document document = kualiDocumentFormBase.getDocument();


        // check authorization for adding ad hoc route person
        DocumentAuthorizer documentAuthorizer = getDocumentHelperService().getDocumentAuthorizer(document);
        if (!documentAuthorizer.canSendAdHocRequests(document, kualiDocumentFormBase.getNewAdHocRoutePerson().getActionRequested(), GlobalVariables.getUserSession().getPerson())) {
            throw buildAuthorizationException("ad-hoc route", document);
        }

        // check business rules
        boolean rulePassed = getKualiRuleService().applyRules(new AddAdHocRoutePersonEvent(document, kualiDocumentFormBase.getNewAdHocRoutePerson()));

        // if the rule evaluation passed, let's add the ad hoc route person
        if (rulePassed) {
            // uppercase userid for consistency
//            kualiDocumentFormBase.getNewAdHocRoutePerson().setId(StringUtils.upperCase(kualiDocumentFormBase.getNewAdHocRoutePerson().getId()));
            kualiDocumentFormBase.getNewAdHocRoutePerson().setId(kualiDocumentFormBase.getNewAdHocRoutePerson().getId());
            kualiDocumentFormBase.getAdHocRoutePersons().add(kualiDocumentFormBase.getNewAdHocRoutePerson());
            AdHocRoutePerson person = new AdHocRoutePerson();
            kualiDocumentFormBase.setNewAdHocRoutePerson(person);
        }

        return mapping.findForward(RiceConstants.MAPPING_BASIC);
    }
 
Example 29
public ActionForward prepareEditState(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) {
    PhdProcessState state = getDomainObject(request, "stateId");
    PhdProcessStateBean bean = new PhdProcessStateBean(state);

    request.setAttribute("bean", bean);

    return mapping.findForward("editPhdProcessState");
}
 
Example 30
public ActionForward removeSelectedDegreesEntry(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) {
    SecondCycleIndividualCandidacyProcessBean bean =
            (SecondCycleIndividualCandidacyProcessBean) getIndividualCandidacyProcessBean();

    Degree selectedDegree = getDomainObject(request, "removeIndex");
    bean.removeSelectedDegree(selectedDegree);

    request.setAttribute(getIndividualCandidacyProcessBeanName(), bean);
    invalidateDocumentFileRelatedViewStates();

    return forwardTo(mapping, request);
}