Package com.adito.wizard

Examples of com.adito.wizard.AbstractWizardSequence


    }
   
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        // Store the current wizard flow so we can return to it when complete
        AbstractWizardSequence seq = (AbstractWizardSequence)request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);
        if(seq != null) {
            // get referer from parameter
            ((CoreForm)form).setReferer(CoreUtil.getRequestReferer(request));
            request.getSession().removeAttribute(Constants.WIZARD_SEQUENCE);
            request.getSession().setAttribute(Constants.SUSPENDED_WIZARD_SEQUENCE, seq);
View Full Code Here


     *      javax.servlet.http.HttpServletRequest)
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);
        categoryIdx = 0;
        AbstractWizardSequence seq = getWizardSequence(request);
        propertyItemImpls = seq == null ? null : (PropertyItemImpl[]) seq.getAttribute(getKeyForForm(ATTR_PROPERTY_ITEMS), null);
        categoryDefinitions = seq == null ? null : (List) seq.getAttribute(getKeyForForm(ATTR_CATEGORY_DEFINITIONS), null);
        if (propertyItemImpls != null) {
            for (int i = 0; i < propertyItemImpls.length; i++) {
                if (propertyItemImpls[i].getType() == PropertyDefinition.TYPE_BOOLEAN) {
                    propertyItemImpls[i].setValue("false");
                }
View Full Code Here

     *      javax.servlet.http.HttpServletRequest,
     *      javax.servlet.http.HttpServletResponse)
     */
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        AbstractWizardSequence seq = (AbstractWizardSequence) request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);
        if (seq == null) {
            try {
                seq = createWizardSequence(mapping, form, request, response);
            }
            catch(RedirectException rde) {
                log.error("Redirect to . " + rde.getForward().getPath(), rde);
                return rde.getForward();
            }
            request.getSession().setAttribute(Constants.WIZARD_SEQUENCE, seq);
        }
        ((AbstractWizardForm) form).init(seq, request);
        seq.setCurrentPageForm((AbstractWizardForm) form);
        Util.noCache(response);
        return mapping.findForward("display");
    }
View Full Code Here

     * @throws Exception on any error
     */
    public ActionForward gotoStep(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        applyToSequence(mapping, (AbstractWizardForm) form, request, response);
        AbstractWizardSequence seq = getWizardSequence(request);
        return new ActionForward(((WizardStep) seq.getSteps().get(((AbstractWizardForm) form).getGotoStep())).getPath(), true);
    }
View Full Code Here

    /*
     * Apply the current form to the wizard sequence object
     */
    protected void applyToSequence(ActionMapping mapping, AbstractWizardForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        AbstractWizardSequence seq = (AbstractWizardSequence) request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);
        if (seq == null) {
            throw new Exception("No sequence.");
        }
        form.apply(seq);
    }
View Full Code Here

     * @throws Exception
     */
    public ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        applyToSequence(mapping, (AbstractWizardForm) form, request, response);
        AbstractWizardSequence seq = (AbstractWizardSequence) request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);
        if (seq == null) {
            throw new Exception("No sequence.");
        }
        return seq.getFinishActionForward();
    }
View Full Code Here

     * @return forward
     * @throws Exception
     */
    public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        AbstractWizardSequence seq = getWizardSequence(request);
        if(seq != null) {
            request.getSession().removeAttribute(Constants.WIZARD_SEQUENCE);
            for (Iterator i = seq.getForms().iterator(); i.hasNext();) {
                String formName = ((AbstractWizardForm) i.next()).getPageName() + "Form";
                request.getSession().removeAttribute(formName);
            }
            ActionForward fwd = new ActionForward(seq.getReferer(), true);
            return fwd;
        }
        return mapping.findForward("home");
    }
View Full Code Here

     */
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        // Do the install
        List<WizardActionStatus> actionStatus = new ArrayList<WizardActionStatus>();
        AbstractWizardSequence seq = getWizardSequence(request);
        AbstractKeyStoreImportType importType = KeyStoreImportTypeManager.getInstance().getType(
            (String)seq.getAttribute(KeyStoreImportTypeForm.ATTR_TYPE, ReplyFromCAImportType.REPLY_FROM_CA));
        File f = (File)seq.getAttribute(KeyStoreImportFileForm.ATTR_UPLOADED_FILE, null);
        String alias = (String)seq.getAttribute(KeyStoreImportFileForm.ATTR_ALIAS, null);
        String passphrase = (String)seq.getAttribute(KeyStoreImportFileForm.ATTR_PASSPHRASE, null);
        try {
            importType.doInstall(f, alias, passphrase, seq, LogonControllerFactory.getInstance().getSessionInfo(request));
            actionStatus.add(new WizardActionStatus(WizardActionStatus.COMPLETED_OK, "keyStoreImportType." + importType.getName() + ".installed", alias, "", "", "", "", importType.getBundle()));
        }
        catch(Exception e) {
View Full Code Here

     * @throws Exception on any error
     */
    public ActionForward exit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {

        AbstractWizardSequence seq = getWizardSequence(request);
        AbstractKeyStoreImportType importType = KeyStoreImportTypeManager.getInstance().getType(
            (String)seq.getAttribute(KeyStoreImportTypeForm.ATTR_TYPE, ReplyFromCAImportType.REPLY_FROM_CA));
        ActionForward fwd = cancel(mapping, form, request, response);
        if(importType != null && importType.isRestartRequired()) {
            String orig = fwd.getPath();
            fwd = mapping.findForward("restartRequired");
            fwd = CoreUtil.addParameterToForward(fwd, "no", orig);
View Full Code Here

        try {
            if (fileName.trim().length() == 0) {
                errs.add(Globals.ERROR_KEY, new ActionMessage("keyStoreImportWizard.keyStoreImportFile.noFileProvided"));
            } else {

                AbstractWizardSequence seq = (AbstractWizardSequence) request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);

                AbstractKeyStoreImportType importType = KeyStoreImportTypeManager.getInstance().getType(
                    (String)seq.getAttribute(KeyStoreImportTypeForm.ATTR_TYPE, ReplyFromCAImportType.REPLY_FROM_CA));
                SessionInfo sessionInfo = getSessionInfo(request);
                importType.validate(errs, alias, passphrase, seq, sessionInfo);

                if (errs.size() == 0) {

                    in = uploadFile.getInputStream();
                    out = new FileOutputStream(uploadedFile);
                    Util.copy(in, out);

                    if (passphrase != null) {
                        seq.putAttribute(KeyStoreImportFileForm.ATTR_PASSPHRASE, passphrase);
                    }
                    seq.putAttribute(KeyStoreImportFileForm.ATTR_UPLOADED_FILE, uploadedFile);
                    seq.putAttribute(KeyStoreImportFileForm.ATTR_FILENAME, uploadFile);
                    if (alias != null) {
                        seq.putAttribute(KeyStoreImportFileForm.ATTR_ALIAS, alias.toLowerCase());
                    }

                    ActionMessages msgs = new ActionMessages();
                    msgs.add(Globals.MESSAGE_KEY, new ActionMessage("keyStoreImportWizard.keyStoreImportFile.uploaded", fileName,
                                    new Integer(fileSize)));
View Full Code Here

TOP

Related Classes of com.adito.wizard.AbstractWizardSequence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.