Package org.apache.cocoon.forms.event

Examples of org.apache.cocoon.forms.event.ProcessingPhaseEvent


        this.endProcessing = null;
        this.isValid = false;

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }

        this.phase = ProcessingPhase.READ_FROM_REQUEST;
        // Find the submit widget, if not an action
        this.submitWidget = null;
        String submitId = formContext.getRequest().getParameter("forms_submit_id");
        if (submitId != null && submitId.length() > 0) {
            // if the form has an ID, it is used as part of the submitId too
            // this has ID has to be cut off
            if(this.getId() != null && !"".equals(this.getId())) {
                submitId = submitId.substring(submitId.indexOf('.')+1);
            }
            StringTokenizer stok = new StringTokenizer(submitId, ".");
            Widget submit = this;
            while (stok.hasMoreTokens()) {
                submit = submit.lookupWidget(stok.nextToken());
                if (submit == null) {
                    throw new IllegalArgumentException("Invalid submit id (no such widget): " + submitId);
                }
            }

            setSubmitWidget(submit);
        }

        try {
            // Start buffering events
            this.bufferEvents = true;

            doReadFromRequest(formContext);

            // Fire events, still buffering them: this ensures they will be handled in the same
            // order as they were added.
            fireEvents();
        } finally {
            // No need for buffering in the following phases
            this.bufferEvents = false;
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
        if (this.endProcessing != null) {
            return this.endProcessing.booleanValue();
        }
View Full Code Here


            return this.endProcessing.booleanValue();
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
        if (this.endProcessing != null) {
            // De-validate the form if one of the listeners asked to end the processing
            // This allows for additional application-level validation.
            this.isValid = false;
View Full Code Here

        this.endProcessing = null;
        this.isValid = false;
       
        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
       
        this.phase = ProcessingPhase.READ_FROM_REQUEST;
        // Find the submit widget, if not an action
        this.submitWidget = null;
        String submitId = formContext.getRequest().getParameter("forms_submit_id");
        if (submitId != null && submitId.length() > 0) {
            StringTokenizer stok = new StringTokenizer(submitId, ".");
            Widget submit = this;
            while (stok.hasMoreTokens()) {
                submit = submit.lookupWidget(stok.nextToken());
                if (submit == null) {
                    throw new IllegalArgumentException("Invalid submit id (no such widget): " + submitId);
                }
            }
           
            setSubmitWidget(submit);
        }
       
        try {
            // Start buffering events
            this.bufferEvents = true;
           
            doReadFromRequest(formContext);
           
            // Fire events, still buffering them: this ensures they will be handled in the same
            // order as they were added.
            fireWidgetEvents();
        } finally {
            // No need for buffering in the following phases
            this.bufferEvents = false;
        }
       
        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }

        if (this.endProcessing != null) {
            return this.endProcessing.booleanValue();
        }

        // Validate the form
        this.phase = ProcessingPhase.VALIDATE;
        this.isValid = doValidate();

        if (this.endProcessing != null) {
            return this.endProcessing.booleanValue();
        }
       
        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
       
        if (this.endProcessing != null) {
            // De-validate the form if one of the listeners asked to end the processing
            // This allows for additional application-level validation.
View Full Code Here

     * Inform the form that the values are loaded.
     */
    public void informEndLoadingModel() {
        // Notify the end of the load phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.LOAD_MODEL));
        }
    }
View Full Code Here

     * Inform the form that the values are saved.
     */
    public void informEndSavingModel() {
        // Notify the end of the save phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.SAVE_MODEL));
        }
    }
