Package com.volantis.mcs.devices

Examples of com.volantis.mcs.devices.InternalDevice


        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_VFC, "true");
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_VFC_SINCE, "4.0.0");

        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);
        return (DOMProtocol)builder.build(
            new ProtocolRegistry.XHTMLFullFactory(), device);
    }
View Full Code Here


        // Get the categorization schema.
        String categorizationScheme = policy.getCategorizationScheme();

        // First try variants targeted at specific devices, or categories.
        InternalDevice targetDevice = context.getDevice();

        // Iterate upwards over the devices, starting with the target device.
        InternalDevice device = targetDevice;
        while (device != null) {

            String deviceName = device.getName();

            // Check to see whether there is a variant targeted at the
            // specified device. If there is and it is not filtered out then
            // return it.
            variant = policy.getDeviceTargetedVariant(deviceName);
            if (variant != null) {

                // Filter the variant according to the target device (not the
                // current one which may be an ancestor) to make sure that it
                // is compatible. If it is then return it, otherwise continue.
                variant = filter(targetDevice, variant, requiredEncodings);
                if (variant != null) {
                    return createSelectedVariant(policy, variant, device);
                }
            }

            // If the device is the target device and the policy has a
            // categorization schema then check to see whether it matches
            // the category. This does not check the category of devices other
            // than the target device because categories are inherited from
            // the parent device anyway.
            if (device == targetDevice && categorizationScheme != null) {

                // Get the value of the category from the device.
                String categoryName = device.getPolicyValue(
                        categorizationScheme);

                variant = policy.getCategoryTargetedVariant(categoryName);
                if (variant != null) {

                    // Filter the variant.
                    variant = filter(targetDevice, variant, requiredEncodings);
                    if (variant != null) {
                        return createSelectedVariant(policy, variant, device);
                    }
                }
            }

            device = device.getFallbackDevice();
        }

        // Next, if any required encodings have been specified then try and
        // find a variant with one of those encodings. The encodings are
        // tried in the order they were specified.
