Package com.volantis.mcs.policies.variants

Examples of com.volantis.mcs.policies.variants.VariantBuilder


        StyleSheetActivator styleSheetActivator =
                new StyleSheetActivatorImpl(logicalProject, baseURL);

        List variantBuilders = variablePolicyBuilder.getVariantBuilders();
        for (int i = 0; i < variantBuilders.size(); i++) {
            VariantBuilder variantBuilder = (VariantBuilder)
                    variantBuilders.get(i);

            InternalThemeContentBuilder themeContentBuilder =
                    (InternalThemeContentBuilder)
                    variantBuilder.getContentBuilder();
            InternalThemeContent theme =
                    themeContentBuilder.getInternalThemeContent();

            ActivatedThemeContent activated = activateThemeContent(
                    styleSheetActivator, theme);
            variantBuilder.setContentBuilder(
                    new FixedContentBuilder(activated));
        }

        // Convert the builder back into a policy. This will trigger another
        // full validation of the policy with consequent redundant logging.
View Full Code Here


        // =====================================================================

        VariablePolicyBuilder policyBuilder =
                factory.createVariablePolicyBuilder(PolicyType.IMAGE);

        VariantBuilder variantBuilder =
                factory.createVariantBuilder(VariantType.IMAGE);
        policyBuilder.addVariantBuilder(variantBuilder);

        // Selection.
        TargetedSelectionBuilder targeted =
                factory.createTargetedSelectionBuilder();
        targeted.addDevice("PC");
        targeted.addDevice("Master");

        variantBuilder.setSelectionBuilder(targeted);

        // Meta Data.
        ImageMetaDataBuilder imageBuilder =
                factory.createImageMetaDataBuilder();
        imageBuilder.setConversionMode(ImageConversionMode.NEVER_CONVERT);
        imageBuilder.setImageEncoding(ImageEncoding.GIF);
        imageBuilder.setWidth(10);
        imageBuilder.setHeight(50);
        imageBuilder.setPixelDepth(12);

        variantBuilder.setMetaDataBuilder(imageBuilder);

        // Content.
        URLContentBuilder content = factory.createURLContentBuilder();
        content.setURL("fred.gif");
        variantBuilder.setContentBuilder(content);

        Variant variant = variantBuilder.getVariant();

        ActivatedVariablePolicy activatedVariablePolicy =
                new ActivatedVariablePolicyImpl(
                        policyBuilder.getVariablePolicy(), actualProjectMock,
                        logicalProjectMock);
View Full Code Here

        policy.setCategorizationScheme("category");
        return policy;
    }

    private Variant createCategorizedVariant(VariablePolicyBuilder policyBuilder) {
        VariantBuilder variantBuilder =
                factory.createVariantBuilder(VariantType.IMAGE);
        policyBuilder.addVariantBuilder(variantBuilder);

        // Selection.
        TargetedSelectionBuilder targeted =
                factory.createTargetedSelectionBuilder();
        targeted.addCategory("Ok");
        targeted.addCategory("Good");

        variantBuilder.setSelectionBuilder(targeted);

        // Meta Data.
        ImageMetaDataBuilder imageBuilder =
                factory.createImageMetaDataBuilder();
        imageBuilder.setConversionMode(ImageConversionMode.NEVER_CONVERT);
        imageBuilder.setImageEncoding(ImageEncoding.GIF);
        imageBuilder.setWidth(10);
        imageBuilder.setHeight(50);
        imageBuilder.setPixelDepth(12);

        variantBuilder.setMetaDataBuilder(imageBuilder);

        // Content.
        URLContentBuilder content = factory.createURLContentBuilder();
        content.setURL("fred.gif");
        variantBuilder.setContentBuilder(content);

        return variantBuilder.getVariant();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.policies.variants.VariantBuilder

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.