Package ariba.ui.aribaweb.util

Examples of ariba.ui.aribaweb.util.AWGenericException


        See 8) from above
    */
    public static AWBinding fieldBinding (String bindingName, String fieldPathString, AWBinding defaultBinding)
    {
        if (StringUtil.nullOrEmptyOrBlankString(fieldPathString)) {
            throw new AWGenericException("invalid field binding: " + fieldPathString);
        }
        AWBinding fieldBinding = null;
        char firstChar = fieldPathString.charAt(0);
        if (firstChar == '!') {
            fieldBinding = new AWBooleanNotBinding();
View Full Code Here


        Object clonedObject = null;
        try {
            clonedObject = super.clone();
        }
        catch (CloneNotSupportedException cloneNotSupportedException) {
            throw new AWGenericException(cloneNotSupportedException);
        }
        return clonedObject;
    }
View Full Code Here

        validate(validationContext, componentDefinition);
    }

    protected final AWGenericException getBindingException (String message, Exception exception)
    {
        AWGenericException wrappedException = null;
        if (exception instanceof AWGenericException) {
            wrappedException = (AWGenericException)exception;
            wrappedException.addMessage(message);
        }
        else {
            wrappedException = new AWBindingException(message, exception);
        }
        return wrappedException;
View Full Code Here

    private AWBindingDictionary _unrecognizedBindingsDictionary;

    public void init (String tagName, Map bindingsHashtable)
    {
        if (AWGenericElement.hasGenericElementAttributes(bindingsHashtable)) {
            throw new AWGenericException(getClass().getName() + ": contains AWGenericElementAttributes. " + bindingsHashtable);
        }
        _otherBindings = (AWBinding)bindingsHashtable.remove(AWBindingNames.otherBindings);
        _unrecognizedBindingsDictionary = AWGenericElement.escapedBindingsDictionary(bindingsHashtable);
        super.init(tagName, null);
    }
View Full Code Here

    {
        if (_initializingSession) {
            // if we're in the middle of initializing and we get a call for an optional session, no need to blow up
            if (!required) return null;
            _initializingSession = false;
            throw new AWGenericException("Circular call to session(boolean flag) detected.  Ensure that session initialization does not call session(boolean flag).");
        }

        _initializingSession = true;
        try {
            if (_awsession == null && _request != null) {
View Full Code Here

    // Form Handling
    ////////////////////
    public void setCurrentForm (AWHtmlForm currentForm)
    {
        if (currentForm != null && _currentForm != null) {
            throw new AWGenericException("Nested forms detected.");
        }
        _currentForm = currentForm;
    }
View Full Code Here

            }
        }
        else {
            boolean isRequired = (_required == null) ? true : _required.booleanValue(subcomponent);
            if (isRequired) {
                throw new AWGenericException(getClass().getName() + ": reference to Named Content not found: \"" + templateName + "\"");
            }
        }
        return namedSubtemplate;
    }
View Full Code Here

        }
    }

    private void throwException (Throwable t, AWElement element)
    {
        throwException(new AWGenericException(t), element);
    }
