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

The following examples show how to use org.apache.struts.action.ActionForm. 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
/**
 * {@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 2
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 3
Source Project: SSO   Source File: SSOAction.java    License: 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 4
Source Project: spacewalk   Source File: BaseRankChannels.java    License: 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 5
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 6
/**
 * 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 7
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 8
@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 9
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 10
Source Project: spacewalk   Source File: SubscribeConfirm.java    License: 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 11
Source Project: uyuni   Source File: WorkWithGroupAction.java    License: 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 12
Source Project: Films   Source File: UserspaceAction.java    License: 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 13
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 14
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 15
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 16
Source Project: jpetstore-kubernetes   Source File: EditAccountAction.java    License: 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 17
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 18
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 19
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 Project: kfs   Source File: CorrectionAction.java    License: 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 21
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 22
@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 23
/**
 * {@inheritDoc}
 */
public ActionForward execute(ActionMapping mapping,
                             ActionForm formIn,
                             HttpServletRequest request,
                             HttpServletResponse response) {
    ListHelper helper = new ListHelper(this, request);
    helper.execute();

    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
 
Example 24
/**
 * Calls the document service to blanket approve the document
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return ActionForward
 * @throws Exception
 */
public ActionForward blanketApprove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form;
    doProcessingAfterPost(kualiDocumentFormBase, request);

    // KULRICE-7864: blanket approve should not be allowed when adhoc route for completion request is newly added
    boolean hasPendingAdhocForCompletion = this.hasPendingAdhocForCompletion(kualiDocumentFormBase);
    if(hasPendingAdhocForCompletion){
        GlobalVariables.getMessageMap().putError(KRADConstants.NEW_AD_HOC_ROUTE_WORKGROUP_PROPERTY_NAME, RiceKeyConstants.ERROR_ADHOC_COMPLETE_BLANKET_APPROVE_NOT_ALLOWED);

        return mapping.findForward(RiceConstants.MAPPING_BASIC);
    }

    kualiDocumentFormBase.setDerivedValuesOnForm(request);
    ActionForward preRulesForward = promptBeforeValidation(mapping, form, request, response);
    if (preRulesForward != null) {
        return preRulesForward;
    }

    Document document = kualiDocumentFormBase.getDocument();

    ActionForward forward = checkAndWarnAboutSensitiveData(mapping, form, request, response, KRADPropertyConstants.DOCUMENT_EXPLANATION, document.getDocumentHeader().getExplanation(), "blanketApprove", "");
    if (forward != null) {
        return forward;
    }

    document = getDocumentService().blanketApproveDocument(document, kualiDocumentFormBase.getAnnotation(), combineAdHocRecipients(kualiDocumentFormBase));
    kualiDocumentFormBase.setDocument(document);
    KNSGlobalVariables.getMessageList().add(RiceKeyConstants.MESSAGE_ROUTE_APPROVED);
    kualiDocumentFormBase.setAnnotation("");
    return returnToSender(request, mapping, kualiDocumentFormBase);
}
 
Example 25
public ActionForward prepareCreateEnrolmentPeriod(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) {

    final ManageEnrolmentsBean bean = new ManageEnrolmentsBean();
    bean.setSemester((ExecutionSemester) getDomainObject(request, "executionIntervalId"));

    request.setAttribute("createBean", bean);
    return mapping.findForward("createEnrolmentPeriod");
}
 
Example 26
public ActionForward viewExternalCurricularCourse(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) {

    final ExternalCurricularCourse externalCurricularCourse = getExternalCurricularCourse(request);
    request.setAttribute("externalCurricularCourseBean", new ExternalCurricularCourseResultBean(externalCurricularCourse));
    request.setAttribute("externalEnrolments", externalCurricularCourse.getExternalEnrolmentsSet());
    return mapping.findForward("viewExternalCurricularCourse");
}
 
Example 27
/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping,
                             ActionForm formIn,
                             HttpServletRequest request,
                             HttpServletResponse response) {

    RequestContext requestContext = new RequestContext(request);

    Long prid = requestContext.getRequiredParam(RequestContext.PRID);
    Long sid = requestContext.getRequiredParam(RequestContext.SID);

    User user = requestContext.getCurrentUser();
    Server server = SystemManager.lookupByIdAndUser(sid, user);
    Profile profile = ProfileManager.lookupByIdAndOrg(prid, user.getOrg());

    ListHelper helper = new ListHelper(this, request);
    helper.execute();

    DynaActionForm dynaForm = (DynaActionForm) formIn;
    getStrutsDelegate().prepopulateDatePicker(request, dynaForm,
            "date", DatePicker.YEAR_RANGE_POSITIVE);

    if (requestContext.wasDispatched("schedulesync.jsp.schedulesync")) {
        Date time = getStrutsDelegate().readDatePicker(dynaForm, "date",
                DatePicker.YEAR_RANGE_POSITIVE);
        Map syncParam = new HashMap();
        syncParam.put(RequestContext.SID, sid);
        syncParam.put(RequestContext.PRID, prid);
        syncParam.put(RequestContext.DISPATCH,
                request.getParameter(RequestContext.DISPATCH));
        syncParam.put("time", time.getTime());
        return getStrutsDelegate().forwardParams(mapping.findForward("sync"),
                syncParam);
    }

    request.setAttribute("system", server);
    request.setAttribute("profilename", profile.getName());
    return getStrutsDelegate().forwardParams(mapping.findForward(
             RhnHelper.DEFAULT_FORWARD), request.getParameterMap());
}
 
Example 28
@Override
public ActionForward updateParametersToSearchOptionalCurricularCourses(ActionMapping mapping, ActionForm actionForm,
        HttpServletRequest request, HttpServletResponse response) {

    final BolonhaStudentOptionalEnrollmentBean bean = getBolonhaStudentOptionalEnrollmentBeanFromViewState();
    addCompetenceCoursesAvalailableToEnrol(request, bean.getStudentCurricularPlan());
    return super.updateParametersToSearchOptionalCurricularCourses(mapping, actionForm, request, response);
}
 
Example 29
@EntryPoint
public ActionForward listApplicationPeriods(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) {

    request.setAttribute("periods", getSortedCandidacyPeriods());

    final User userView = Authenticate.getUser();
    if (userView != null && Group.managers().isMember(userView)) {
        final GenericApplicationPeriodBean genericApplicationPeriodBean = new GenericApplicationPeriodBean();
        request.setAttribute("genericApplicationPeriodBean", genericApplicationPeriodBean);
    }

    return mapping.findForward("genericApplications.listApplicationPeriods");
}
 
Example 30
public ActionForward viewDeclaration(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    Thesis thesis = getThesis(request);

    if (thesis.isWaitingConfirmation()) {
        request.setAttribute("bean", new DeclarationBean(thesis));
        return mapping.findForward("thesis-declaration");
    } else {
        return mapping.findForward("thesis-declaration-view");
    }
}