Package com.volantis.mcs.runtime.configuration

Examples of com.volantis.mcs.runtime.configuration.StyleSheetExternalGenerationConfiguration


                new TestXmlConfigurationBuilder(doc);
        MarinerConfiguration config = configBuilder.buildConfiguration();
        assertNotNull(config);
        StyleSheetsConfig styleConfig = config.getStylesheetConfiguration();
        if (value != null) {
            StyleSheetExternalGenerationConfiguration style =
                    styleConfig.getExternalCacheConfiguration();
            assertNotNull("stylesheetConfiguration", style);
            assertEquals(value.baseUrl, style.getBaseUrl());
        } else {
            assertNull("stylesheetConfiguration", styleConfig);
        }
    }
View Full Code Here


    private void configureStyleSheet(StyleSheetsConfig config) {

        styleSheetConfiguration = new StyleSheetConfiguration();

        boolean supportsExternal = true;
        StyleSheetExternalGenerationConfiguration externalConfig = null;
        StyleSheetPageLevelGenerationConfiguration pageLevelConfig = null;

        if (config != null) {
            // Get the internal and external config information
            externalConfig = config.getExternalCacheConfiguration();
            pageLevelConfig = config.getPageLevelCacheConfiguration();
        }

        // Handle the external generation caching
        if (externalConfig == null) {

            if (logger.isDebugEnabled()) {
                logger.debug(
                        "No " + CONFIG_EXTERNAL_STYLE_SHEET_ELEMENT +
                        " element in the configuration file");
            }

            // If the element does not exist (or has no attributes which
            // is not valid according to the dtd) then we cannot support
            // generation of external style sheets.
            supportsExternal = false;

            // Set the preferred location to be internal.
            styleSheetConfiguration.setPreferredLocation(
                    StyleSheetConfiguration.INLINE);
        } else {

            // Set the base url which may not have been set.
            String value = externalConfig.getBaseUrl();
            if (value != null) {
                MarinerURL baseURL = new MarinerURL(value);
                baseURL.makeReadOnly();
                styleSheetConfiguration.setBaseURL(baseURL);
            }

            // Set the preferred location to be external.
            styleSheetConfiguration.setPreferredLocation(
                    StyleSheetConfiguration.EXTERNAL);

            // Set the css session type.
            styleSheetConfiguration.setCssSessionType(
                    externalConfig.getCssSessionType());
        }

        styleSheetConfiguration.setSupportsExternal(supportsExternal);

        // Handle the page level generation caching
View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.configuration.StyleSheetExternalGenerationConfiguration

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.