Examples of AWResponse


Examples of ariba.ui.aribaweb.core.AWResponse

        return AWComponentActionRequestHandler.SharedInstance.urlWithSenderId(requestContext(), _elementId);
    }

    public AWResponse invokeAction ()
    {
        AWResponse response = application().createResponse();
        AWContentType contentType = (AWContentType)valueForBinding(BindingNames.contentType);
        response.setContentType(contentType);
        // byte[] imageBytes = (byte[])valueForBinding(BindingNames.bytes);
        response.setContent((byte[])valueForBinding(BindingNames.bytes));
        return response;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

    public static final String PostsAction = "posts";

    public AWResponseGenerating postsAction ()
    {
        AWRequest request = request();
        AWResponse response = application().createResponse(request());
        response.setContentType(AWContentType.TextXml);
        if ("GET".equals(request.method())) {
            String pi = request.formValueForKey("pi");
            List posts = PostService.getPosts();
            if (pi != null) {
                int postIndex = Integer.parseInt(pi);
                posts = ListUtil.list(posts.get(postIndex));
            }
            PostContent postContent =
                (PostContent)pageWithName(PostContent.class.getName());
            postContent.setPosts(posts);
            postContent.generateResponse(response, requestContext());
        }
        else {
            response.setStatus(HTTP.CodeNotImplemented);
            response.appendContent("<Status>Not Implemented</Status>");
        }
        return response;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

    private static final AWEncodedString PxQuote = AWEncodedString.sharedEncodedString("px\"");
    private static final AWEncodedString StylePaddingWIth = AWEncodedString.sharedEncodedString(" style=\"padding:0px 4px 0px ");

    public String indentationWithControlStyle ()
    {
        AWResponse response = response();
        response.appendContent(StylePaddingWIth);
        response.appendContent(String.valueOf(indentationWithControl()));
        response.appendContent(PxQuote);
        return null;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

        return null;
    }

    public String indentationWithoutControlStyle ()
    {
        AWResponse response = response();
        response.appendContent(StylePaddingWithout);
        response.appendContent(String.valueOf(indentationWithoutControl()));
        response.appendContent(PxQuote);
        return null;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

    }
   
    public String spacePadding ()
    {
        int i = _currentRepetition.nestingLevel();
        AWResponse response = response();
        while (i-- != 0) {
            response.appendContent(FourNBSPs);
        }
        return null;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

    }

    protected String emitAsPreTags (String text, int selectedLine)
    {
        boolean more = true;
        AWResponse response = response();
        BufferedReader reader = new BufferedReader(new StringReader(text));
        if (selectedLine > 0) {
            response.appendContent(OpenPre);
            more = emitLines(reader, response, selectedLine-1);
            response.appendContent(ClosePre);
        }
        if (selectedLine >=0 && more) {
            response.appendContent(OpenPreSelected);
            more = emitLines(reader, response, 1);
            response.appendContent(ClosePre);
        }
        if (more) {
            response.appendContent(OpenPre);
            emitLines(reader, response, Integer.MAX_VALUE);
            response.appendContent(ClosePre);
        }
        return null;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

        return null;
    }

    public AWResponseGenerating renderWord ()
    {
        AWResponse response = requestContext().response();
        if (response == null) {
            response = application().createResponse(request());
            requestContext().setResponse(response);
        }

        response.setContentType(AWContentType.ApplicationMSWord);
        return renderPrintPage();
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

        return os.toByteArray();
    }

    public AWResponseGenerating downloadPart (MimePart part, boolean asFile)
    {
        AWResponse response = application().createResponse();

        try {
            DataHandler dh = part.getDataHandler();
            AWContentType contentType = AWContentType.contentTypeNamed(dh.getContentType());
            String filename = dh.getName();
            if (filename != null && asFile) {
                Util.setHeadersForDownload (requestContext(), response, filename);
            }
            response.setContentType(contentType);
            response.setContent(dataHandlerBytes(dh));
        } catch (MessagingException e) {
            throw new AWGenericException(e);
        }
        return response;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

               url() == null) ? "javascript:void(0);" : url();
    }

    public String onClick ()
    {
        AWResponse response = response();
        ActionHandler handler = handler();
        AWRequestContext requestContext = requestContext();
        String target = handler.target(requestContext);
        response.appendContent(Constants.Space);
        response.appendContent(Constants.OnClick);
        response.appendContent(Constants.Equals);
        response.appendContent(Constants.Quote);
        if (handler.isExternal(requestContext) &&
            handler.onClick(requestContext) != null) {
            response.appendContent(handler.onClick(requestContext));
        }
        else if (_submitForm && target == null && handler.submitFormToUrl()) {
            // This is the case where we are provided a url (eg from jsp) and are within
            // a form.  We do not support submitting a form and opening a new window.
            // If the target is provided, we will simply do a GET and display results
            // in that window.
            response.appendContent("document.forms[0].action='");
            response.appendContent(url());
            response.appendContent("';ariba.Request.submitForm(document.forms[0]);return false");
        }
        else {
            if (target != null) {
                response.appendContent(Constants.Return);
                response.appendContent(Constants.Space);
                response.appendContent(Constants.OpenWindow);
                response.appendContent(Constants.OpenParen);

                response.appendContent(Constants.SingleQuote);
                response.appendContent(url());
                response.appendContent(Constants.SingleQuote);
                response.appendContent(Constants.Comma);
                response.appendContent(Constants.Space);

                response.appendContent(Constants.SingleQuote);
                response.appendContent(target);
                response.appendContent(Constants.SingleQuote);
                response.appendContent(Constants.Comma);
                response.appendContent(Constants.Space);

                response.appendContent(Constants.SingleQuote);
                response.appendContent(handler.windowAttributes(requestContext));
                response.appendContent(Constants.SingleQuote);

                response.appendContent(Constants.CloseParen);
            }
            else {
                response.appendContent(Constants.Return);
                response.appendContent(Constants.Space);
                response.appendContent("ariba.Request.setDocumentLocation");
                response.appendContent(Constants.OpenParen);

                response.appendContent(Constants.SingleQuote);
                response.appendContent(url());
                response.appendContent(Constants.SingleQuote);
                response.appendContent(Constants.Comma);
                response.appendContent(Constants.Space);

                response.appendContent(Constants.Null);

                response.appendContent(Constants.CloseParen);
            }
        }
        response.appendContent(Constants.Semicolon);
        response.appendContent(Constants.Quote);
        return null;
    }
View Full Code Here

Examples of ariba.ui.aribaweb.core.AWResponse

    public AWResponse windowClosedByUser ()
    {
        Object value = valueForBinding(BindingNames.windowClosed);
        Assert.that(value == null, "windowClosed methods must be type 'void'");
        AWResponse response = application().createResponse();
        response.setStatus(AWResponse.StatusCodes.NoContent);
        return response;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.