View Full Code Here

            TransVisitor visitor = new XHTMLBasicTransVisitor(protocol, this) {
                // javadoc inherited
                public void preprocess(Document document) {
                    super.preprocess(document);

                    InternalDevice device =
                            this.protocol.getMarinerPageContext().getDevice();
                    TableWidthTransformer tableWidthProcess =
                            new TableWidthTransformer(device);
                    int useableWidth = device.getPixelsX();
                    for (int i=0; i<tables.size(); i++) {
                        TransTable table = (TransTable) tables.get(i);
                        tableWidthProcess.transformPercentagesToPixels(
                                table, useableWidth);
                    }
View Full Code Here

            ObjectAttribute objectAttribute) throws XDIMEException {

        MarinerPageContext pageContext = ContextInternals.
            getMarinerPageContext(context.getInitialRequestContext());
       
        InternalDevice device = pageContext.getDevice();
       
        Map inputParameters = new HashMap();

        int maxSize = device
            .getIntegerPolicyValue(DOWNLOADABLE_VIDEO_MAXSIZE_POLICY, 0);
        if (maxSize != 0) {
            inputParameters.put(MAP_MAX_VIDEO_SIZE,
                    Integer.toString(maxSize));
        }
       
        List params = device
            .getCommaSeparatedPolicyValues(
                    DOWNLOADABLE_VIDEO_PREFERENCE_ORDER_POLICY);
        if (!params.isEmpty()) {
            String param = (String) params.get(0);
            Object[] formatParams = new Object[]{param};
           
            String visualCodec = device
                .getPolicyValue(MessageFormat.format(
                        DOWNLOADABLE_VIDEO_X_VISUAL_CODEC_POLICY,
                        formatParams));
            if (visualCodec != null) {
                inputParameters.put(MAP_VIDEO_VISUAL_CODEC,
                        visualCodec);
            }

            String audioCodec = device
                .getPolicyValue(MessageFormat.format(
                        DOWNLOADABLE_VIDEO_X_AUDIO_CODEC_POLICY,
                        formatParams));
            if (audioCodec != null) {
                inputParameters.put(MAP_VIDEO_AUDIO_CODEC,
                        audioCodec);
            }
        }
       
        int frameRate = device
            .getIntegerPolicyValue(DOWNLOADABLE_VIDEO_VISUAL_FRAMERATE_POLICY, 0);
        if (frameRate != 0) {
            inputParameters.put(MAP_VIDEO_FRAME_RATE,
                    Integer.toString(frameRate));
        }
       
        int width = device
            .getIntegerPolicyValue(DOWNLOADABLE_VIDEO_PIXELSX_POLICY,
                device.getPixelsX());   
        if (width != 0) {
            inputParameters.put(MAP_VIDEO_WIDTH,
                    Integer.toString(width));
        }

        int height = device
            .getIntegerPolicyValue(DOWNLOADABLE_VIDEO_PIXELSY_POLICY,
                device.getPixelsY());
        if (height != 0) {
            inputParameters.put(MAP_VIDEO_HEIGHT,
                    Integer.toString(height));
        }
       
        int maxVisualBitRate = device
            .getIntegerPolicyValue(DOWNLOADABLE_VIDEO_VISUAL_MAXBITRATE_POLICY, 0);
        if (maxVisualBitRate != 0) {
            inputParameters.put(MAP_MAX_VIDEO_VISUAL_BIT_RATE,
                    Integer.toString(maxVisualBitRate));
        }
       
        int maxAudioBitRate = device
            .getIntegerPolicyValue(DOWNLOADABLE_VIDEO_AUDIO_MAXBITRATE_POLICY, 0);
        if (maxAudioBitRate != 0) {
            inputParameters.put(MAP_MAX_VIDEO_AUDIO_BIT_RATE,
                    Integer.toString(maxAudioBitRate));
        }
View Full Code Here

            ObjectAttribute objectAttribute) throws XDIMEException {
       
        MarinerPageContext pageContext = ContextInternals.
            getMarinerPageContext(context.getInitialRequestContext());
       
        InternalDevice device = pageContext.getDevice();
               
        Map inputParameters = new HashMap();
   
        List params = device
            .getCommaSeparatedPolicyValues(
                DOWNLOADABLE_AUDIO_PREFERENCE_ORDER_POLICY);
        if (!params.isEmpty()) {
            String param = (String) params.get(0);
            Object[] formatParams = new Object[]{param};
           
            String visualCodec = device
                    .getPolicyValue(MessageFormat.format(
                            DOWNLOADABLE_AUDIO_X_CODEC_POLICY,
                            formatParams));
           
            if (visualCodec != null) {
                inputParameters.put(MAP_AUDIO_CODEC, visualCodec);
            }
        }

        int maxSize = device
            .getIntegerPolicyValue(DOWNLOADABLE_AUDIO_MAXSIZE_POLICY, 0);
        if (maxSize != 0) {
            inputParameters.put(MAP_MAX_AUDIO_SIZE,
                    Integer.toString(maxSize));
        }
       
        int maxVisualBitRate = device
            .getIntegerPolicyValue(DOWNLOADABLE_AUDIO_MAXBITRATE_POLICY, 0);
        if (maxVisualBitRate != 0) {
            inputParameters.put(MAP_MAX_AUDIO_BIT_RATE,
                    Integer.toString(maxVisualBitRate));
        }
View Full Code Here

        if (asset.getClass() == DynamicVisualAsset.class) {
            DynamicVisualAsset dynamicVisualAsset = (DynamicVisualAsset) asset;
            if (dynamicVisualAsset.getEncoding() == DynamicVisualAsset.TV) {
                MarinerPageContext marinerPageContext
                        = ContextInternals.getMarinerPageContext(requestContext);
                InternalDevice device = marinerPageContext.getDevice();

                String tvChannelPrefix = device.getTVChannelPrefix();
                String url = tvChannelPrefix;
                String value = dynamicVisualAsset.getValue();
                if (value != null) {
                    url += value;
                }
View Full Code Here

        final DefaultDevice defaultDevice =
            new DefaultDevice("Test Device", new HashMap(), null);
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_JAVASCRIPT, "true");
        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);

        final DOMProtocol protocol = (DOMProtocol)builder.build(
            new ProtocolRegistry.HTMLVersion4_0Factory(), device);
        return protocol;
View Full Code Here

     */
    protected void buildPageContext() throws RepositoryException,
        IllegalAccessException, InstantiationException,
        ClassNotFoundException {
       
        InternalDevice device = createInternalDevice();

        MarinerURL requestURL =
            new MarinerURL("http://localhost/test.jsp");


View Full Code Here

        policies.put("mpeg4inpage", "true");
        policies.put("flashinpage", "true");
        policies.put("downloadeble.audio.maxsize", "1000");
        policies.put("downloadeble.audio.maxbitrate", "128");

        InternalDevice device = INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice("Test Device", policies, null));
        return device;
    }
View Full Code Here

        final DefaultDevice defaultDevice =
            new DefaultDevice("Test Device", new HashMap(), null);
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_JAVASCRIPT, "true");
        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);

        DOMProtocol protocol = (DOMProtocol) builder.build(
                new ProtocolRegistry.HTMLVersion4_0Factory(), device);
        return protocol;
View Full Code Here

TOP

Related Classes of com.volantis.mcs.devices.InternalDevice

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.