Package org.apache.shale.dialog

Examples of org.apache.shale.dialog.DialogContext


    /** {@inheritDoc} */
    public DialogContext getParent() {

        if (this.parentDialogId != null) {
            DialogContext parent = manager.get(this.parentDialogId);
            if (parent == null) {
                throw new IllegalStateException("Dialog instance '"
                        + parentDialogId + "' was associated with this instance '"
                        + getId() + "' but is no longer available");
            }
View Full Code Here


        String parentId = (String) context.getExternalContext().
                getRequestParameterMap().get(Constants.PARENT_ID);
        if (dialogName != null) {

            // Create a new DialogContext instance
            DialogContext dcontext = create(context, dialogName, parentId);
            if (dcontext == null) {
                return;
            }

            // Start the new DialogContext instance
            dcontext.start(context);
            if (log.isDebugEnabled()) {
                log.debug("afterRestoreView() creating dialog context with id '"
                          + id + "' for FacesContext instance '"
                          + context + "' associated with parent dialog context id '"
                          + parentId + "' and advancing to viewId '"
View Full Code Here

     *
     * @param context <code>FacesContext</code> for the current request
     */
    private void beforeRenderResponse(FacesContext context) {

        DialogContext dcontext = (DialogContext)
          context.getExternalContext().getRequestMap().get(Constants.CONTEXT_BEAN);
        Map map = context.getViewRoot().getAttributes();
        if ((dcontext != null) && dcontext.isActive()) {
            if (log.isDebugEnabled()) {
                log.debug("beforeRenderResponse() saving dialog context id '"
                          + dcontext.getId()
                          + "' for FacesContext instance '"
                          + context + "'");
            }
            map.put(CONTEXT_ID_ATTR, dcontext.getId());
            Object opaqueState = dcontext.getOpaqueState();
            if (opaqueState != null) {
                map.put(CONTEXT_OPAQUE_ATTR, opaqueState);
            }
        } else {
            if (log.isTraceEnabled()) {
View Full Code Here

          context.getApplication().getVariableResolver().
                resolveVariable(context, Constants.MANAGER_BEAN);
        if (manager == null) {
            return null;
        }
        DialogContext parent = null;
        if (parentId != null) {
            parent = manager.get(parentId);
        }
        DialogContext dcontext = manager.create(context, dialogName, parent);
        return dcontext;

    }
View Full Code Here

          context.getApplication().getVariableResolver().
                resolveVariable(context, Constants.MANAGER_BEAN);
        if (manager == null) {
            return;
        }
        DialogContext dcontext = manager.get(dialogId);
        if (dcontext == null) {
            return;
        }
        if (log.isDebugEnabled()) {
            log.debug("afterPhase() restoring dialog context with id '"
                      + dialogId + "' for FacesContext instance '"
                      + context + "'");
        }
        context.getExternalContext().getRequestMap().put(Constants.CONTEXT_BEAN, dcontext);
        Object opaqueState = context.getViewRoot().getAttributes().get(CONTEXT_OPAQUE_ATTR);
        if (opaqueState != null) {
            dcontext.setOpaqueState(opaqueState);
        }

    }
View Full Code Here

                      + context + "', fromAction='"
                      + fromAction + "', outcome='"
                      + outcome + "')");
        }

        DialogContext dcontext = (DialogContext)
          context.getExternalContext().getRequestMap().get(Constants.CONTEXT_BEAN);
        String prefix = prefix(context);
        if (dcontext == null) {
            if ((outcome != null) && outcome.startsWith(prefix)) {
                // Create and start a new DialogContext instance
                DialogContextManager manager = (DialogContextManager)
                  context.getApplication().getVariableResolver().
                  resolveVariable(context, Constants.MANAGER_BEAN);
                dcontext =
                  manager.create(context, outcome.substring(prefix.length()));
                dcontext.start(context);
                if (log.isDebugEnabled()) {
                    log.debug("Starting dialog '"
                              + outcome.substring(prefix.length())
                              + "' for FacesContext instance '"
                              + context + "' with navigation to viewId '"
                              + context.getViewRoot().getViewId() + "'");
                }
                return;
            } else {
                // No active dialog, so delegate to the original handler
                original.handleNavigation(context, fromAction, outcome);
                return;
            }
        } else {
            // Advance the currently active DialogContext instance
            dcontext.advance(context, outcome);
            if (log.isDebugEnabled()) {
                log.debug("Advancing dialog '"
                          + dcontext.getName() + "' for FacesContext '"
                          + context + "' with navigation to viewId '"
                          + context.getViewRoot().getViewId() + "'");
            }
        }
View Full Code Here

    /** {@inheritDoc} */
    public DialogContext getParent() {

        if (this.parentDialogId != null) {
            DialogContext parent = manager.get(this.parentDialogId);
            if (parent == null) {
                throw new IllegalStateException("Dialog instance '"
                        + parentDialogId + "' was associated with this instance '"
                        + getId() + "' but is no longer available");
            }
View Full Code Here

TOP

Related Classes of org.apache.shale.dialog.DialogContext

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.