org.apache.struts.action.ActionForm Java Examples

The following examples show how to use org.apache.struts.action.ActionForm. 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: AcademicCalendarsManagementDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward editEntry(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    CalendarEntryBean bean = getRenderedObject("editedEntryBeanID");

    AcademicCalendarEntry entry = null;
    try {
        entry = CreateAcademicCalendarEntry.run(bean, false);

    } catch (DomainException e) {
        addActionMessage(request, e.getMessage(), e.getArgs());
        request.setAttribute("entryBean", bean);
        return mapping.findForward("prepareCreateCalendarEntry");
    }

    return generateGanttDiagram(mapping, request, CalendarEntryBean.createCalendarEntryBeanToCreateEntry(
            entry.getRootEntry(), entry, bean.getBeginDateToDisplay(), bean.getEndDateToDisplay()));
}
 
Example #2
Source File: EditExecutionCourseDispatchAction.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected DynaActionForm prepareReturnAttributes(ActionForm form, HttpServletRequest request) {
    separateLabel(form, request, "executionPeriod", "executionPeriodId", "executionPeriodName");

    String executionCoursesNotLinked = RequestUtils.getAndSetStringToRequest(request, "executionCoursesNotLinked");
    DynaActionForm executionCourseForm = (DynaValidatorForm) form;
    Boolean chooseNotLinked = null;
    if (executionCoursesNotLinked == null || executionCoursesNotLinked.equals("null")
            || executionCoursesNotLinked.equals(Boolean.FALSE.toString())) {

        separateLabel(form, request, "executionDegree", "executionDegreeId", "executionDegreeName");
        separateLabel(form, request, "curYear", "curYearId", "curYearName");
        String curYear = (String) request.getAttribute("curYear");
        executionCourseForm.set("curYear", curYear);
        chooseNotLinked = new Boolean(false);
    } else {
        chooseNotLinked = new Boolean(executionCoursesNotLinked);
        executionCourseForm.set("executionCoursesNotLinked", chooseNotLinked);
    }
    return executionCourseForm;
}
 
Example #3
Source File: ForunsManagement.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward createThreadAndMessage(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws FenixServiceException {

    CreateConversationThreadAndMessageBean createConversationThreadAndMessageBean =
            (CreateConversationThreadAndMessageBean) RenderUtils.getViewState("createThreadAndMessage").getMetaObject()
                    .getObject();

    try {
        CreateConversationThreadAndMessage.runCreateConversationThreadAndMessage(createConversationThreadAndMessageBean);
    } catch (DomainException e) {
        ActionMessages actionMessages = new ActionMessages();
        actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(e.getKey()));

        saveMessages(request, actionMessages);

        return prepareCreateThreadAndMessage(mapping, form, request, response);
    }

    return this.viewForum(mapping, form, request, response);
}
 
Example #4
Source File: OutboundMobilityCandidacyDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward selectCandidatesForAllGroups(final ActionMapping mapping, final ActionForm actionForm,
        final HttpServletRequest request, final HttpServletResponse response) throws IOException {
    final OutboundMobilityCandidacyPeriod period = getDomainObject(request, "candidacyPeriodOid");

    try {
        final String result = period.selectCandidatesForAllGroups();
        request.setAttribute("result", result);
    } catch (final DomainException ex) {
        final String error = ex.getKey();
        request.setAttribute("error", error);
    }

    final OutboundMobilityContextBean outboundMobilityContextBean = new OutboundMobilityContextBean();
    outboundMobilityContextBean.setCandidacyPeriodsAsList(Collections.singletonList(period));

    request.setAttribute("outboundMobilityContextBean", outboundMobilityContextBean);
    return mapping.findForward("prepare");
}
 
Example #5
Source File: Over23IndividualCandidacyProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
protected void setStartInformation(ActionForm form, HttpServletRequest request, HttpServletResponse response) {
    final IndividualCandidacyProcessBean bean = new Over23IndividualCandidacyProcessBean();
    bean.setCandidacyProcess(getParentProcess(request));
    bean.setChoosePersonBean(new ChoosePersonBean());

    /*
     * 06/05/2009 - Due to Public Candidacies, a candidacy created in admin
     * office is external So we dont require ChoosePersonBean because a
     * Person will not be associated or created at individual candidacy
     * creation stage. Instead we bind with an empty PersonBean.
     * 
     * bean.setChoosePersonBean(new ChoosePersonBean());
     */
    bean.setPersonBean(new PersonBean());

    /*
     * 06/05/2009 - Also we mark the bean as an external candidacy.
     */
    bean.setInternalPersonCandidacy(Boolean.FALSE);
    request.setAttribute(getIndividualCandidacyProcessBeanName(), bean);
}
 
