head	1.9;
access;
symbols;
locks; strict;
comment	@# @;


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

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

1.7
date	2001.07.24.21.11.39;	author dlr;	state Exp;
branches;
next	1.6;

1.6
date	2001.06.28.02.19.45;	author elicia;	state Exp;
branches;
next	1.5;

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

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

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

1.2
date	2001.06.12.23.52.29;	author elicia;	state Exp;
branches;
next	1.1;

1.1
date	2001.06.12.00.55.24;	author elicia;	state Exp;
branches;
next	;


desc
@@


1.9
log
@Updated for new location of task navs.
@
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 COLLAB.NET 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.apache.turbine.util.Log;

/**
 * Determines whether or not a task bar include file exists.
 *
 * @@author <a href="mailto:elicia@@collab.net">Elicia David</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 */
public class ServletTaskBar extends ServletHtdoc
{
    private static final String WEB_ROOT = "look/www/master/TaskNav";

    private static final String TASKS_SNIPPET = "Tasks.vm";

    /**
     * Creates a new instance for the provided document root.
     */
    public ServletTaskBar(String documentRoot)
    {
        super(documentRoot);
    }

    /**
     * @@see org.tigris.helm.tool.ServletHtdoc#getServletNamePostfix()
     */
    protected final String getServletNamePostfix()
    {
        return TASKS_SNIPPET;
    }

    /**
     * @@see org.tigris.helm.tool.ServletHtdoc#getWebRoot()
     */
    protected final String getWebRoot()
    {
        return WEB_ROOT;
    }
}
@


1.8
log
@Made web root a hook method.
@
text
@d61 1
a61 1
    private static final String WEB_ROOT = "look/www/master";
@


1.7
log
@No @@link markup necessary in a @@see.
@
text
@d61 2
a63 1
    protected static final String WEBROOT = "look/www/master";
d74 1
a74 4
     * Returns the template path to the task file for the specified servlet.
     *
     * @@param servletName The servlet to get a task file path for.
     * @@param             A task file path.
d76 1
a76 1
    public String getPath(String servletName)
d78 1
a78 2
        return (WEBROOT + File.separatorChar + servletName +
                getServletNamePostfix());
d82 1
a82 1
     * @@see org.tigris.helm.tool.ServletHtdoc#getServletNamePostfix()
d84 1
a84 1
    protected final String getServletNamePostfix()
d86 1
a86 1
        return TASKS_SNIPPET;
@


1.6
log
@moved the Tasks documents to /htodc/look/www/master, so changed these to point to that directory.
@
text
@d85 1
a85 1
     * @@see {@@link org.tigris.helm.tool.ServletHtdoc#getServletNamePostfix()}
@


1.5
log
@all your servlet are belong to me
@
text
@d61 2
a62 1
    private static final String TASKS_SNIPPET = "Tasks.html";
d70 12
@


1.4
log
@Introduced ServletHtdoc abstract base class to remove code duplicated between ServletHelp and ServletTaskBar, leveraging the OO features of the Java language.
@
text
@d57 1
@


1.3
log
@Corrected comment.
@
text
@d58 1
a58 1
public class ServletTaskBar
a59 1
    private static final String WEBSITE_DOCS = "www/www/docs";
a60 3
    private static final boolean DEBUG = false;

    private String documentRoot;
d67 1
a67 21
        this.documentRoot = documentRoot;
    }

    /**
     * Returns whether help for the supplied servlet is available.
     */
    public Boolean available(String servletName)
    {
        return (getTaskBarFile(servletName).exists() ?
                Boolean.TRUE : Boolean.FALSE);
    }

    /**
     * Returns the template path to the help file for the specified servlet.
     *
     * @@param servletName The servlet to get a help file path for.
     * @@param             A help file path.
     */
    public String getPath(String servletName)
    {
        return WEBSITE_DOCS + File.separatorChar + servletName + TASKS_SNIPPET;
a69 1

d71 1
a71 3
     * Returns a {@@link java.io.File} object corresponding to the
     * absolute path to the help file associated with the supplied
     * servlet name.
d73 1
a73 1
    private final File getTaskBarFile(String servletName)
d75 1
a75 8
        String fileName = documentRoot + File.separatorChar +
            getPath(servletName);
        if (DEBUG)
        {
            Log.debug("ServletTasks: File name for '" + servletName + "' is '" +
                      fileName + '\'');
        }
        return new File(fileName);
a76 2


@


1.2
log
@removed cruft
@
text
@d54 1
a54 2
 * Determines whether or not a task bar include file exists.  Final for performance
 * boost only.
@


1.1
log
@adding this servlet for the servlet-specific task bar in the Project_Nav.
@
text
@a75 11
     * @@deprecated Use available(servletName) instead of helpExists(fileName).
     */
    public Boolean taskbarExists(String fileName)
    {
        File f = new File(fileName);
        Log.debug("Servlet TaskBar: File " + fileName +
                  (f.exists() ? " exists" : " does not exist"));
        return (f.exists() ? Boolean.TRUE : Boolean.FALSE);
    }

    /**
d95 1
d112 2
@

