Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.ApplicationContext


     */
    public ApplicationContext createApplicationContext(
            MarinerRequestContext requestContext)
                throws RepositoryException {

        ApplicationContext applicationContext = null;

        // Get the Volantis bean.
        Volantis volantisBean = Volantis.getInstance();
        if (volantisBean == null) {
            throw new IllegalStateException
View Full Code Here


     * @return                the newly created application context.
     */
    protected ApplicationContext createApplicationContext(
            Volantis volantisBean,
            MarinerRequestContext requestContext) {
        ApplicationContext applicationContext;

        // Create the multipart package handler if page packaging is enabled
        if (volantisBean.isPagePackagingMimeEnabled() ) {
            applicationContext = new MultipartApplicationContext(requestContext);
        } else {
View Full Code Here

        }

        if (!(asset instanceof LinkAsset)) {
            String plain = rewritten.getExternalForm();
            String encoded = getEncodedURI(plain);
            ApplicationContext ac =
                ContextInternals.getApplicationContext(requestContext);
            PackageResources pr = ac.getPackageResources();

            if (pr != null) {
                boolean onClientSide = false;
                if (assetGroup != null) {
                    onClientSide = (assetGroup.getLocationType() ==
View Full Code Here

        // will be non-null if dissection has been applied to the output -
        // that certain types of URL will not be packaged, depending on the
        // device policy and that assets that are thought to already be
        // cached on the device should not be resent
        MarinerRequestContext requestContext = context.getRequestContext();
        ApplicationContext ac =
            ContextInternals.getApplicationContext(requestContext);
        PackageResources pr = ac.getPackageResources();
        List encodedURLs = pr.getEncodedURLs();
        Map assetURLMap = pr.getAssetURLMap();
        Iterator iterator;
        String encodedURL;
        PackageResources.Asset asset;
View Full Code Here

     */
    protected void outputPackage(MimeMultipart pkg,
                                 MarinerPageContext context)
        throws PackagingException {
        MarinerRequestContext requestContext = context.getRequestContext();
        ApplicationContext ac =
            ContextInternals.getApplicationContext(requestContext);
        PackageResources pr = ac.getPackageResources();

        // Final stage is setting up the message's content, content type,
        // ensuring that the message has only those headers required and
        // writing the message to the response output stream
        OutputStream outputStream = null;
View Full Code Here

        return pageContext.getDeviceLayoutContext().getInclusionPath();
    }

    public boolean isFragmentationSupported() {
        MarinerRequestContext requestContext = pageContext.getRequestContext();
        ApplicationContext applicationContext =
                ContextInternals.getApplicationContext(requestContext);
        return applicationContext.isFragmentationSupported();
    }
View Full Code Here

     @todo - this might be temporary - check how does it works without.
     */
    private void createFakeAssetURLMapEntry(MarinerRequestContext context,
                                            String url) {
        // copied from ObjectElement implementation       
        ApplicationContext ac = ContextInternals.getApplicationContext(context);
        PackageResources pr = ac.getPackageResources();
        if (pr != null) {
            PackagedURLEncoder packagedURLEncoder = ac.getPackagedURLEncoder();
            if (packagedURLEncoder != null) {
                String encoded = packagedURLEncoder.getEncodedURI(url);
                PackageResources.Asset prAsset = new PackageResources.Asset(
                        url, false);
                pr.addAssetURLMapping(encoded, prAsset);
View Full Code Here

        RuntimeTestMarinerRequestContext requestContext = new RuntimeTestMarinerRequestContext();
        EnvironmentContext environmentContext = new RuntimeTestEnvironmentContext();
        ((RuntimeTestEnvironmentContext)environmentContext)
                .setResponseWriter(writer);

        ApplicationContext applicationContext = new ApplicationContext(
            requestContext);

        pageContext.setDeviceLayout(deviceLayout);

        applicationContext.setDevice(device);
        applicationContext.setProtocol(protocol);
        applicationContext.setDissectionSupported(true);
        applicationContext.setFragmentationSupported(true);
        applicationContext.setCanvasTagSupported(true);
        applicationContext.setWMLCSupported(false);
        applicationContext.setEncodingManager(new EncodingManager());
        applicationContext.setPackager(new DefaultPackager());

        TestVolantis volantisBean = new TestVolantis();

        RuntimeDeviceTheme runtimeDeviceTheme = createRuntimeDeviceTheme();
View Full Code Here

    private static void createFakeAssetURLMapEntry(MarinerRequestContext context,
                                            String url) {

        // TODO: factor together with AbstractImageElement

        ApplicationContext ac = ContextInternals.getApplicationContext(context);
        PackageResources pr = ac.getPackageResources();

        if (pr != null) {
            PackagedURLEncoder packagedURLEncoder = ac.getPackagedURLEncoder();

            if (packagedURLEncoder != null) {
                String encoded = packagedURLEncoder.getEncodedURI(url);

                PackageResources.Asset prAsset = new PackageResources.Asset(
View Full Code Here

     *                entry.
     */
    private void createFakeAssetURLMapEntry(
            MarinerRequestContext context,
            String url) {
        ApplicationContext ac = ContextInternals.getApplicationContext(context);
        PackageResources pr = ac.getPackageResources();

        if (pr != null) {
            PackagedURLEncoder packagedURLEncoder = ac.getPackagedURLEncoder();

            if (packagedURLEncoder != null) {
                String encoded = packagedURLEncoder.getEncodedURI(url);

                PackageResources.Asset prAsset = new PackageResources.Asset(
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.