Package com.volantis.mcs.runtime.configuration

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


        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
        int pageLevelMaxAge = 60000;
        if (pageLevelConfig == null) {

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

        } else {
            String maxAgeString = pageLevelConfig.getMaxAge();
            if (maxAgeString != null) {
                if ("unlimited".equals(maxAgeString)) {
                    pageLevelMaxAge = -1;
                } else {
                    try {
View Full Code Here

TOP

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

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.