Package ariba.ui.aribaweb.util

Examples of ariba.ui.aribaweb.util.AWGenericException


        {
            try {
                _outputStream.write(bytes);
                _bytesWritten += bytes.length;
            } catch (IOException e) {
                throw new AWGenericException(e);
            }
        }
View Full Code Here


        try {
                // changed psheill.  Get latest class, or possibly subclass
            componentInstance = (AWComponent)componentClass().newInstance();
        }
        catch (IllegalAccessException illegalAccessException) {
            throw new AWGenericException(illegalAccessException);
        }
        catch (InstantiationException exception) {
            String message = Fmt.S("Error: Unable to instantiate new instance of component class named \"%s\"", _componentClass.getName());
            throw new AWGenericException(message, exception);
        }

        return componentInstance;
    }
View Full Code Here

     */
    private void validateStringValue (String stringValue)
    {
        for (int i=0; i<BadChars.length; i++) {
            if (stringValue.indexOf(BadChars[i]) != -1) {
                throw new AWGenericException(
                    Fmt.S("Illegal character or string '%s' included in javascript: %s",
                        BadChars[i], stringValue));
            }
        }
    }
View Full Code Here

                }
                else if ((_operand = (AWBinding)bindingsHashtable.remove(AWBindingNames.isGreaterOrEqual)) != null) {
                    _operator = IsGreaterOrEqual;
                }
                else {
                    throw new AWGenericException(
                        "AWIf: Missing binding.  If you specify the 'value' binding, " +
                        "you must also specify a binding to which this value will be compared.");
                }
            }
            else {
View Full Code Here

    {
        try {
            return method.invoke(onObject, args);
        }
        catch (IllegalAccessException e) {
            throw new AWGenericException(e);
        }
        catch (InvocationTargetException e) {
            throw new AWGenericException (e);
        }
    }
View Full Code Here

                ((AWDirectAction)obj).init(requestContext);
            }
            return obj;
        }
        catch (IllegalAccessException illegalAccessException) {
            throw new AWGenericException(illegalAccessException);
        }
        catch (InstantiationException instantiationException) {
            throw new AWGenericException(instantiationException);
        }
    }
