Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.ApplicationContext


            WMLCDeviceSupport.getMode(context.getRequestContext());

        // Calculate if this device request (including headers) can result in
        // WMLC generation.
        MarinerRequestContext requestContext = context.getRequestContext();
        ApplicationContext appContext =
            ContextInternals.getApplicationContext(requestContext);
        if (wmlcSupported == WMLCDeviceSupport.WML) {
            // Device says no WMLC
            willGenerateWMLC = false;
        } else if (wmlcSupported == WMLCDeviceSupport.WMLC) {
            // Device says support WMLC
            willGenerateWMLC = true;
        } else {
            // Decide if we will generate binary WMLC from the headers
            willGenerateWMLC = appContext.isWMLCSupported();
            // If we want to do WMLC but the config says do WML, then do WML
            if (willGenerateWMLC) {
                ProtocolsConfiguration protocols =
                        context.getVolantisBean().getProtocolsConfiguration();
View Full Code Here


    protected void writeDocument(PackageBodyOutput output)
        throws IOException, ProtocolException {

        MarinerRequestContext requestContext = context.getRequestContext();
        ApplicationContext appContext =
            ContextInternals.getApplicationContext(requestContext);

        // If the accept headers indicate that WMLC is supported, create a
        // WBXML producer. If not, default to WMLProducer.
        WBSAXContentHandler handler = null;
        WBSAXDocumentOutputter wbsaxOutputter;
        WBSAXContentHandler producer;

        // If the user has not asked to know the output style of this protocol,
        // then we will not have calculated whether we will be generating WMLC.
        // In this case we better generate it now as we are about to need it.
        if (generateWMLC == null) {
            calculateGenerateWMLC();
        }

        // Check that the outputs of calculateGenerateWMLC are available.
        if (charsetCode == null || generateWMLC == null) {
            throw new IllegalStateException(
                    "charsetCode and generateWMLC must be available");
        }

        EnvironmentContext envContext = context.getEnvironmentContext();
        if (Boolean.TRUE.equals(generateWMLC)) {
            // Generate binary WMLC.
            envContext.setContentType("application/vnd.wap.wmlc");
            producer = new WBXMLProducer(output.getOutputStream());
        } else {
            // For WML, the entity encoding is done now. The encoding writer
            // is passed to the producer to do the encoding.
            envContext.setContentType("text/vnd.wap.wml");
            Writer out = output.getWriter();
            Writer enc = new EncodingWriter(out, getCharacterEncoder());
            producer = new WMLProducer(out, enc);
        }

        SerialisationURLListener urlListener = null;
        final PackageResources pr = appContext.getPackageResources();
        if (pr != null) {
            // Force the packager to understand that only a subset of
            // assets are likely to be included in the response
            pr.initializeEncodedURLs();
View Full Code Here

     */
    // TODO: Removed the commented code and the bogus return statement once
    // Application context is checked in
    private String  storePaneSrcContent(String content) {
        MarinerRequestContext requestContext = getMarinerPageContext().getRequestContext();
        ApplicationContext appContext = ContextInternals.getApplicationContext (requestContext);

        return appContext.mapSMILAsset(content.trim());
    }
View Full Code Here

     * @return rewritten URL.
     */
    protected static String rewriteURLWithPageURLRewriter(XDIMEContextInternal context, String url, PageURLType urlType) {
        MarinerRequestContext requestContext = context.getInitialRequestContext();
       
        ApplicationContext applicationContext = ContextInternals.getApplicationContext(requestContext);
       
        PageURLRewriter rewriter = applicationContext.getPageURLRewriter();
       
        if (rewriter != null) {
            // Convert URL string to MarinerURL instance.
            MarinerURL marinerURL = new MarinerURL(url);
           
View Full Code Here

        // Let the base class create basic mocks
        super.setUp()
        XDIMEContentHandler handler = getXDIMEContentHandler();
        MarinerRequestContextMock context =
          (MarinerRequestContextMock)handler.getCurrentRequestContext();
        ApplicationContext appContext = new ApplicationContext(context);
       
        context.expects.getApplicationContext().returns(appContext).fixed(2);
              
        addDefaultElementExpectations(ClockContentAttributes.class);
    }
View Full Code Here

                        return deviceLayoutContextStack.peek();
                    }
                }).any();
        setProtocolSpecificExpectations();

        ApplicationContext applicationContext = new ApplicationContext(
            requestContextMock);
        applicationContext.setDevice(device);
        applicationContext.setProtocol(protocol);
        applicationContext.setDissectionSupported(true);
        applicationContext.setFragmentationSupported(true);
        applicationContext.setCanvasTagSupported(true);
        applicationContext.setWMLCSupported(false);

        ExpressionFactory expressionFactory = ExpressionFactory.getDefaultInstance();

        ExpressionContext expressionContext =
            expressionFactory.createExpressionContext(null,
View Full Code Here

     * @param bodyContext
     */
    private void packagePage(Object bodyContext)
        throws IOException, ProtocolException {
        MarinerRequestContext requestContext = context.getRequestContext();
        ApplicationContext ac =
            ContextInternals.getApplicationContext(requestContext);
        Packager packager = ac.getPackager();

        if (packager != null) {
            try {
                packager.createPackage(requestContext, this, bodyContext);
            } catch (PackagingException e) {
View Full Code Here

            throws PAPIException {
        if (logger.isDebugEnabled()) {
            logger.debug("MessageElement end ");
        }

        ApplicationContext applicationContext =
                ContextInternals.getApplicationContext(context);

        // End of the message tag so we can't have any more canvas tags
        applicationContext.setCanvasTagSupported(false);

        return CONTINUE_PROCESSING;
    }
View Full Code Here

        if (logger.isDebugEnabled()) {
            logger.debug("MessageElement start ");
        }
        VolantisProtocol protocol = pageContext.getProtocol();
        ApplicationContext applicationContext =
                ContextInternals.getApplicationContext(context);

        // We found a message tag so now allow canvas tags.
        applicationContext.setCanvasTagSupported(true);
        return PROCESS_ELEMENT_BODY;
    }
View Full Code Here

    // javadoc inherited
    public int elementStart(
            MarinerRequestContext context, PAPIAttributes papiAttributes)
            throws PAPIException {

        ApplicationContext applicationContext =
                ContextInternals.getApplicationContext(context);
        if (!applicationContext.isCanvasTagSupported()) {
            // Hmmm, we could be running under another app that requires a different
            // top level tag, so lets die
            throw new IllegalStateException("canvas tag not allowed here");
        }
View Full Code Here

TOP

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

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.