Package com.volantis.mps.context

Examples of com.volantis.mps.context.MPSApplicationContext


                    ImageAsset.fileExtension(imageEncoding);
            } else {
                newUrl = getFileName(oldUrl);
            }
       
            MPSApplicationContext applicationContext =
                (MPSApplicationContext)ContextInternals
                    .getApplicationContext(requestContext);

            HttpServletResponse response =
                (HttpServletResponse)((MarinerServletRequestContext)requestContext).getResponse();

            if (assetGroup != null) {
                response.setHeader("asset." +
                                   assetGroup.getLocationType() +
                                   "." +
                                   Base64.encodeString(newUrl),
                                   Base64.encodeString(oldUrl));
                applicationContext.mapAsset(newUrl,
                        new MessageAsset(assetGroup.getLocationType(), oldUrl));
            } else {
                response.setHeader("asset." +
                                   AssetGroup.ON_SERVER +
                                   "." +
                                   Base64.encodeString(newUrl),
                                   Base64.encodeString(oldUrl));
                applicationContext.mapAsset(newUrl,
                        new MessageAsset(AssetGroup.ON_SERVER, oldUrl));
            }

            // Add headers for maximum file and MM (message) sizes.
            // This reuses the names found in the
            // MarinerPageContext#constructURL method and also used in the
            // MPSApplicationContext#setDevice method
            Integer maxFileSize = applicationContext.getMaxFileSize();
            Integer maxMMSize = applicationContext.getMaxMMSize();
            if (maxFileSize != null) {
                response.setHeader("maxfilesize", maxFileSize.toString());
            }
            if (maxMMSize != null) {
                response.setHeader("maxmmsize", maxMMSize.toString());
View Full Code Here


            } catch( MalformedURLException e ) {
                throw new MessageException( e );
            }
            reader.parse( new InputSource( new StringReader( messageXML ) ) );

            MPSApplicationContext applicationContext =
                 (MPSApplicationContext)ContextInternals.getApplicationContext(
                                                               requestContext );

            applicationContext.getAssetMap();

            // set charset type for content
            String contentType = getContentTypeHeader(
                                        internalResponse.getContentType(),
                                        characterEncoding);


            rawMessage = new ProtocolIndependentMessage(
                    internalResponse.getResponseAsString(),
                    contentType,
                    applicationContext.getAssetMap(),
                    characterEncoding);
            rawMessage.setBaseURL( new URL( baseUrl ) );
            rawMessage.setMaxFileSize( applicationContext.getMaxFileSize() );
            rawMessage.setMaxMMSize( applicationContext.getMaxMMSize() );

            requestContext.release();
        } catch (SAXException se) {
            Exception cause = se.getException();
            // Check the root cause of the SAXException, as it may not be
View Full Code Here

                    ImageAsset.fileExtension(imageEncoding);
            } else {
                newUrl = getFileName(oldUrl);
            }

            MPSApplicationContext applicationContext =
                (MPSApplicationContext)ContextInternals
                    .getApplicationContext(requestContext);

            if (assetGroup != null) {
                applicationContext.mapAsset(newUrl,
                        new MessageAsset(assetGroup.getLocationType(), oldUrl));
            } else {
                applicationContext.mapAsset(newUrl,
                        new MessageAsset(AssetGroup.ON_SERVER, oldUrl));
            }   
            MarinerURL urlToReturn = new MarinerURL();
            urlToReturn.setPath("cid:"+newUrl);
            return urlToReturn;
View Full Code Here

TOP

Related Classes of com.volantis.mps.context.MPSApplicationContext

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.