View Full Code Here

            }
            if (currentPage.pageComponent().shouldValidateRequest()) {
                currentPage.pageComponent().validateRequest(requestContext);
            }
            if (! isValidNode(requestContext)) {
                throw new AWGenericException("Security Exception.  Invalid node.");
            }
            int requestType = session.requestType(request);

            AWPage perfSourcePage = null;
            String perfSourceArea = null;

            switch (requestType) {
                case AWSession.BacktrackRequest:
                case AWSession.ForwardTrackRequest: {
                    currentPage.ensureAwake(requestContext);
                    AWPage restoredPage = null;
                    AWBacktrackState backtrackState =
                        (requestType == AWSession.BacktrackRequest) ?
                        currentPage.updateBacktrackStateForBackButton() :
                        currentPage.updateBacktrackStateForForwardButton();

                    // record perf trace info
                    perfSourcePage = currentPage;
                    perfSourceArea = (requestType == AWSession.BacktrackRequest)
                            ? "backtrack" : "forwardtrack";

                    if (backtrackState != null) {
                        requestContext.setBacktrackState(backtrackState);
                        restoredPage  = currentPage;
                    }
                    else {
                        restoredPage = (requestType == AWSession.BacktrackRequest) ?
                            session.restorePreviousPage(currentPage) :
                            session.restoreNextPage(currentPage);
                        restoredPage.ensureAwake(requestContext);
                    }
                    session.savePage(restoredPage);
                    requestContext.setPage(restoredPage);
                    response = requestContext.generateResponse();
                    break;
                }
                case AWSession.InterruptedNewRequest:
                    // this is the case where a request came in from an obsolete page (e.g. the user pushed another
                    // button while the previous action was still running.  We treat this like a refresh and take
                    // them to the "currentPage" -- i.e. the one that was the result of the *first* action.
                case AWSession.RefreshRequest: {
                    // record perf trace info
                    perfSourcePage = currentPage;
                    perfSourceArea = "refresh";

                    // if the current page is a boundary (ie AWRedirect), then
                    // move the server state back one, allowing us to skip over the
                    // boundary page -- note that this may be a refresh request due to a
                    // browser backtrack (since boundary components should not be refreshable)
                    if (currentPage.pageComponent().isBoundary()) {
                        // check to see there is a previous page in the page cache, if
                        // so, then do a server side back.  If not, then do a browser
                        // backtrack.  For the case that there is a boundary page as the
                        // first (and only) page on the page cache (DashboardMain).
                        if (session.previousPage(currentPage) != null) {
                            requestContext.setHistoryAction(AWSession.BacktrackRequest);
                            session.initRequestType();
                            currentPage = session.restorePreviousPage(currentPage);
                        }
                        else {
                            // no previous page so return the browser back here ...
                            response = application.createResponse();
                            AWRedirect.browserBack(response);
                        }

                        // record perf trace info
                        perfSourcePage = currentPage;
                        perfSourceArea = "backtrack";
                    }

                    if (response == null) {
                        // AWReload support
                        if (AWConcreteApplication.IsRapidTurnaroundEnabled) AWUtil.getClassLoader().checkForUpdates();

                        currentPage.ensureAwake(requestContext);
                        session.savePage(currentPage);
                        requestContext.setPage(currentPage);
                        response = requestContext.generateResponse();
                    }
                    break;
                }
                case AWSession.NewRequest: {
                    currentPage.ensureAwake(requestContext);
                    AWResponseGenerating actionResults = null;
                    if (isInterrupted) {
                        actionResults = currentPage.pageComponent();
                    }
                    else {
                        requestContext.applyValues();
                        actionResults = requestContext.invokeActionForRequest();
                        if (actionResults == null) {
                            if (false && AWConcreteApplication.IsDebuggingEnabled) {
                                Assert.that(false,
                                    "Unable to locate item which was clicked.  Target senderId: %s",
                                    requestContext.requestSenderId());
                            }
                            else {
                                actionResults = currentPage.pageComponent();
                            }
                        }
                    }

                    // Allow response to replace itself (see AWRedirect for example)
                    if (actionResults instanceof AWResponseGenerating.ResponseSubstitution) {
                        actionResults = ((AWResponseGenerating.ResponseSubstitution)actionResults).replacementResponse();
                    }

                    if (actionResults instanceof AWComponent) {
                        AWComponent actionResultsComponent = (AWComponent)actionResults;
                        AWPage actionResultsPage = actionResultsComponent.page();
                        if (actionResultsPage != currentPage) {
                            // check if user is allowed to see this page
                            // If not, record it before propagating exception so that post
                            // auth they proceed to new page
                            if (actionResultsComponent.shouldValidateSession()) {
                                try {
                                    actionResultsComponent.validateSession(requestContext);
                                }
                                catch (AWSessionValidationException e) {
                                    session.savePage(actionResultsPage, true);
                                    throw e;
                                }
                            }

                            currentPage.truncateBacktrackState();
                        }

                        actionResultsPage.ensureAwake(requestContext);
                        formPostFilter(request,  requestContext, actionResultsComponent);
                        session.savePage(actionResultsPage);

                        /* Performance debugging feature -- replay request N times
                           -- see AWDebugPane for activation */
                        _debugRepeatRequest(
                            requestContext, actionResultsComponent, request);

                        response = requestContext.generateResponse();
                    }
                    else {
                        response = actionResults.generateResponse();
                    }
                    break;
                }
                default: {
                    throw new AWGenericException(getClass().getName() +
                        ": unrecognized requestType: " + requestType);
                }
            }

            // Perf trace
View Full Code Here

                        AWSession session = requestContext.session();
                        response = processExceptionHandlerResults(handlerResults, requestContext, session);
                    }
                }
                catch (RuntimeException e) {
                    AWGenericException newException =
                        new AWGenericException(
                            "Error occurred while handling session validation.  Please make" +
                            " sure that if session validation is configured properly.",e);
                    return handleException(requestContext, newException).generateResponse();
                }
            }
            catch (AWSiteUnavailableException e) {
                AWResponseGenerating handlerResults =
                    handleSiteUnavailableException(requestContext);
                if (handlerResults != null) {
                    response = handlerResults.generateResponse();
                }
            }
            catch (AWRemoteHostMismatchException exception) {
                AWResponseGenerating result =
                    handleRemoteHostMismatchException(requestContext, exception);
                response = result.generateResponse();
            }
        }
        catch (ExceptionInInitializerError error) {
            Throwable throwable = error.getException();
            if (throwable instanceof Exception) {
                response = responseForException(requestContext, (Exception)throwable);
            }
            else {
                throwable.printStackTrace();
            }
        }
        catch (Throwable throwable) {
            Exception runtimeException = (throwable instanceof Exception)
                    ? (Exception)throwable
                    : new AWGenericException(throwable);

            boolean ignore = false;
            if (runtimeException instanceof WrapperRuntimeException) {
                WrapperRuntimeException wrapperException =
                    (WrapperRuntimeException)runtimeException;
View Full Code Here

TOP

Related Classes of ariba.ui.aribaweb.util.AWGenericException

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.