head	1.12;
access;
symbols
	TIGRIS_1_1_0RC2:1.5
	TIGRIS_1_1_0RC1:1.5
	TIGRIS_1_1:1.5.0.4
	TIGRIS_1_0_8:1.5
	TIGRIS_1_0_8RC3:1.5
	TIGRIS_1_0_8RC2:1.5
	TIGRIS_1_0_8RC1:1.5
	TIGRIS_1_0_7:1.5
	TIGRIS_1_0_7RC3:1.5
	TIGRIS_1_0_7RC2:1.5
	TIGRIS_1_0_7RC1:1.5
	TIGRIS_1_0_6:1.5
	TIGRIS_1_0_6RC5:1.5
	TIGRIS_1_0_6RC4:1.5
	TIGRIS_1_0_6RC3:1.5
	TIGRIS_1_0_6RC2:1.5
	TIGRIS_1_0_6RC1:1.5
	TIGRIS_1_0_5:1.5
	TIGRIS_1_0_5RC6:1.5
	TIGRIS_1_0_5RC5:1.5
	TIGRIS_1_0_5RC4:1.5
	TIGRIS_1_0_5RC3:1.5
	TIGRIS_1_0_5RC2:1.5
	TIGRIS_1_0_5RC1:1.5
	TIGRIS_1_0_4:1.5
	TIGRIS_1_0_3:1.5
	TIGRIS_1_0_2:1.5
	TIGRIS_1_0_1:1.5
	TIGRIS_1_0:1.5.0.6
	TIGRIS_1_0_0:1.5
	TIGRIS_1_0_0_RC1:1.5.0.2;
locks; strict;
comment	@# @;


1.12
date	2001.07.23.19.52.23;	author dlr;	state Exp;
branches;
next	1.11;

1.11
date	2001.07.23.19.51.25;	author dlr;	state Exp;
branches;
next	1.10;

1.10
date	2001.07.23.19.49.29;	author dlr;	state Exp;
branches;
next	1.9;

1.9
date	2001.07.19.18.42.23;	author dlr;	state Exp;
branches;
next	1.8;

1.8
date	2001.06.07.02.53.14;	author dlr;	state Exp;
branches;
next	1.7;

1.7
date	2001.06.07.02.24.13;	author leonardr;	state Exp;
branches;
next	1.6;

1.6
date	2001.05.25.16.57.15;	author leonardr;	state Exp;
branches;
next	1.5;

1.5
date	2001.03.06.07.45.10;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.03.02.23.12.10;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.23.19.26.19;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.22.01.15.06;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.21.20.03.52;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.12
log
@Corrected comment.
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */

package org.tigris.helm.tool;

import java.io.File;

import org.tigris.helm.tool.HelmProperties;

/**
 * TemplateTool is a utility class.
 *
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@version $Id: TemplateTool.java,v 1.11 2001/07/23 19:51:25 dlr Exp $
 */
public class TemplateTool
{
    /**
     * ISO 8859-1, Latin alphabet No. 1 encoding used when
     * instantiating template contexts.  This is one of the default
     * encodings included in rt.jar.
     */
    public static final String LATIN_ENCODING = "ISO8859_1";

    private static final String BASE_HELM_MODULE = File.separatorChar + "org" +
        File.separatorChar + "tigris" + File.separatorChar + "helm";

    /**
     * The path to the service admin templates (relative to Turbine
     * template root).  
     */
    private static final String SERVICE_ADMIN_PATH = BASE_HELM_MODULE +
        File.separatorChar + "host" + File.separatorChar + "service";

    /**
     * The path to the message templates (relative to Turbine template root).
     */
    private static final String MESSAGE_PATH = BASE_HELM_MODULE +
        File.separatorChar + "messages";

    /**
     * @@see #getPathToTemplate
     */
    public static final String getPathToServiceAdminTemplate
        (String templateName)
    {
        return getPathToTemplate(SERVICE_ADMIN_PATH, templateName);
    }

    /**
     * @@see #getPathToTemplate
     */
    public static final String getPathToMessageTemplate(String templateName)
    {
        return getPathToTemplate(MESSAGE_PATH, templateName);
    }

    /**
     * @@see #getPathToTemplate
     */
    public static final String getPathToRemoteBrandingTemplate(String name)
    {
        return getPathToTemplate("", name);
    }

    /**
     * Returns the path to the named message template (relative to Turbine
     * template root).  This is generally used for email message bodies.
     *
     * <pre><code><blockquote>
     * String tmpl = TemplateTool.getPathToTemplate(TemplateTool.MESSAGE_PATH,
     *                                              "FooBar.vm");
     * </blockquote></code></pre>
     *
     * @@param templateName The base file system name of the template.
     * @@return             The path to the named template.
     */
    protected static final String getPathToTemplate(String pathSnippet,
                                                    String templateName)
    {
        return (pathSnippet + File.separatorChar + templateName);
    }
}
@


1.11
log
@Removed unused method and supporting constant.
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.10 2001/07/23 19:49:29 dlr Exp $
d63 3
a65 3
     * ISO 8859-1, Latin alphabet No. 1 encoding used when instantiating
     * <code>BuildContext</code> objects.  This is one of the default encodings
     * included in rt.jar.
@


