Package org.apache.velocity.runtime.configuration

Examples of org.apache.velocity.runtime.configuration.Configuration


            DEFAULT_COOKIE_PARSER
        };
        configurations.put(DEFAULT_CONFIG,def.clone());

        // Check other configurations.
        Configuration conf = getConfiguration();
        if (conf != null)
        {
            String key,value;
            String[] config;
            String[] plist = new String[]
            {
                RUN_DATA,
                PARAMETER_PARSER,
                COOKIE_PARSER
            };
            for (Iterator i = conf.getKeys(); i.hasNext();)
            {
                key = (String) i.next();
                value = conf.getString(key);
                for (int j = 0; j < plist.length; j++)
                {
                    if (key.endsWith(plist[j]) &&
                        (key.length() > (plist[j].length() + 1)))
                    {
View Full Code Here


     * This method sets up the template cache.
     */
    private void initJsp() throws Exception
    {
        ServletContext context = TurbineServlet.getServletContext();
        Configuration config = getConfiguration();

        /*
         * Use the turbine template service to translate
         * the template paths.
         */
        paths = TurbineTemplate.translateTemplatePaths(
            config.getStringArray("templates"));
       
        /* not working properly - removing until I can investigate (jdm)
        if (path.startsWith("/"))
        {
            path = path.substring(1);
        }
        if (path.length() > 0 && !path.endsWith("/"))
        {
            path += "/";
        }
        */
       
        bufferSize = config.getInt("buffer.size", 8192);
   
        /*
         * Register with the template service.
         */
        registerConfiguration("jsp");
View Full Code Here

        }
        context.put("databaseModel", dbm);

        context.put("dataset", "all");

        Configuration props = getContextProperties();

        String dbUrl = (String)props.getProperty("databaseUrl");
        String dbDriver = (String)props.getProperty("databaseDriver");
        String dbUser = (String)props.getProperty("databaseUser");
        String dbPassword = (String)props.getProperty("databasePassword");

        System.err.println("Your DB settings are:");
        System.err.println("driver : "+dbDriver);
        System.err.println("URL : "+dbUrl);
        System.err.println("user : "+dbUser);
View Full Code Here

        // shouldn't since WAR files are the future anyways.
        props = ServletUtils.expandRelative(config, props);

        try
        {
            init(new Configuration(props));
        }
        catch (IOException e)
        {
            throw new InitializationException("Can't load file " + props);
        }
View Full Code Here

     * @exception IOException, if there was an I/O problem.
     */
    public static void setPropertiesFileName(String propertiesFileName)
        throws TurbineException
    {
        Configuration mappings = new Configuration();
       
        mappings.setProperty(ResourceService.SERVICE_NAME,
            TurbineResourceService.class.getName());
       
        TurbineServices services = (TurbineServices) TurbineServices.getInstance();
        services.initMapping(mappings);
        services.initServices(new TurbineConfig(".", propertiesFileName), true);
View Full Code Here

     * @exception TurbineException, if there was an I/O problem.
     */
    public static void setProperties(Properties properties)
        throws TurbineException
    {
        Configuration mappings = new Configuration();
       
        mappings.setProperty(ResourceService.SERVICE_NAME,
            TurbineResourceService.class.getName());
       
        TurbineServices services = (TurbineServices) TurbineServices.getInstance();
        services.initMapping(mappings);
        services.initServices(properties, true);
View Full Code Here

     *
     * @param props A Properties object.
     */
    private void init(Properties props)
    {
        Configuration configuration = Configuration.convertProperties(props);
        init(configuration);
    }
View Full Code Here

     * @param prefix the common name prefix
     * @return A ResourceService providing the subset of configuration.
     */
    public ResourceService getResources(String prefix)
    {
        Configuration config = getConfiguration().subset(prefix);
       
        if (config == null)
        {
            return null;
        }
View Full Code Here

     * @param prefix the common name prefix
     * @return A Configuration providing the subset of configuration.
     */
    public Configuration getConfiguration(String prefix)
    {
        Configuration config = getConfiguration().subset(prefix);
       
        if (config == null)
        {
            return null;
        }
View Full Code Here

     */
    public static void setProperty(String key, Object value)
    {
        if (overridingProperties == null)
        {
            overridingProperties = new Configuration();
        }           
           
        overridingProperties.setProperty( key, value );
    }       
View Full Code Here

TOP

Related Classes of org.apache.velocity.runtime.configuration.Configuration

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.