Package org.apache.commons.collections

Examples of org.apache.commons.collections.ExtendedProperties.addProperty()


        // Try reading an overriding Velocity configuration
        try
        {
            ExtendedProperties p = loadConfiguration(config);
            p.addProperty("velocimacro.library", "/WEB-INF/jetspeed_macros.vm");
            p.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(p);
        }
        catch(Exception e)
        {
View Full Code Here


            velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext());
            velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.view.servlet.ServletLogger");
            ExtendedProperties configuration = loadConfiguration(getServletConfig());
            if (macros != null)
            {
                configuration.addProperty("velocimacro.library", macros.getAppRelativePath());
            }
            configuration.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(configuration);

            // initialize and return velocity engine
View Full Code Here

        // Try reading an overriding Velocity configuration
        try
        {
            ExtendedProperties p = loadConfiguration(config);
            p.addProperty("velocimacro.library", "/WEB-INF/jetspeed_macros.vm");
            p.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(p);
        }
        catch(Exception e)
        {
View Full Code Here

            velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext());
            velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.view.servlet.ServletLogger");
            ExtendedProperties configuration = loadConfiguration(getServletConfig());
            if (macros != null)
            {
                configuration.addProperty("velocimacro.library", macros.getAppRelativePath());
            }
            configuration.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(configuration);

            // initialize and return velocity engine
View Full Code Here

    public void testExtendedPropertiesToConfiguration()
    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", config.getString("string"), "teststring");
View Full Code Here

    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", config.getString("string"), "teststring");
        List item1 = config.getList("list");
View Full Code Here

        {
            String key = (String) i.next();
            if (!key.endsWith(RESOURCE_LOADER_PATH))
            {
                Object value = conf.getProperty(key);
                veloConfig.addProperty(key, value);
                continue; // for()
            }

            Vector paths = conf.getVector(key, null);
            if (paths == null)
View Full Code Here

                    log.debug("Result (normal fs reference): " + path);
                }

                log.debug("Adding " + key + " -> " + path);
                // Re-Add this property to the configuration object
                veloConfig.addProperty(key, path);
            }
        }
        return veloConfig;
    }
View Full Code Here

    public void testExtendedPropertiesToConfiguration()
    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
View Full Code Here

    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
        List item1 = config.getList("list");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.