Example #6
Source File: SSOAction.java    From SSO with Apache License 2.0 6 votes vote down vote up
@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		BufferedReader bf = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
		StringBuffer sb = new StringBuffer();
		String line = "";
		for(line = bf.readLine(); line != null; line = bf.readLine()) {
			sb.append(line);
		}
//		System.out.println("ok");
		Gson g = new Gson();
		RequestProperty reqp = g.fromJson(sb.toString(), RequestProperty.class);
		System.out.println(reqp);
		if(reqp.getAction_type().equals("getByUsername")) {
			String username = reqp.getUsername();
			output(response, username);
		}
		return null;
	}
 
Example #7
Source File: StudentsListByCurricularCourseDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward downloadStatistics(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    ExecutionYear executionYear = getDomainObject(request, "executionYearId");
    Set<Degree> degreesToInclude =
            AcademicAccessRule.getDegreesAccessibleToFunction(AcademicOperationType.STUDENT_LISTINGS, Authenticate.getUser())
                    .collect(Collectors.toSet());

    final String filename = getResourceMessage("label.statistics") + "_" + executionYear.getName().replace('/', '-');
    final Spreadsheet spreadsheet = new Spreadsheet(filename);
    addStatisticsHeaders(spreadsheet);
    addStatisticsInformation(spreadsheet, executionYear, degreesToInclude);

    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-disposition", "attachment; filename=" + filename + ".xls");
    ServletOutputStream writer = response.getOutputStream();

    spreadsheet.exportToXLSSheet(writer);
    writer.flush();
    response.flushBuffer();

    return null;
}
 
