Package org.apache.amber.oauth2.common

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


    {
        // This is a complex area as we are trying to keep public and private services properly
        // seperated, and trying to keep stateless and stateful (i.e., perthread scope) services
        // seperated. So we inform the stateful queue service what it needs to do here ...

        ContentType pageContentType =
                (ContentType) request.getAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME);

        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        MarkupWriter writer = factory.newMarkupWriter(pageContentType);

        JSONObject reply = new JSONObject();

        // ... and here, the pipeline eventually reaches the PRQ to let it render the root render command.

        partialMarkupRenderer.renderMarkup(writer, reply);

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

        pw.print(reply);

        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

        {
            // This is a complex area as we are trying to keep public and private services properly
            // separated, and trying to keep stateless and stateful (i.e., perthread scope) services
            // separated. So we inform the stateful queue service what it needs to do here ...

            ContentType pageContentType = (ContentType) request.getAttribute(InternalConstants.CONTENT_TYPE_ATTRIBUTE_NAME);

            ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

            MarkupWriter writer = factory.newPartialMarkupWriter(pageContentType);

            JSONObject reply = new JSONObject();

            // ... and here, the pipeline eventually reaches the PRQ to let it render the root render command.

            partialMarkupRenderer.renderMarkup(writer, reply);

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

            reply.print(pw, compactJSON);

            pw.close();
        } finally
View Full Code Here

        };

        resources.triggerEvent(EventConstants.PROVIDE_COMPLETIONS, 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

        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

                                         boolean compactJSON)
    {
        this.response = response;
        this.compactJSON = compactJSON;

        contentType = new ContentType(InternalConstants.JSON_MIME_TYPE).withCharset(outputEncoding);
    }
View Full Code Here

        this.request = request;
        this.response = response;
        this.partialMarkupRenderer = partialMarkupRenderer;
        this.compactJSON = compactJSON;

        contentType = new ContentType(InternalConstants.JSON_MIME_TYPE).withCharset(outputEncoding);
    }
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).withCharset(outputCharset);
    }
View Full Code Here

    @Override
    public StreamableResource getStreamableResource(Resource baseResource, StreamableResourceProcessing processing, ResourceDependencies dependencies) throws IOException
    {
        StreamableResource resource = delegate.getStreamableResource(baseResource, processing, dependencies);

        ContentType contentType = resource.getContentType();

        if (contentType.getBaseType().equals("text")
                && ! contentType.hasParameters()
                && processing != StreamableResourceProcessing.FOR_AGGREGATION)
        {
            return resource.withContentType(contentType.withCharset("utf-8"));
        }

        return resource;
    }
View Full Code Here

        BytestreamCache bytestreamCache = readStream(transformed);

        transformed.close();

        ContentType contentType = rt == null
                ? new ContentType(contentTypeAnalyzer.getContentType(baseResource))
                : rt.getTransformedContentType();

        boolean compressable = compressionAnalyzer.isCompressable(contentType.getMimeType());

        long lastModified = resourceChangeTracker.trackResource(baseResource);

        return new StreamableResourceImpl(baseResource.toString(), contentType, compressable ? CompressionStatus.COMPRESSABLE
                : CompressionStatus.NOT_COMPRESSABLE, lastModified, bytestreamCache, checksumGenerator, null);
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.