Package org.apache.amber.oauth2.common

Examples of org.apache.amber.oauth2.common.OAuth$ContentType


        this.outputEncoding = outputEncoding;
    }

    public void processResultValue(JSONArray value) throws IOException
    {
        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        pw.print(value.toString());

        pw.flush();
    }
View Full Code Here


        this.outputEncoding = outputEncoding;
    }

    public void processResultValue(JSONObject value) throws IOException
    {
        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        pw.print(value.toString());

        pw.flush();
    }
View Full Code Here

        RequestPageCache cache = mockRequestPageCache();
        PageContentTypeAnalyzer analyzer = mockPageContentTypeAnalyzer();
        Component component = mockComponent();
        String pageName = "foo/bar";
        Page page = mockPage();
        ContentType contentType = new ContentType("zig/zag");
        ComponentResources resources = mockComponentResources();

        train_getComponentResources(component, resources);
        train_getPageName(resources, pageName);
        train_get(cache, pageName, page);
View Full Code Here

        if (pageActivator.activatePage(activePage.getRootElement().getComponentResources(), parameters
                .getPageActivationContext(), interceptor))
            return;

        ContentType contentType = pageContentTypeAnalyzer.findContentType(activePage);

        request.setAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME, contentType);

        Page containerPage = cache.get(parameters.getContainingPageName());
View Full Code Here

        // If we end up doing a partial render, the page render queue service needs to know the
        // page that will be rendered (for logging purposes, if nothing else).

        queue.setRenderingPage(activePage);

        ContentType contentType = pageContentTypeAnalyzer.findContentType(activePage);

        request.setAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME, contentType);

        Page containerPage = cache.get(parameters.getContainingPageName());
View Full Code Here

            }
        };

        resources.triggerEvent("providecompletions", new Object[] {input}, callback);

        ContentType contentType = responseRenderer.findContentType(this);

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

    public void renderPageResponse(Page page) throws IOException
    {
        Defense.notNull(page, "page");

        ContentType contentType = pageContentTypeAnalyzer.findContentType(page);

        // For the moment, the content type is all that's used determine the model for the markup writer.
        // It's something of a can of worms.

        MarkupWriter writer = markupWriterFactory.newMarkupWriter(contentType);

        markupRenderer.renderPageMarkup(page, writer);

        PrintWriter pw = response.getPrintWriter(contentType.toString());

        writer.toMarkup(pw);

        pw.flush();
    }
View Full Code Here

    public MarkupWriter newMarkupWriter(String pageName)
    {
        Page page = cache.get(pageName);

        ContentType contentType = analyzer.findContentType(page);

        return newMarkupWriter(contentType);
    }
View Full Code Here

     * @param text        text to be streamed in the response
     * @see org.apache.tapestry5.SymbolConstants#CHARSET
     */
    public TextStreamResponse(String contentType, String charset, String text)
    {
        this(new ContentType(Defense.notBlank(contentType, "contentType"),
                             Defense.notBlank(charset, "charset")), text);
    }
View Full Code Here

        String contentTypeString = metaDataLocator.findMeta(MetaDataConstants.RESPONSE_CONTENT_TYPE, pageResources,
                                                            String.class);

        // Draconian but necessary: overwrite the content type they selected with the application-wide output charset.

        return new ContentType(contentTypeString, outputCharset);
    }
View Full Code Here

TOP

Related Classes of org.apache.amber.oauth2.common.OAuth$ContentType

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.