1.10
log
@Added BASE_HELM_MODULE constant.
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.9 2001/07/19 18:42:23 dlr Exp $
a85 6
     * The path to the branding templates (relative to Turbine template root).
     */
    private static final String BRANDING_PATH = File.separatorChar +
        "org" + File.separatorChar + "joist" + File.separatorChar + "master";

    /**
a99 8
    }

    /**
     * @@see #getPathToTemplate
     */
    public static final String getPathToBrandingTemplate(String templateName)
    {
        return getPathToTemplate(BRANDING_PATH, templateName);
@


1.9
log
@Updated in light of the port of Joist JoistProperties class to Helm (as class HelmProperties).
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.8 2001/06/07 02:53:14 dlr Exp $
d69 3
d76 2
a77 4
    private static final String SERVICE_ADMIN_PATH = 
        File.separatorChar + "org" + File.separatorChar + "tigris" +
        File.separatorChar + "helm" + File.separatorChar + "host" + 
        File.separatorChar + "service";
d82 1
a82 2
    private static final String MESSAGE_PATH = File.separatorChar + "org" +
        File.separatorChar + "tigris" + File.separatorChar + "helm" +
@


1.8
log
@Removed now-unused WM-specific constant.
@
text
@d51 1
a51 1
import org.joist.util.JoistProperties;
d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.7 2001/06/07 02:24:13 leonardr Exp $
@


1.7
log
@Controls for services now go right next to their statuses. Also added status for TaskRunnerService
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.6 2001/05/25 16:57:15 leonardr Exp $
a61 6
    /**
     * The path to WebMacro properties file (relative to web app root).
     */
    public static final String WM_PROPS_FILE =
        File.separator + "conf" + File.separator + "WebMacro.properties";

@


1.6
log
@.wm is now .vm
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.5 2001/03/06 07:45:10 dlr Exp $
d76 9
d96 9
@


1.5
log
@Wrap base routine.
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.4 2001/03/02 23:12:10 dlr Exp $
d118 1
a118 1
     *                                              "FooBar.wm");
@


1.4
log
@Corrected documentation and added a method to get the path to a
branding template.
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.3 2001/02/23 19:26:19 dlr Exp $
d78 1
a78 1
    private static final String MSG_TMPL_PATH = File.separatorChar + "org" +
d85 1
a85 1
    private static final String BRANDING_TMPL_PATH = File.separatorChar +
d89 1
a89 9
     * Returns the path to the named message template (relative to Turbine
     * template root).  This is generally used for email message bodies.
     *
     * <pre><code><blockquote>
     * String tmpl = TemplateTool.getPathToMessageTemplate("FooBar.wm");
     * </blockquote></code></pre>
     *
     * @@param templateName The base file system name of the template.
     * @@return             The path to the named template.
d93 1
a93 1
        return (MSG_TMPL_PATH + File.separatorChar + templateName);
d97 23
a119 2
     * Returns the path to the named branding template (relative to Turbine
     * template root).
a122 1
     * @@see                #getPathToMessageTemplate(String templateName)
d124 2
a125 1
    public static final String getPathToBrandingTemplate(String templateName)
d127 1
a127 1
        return (BRANDING_TMPL_PATH + File.separatorChar + templateName);
@


1.3
log
@Everything is now relative to web app root.
@
text
@d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.2 2001/02/22 01:15:06 dlr Exp $
d76 1
a76 1
     * The path to the message templates (relative to web app root).
d83 8
a90 2
     * Returns the path to the named message template (relative to web app
     * root).  This is generally used for email message bodies.
d97 1
a97 1
     * @@return             
d102 13
@


1.2
log
@Added static getPathToMessageTemplate() method and made the
BASE_TEMPLATE_PATH constant protected.
@
text
@d49 1
a49 1
import java.io.*;
d58 1
a58 1
 * @@version $Id: TemplateTool.java,v 1.1 2001/02/21 20:03:52 dlr Exp $
d63 1
a63 1
     * The path to WebMacro properties file.
d66 1
a66 2
        JoistProperties.getProperty("SANDBOX") + File.separator + "conf" +
        File.separator + "WebMacro.properties";
d76 1
a76 2
     * The path to the base template directory (i.e.
     * <code>$SANDBOX/site/templates</code>).
d78 3
a80 3
    protected static final String BASE_TEMPLATE_PATH = 
        JoistProperties.getProperty("SANDBOX") + File.separator + "site" +
        File.separator + "templates";
d83 3
a85 2
     * Returns the path to the named message template (generally used for email
     * message bodies).
d93 1
a93 1
    public static String getPathToMessageTemplate(String templateName)
d95 1
a95 4
        return (BASE_TEMPLATE_PATH + File.separatorChar + "org" +
                File.separatorChar + "tigris" + File.separatorChar + "helm" +
                File.separatorChar + "messages" + File.separatorChar +
                templateName);
@


1.1
log
@Useful template properties scavenged from TemplateInterpolator.
@
text
@d58 1
a58 1
 * @@version $Id: $
d70 7
d80 1
a80 1
    public static final String BASE_TEMPLATE_PATH = 
d85 8
a92 3
     * ISO 8859-1, Latin alphabet No. 1 encoding used when instantiating
     * <code>BuildContext</code> objects.  This is one of the default encodings
     * included in rt.jar.
d94 7
a100 1
    public static final String LATIN_ENCODING = "ISO8859_1";
@