Example #8
Source File: ActionChainEditAction.java    From spacewalk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public ActionForward execute(ActionMapping mapping, ActionForm formIn,
    HttpServletRequest request, HttpServletResponse response) {
    DynaActionForm form = (DynaActionForm) formIn;
    RequestContext requestContext = new RequestContext(request);
    ActionChain actionChain = getActionChain(
            requestContext.getCurrentUser(),
            Long.valueOf(request.getParameter(ACTION_CHAIN_ID_PARAMETER)));

    if (isSubmitted(form)) {
        if (requestContext.wasDispatched("actionchain.jsp.delete")) {
            return delete(mapping, request, actionChain);
        }
        if (requestContext.wasDispatched("actionchain.jsp.saveandschedule")) {
            return schedule(mapping, request, form, actionChain);
        }
    }
    setAttributes(request, form, actionChain);

    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
 
Example #9
Source File: BaseRankChannels.java    From spacewalk with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * Raises an error message saying javascript is required
 * to process this page
 * @param mapping struts ActionMapping
 * @param formIn struts ActionForm
 * @param request HttpServletRequest
 * @param response HttpServletResponse
 * @return An action forward to the default page with the error message
 */
public ActionForward handleNoScript(ActionMapping mapping,
                        ActionForm formIn,
                        HttpServletRequest request,
                        HttpServletResponse response) {
    RequestContext context = new RequestContext(request);


    if (!context.isJavaScriptEnabled()) {
        getStrutsDelegate().
        saveMessage("common.config.rank.jsp.error.nojavascript", request);
    }

    Map map = new HashMap();
    processParams(context, map);
    User user = context.getCurrentUser();
    RhnSet set = getRhnSet(user);
    setup(context, (DynaActionForm)formIn, set);
    return getStrutsDelegate().forwardParams
                                (mapping.findForward(RhnHelper.DEFAULT_FORWARD),
                                                    map);
}
 
Example #10
Source File: CapitalAssetInformationActionBase.java    From kfs with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * clear up the modify capital asset information.  The amount field is reset to 0
 * Processes any remaining capital assets so that it recalculates the system control
 * and system control remaining amounts.
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return action forward string
 * @throws Exception
 */
public ActionForward clearCapitalAssetModify(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    LOG.debug("clearCapitalAssetModify() - start");

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

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

    int clearIndex = getSelectedLine(request);
    capitalAssetInformation.get(clearIndex).setCapitalAssetLineAmount(KualiDecimal.ZERO);

    //zero out the amount distribute on the accounting lines...
    for (CapitalAssetAccountsGroupDetails groupAccountLine : capitalAssetInformation.get(clearIndex).getCapitalAssetAccountsGroupDetails()) {
        groupAccountLine.setAmount(KualiDecimal.ZERO);
    }

    //now process the remaining capital asset records
    processRemainingCapitalAssetInfo(form, capitalAssetInformation);

    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
Example #11
Source File: EditAccountAction.java    From jpetstore-kubernetes with Apache License 2.0 6 votes vote down vote up
protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  AccountActionForm acctForm = (AccountActionForm) form;
if (AccountActionForm.VALIDATE_EDIT_ACCOUNT.equals(acctForm.getValidate())) {
	acctForm.getAccount().setListOption(request.getParameter("account.listOption") != null);
	acctForm.getAccount().setBannerOption(request.getParameter("account.bannerOption") != null);
	Account account = acctForm.getAccount();
	getPetStore().updateAccount(account);
	acctForm.setAccount(getPetStore().getAccount(account.getUsername()));
	PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
	myList.setPageSize(4);
	acctForm.setMyList(myList);
	request.getSession().setAttribute("accountForm", acctForm);
	request.getSession().removeAttribute("workingAccountForm");
	return mapping.findForward("success");
}
else {
	request.setAttribute("message", "Your account was not updated because the submitted information was not validated.");
	return mapping.findForward("failure");
}
}
 
Example #12
Source File: IndividualCandidacyProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public ActionForward prepareCreateNewProcess(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) {
    if (!hasParentProcess(request)) {
        addActionMessage(request, "error.IndividualCandidacy.invalid.candidacyProcess");
        return listProcesses(mapping, form, request, response);
    } else {
        setStartInformation(form, request, response);

        /*
         * 06/05/2009 - Skip search Person and step to personal data form. A
         * person will not be created
         * 
         * return mapping.findForward("prepare-create-new-process");
         */
        return mapping.findForward("prepare-create-new-process");
        // return mapping.findForward("fill-personal-information");
    }
}
 
Example #13
Source File: MarkSheetRectifyDispatchAction.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
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 #14
Source File: CorrectionAction.java    From kfs with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Add a correction group
 */
public ActionForward addCorrectionGroup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    LOG.debug("addCorrectionGroup() started");

    CorrectionForm correctionForm = (CorrectionForm) form;
    GeneralLedgerCorrectionProcessDocument document = correctionForm.getCorrectionDocument();

    document.addCorrectionChangeGroup(new CorrectionChangeGroup());
    correctionForm.syncGroups();

    if (!correctionForm.isRestrictedFunctionalityMode()) {
        correctionForm.getDisplayEntries().clear();
        correctionForm.getDisplayEntries().addAll(correctionForm.getAllEntries());

        if (correctionForm.getShowOutputFlag()) {
            updateEntriesFromCriteria(correctionForm, correctionForm.isRestrictedFunctionalityMode());
        }
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
Example #15
Source File: SubscribeConfirm.java    From spacewalk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Set up the page.
 * @param mapping struts ActionMapping
 * @param formIn struts ActionForm
 * @param request HttpServletRequest
 * @param response HttpServletResponse
 * @return an ActionForward to the same page
 */
public ActionForward execute(ActionMapping mapping,
        ActionForm formIn, HttpServletRequest request,
        HttpServletResponse response) {
    //check that we have a viable priority
    checkPosition(request);

    //typical stuff
    RequestContext context = new RequestContext(request);
    User user = context.getCurrentUser();

    //Decide whether we are visiting the same page or
    //performing the subscribe.
    String dispatch = request.getParameter("dispatch");
    if (dispatch != null && dispatch.equals(LocalizationService
            .getInstance().getMessage("ssm.config.subscribeconfirm.jsp.confirm"))) {
        return confirm(mapping, request, user);
    }
    return setup(mapping, request, user);

}
 
Example #16
Source File: WorkWithGroupAction.java    From uyuni with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping,
        ActionForm formIn,
        HttpServletRequest request,
        HttpServletResponse response) {

    RequestContext requestContext = new RequestContext(request);
    ManagedServerGroup serverGroup = requestContext.lookupAndBindServerGroup();
    User user =  requestContext.getCurrentUser();

    RhnSet systemSet = RhnSetDecl.SYSTEMS.create(user);

    Iterator systems = SystemManager.systemsInGroup(serverGroup.getId(), null)
                            .iterator();
    while (systems.hasNext()) { //for every system in a group
        Long id = ((SystemOverview)systems.next()).getId();
        systemSet.addElement(id);
    }

    RhnSetManager.store(systemSet);

    //response.sendRedirect("/rhn/systems/ssm/ListSystems.do");
    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
 
Example #17
Source File: UserspaceAction.java    From Films with Apache License 2.0 6 votes vote down vote up
public ActionForward goUserComment(ActionMapping mapping, ActionForm form,
		HttpServletRequest request, HttpServletResponse response) {
	// TODO Auto-generated method stub
	Users user = (Users) request.getSession().getAttribute("loginUser");
	if(user!=null){
		String s_pageNow=request.getParameter("pageNow");
		int pageNow=1;
		if(s_pageNow!=null){
			pageNow=Integer.parseInt(s_pageNow);
		}
		request.setAttribute("now", pageNow);
		int pageCount=fcService.getPageCount(10);
		request.setAttribute("pageCount", pageCount);
		request.setAttribute("mycom", fcService.getComments(10,pageNow,user.getUid()));
		return mapping.findForward("goUserComment");
	}else{	
		return mapping.findForward("logout");
	}
}
 
Example #18
Source File: SummariesControlAction.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward listSummariesControl(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    DepartmentSummaryElement departmentSummaryElement = getRenderedObject();
    String executionSemesterID = null;
    if (departmentSummaryElement != null) {
        executionSemesterID = departmentSummaryElement.getExecutionSemester().getExternalId();
    } else {
        executionSemesterID = (String) getFromRequest(request, "executionSemesterID");
        ExecutionSemester executionSemester = FenixFramework.getDomainObject(executionSemesterID);
        departmentSummaryElement = new DepartmentSummaryElement(null, executionSemester);
    }
    request.setAttribute("executionSemesters", departmentSummaryElement);
    setAllDepartmentsSummaryResume(request, executionSemesterID);

    return mapping.findForward("success");
}
 
Example #19
Source File: IndividualCandidacyProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward uploadDocument(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws FenixServiceException, IOException {
    CandidacyProcessDocumentUploadBean uploadBean =
            (CandidacyProcessDocumentUploadBean) getObjectFromViewState("individualCandidacyProcessBean.document");
    try {
        IndividualCandidacyDocumentFile documentFile =
                createIndividualCandidacyDocumentFile(uploadBean, uploadBean.getIndividualCandidacyProcess()
                        .getPersonalDetails().getDocumentIdNumber());
        uploadBean.setDocumentFile(documentFile);

        executeActivity(getProcess(request), "EditDocuments", uploadBean);
    } catch (DomainException e) {
        addActionMessage(request, e.getMessage(), e.getArgs());
    }

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

}
 
Example #20
Source File: AbstractManageThesisDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward changePersonType(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    ThesisBean bean = getRenderedObject("bean");
    RenderUtils.invalidateViewState("bean");

    if (bean == null) {
        return searchStudent(mapping, actionForm, request, response);
    }

    bean.setPerson(null);
    bean.setRawPersonName(null);
    bean.setUnitName(null);
    bean.setRawUnitName(null);

    request.setAttribute("bean", bean);
    return mapping.findForward("select-person");
}
 
Example #21
Source File: PhdIndividualProgramProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ActionForward addJobInformation(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) {

    addQualificationsAndJobsContextInformation(request);
    final Object bean = getRenderedObject("job");

    try {
        ExecuteProcessActivity.run(getProcess(request), AddJobInformation.class.getSimpleName(), bean);
        addSuccessMessage(request, "message.job.information.create.success");

    } catch (DomainException e) {
        addErrorMessage(request, e.getKey(), e.getArgs());
        request.setAttribute("job", bean);
    }
    return mapping.findForward("editQualificationsAndJobsInformation");
}
 
Example #22
Source File: PublicInstitutionPhdProgramsCandidacyProcessDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 6 votes vote down vote up
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 #23
Source File: SystemChannelsAction.java    From spacewalk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Update the base channel for a system.
 * @param mapping ActionMapping
 * @param formIn ActionForm
 * @param request ServletRequest
 * @param response ServletResponse
 * @return The ActionForward to go to next.
 */
public ActionForward updateChildChannels(ActionMapping mapping,
        ActionForm formIn,
        HttpServletRequest request,
        HttpServletResponse response) {
    RequestContext rctx = new RequestContext(request);
    User user = rctx.getCurrentUser();
    Server s  = SystemManager.lookupByIdAndUser(
            rctx.getRequiredParam(RequestContext.SID), user);

    String[] childChannelIds = request.getParameterValues(CHILD_CHANNELS);

    List<Long> channelIdsList = new LinkedList<Long>();
    if (childChannelIds != null) {
        for (int i = 0; i < childChannelIds.length; i++) {
            channelIdsList.add(Long.valueOf(childChannelIds[i]));
            log.debug("Adding child id: " + channelIdsList.get(i));
        }
    }
    UpdateChildChannelsCommand cmd = new UpdateChildChannelsCommand(user, s,
            channelIdsList);
    ValidatorError error = cmd.store();
    if (error != null) {
        log.debug("Got error trying to store child channels: " + error);
        getStrutsDelegate().saveMessages(request,
                RhnValidationHelper.validatorErrorToActionErrors(error));
    }
    else {
        getStrutsDelegate().saveMessage("sdc.channels.edit.child_channels_updated",
                request);

        String message =
            LocalizationService.getInstance().getMessage("snapshots.childchannel");
        SystemManager.snapshotServer(s, message);
    }

    return getStrutsDelegate().forwardParam(mapping.findForward("update"),
            RequestContext.SID, s.getId().toString());
}
 
Example #24
Source File: DelegateRuleAction.java    From rice with Educational Community License v2.0 5 votes vote down vote up
public ActionForward createDelegateRule(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {
	DelegateRuleForm form = (DelegateRuleForm) actionForm;
	if (!validateCreateDelegateRule(form)) {
		return mapping.findForward(getDefaultMapping());
	}
	return new ActionForward(generateMaintenanceUrl(request, form), true);
}
 
Example #25
Source File: AlumniProfessionalInformationDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
@EntryPoint
public ActionForward innerProfessionalInformation(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    request.setAttribute("alumni", getAlumniFromLoggedPerson(request));
    return mapping.findForward("innerProfessionalInformation");
}
 
Example #26
Source File: UploadPhotoDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward save(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    PhotographUploadBean photo = getRenderedObject();
    RenderUtils.invalidateViewState();

    try (InputStream stream = photo.getFileInputStream()) {
        UploadOwnPhoto.run(ByteStreams.toByteArray(stream), ContentType.getContentType(photo.getContentType()));
    }
    final Person person = Authenticate.getUser().getPerson();
    request.setAttribute("personBean", new PersonBean(person));
    EmergencyContactBean emergencyContactBean = new EmergencyContactBean(person);
    request.setAttribute("emergencyContactBean", emergencyContactBean);
    return mapping.findForward("visualizePersonalInformation");
}
 
Example #27
Source File: ManageThesisDA.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ActionForward changeCredits(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    String target = request.getParameter("target");

    if (target == null) {
        return editProposal(mapping, actionForm, request, response);
    }

    request.setAttribute("editOrientatorCreditsDistribution", target);

    return editProposal(mapping, actionForm, request, response);
}
 
Example #28
Source File: ClassAssignmentsReportSearchAction.java    From unitime with Apache License 2.0 5 votes vote down vote up
/** 
 * Method execute
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return ActionForward
 * @throws HibernateException
 */

public ActionForward searchClasses(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response) throws Exception {	
	
	return(performAction(mapping, form, request, response, "search"));
	
}
 
Example #29
Source File: CashReceiptAction.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Overridden to guarantee that form of copied document is set to whatever the entry mode of the document is
 * @see org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase#copy(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
@Override
public ActionForward copy(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    ActionForward forward = super.copy(mapping, form, request, response);
    initDerivedCheckValues((CashReceiptForm)form);
    return forward;
}
 
Example #30
Source File: RemovePackagesAction.java    From uyuni with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
                HttpServletRequest request, HttpServletResponse response) {

    RequestContext ctxt = new RequestContext(request);
    //put advisory in request for the toolbar
    request.setAttribute("advisory", ctxt.lookupErratum().getAdvisory());
    request.setAttribute(ListTagHelper.PARENT_URL, request.getRequestURI());

    ListRhnSetHelper helper = new ListRhnSetHelper(this, request,
                                                   RhnSetDecl.PACKAGES_TO_REMOVE);
    helper.setDataSetName(ListPackagesAction.DATASET_NAME);
    helper.setListName(ListPackagesAction.LIST_NAME);
    helper.setWillClearSet(false);
    helper.execute();

    if (helper.isDispatched()) {
        StrutsDelegate delegate = getStrutsDelegate();
        Errata errata = ctxt.lookupErratum();
        User user = ctxt.getCurrentUser();
        RhnSet idsToRemove = helper.getSet();
        int packagesRemoved = processRemovePackagesFrom(errata, user, idsToRemove);
        doMessages(request, packagesRemoved, errata.getAdvisory());
        helper.destroy();

        Long eid = ctxt.getRequiredParam(ListPackagesAction.EID_PARAM);
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(ListPackagesAction.EID_PARAM, eid);
        return delegate.forwardParams(
                        mapping.findForward(RhnHelper.CONFIRM_FORWARD), params);
    }
    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}