Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.PrerendererPackageContext


            ((MarinerServletRequestContext) requestContext).
            getHttpRequest();
       
        HttpSession session = httpRequest.getSession();

        PrerendererPackageContext prerendererPackageContext = (PrerendererPackageContext)
            session.getAttribute(PRERENDERER_PACKAGE_CONTEXT_ATTRIBUTE_NAME);

        if (prerendererPackageContext == null) {
            throw new IllegalStateException("No prerendering context. Session expired possibly.");
        }
View Full Code Here


            throws ServletException, IOException {

        // Step 1: Get current prerendering context.
        HttpSession session = request.getSession();
       
        PrerendererPackageContext prerendererPackageContext =
            getPrerendererPackageContext(session);

        // Step 2: Get list of resources and prepare XML response from it.
        Map resources = prerendererPackageContext.getIncrementalRewrittenURIMap();

        Document document = new Document();

        Element resourcesElement = new Element("resources");
View Full Code Here

            // Step 2: Create PrerendererPackageContext initialized with the
            // list of remote page URIs. The PrerendererPackageContext throws
            // IllegalArgumentException in case any of the URIs in not valid. In
            // case of error, send HTTP 400 error with exception message.
            PrerendererPackageContext prerendererPackageContext = createPrerendererPackageContext(
                        request, pageURIs, baseURI, prefixPathURI);
           
            // Step 3: Get the list of rewritten page URIs.
            List rewrittenPageURIs = prerendererPackageContext.getRewrittenPageURIs();

            // Step 4: Prepare the XML response.
            Document outputDocument = new Document();

            Element outputPagesElement = new Element("pages");
View Full Code Here

        if (session.getAttribute(PRERENDERER_PACKAGE_CONTEXT_ATTRIBUTE_NAME) != null) {
            throw new IllegalStateException(
                    "PrerenderingContext already created.");
        }

        PrerendererPackageContext prerenderingContext = getPrerendererApplication()
                .createPrerendererPackageContext(pageURIs, baseURI, prefixPathURI);

        session.setAttribute(PRERENDERER_PACKAGE_CONTEXT_ATTRIBUTE_NAME,
                prerenderingContext);
View Full Code Here

     * @throws IllegalStateException if no context is currently associated with
     *             specified session.
     */
    private PrerendererPackageContext getPrerendererPackageContext(
            HttpSession session) {
        PrerendererPackageContext context = (PrerendererPackageContext) session
                .getAttribute(PRERENDERER_PACKAGE_CONTEXT_ATTRIBUTE_NAME);

        if (context == null) {
            throw new IllegalStateException("No current PrerenderingContext.");
        }
View Full Code Here

     * @throws ClassCastException In case the list of pageURIs contains an
     *             instance of class different than java.set.URI.
     * @throws IllegalArgumentException In case the some of the URIs is illegal.
     */
    public PrerendererPackageContext createPrerendererPackageContext(List pageURIs, URI baseURI, URI prefixPathURI) {   
        return new PrerendererPackageContext(pageURIs, baseURI, prefixPathURI);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.PrerendererPackageContext

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.