View Full Code Here

        this.endProcessing = null;
        this.isValid = false;

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.PROCESSING_INITIALIZE));
        }

        try {
            // Start buffering events
            this.bufferEvents = true;
            this.submitWidget = null;

            doReadFromRequest(formContext);

            // Find the submit widget, if not an action
            // This has to occur after reading from the request, to handle stateless forms
            // where the submit widget is recreated when the request is read (e.g. a row-action).

            // Note that we don't check this if the submit widget was already set, as it can cause problems
            // if the user triggers submit with an input (which sets 'forms_submit_id'), then clicks back
            // and submits using a regular submit button.
            if (getSubmitWidget() == null) {
                String submitId = formContext.getRequest().getParameter(SUBMIT_ID_PARAMETER);
                if (!StringUtils.isEmpty(submitId)) {
                    // if the form has an ID, it is used as part of the submitId too and must be removed
                    if(!StringUtils.isEmpty(this.getId())) {
                        submitId = submitId.substring(submitId.indexOf('.')+1);
                    }
                    Widget submit = this.lookupWidget(submitId.replace('.', '/'));
                    if (submit == null) {
                        throw new IllegalArgumentException("Invalid submit id (no such widget): " + submitId);
                    }
                    setSubmitWidget(submit);
                }
            }

            // Fire events, still buffering them: this ensures they will be handled in the same
            // order as they were added.
            fireEvents();

        } finally {
            // No need for buffering in the following phases
            this.bufferEvents = false;
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.READ_FROM_REQUEST));
        }

        if (this.endProcessing != null) {
            return this.endProcessing.booleanValue();
        }
View Full Code Here

            return this.wasValid;
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.VALIDATE));
        }

        if (this.endProcessing != null) {
            // De-validate the form if one of the listeners asked to end the processing
            // This allows for additional application-level validation.
View Full Code Here

        this.endProcessing = null;
        this.isValid = false;

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }

        this.phase = ProcessingPhase.READ_FROM_REQUEST;

        try {
            // Start buffering events
            this.bufferEvents = true;

            this.submitWidget = null;

            doReadFromRequest(formContext);

            // Find the submit widget, if not an action
            // This has to occur after reading from the request, to handle stateless forms
            // where the submit widget is recreated when the request is read (e.g. a row-action).
           
            // Note that we don't check this if the submit widget was already set, as it can cause problems
            // if the user triggers submit with an input (which sets 'forms_submit_id'), then clicks back
            // and submits using a regular submit button.
            if (getSubmitWidget() == null) {
                String submitId = formContext.getRequest().getParameter(SUBMIT_ID_PARAMETER);
                if (!StringUtils.isEmpty(submitId)) {
                    // if the form has an ID, it is used as part of the submitId too and must be removed
                    if(!StringUtils.isEmpty(this.getId())) {
                        submitId = submitId.substring(submitId.indexOf('.')+1);
                    }
                    Widget submit = this.lookupWidget(submitId.replace('.', '/'));
                    if (submit == null) {
                        throw new IllegalArgumentException("Invalid submit id (no such widget): " + submitId);
                    }
                    setSubmitWidget(submit);
                }
            }

            // Fire events, still buffering them: this ensures they will be handled in the same
            // order as they were added.
            fireEvents();

        } finally {
            // No need for buffering in the following phases
            this.bufferEvents = false;
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
        if (this.endProcessing != null) {
            return this.endProcessing.booleanValue();
        }
View Full Code Here

            return this.wasValid;
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
        if (this.endProcessing != null) {
            // De-validate the form if one of the listeners asked to end the processing
            // This allows for additional application-level validation.
            this.isValid = false;
View Full Code Here

        this.endProcessing = null;
        this.isValid = false;

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }

        this.phase = ProcessingPhase.READ_FROM_REQUEST;
        // Find the submit widget, if not an action
        this.submitWidget = null;
        String submitId = formContext.getRequest().getParameter("forms_submit_id");
        if (submitId != null && submitId.length() > 0) {
            // if the form has an ID, it is used as part of the submitId too
            // this has ID has to be cut off
            if(this.getId() != null && !"".equals(this.getId())) {
                submitId = submitId.substring(submitId.indexOf('.')+1);
            }
            StringTokenizer stok = new StringTokenizer(submitId, ".");
            Widget submit = this;
            while (stok.hasMoreTokens()) {
                submit = submit.lookupWidget(stok.nextToken());
                if (submit == null) {
                    throw new IllegalArgumentException("Invalid submit id (no such widget): " + submitId);
                }
            }

            setSubmitWidget(submit);
        }

        try {
            // Start buffering events
            this.bufferEvents = true;

            doReadFromRequest(formContext);

            // Fire events, still buffering them: this ensures they will be handled in the same
            // order as they were added.
            fireEvents();
        } finally {
            // No need for buffering in the following phases
            this.bufferEvents = false;
        }

        // Notify the end of the current phase
        if (this.listener != null) {
            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
        }
        if (this.endProcessing != null) {
            return this.endProcessing.booleanValue();
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.forms.event.ProcessingPhaseEvent

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.