Java Code Examples for org.apache.struts.action.ActionMapping#findForward()

The following examples show how to use org.apache.struts.action.ActionMapping#findForward() . 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: CapitalAssetInformationActionBase.java    From kfs with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * delete a detail line from the capital asset information
 */
public ActionForward deleteCapitalAssetInfoDetailLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    LOG.debug("deleteCapitalAssetInfoDetailLine() - start");

    KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase = (KualiAccountingDocumentFormBase) form;
    List<CapitalAssetInformation> capitalAssetInformation =  this.getCurrentCapitalAssetInformationObject(kualiAccountingDocumentFormBase);

    if (capitalAssetInformation == null) {
        return mapping.findForward(KFSConstants.MAPPING_BASIC);
    }

    int lineIndexForCapitalAssetInfo = this.getLineToDelete(request);
    capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetInformationDetails().remove(0);

    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
Example 2
Source File: LineItemReceivingAction.java    From kfs with GNU Affero General Public License v3.0 6 votes vote down vote up
protected ActionForward performDuplicateReceivingLineCheck(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, LineItemReceivingDocument lineItemReceivingDocument) throws Exception {
    ActionForward forward = null;
    HashMap<String, String> duplicateMessages = SpringContext.getBean(ReceivingService.class).receivingLineDuplicateMessages(lineItemReceivingDocument);
    if (duplicateMessages != null && !duplicateMessages.isEmpty()) {
        Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME);
        if (question == null) {

            return this.performQuestionWithoutInput(mapping, form, request, response, PurapConstants.LineItemReceivingDocumentStrings.DUPLICATE_RECEIVING_LINE_QUESTION, duplicateMessages.get(PurapConstants.LineItemReceivingDocumentStrings.DUPLICATE_RECEIVING_LINE_QUESTION), KFSConstants.CONFIRMATION_QUESTION, KFSConstants.ROUTE_METHOD, "");
        }

        Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON);
        if ((PurapConstants.LineItemReceivingDocumentStrings.DUPLICATE_RECEIVING_LINE_QUESTION.equals(question)) && ConfirmationQuestion.NO.equals(buttonClicked)) {
            forward = mapping.findForward(KFSConstants.MAPPING_BASIC);
        }
    }

    return forward;
}
 
Example 3
Source File: RefactoredIndividualCandidacyProcessPublicDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward executeCreateCandidacyPersonalInformationInvalid(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response) {
    ActionForward actionForwardError = verifySubmissionPreconditions(mapping);
    if (actionForwardError != null) {
        return actionForwardError;
    }

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

    return mapping.findForward("show-candidacy-creation-page");
}
 
Example 4
Source File: VoucherAction.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * This helper method determines from the request object instance whether or not the user has been prompted about the journal
 * being out of balance. If they haven't, then the method will build the appropriate message given the state of the document and
 * return control to the question component so that the user receives the "yes"/"no" prompt. If the question has been asked, the
 * we evaluate the user's answer and direct the flow appropriately. If they answer with a "No", then we build out a message
 * stating that they chose that value and return an ActionForward of a MAPPING_BASIC which keeps them at the same page that they
 * were on. If they choose "Yes", then we return a null ActionForward, which the calling action method recognizes as a "Yes" and
 * continues on processing the "Route."
 * 
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return ActionForward
 * @throws Exception
 */
