Package com.volantis.mcs.runtime.configuration.project

Examples of com.volantis.mcs.runtime.configuration.project.AssetConfiguration


     */
    private AssetsConfiguration initialiseAssetConfiguration(
            AssetsAttributes attrs) {
        // Create a new AssetsConfiguration and add all the asset types to it.
        final AssetsConfiguration config = new AssetsConfiguration();
        config.setAudioAssets(new AssetConfiguration());
        config.setDynamicVisualAssets(new AssetConfiguration());
        config.setImageAssets(new AssetConfiguration());
        config.setScriptAssets(new AssetConfiguration());
        config.setTextAssets(new AssetConfiguration());

        // Copy the base URL.
        config.setBaseUrl(attrs.getBaseUrl());

        // Create a List of the asset configurations to simplify processing.
        final List assetConfigsList = new ArrayList(5);
        assetConfigsList.add(config.getAudioAssets());
        assetConfigsList.add(config.getDynamicVisualAssets());
        assetConfigsList.add(config.getImageAssets());
        assetConfigsList.add(config.getScriptAssets());
        assetConfigsList.add(config.getTextAssets());

        // Process each asset configuration, inserting a leading slash if
        // necessary.
        for (Iterator it = assetConfigsList.iterator(); it.hasNext();) {
            AssetConfiguration assetConfig = (AssetConfiguration) it.next();
            assetConfig.setPrefixUrl("/");
        }

        return config;
    }
View Full Code Here


                    (XmlPoliciesConfiguration) policies;
            assertEquals("", "an xml dir", xmlPolicies.getDirectory());

            AssetsConfiguration assets = project.getAssets();
            assertNotNull(assets);
            AssetConfiguration audioAssets = assets.getAudioAssets();
            assertNotNull(audioAssets);
            assertEquals("", "a/prefix/url", audioAssets.getPrefixUrl());

            GeneratedResourcesConfiguration resources =
                    project.getGeneratedResources();
            assertNotNull(resources);
            assertEquals("", "default-resources", resources.getBaseDir());
        }

        // Test the single named project which was present.
        {
            RuntimeProjectConfiguration project = (RuntimeProjectConfiguration)
                    projects.getNamedProjects().values().iterator().next();
            assertNotNull(project);
            assertEquals("", "a/project", project.getName());

            AbstractPoliciesConfiguration policies = project.getPolicies();
            assertNotNull(policies);
            assertTrue(policies instanceof JdbcPoliciesConfiguration);
            JdbcPoliciesConfiguration jdbcPolicies =
                    (JdbcPoliciesConfiguration) policies;
            assertEquals("", "a jdbc policy", jdbcPolicies.getName());

            AssetsConfiguration assets = project.getAssets();
            assertNotNull(assets);
            AssetConfiguration dynvisAssets = assets.getDynamicVisualAssets();
            assertNotNull(dynvisAssets);
            assertEquals("", "another/prefix/url", dynvisAssets.getPrefixUrl());

            GeneratedResourcesConfiguration resources =
                    project.getGeneratedResources();
            assertNotNull(resources);
            assertEquals("", "custom-resources", resources.getBaseDir());
View Full Code Here

     * @return An initialised instance of AssetsConfiguration.
     */
    private AssetsConfiguration createConfig(String baseURL) {
        // Base variables
        AssetsConfiguration assetConfig = new AssetsConfiguration();
        AssetConfiguration asset;

        // Setting the prefixes
        asset = new AssetConfiguration();
        asset.setPrefixUrl(audioPrefixString);
        assetConfig.setAudioAssets(asset);
        asset = new AssetConfiguration();
        asset.setPrefixUrl(dynamicVisualPrefixString);
        assetConfig.setDynamicVisualAssets(asset);
        asset = new AssetConfiguration();
        asset.setPrefixUrl(imagePrefixString);
        assetConfig.setImageAssets(asset);
        asset = new AssetConfiguration();
        asset.setPrefixUrl(scriptPrefixString);
        assetConfig.setScriptAssets(asset);
        asset = new AssetConfiguration();
        asset.setPrefixUrl(textPrefixString);
        assetConfig.setTextAssets(asset);

        // Setting the base URL
        assetConfig.setBaseUrl(baseURL);

View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.configuration.project.AssetConfiguration

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.