View Full Code Here

        AWDirectAction directAction = null;
        try {
            directAction = (AWDirectAction)directActionClass.newInstance();
        }
        catch (IllegalAccessException illegalAccessException) {
            throw new AWGenericException(illegalAccessException);
        }
        catch (InstantiationException instantiationException) {
            throw new AWGenericException(
                "*** Error: cannot instantiate direct action class named \"" +
                directActionName[ClassNameIndex] + "\"", instantiationException);
        }

        directAction.init(requestContext);

        try {
            if (request.formValueForKey(AWRequestContext.RefreshRequestKey) != null) {
                // if this is a refresh request (ie. forward track over a redirect from
                // another app, then see if we have a valid session and we have a
                // page to refresh.  Otherwise, this app must have been restarted but
                // the other app was not so there is a mismatch in state.  In this case,
                // actually execute the direct action.
                AWSession session = requestContext.session(false);
                if (session != null) {
                    AWPage page = session.restoreCurrentPage();
                    if (page != null) {
                        if (page.pageComponent().isBoundary()) {
                            // need to forward track here and then redirect to
                            // refresh the page ...
                            requestContext.setHistoryAction(
                                AWSession.ForwardTrackRequest);
                            session.initRequestType();
                            page = session.restoreNextPage(page);
                        }
                        AWRedirect redirectComponent =
                            (AWRedirect)application.createPageWithName(
                                AWRedirect.PageName, requestContext);
                        String effectiveUrl =
                            AWComponentActionRequestHandler.SharedInstance.refreshUrl(
                                requestContext);

                        redirectComponent.setUrl(effectiveUrl);
                        redirectComponent.setSelfRedirect(true);
                        requestContext.setPage(redirectComponent.page());
                        response = requestContext.generateResponse();
                    }
                }
            }

            if (response == null) {
                AWResponseGenerating actionResults = null;

                if (!request.hasHandler()) {
                    // If there is not handler specified, then the user is
                    // accessing the /Main page and that is the only time
                    // that we want to execute the filters.
                    for (int i=0; i<_defaultRequestFilter.size(); i++) {
                        AWDefaultRequestFilter filter =
                            (AWDefaultRequestFilter)_defaultRequestFilter.get(i);
                        filter.execute(requestContext);
                    }
                }
                if (!directAction.skipValidation(directActionName[ActionNameIndex])) {
                    if (!AWDirectAction.isServerManagementAction(request) &&
                        directAction.shouldValidateNode()) {
                        directAction.validateNode(requestContext,
                                                  directActionName[ClassNameIndex],
                                                  directActionName[ActionNameIndex]);
                    }

                    if (directAction.shouldValidateSession()) {
                        directAction.validateSession(requestContext);
                    }

                    if (directAction.shouldValidateRequest()) {
                        directAction.validateRequest(requestContext);
                    }
                }

                actionResults =
                    directAction.performActionNamed(directActionName[ActionNameIndex]);

                Assert.that(actionResults != null,
                            "Direct action result cannot be null.");

                // Allow response to replace itself (see AWRedirect for example)
                if (actionResults instanceof AWResponseGenerating.ResponseSubstitution) {
                    actionResults = ((AWResponseGenerating.ResponseSubstitution)actionResults).replacementResponse();
                }
               
                return actionResults;
            }
        }
        catch (AWNodeChangeException e) {
            AWNodeValidator nv = e.getNodeValidator();
            AWResponseGenerating handlerResults =
                nv.handleNodeValidationException(requestContext);
            nv.terminateCurrentSession(requestContext);
            response = handlerResults.generateResponse();
        }
        catch (AWSessionValidationException exception) {
            try {
                if (AWConcreteApplication.IsDebuggingEnabled) {
                    Log.aribaweb.debug("AWDirectActionRequestHandler: handling session " +
                                       "validation exception");
                }

                // if there is a default validator, run it here
                AWNodeValidator nv = AWNodeManager.getDefaultNodeValidator();
                if (nv != null && !nv.isValid(requestContext)) {
                    Log.aribaweb_nodeValidate.debug("AWDirectActionRequestHandler: invalid node. " +
                                       "NodeValidator generating response.");
                    AWResponseGenerating handlerResults =
                        nv.handleNodeValidationException(requestContext);
                    nv.terminateCurrentSession(requestContext);
                    response = handlerResults.generateResponse();
                }
                else {
                    AWResponseGenerating handlerResults =
                        handleSessionValidationError(requestContext, exception);
                    // If there is not valid HttpSession, create a new one to enable
                    // load balancers which use the sessionid.
                    if (requestContext.httpSession(false) == null) {
                        // request.getSession(true);
                        requestContext.createHttpSession();
                        Log.aribaweb_session.debug("AWDirectActionRequestHandler: create HttpSession");
                    }
                    if (exception instanceof AWClearBrowserHistoryException) {
                        AWComponent actionResultsComponent = (AWComponent)handlerResults;
                        response = clearBrowserHistory(requestContext,
                            actionResultsComponent);
                    }
                    else if (requestContext.session(false) != null &&
                        handlerResults instanceof AWComponent) {
                        AWComponent actionResultsComponent = (AWComponent)handlerResults;
                        AWPage actionResultsPage = actionResultsComponent.page();
                        attemptSavePage(requestContext, actionResultsPage);
                    }
                    if (response == null) {
                        response = handlerResults.generateResponse();
                    }
                }
            }
            catch (RuntimeException e) {
                AWGenericException newException =
                    new AWGenericException(
                        "Error occurred while handling session validation.  Please make" +
                        " sure session validation is configured properly.",e);
                return handleException(requestContext, newException).generateResponse();
            }
        }
View Full Code Here

                                                Throwable t)
    {
        AWResponse response = null;
        Exception exception = (t instanceof Exception)
                ? (Exception)t
                : new AWGenericException(t);       
        try {
            AWResponseGenerating handleExceptionResults = handleException(requestContext,
                                                                          exception);
            if (handleExceptionResults instanceof AWComponent) {
                AWPage handlerPage = ((AWComponent)handleExceptionResults).page();
View Full Code Here

    public void init (String tagName, Map bindingsHashtable)
    {
        _action = (AWBinding)bindingsHashtable.remove(AWBindingNames.action);
        if (_action == null) {
            throw new AWGenericException(getClass().getName() + ": must have an 'action' binding.");
        }
        _semanticKeyBinding = (AWBinding)bindingsHashtable.remove(AWBindingNames.semanticKeyBindingName());
        super.init(tagName, bindingsHashtable);
    }
View Full Code Here

    // ** Thread Safety Considerations: Although elements are shared between threads, since there are no ivars, there are no locking issues..

    public AWElement determineInstance (String elementName, Map bindingsHashtable, String templateName, int lineNumber)
    {
        throw new AWGenericException(getClass().getName() + ": determineInstance(String, Map, String, int) not implemented.");
    }
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.