protected ActionForward processRouteOutOfBalanceDocumentConfirmationQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    VoucherForm vForm = (VoucherForm) form;
    VoucherDocument avDoc = vForm.getVoucherDocument();

    String question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME);
    ConfigurationService kualiConfiguration = SpringContext.getBean(ConfigurationService.class);

    if (question == null) { // question hasn't been asked
        String currencyFormattedDebitTotal = (String) new CurrencyFormatter().format(avDoc.getDebitTotal());
        String currencyFormattedCreditTotal = (String) new CurrencyFormatter().format(avDoc.getCreditTotal());
        String currencyFormattedTotal = (String) new CurrencyFormatter().format(((AmountTotaling) avDoc).getTotalDollarAmount());
        String message = "";
        message = StringUtils.replace(kualiConfiguration.getPropertyValueAsString(KFSKeyConstants.QUESTION_ROUTE_OUT_OF_BALANCE_JV_DOC), "{0}", currencyFormattedDebitTotal);
        message = StringUtils.replace(message, "{1}", currencyFormattedCreditTotal);

        // now transfer control over to the question component
        return this.performQuestionWithoutInput(mapping, form, request, response, KFSConstants.JOURNAL_VOUCHER_ROUTE_OUT_OF_BALANCE_DOCUMENT_QUESTION, message, KFSConstants.CONFIRMATION_QUESTION, KFSConstants.ROUTE_METHOD, "");
    }
    else {
        String buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON);
        if ((KFSConstants.JOURNAL_VOUCHER_ROUTE_OUT_OF_BALANCE_DOCUMENT_QUESTION.equals(question)) && ConfirmationQuestion.NO.equals(buttonClicked)) {
            KNSGlobalVariables.getMessageList().add(KFSKeyConstants.MESSAGE_JV_CANCELLED_ROUTE);
            return mapping.findForward(KFSConstants.MAPPING_BASIC);
        }
    }
    return null;
}
 
Example 5
Source File: KualiLookupAction.java    From rice with Educational Community License v2.0 5 votes vote down vote up
/**
 * clearValues - clears the values of all the fields on the jsp.
 */
public ActionForward clearValues(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    LookupForm lookupForm = (LookupForm) form;
    Lookupable kualiLookupable = lookupForm.getLookupable();
    if (kualiLookupable == null) {
        LOG.error("Lookupable is null.");
        throw new RuntimeException("Lookupable is null.");
    }

    kualiLookupable.performClear(lookupForm);


    return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
 
Example 6
Source File: ManageSecondCycleThesisDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward prepareAddJuryMember(final ActionMapping mapping, final ActionForm actionForm,
        final HttpServletRequest request, final HttpServletResponse response) throws Exception {
    final Thesis thesis = getDomainObject(request, "thesisOid");
    request.setAttribute("thesis", thesis);
    EvaluationMemberBean evaluationMemberBean = getRenderedObject();
    if (evaluationMemberBean == null) {
        evaluationMemberBean =
                request.getParameter("external") == null ? new InternalEvaluationMemberBean() : new ExternalEvaluationMemberBean();
    }
    request.setAttribute("evaluationMemberBean", evaluationMemberBean);
    return mapping.findForward("addJuryMember");
}
 
Example 7
Source File: BarcodeInventoryErrorAction.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * @see org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase#refresh(org.apache.struts.action.ActionMapping,
 *      org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
@Override
public ActionForward refresh(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    super.refresh(mapping, form, request, response);

    BarcodeInventoryErrorForm bcieForm = (BarcodeInventoryErrorForm) form;
    BarcodeInventoryErrorDocument document = bcieForm.getBarcodeInventoryErrorDocument();

    this.invokeRules(document, false);

    return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
 
Example 8
Source File: StandaloneIndividualCandidacyProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward executeEditCandidacyInformation(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response) throws FenixServiceException {

    try {
        executeActivity(getProcess(request), "EditCandidacyInformation", getIndividualCandidacyProcessBean());
    } catch (final DomainException e) {
        addActionMessage(request, e.getMessage(), e.getArgs());
        request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
        return mapping.findForward("edit-candidacy-information");
    }
    return listProcessAllowedActivities(mapping, actionForm, request, response);
}
 
Example 9
Source File: ReportStudentsUTLCandidatesDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
@EntryPoint
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
    ReportStudentsUTLCandidatesBean bean = new ReportStudentsUTLCandidatesBean();
    request.setAttribute("bean", bean);

    return mapping.findForward("prepare");
}
 
Example 10
Source File: EventReportsDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward prepareCreateReportRequest(final ActionMapping mapping, final ActionForm form,
        final HttpServletRequest request, final HttpServletResponse response) {
    EventReportQueueJobBean bean = createEventReportQueueJobBean();

    request.setAttribute("bean", bean);

    return mapping.findForward("createReportRequest");
}
 
Example 11
Source File: TravelActionBase.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
public ActionForward addImportedExpenseLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    final TravelFormBase travelForm = (TravelFormBase) form;
    final TravelMvcWrapperBean mvcWrapper = newMvcDelegate(form);

    travelForm.getObservable().notifyObservers(mvcWrapper);

    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
Example 12
Source File: OptionalCurricularCoursesLocationManagementDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward prepare(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) {

    final StudentCurricularPlan studentCurricularPlan = getStudentCurricularPlan(request);
    request.setAttribute("studentCurricularPlan", studentCurricularPlan);

    final List<Enrolment> enrolments = new ArrayList<>(studentCurricularPlan.getEnrolmentsSet());
    Collections.sort(enrolments, Enrolment.COMPARATOR_BY_EXECUTION_PERIOD_AND_NAME_AND_ID);
    request.setAttribute("enrolments", enrolments);

    return mapping.findForward("showEnrolments");
}
 
Example 13
Source File: ManageAssociatedObjects.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward prepareEditDepartment(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    AssociatedObjectsBean associatedObjectsBean = new AssociatedObjectsBean();
    Department d = FenixFramework.getDomainObject(request.getParameter("oid"));
    associatedObjectsBean.setDepartment(d);
    associatedObjectsBean.setCode(d.getCode());
    associatedObjectsBean.setName(d.getName());
    associatedObjectsBean.setRealName(d.getRealName());
    associatedObjectsBean.setRealNameEn(d.getRealNameEn());
    associatedObjectsBean.setMembersGroupExpression(d.getCompetenceCourseMembersGroup().getExpression());

    request.setAttribute("bean", associatedObjectsBean);

    return mapping.findForward("editDepartment");
}
 
Example 14
Source File: PhdMeetingSchedulingProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ActionForward prepareRequestScheduleThesisMeeting(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response) {

    request.setAttribute("thesisProcessBean", new PhdThesisProcessBean());
    return mapping.findForward("requestScheduleThesisMeeting");
}
 
Example 15
Source File: UpdateCustomKeyAction.java    From spacewalk with GNU General Public License v2.0 4 votes vote down vote up
/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping,
        ActionForm formIn,
        HttpServletRequest request,
        HttpServletResponse response) {

    RequestContext context = new RequestContext(request);
    DynaActionForm form = (DynaActionForm)formIn;
    User loggedInUser  = context.getCurrentUser();

    Long cikid = context.getParamAsLong(CIKID_PARAM);
    CustomDataKey key = OrgFactory.lookupKeyById(cikid);

    request.setAttribute(CIKID_PARAM, cikid);
    request.setAttribute(LABEL_PARAM, key.getLabel());
    if (context.isSubmitted()) {
        request.setAttribute(DESC_PARAM, request.getParameter(DESC_PARAM));
    }
    else {
        request.setAttribute(DESC_PARAM, key.getDescription());
    }

    request.setAttribute(CREATE_PARAM, key.getCreated());
    request.setAttribute(MODIFY_PARAM, key.getModified());

    if (key.getCreator() != null) {
        request.setAttribute(CREATOR_PARAM, key.getCreator().getLogin());
    }
    else {
        request.setAttribute(CREATOR_PARAM, "");
    }

    if (key.getLastModifier() != null) {
        request.setAttribute(MODIFIER_PARAM, key.getLastModifier().getLogin());
    }
    else {
        request.setAttribute(MODIFIER_PARAM, "");
    }

    Map<String, Object> params = new HashMap<String, Object>();
    params.put(CIKID_PARAM, cikid);
    ListHelper helper = new ListHelper(this, request, params);
    helper.execute();

    if (context.wasDispatched("system.jsp.customkey.updatebutton")) {
        String description = (String)form.get(DESC_PARAM);
        if (description.length() < 2) {
            createErrorMessage(request, "system.customkey.error.tooshort", null);
            return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
        }
        else if (description.length() > 4000) {
            createErrorMessage(request, "system.customkey.error.descr_toolong", null);
            return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
        }

        key.setDescription(description);
        key.setLastModifier(loggedInUser);
        ServerFactory.saveCustomKey(key);
        return mapping.findForward("updated");
    }

    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
 
Example 16
Source File: UserCenterAction.java    From Films with Apache License 2.0 4 votes vote down vote up
public ActionForward addUser(ActionMapping mapping, ActionForm form,
		HttpServletRequest request, HttpServletResponse response) {
	// TODO Auto-generated method stub
	return mapping.findForward("addUserUI");
}
 
Example 17
Source File: PurchasingAccountsPayableActionBase.java    From kfs with GNU Affero General Public License v3.0 4 votes vote down vote up
public ActionForward clearAllTaxes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
Example 18
Source File: DegreeCandidacyForGraduatedPersonIndividualProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ActionForward executeIntroduceCandidacyResultInvalid(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response) {
    request.setAttribute("individualCandidacyResultBean", getCandidacyResultBean());
    return mapping.findForward("introduce-candidacy-result");
}
 
Example 19
Source File: DocumentOperationAction.java    From rice with Educational Community License v2.0 4 votes vote down vote up
public ActionForward refresh(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
	DocumentOperationForm docForm = (DocumentOperationForm) form;
	docForm.getRouteHeader().setDocumentId(docForm.getDocumentId());
	return mapping.findForward("basic");
}
 
Example 20
Source File: WeeklyWorkLoadDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@EntryPoint
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
        throws FenixServiceException {

    final Collection<ExecutionSemester> executionSemesters = Bennu.getInstance().getExecutionPeriodsSet();
    final Set<ExecutionSemester> sortedExecutionPeriods = new TreeSet<ExecutionSemester>(executionSemesters);
    request.setAttribute("executionPeriods", sortedExecutionPeriods);

    final DynaActionForm dynaActionForm = (DynaActionForm) form;

    final String executionPeriodID = getExecutionPeriodID(dynaActionForm);
    final ExecutionSemester selectedExecutionPeriod = findExecutionPeriod(executionSemesters, executionPeriodID);
    request.setAttribute("selectedExecutionPeriod", selectedExecutionPeriod);

    dynaActionForm.set("executionPeriodID", selectedExecutionPeriod.getExternalId().toString());

    // if (selectedExecutionPeriod.isCurrent()) {
    // request.setAttribute("weeks", getWeeks(selectedExecutionPeriod));
    // }

    final Attends firstAttends = findFirstAttends(request, selectedExecutionPeriod);
    request.setAttribute("firstAttends", firstAttends);
    if (firstAttends != null) {
        final Interval executionPeriodInterval = firstAttends.getWeeklyWorkLoadInterval();
        final WeeklyWorkLoadView weeklyWorkLoadView = new WeeklyWorkLoadView(executionPeriodInterval);
        request.setAttribute("weeklyWorkLoadView", weeklyWorkLoadView);

        final Collection<Attends> attends = new ArrayList<Attends>();
        request.setAttribute("attends", attends);

        for (final Registration registration : getUserView(request).getPerson().getStudents()) {
            for (final Attends attend : registration.getOrderedAttends()) {
                if (attend.getEnrolment() != null) {
                    final ExecutionCourse executionCourse = attend.getExecutionCourse();
                    if (executionCourse.getExecutionPeriod() == selectedExecutionPeriod) {
                        weeklyWorkLoadView.add(attend);
                        attends.add(attend);
                    }
                }
            }
        }

        request.setAttribute("weeklyWorkLoadBean", new WeeklyWorkLoadBean());
    }

    dynaActionForm.set("contact", null);
    dynaActionForm.set("autonomousStudy", null);
    dynaActionForm.set("other", null);

    return mapping.findForward("showWeeklyWorkLoad");
}